Python, High Performance Computing, Rust, AWS

BIOS report of cache sizes

Memory hierarchy and computing performance

We discuss code optimization from the point of view of the memory hierarchy. You are probably aware of the disk/RAM hierarchy and the tradeoff between memory and speed. With certain classes of algorithms you can easily take advantage of the cache/RAM hierarchy just by being careful on how you process data. I show a very simple example involving matrix manipulation where you can easily get speedups of up to 40%. And I am pretty sure there are plenty situations where you can do better.


#Python #Performance

Final ray-traced image

Implementing a Ray Tracer in JavaScript

A JavaScript Implementation of a ray tracer based on Peter Shirley's Raytracing in one weekend.



Getting FASTA output from PLINK files using Biopython

Here is a bit of code that you can use to extract FASTA files from PLINK genotype calls. I am doing a few assumptions: There is a reference genome to compare against If no data is available from the genotyping we will infer the reference call. This might be acceptable for some Whole Genome Sequencing data sources (and even so…), but if you are using something less dense then you might want to mark it as missing data.


#Bioinformatics #Python

Rendering of a Python AST

Automatic code changing in Python with the ast module

Most language compilers and interpreters create Abstract Syntax Trees (ASTs) to represent your code before translation or execution. Python makes these trees accessible to the developer via the ast module. This allows for pretty powerful program analysis and even transformation. This article is a primer on Python's ast module. After reading this you will understand the basics of automated code traversing and manipulation by exploring a illustrative example dealing with converting Python 2 to 3 code.


#Metaprogramming #Python