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

Updated 2017 September 5th The aim of linear regression is to find the equation of the straight line that fits the data points the best; the best line is one that minimises the sum of squared residuals of the linear regression model. The equation of a straight line is: where is the slope or gradient...

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