Posts

Showing posts from August, 2022

Swimming Upstream

 For a recent project I needed sequence regions upstream (preceding then 5' end of the gene) of a set of orthologous genes. The orthologs for a gene of interest are obtained from  https://www.ncbi.nlm.nih.gov/gene . For example, searching for  JAK2 orthologs  at that site yields a table of JAK2 genes for a large number of species. After selecting species, the ortholog table can be downloaded. Fetching Genomes Since I wanted to analyze a number of different genes, I decided to automate the process of getting the upstream regions. The first step was to fetch the GenBank records for the genomes of the selected species. The GenBank IDs for each species are included in the downloaded ortholog table. Fetching genomes is straightforward, if a bit slow. It uses Pandas to read the ortholog Table from NCBI and BioPython.Entrez to download the complete GenBank record for the genome. def main (): args = GetArgs() genome_path = args . genome_path ortholog_tab...

Getting a Window from Windows

 I don't usually program specifically for Windows. I run Windows out of necessity, but almost all of my recent programming work is in Python, Julia, or R using WSL-2. Windows makes a reasonable desktop environment Linux development. I would consider ditching Windows entirely, but I have to support our local church and family, all of whom used Windows. Recently, I was asked to develop a simple app that ran on a dedicated Windows notebook connected to a monitoring device. The task was relatively easy, capture a specified Window and save an image of it to a file. The target window title, the output location, and the image type were to be stored in a parameter file that was to be located in a common directory. This sort of thing would be relatively easy in Python, but I was not allowed to install Python on the notebook. The notebook did have Java installed so that was an option. Using C++ and creating a Windows .exe file was also a reasonable choice. In my misspent youth, I did a lot o...