Passing arguments from the command line in Perl

I used to do this for specifying the usage: However this became a problem when I needed to pass the number “0” as an argument. So I thought I’ll improve the code via the Perl module Getopt::Std. Depending on how your script works, you can set up conditional checks (e.g. unless exists $opt{‘f’}) to see…

Continue Reading

The Poisson distribution

A Poisson distribution is the probability distribution that results from a Poisson experiment. A probability distribution assigns a probability to possible outcomes of a random experiment. A Poisson experiment has the following properties: The outcomes of the experiment can be classified as either successes or failures. The average number of successes that occurs in a…

Continue Reading

Manual linear regression analysis using R

Last updated: 2022 December 12th On Wikipedia, linear regression is described as: In statistics, linear regression is a linear approach for modelling the relationship between a scalar response and one or more explanatory variables (also known as dependent and independent variables). The case of one explanatory variable is called simple linear regression; for more than…

Continue Reading

GC and AT content of 5′ UTRs, 3′ UTRs and coding exons of RefSeq gene models

Firstly download bed tracks of the 5′ UTR, 3′ UTR and coding exons from the UCSC Table Browser. The RefSeq gene models are in the table called RefGene. After you’ve saved the 3 bed files (e.g. mm9_refgene_090212_5_utr.bed, mm9_refgene_090212_3_utr.bed and mm9_refgene_090212_coding_exon.bed) use the fastaFromBed program from the BEDTools suite and convert the bed file into a…

Continue Reading

DropBox offering up to 5GB worth of space

From the official DropBox forum: During this beta period, we are also offering additional free space to test automatic uploading of photos and videos. For every 500MB of photos and videos automatically uploaded, you’ll receive another 500MB space bonus, up to 5GB total. More information here. Here’s some R code I used to generate some…

Continue Reading

H3K27Ac

Mainly sourced from Wikipedia but arranged as per my train of thought. Histones are highly alkaline proteins found in eukaryotic cell nuclei that package and order the DNA into structural units called nucleosomes. They are the chief protein components of chromatin, acting as spools around which DNA winds, and play a role in gene regulation….

Continue Reading

Step by step Principal Component Analysis using R

I’ve always wondered what goes on behind the scenes of a Principal Component Analysis (PCA). I found this extremely useful tutorial that explains the key concepts of PCA and shows the step by step calculations. Here, I use R to perform each step of a PCA as per the tutorial. Our dataset visualised on the…

Continue Reading