PCA and rggobi
I labelled only two samples since the text would overlap. Samples 1 to 20 are located near the 16 and samples 21 to 40 near the 37, as expected.
Computational biology and genomics
I labelled only two samples since the text would overlap. Samples 1 to 20 are located near the 16 and samples 21 to 40 near the 37, as expected.
Updated 2024 April 7th Incentive Let be a matrix, where are elements of , where is the row and is the column. If the matrix contained transcript expression data, then is the expression level of the transcript in the assay. The elements of the row of form the transcriptional response of the transcript. The elements…
Once you’ve read in a tab delimited file into a data.frame, here’s one way of operating on the rows I’m still wondering why I need two conversion steps ( e.g. var(as.vector(as.matrix(data_subset[1,]))) ), since var(as.vector(data_subset[1,])) doesn’t work. In time, when I learn more about data.frames and R in general I hope to address this or if…
Say you have a tab delimited file called tally.tsv with n rows and you only want to work with a subset of n based on the sum of each row. Here’s how to do it within R:
Comparing two files containing genomic features is a common task e.g. finding out whether the coordinates of your tags intersect with genes. Of course you could use intersectBed (as part of the BEDTools suite) for this purpose but here’s how to do it anyway using Perl. NOTE: I hard code the length of my tags…
Updated 2014 May 7th If you’re looking for a poor man’s version of the Caesar cipher in Perl, then here it is. Why is it the poor man’s version? First, I’m a PhD student and second, I wrote the code.
Build up an index of files to process, e.g. SAM files. Fork out 16 child processes, each time processing and eliminating one file from the index. As with all my code, use at your own risk. Comments and suggestions always welcome. For more information see Forking in Perl.
Very simple code using Perl to log transform (base 2) a list of numbers. 0 values are converted into 0.5, since you cannot take the logarithm of 0. For this example numbers are stored in the array @n. Using R I know this post is about using Perl to log transform data, but I’ve been…
Lincoln Stein has written a bunch of modules to deal with SAM/BAM files. Check out the CPAN module. If you are having trouble installing Bio::DB::Sam, you may have to recompile SAMTools with the following command: To install the Perl module on a machine where you don’t have root access, follow these instructions. Using this module,…
Foreach item in the array, start a fork. $pid returns 0 if it is the child process. This way you can spawn 4 child processes from one parent. This page explains it all and the code shown below is an adaptation of code shown from the link. I just added code to show the current…