Ngsplot

From Dave's wiki
Jump to navigation Jump to search

https://code.google.com/p/ngsplot/

#download
wget https://ngsplot.googlecode.com/files/ngsplot-2.08.tar.gz

#to install simply add PATH
#and set environmental variable
export PATH=$HOME/src/ngsplot/bin:$PATH
export NGSPLOT=$HOME/src/ngsplot
#and make sure you have these packages
install.packages("doMC", dep=T)
install.packages("caTools", dep=T)
source("http://bioconductor.org/biocLite.R")
biocLite( "BSgenome" )
biocLite( "Rsamtools" )
biocLite( "ShortRead" )

#plot H1-hESC signal across TSSs
ngs.plot.r -G hg19 -R tss -C wgEncodeHaibTfbsH1hescPol2V0416102AlnRep1.bam -O wgEncodeHaibTfbsH1hescPol2V0416102AlnRep1.tss -T PolII -L 3000 -FL 300

#plot H1-hESC signal across random positions defined in a bed file
#-G Genome name
#-R Genomic regions to plot
#-E Gene list to subset regions OR bed file for custom region
#-C Bam file or a configuration file for multiple plot
#-O Name of output
#-T Image title
#-L Flanking region size
#-FL Fragment(insert) length used to calculate physical coverage
ngs.plot.r -G hg19 -R bed -E random.bed -C wgEncodeHaibTfbsH1hescPol2V0416102AlnRep1.bam -O random.tss -T PolII -L 3000 -FL 300

#multiplot
#configuration file must end with ".txt"
ngs.plot.r -G hg19 -R bed -E random.bed -C conf.txt -O output.txt -T blah -L 3000 -FL 300
#see https://code.google.com/p/ngsplot/wiki/HowToUseConfiguration
cat conf.txt
first.bam   random.bed        "1"        300     blue
second.bam   random.bed        "2"        300     green