Thursday, August 8, 2013

R package writing tips

S4 union classes
To create a class that accepts different class objects:

setClassUnion("AorB", c("classA", "classB")) 

Saving data files in R packages
They need to be compressed to avoid warnings when running R CMD check

save(a,b,c,file="savefile.rda",compress='xz') 

Make R package zip (for Windows) on Linux 
make destination folder eg. testand write to test

mkdir test 
R CMD INSTALL -l test pkgname 
cd test 
zip -r pkgname pkgname


R package documentation writing
If you are generating Sweave files from Lyx (Rnw), add

%\VignetteIndexEntry{Your-Title}

to the top of your Rnw file

Wednesday, July 17, 2013

SAM file directionality

Understanding direction flags and how to extract them
  • http://biobeat.wordpress.com/2013/03/14/separating-bam-files-to-forward-and-reverse-strand-files/
  • http://biobeat.wordpress.com/2013/04/29/directional-rna-seq-part-1-extract-strand-information-from-sam-file/
 Paired-end specific discussion:
  • http://ppotato.wordpress.com/2010/08/25/samtool-bitwise-flag-paired-reads/
  • http://www.novocraft.com/wiki/tiki-index.php?page=Extracting+unmapped+reads+from+a+BAM+file+produced+by+novoalign
Useful samflag utility
http://picard.sourceforge.net/explain-flags.html

Thursday, May 16, 2013

Trick : seqMINER

seqMINER is a Chip-seq density clustering and plotting software. A trick to keep clustering from previous computations and plot the same ordering on a new set of bam/bed files: Load your bam file, right click and choose view heatmap (bypassing the "cluster" button). Voila!