ln -s /data/images/proton2/run374/tophat_033/sort_uniq.bam SK3R1-Tbctrl2.bam ln -s /data/images/proton2/run374/tophat_034/sort_uniq.bam SK3R2-Tbctrl3.bam ln -s /data/images/proton2/run374/tophat_035/sort_uniq.bam SK3R3-Tbctrl4.bam ln -s /data/images/proton2/run373/tophat_010/sort_uniq.bam SK3R10-Tdil22-9b.bam ln -s /data/images/proton2/run373/tophat_011/sort_uniq.bam SK3R11-Tdil22-10b.bam ln -s /data/images/proton2/run373/tophat_012/sort_uniq.bam SK3R12-Tdil22-11b.bam ln -s /data/images/proton2/run373/tophat_016/sort_uniq.bam SK3R16-Lbil22-7b.bam ln -s /data/images/proton2/run373/tophat_018/sort_uniq.bam SK3R18-Lbil22-9b.bam ln -s /data/images/proton2/run373/tophat_019/sort_uniq.bam SK3R19-Lcctrl3b.bam ln -s /data/images/proton2/run373/tophat_004/sort_uniq.bam SK3R4-Tbil22-7b.bam ln -s /data/images/proton2/run373/tophat_006/sort_uniq.bam SK3R6-Tbil22-12b.bam ln -s /data/images/proton2/run371/tophat_013/sort_uniq.bam SK3R13-Lbctrl4.bam ln -s /data/images/proton2/run371/tophat_014/sort_uniq.bam SK3R14-Lbctrl5.bam ln -s /data/images/proton2/run371/tophat_015/sort_uniq.bam SK3R15-Lbctrl6.bam ln -s /data/images/proton2/run371/tophat_016/sort_uniq.bam SK3R16-Lbil22-7.bam ln -s /data/images/proton2/run371/tophat_017/sort_uniq.bam SK3R17-Lbil22-8.bam ln -s /data/images/proton2/run371/tophat_018/sort_uniq.bam SK3R18-Lbil22-9.bam ln -s /data/images/proton2/run371/tophat_019/sort_uniq.bam SK3R19-Lcctrl3.bam ln -s /data/images/proton2/run371/tophat_020/sort_uniq.bam SK3R20-Lcctrl4.bam ln -s /data/images/proton2/run371/tophat_021/sort_uniq.bam SK3R21-Lcctrl6.bam ln -s /data/images/proton2/run371/tophat_022/sort_uniq.bam SK3R22-Lcil22-8.bam ln -s /data/images/proton2/run371/tophat_023/sort_uniq.bam SK3R23-Lcil22-11.bam ln -s /data/images/proton2/run371/tophat_024/sort_uniq.bam SK3R24-Lcil22-12.bam ln -s /data/images/proton2/run370/tophat_010/sort_uniq.bam SK3R10-Tdil22-9.bam ln -s /data/images/proton2/run370/tophat_011/sort_uniq.bam SK3R11-Tdil22-10.bam ln -s /data/images/proton2/run370/tophat_012/sort_uniq.bam SK3R12-Tdil22-11.bam ln -s /data/images/proton2/run370/tophat_004/sort_uniq.bam SK3R4-Tbil22-7.bam ln -s /data/images/proton2/run370/tophat_005/sort_uniq.bam SK3R5-Tbil22-11.bam ln -s /data/images/proton2/run370/tophat_006/sort_uniq.bam SK3R6-Tbil22-12.bam ln -s /data/images/proton2/run370/tophat_007/sort_uniq.bam SK3R7-Tdctrl2.bam ln -s /data/images/proton2/run370/tophat_008/sort_uniq.bam SK3R8-Tdctrl3.bam ln -s /data/images/proton2/run370/tophat_009/sort_uniq.bam SK3R9-Tdctrl6.bam samtools merge SK3R4-Tbil22-7m.bam SK3R4-Tbil22-7.bam SK3R4-Tbil22-7b.bam samtools merge SK3R6-Tbil22-12m.bam SK3R6-Tbil22-12.bam SK3R6-Tbil22-12b.bam samtools merge SK3R11-Tdil22-10m.bam SK3R11-Tdil22-10.bam SK3R11-Tdil22-10b.bam samtools merge SK3R10-Tdil22-9m.bam SK3R10-Tdil22-9.bam SK3R10-Tdil22-9b.bam samtools merge SK3R12-Tdil22-11m.bam SK3R12-Tdil22-11.bam SK3R12-Tdil22-11b.bam samtools merge SK3R16-Lbil22-7m.bam SK3R16-Lbil22-7.bam SK3R16-Lbil22-7b.bam samtools merge SK3R18-Lbil22-9m.bam SK3R18-Lbil22-9.bam SK3R18-Lbil22-9b.bam samtools merge SK3R19-Lcctrl3m.bam SK3R19-Lcctrl3.bam SK3R19-Lcctrl3b.bam for i in *bam do echo $i samtools flagstat $i | grep total done require(metaseqR) the.path <- "/data/images/proton2/run374/SKobold" the.contrasts.1 <- c( "Lbctrl_vs_Lbil22" ) # Read transcript data from external file transcript.data <- read.delim("/data/results/tools/rnaseq/metaseqr/mm10/transcript_data_mm10.txt.gz") rownames(transcript.data) <- as.character(transcript.data$transcript_id) # metaseqR related variables outside the pipeline multic <- check.parallel(0.5) # If wish to use multiple cores assign("VERBOSE",TRUE,envir=metaseqR:::meta.env) # Read targets files message("Reading targets file...") targets <- read.targets("targets-LbctrlVSLcctrl.txt") targets <- read.targets("targets-Lbil22VSLcil22.txt") targets <- read.targets("targets-LcctrlVSLcil22.txt") targets <- read.targets("targets-TbctrlVSTbil22.txt") targets <- read.targets("targets-TbctrlVSTdctrl.txt") targets <- read.targets("targets-Tbil22VSTdil22.txt") targets <- read.targets("targets-TdctrlVSTdil22.txt") targets <- read.targets("targets-LbctrlVSLbil22.txt") # Do the counting based with bam files in the targets file r2c.out <- read2count(targets,transcript.data,has.all.fields=TRUE,multic=multic) # Create a counts table to be passed as "embedded" annotation the.counts <- cbind(r2c.out$mergedann,r2c.out$counts) # Run metaseqR metaseqr( counts=the.counts, sample.list=targets$samples, contrast=the.contrasts.1, annotation="embedded", gene.file="/data/results/tools/rnaseq/metaseqr/mm10/gene_data_mm10.txt.gz", id.col=4, # required with embedded annotation gc.col=5, # required with embedded annotation bt.col=8, # required with embedded annotation name.col=7, # required with embedded annotation org="custom", count.type="utr", normalization="deseq", # or whatever supported statistics = c("deseq"), #"edger", "limma", "nbpseq"), # meta.p = "pandora", #statistics = c("deseq", "edger", "noiseq", "bayseq", "limma", "nbpseq"), # meta.p = "pandora", # statistics="deseq", # or whatever supported, more than one also fig.format=c("png","pdf"), export.where=file.path(the.path,"metaseqr_quantseq_LbctrlVSLbil22"), restrict.cores=0.5, # fraction of available cores to use qc.plots=c( "mds","biodetection","countsbio","saturation","readnoise","filtered", "correl","pairwise","boxplot","gcbias","lengthbias", "biodist","volcano","deheatmap" ), exon.filters=NULL, gene.filters=list( length=list( length=500 ), avg.reads=list( average.per.bp=100, quantile=0.25 ), expression=list( median=TRUE, mean=FALSE, quantile=NA, known=NA, custom=NA ), # it's the default anyway biotype=get.defaults("biotype.filter","mm10") ), pcut=0.05, # only for the truncated significant list output, all results are exported anyway export.what=c("annotation","p.value","adj.p.value","fold.change","stats", # export.what=c("annotation","p.value","adj.p.value","fold.change","meta.p.value","adj.meta.p.value","stats", "counts","flags"), # if you use pandora, the fields "meta.p.value" and "adj.meta.p.value" should be added export.scale=c("log2","rpgm"), export.values="normalized", export.stats="mean" ) targets <- read.targets("targets-LbctrlVSLcctrl.txt") # Do the counting based with bam files in the targets file r2c.out <- read2count(targets,transcript.data,has.all.fields=TRUE,multic=multic) # Create a counts table to be passed as "embedded" annotation the.counts <- cbind(r2c.out$mergedann,r2c.out$counts) metaseqr( counts=the.counts, sample.list=targets$samples, contrast="Lbctrl_vs_Lcctrl", annotation="embedded", gene.file="/data/results/tools/rnaseq/metaseqr/mm10/gene_data_mm10.txt.gz", id.col=4, # required with embedded annotation gc.col=5, # required with embedded annotation bt.col=8, # required with embedded annotation name.col=7, # required with embedded annotation org="custom", count.type="utr", normalization="deseq", # or whatever supported statistics = c("deseq"), #"edger", "limma", "nbpseq"), # meta.p = "pandora", #statistics = c("deseq", "edger", "noiseq", "bayseq", "limma", "nbpseq"), # meta.p = "pandora", # statistics="deseq", # or whatever supported, more than one also fig.format=c("png","pdf"), export.where=file.path(the.path,"metaseqr_quantseq_LbctrlVSLcctrl"), restrict.cores=0.5, # fraction of available cores to use qc.plots=c( "mds","biodetection","countsbio","saturation","readnoise","filtered", "correl","pairwise","boxplot","gcbias","lengthbias", "biodist","volcano","deheatmap" ), exon.filters=NULL, gene.filters=list( length=list( length=500 ), avg.reads=list( average.per.bp=100, quantile=0.25 ), expression=list( median=TRUE, mean=FALSE, quantile=NA, known=NA, custom=NA ), # it's the default anyway biotype=get.defaults("biotype.filter","mm10") ), pcut=0.05, # only for the truncated significant list output, all results are exported anyway export.what=c("annotation","p.value","adj.p.value","fold.change","stats", # export.what=c("annotation","p.value","adj.p.value","fold.change","meta.p.value","adj.meta.p.value","stats", "counts","flags"), # if you use pandora, the fields "meta.p.value" and "adj.meta.p.value" should be added export.scale=c("log2","rpgm"), export.values="normalized", export.stats="mean" ) targets <- read.targets("targets-Lbil22VSLcil22.txt") # Do the counting based with bam files in the targets file r2c.out <- read2count(targets,transcript.data,has.all.fields=TRUE,multic=multic) # Create a counts table to be passed as "embedded" annotation the.counts <- cbind(r2c.out$mergedann,r2c.out$counts) metaseqr( counts=the.counts, sample.list=targets$samples, contrast="Lbil22_vs_Lcil22", annotation="embedded", gene.file="/data/results/tools/rnaseq/metaseqr/mm10/gene_data_mm10.txt.gz", id.col=4, # required with embedded annotation gc.col=5, # required with embedded annotation bt.col=8, # required with embedded annotation name.col=7, # required with embedded annotation org="custom", count.type="utr", normalization="deseq", # or whatever supported statistics = c("deseq"), #"edger", "limma", "nbpseq"), # meta.p = "pandora", #statistics = c("deseq", "edger", "noiseq", "bayseq", "limma", "nbpseq"), # meta.p = "pandora", # statistics="deseq", # or whatever supported, more than one also fig.format=c("png","pdf"), export.where=file.path(the.path,"metaseqr_quantseq_Lbil22VSLcil22"), restrict.cores=0.5, # fraction of available cores to use qc.plots=c( "mds","biodetection","countsbio","saturation","readnoise","filtered", "correl","pairwise","boxplot","gcbias","lengthbias", "biodist","volcano","deheatmap" ), exon.filters=NULL, gene.filters=list( length=list( length=500 ), avg.reads=list( average.per.bp=100, quantile=0.25 ), expression=list( median=TRUE, mean=FALSE, quantile=NA, known=NA, custom=NA ), # it's the default anyway biotype=get.defaults("biotype.filter","mm10") ), pcut=0.05, # only for the truncated significant list output, all results are exported anyway export.what=c("annotation","p.value","adj.p.value","fold.change","stats", # export.what=c("annotation","p.value","adj.p.value","fold.change","meta.p.value","adj.meta.p.value","stats", "counts","flags"), # if you use pandora, the fields "meta.p.value" and "adj.meta.p.value" should be added export.scale=c("log2","rpgm"), export.values="normalized", export.stats="mean" ) targets <- read.targets("targets-LcctrlVSLcil22.txt") # Do the counting based with bam files in the targets file r2c.out <- read2count(targets,transcript.data,has.all.fields=TRUE,multic=multic) # Create a counts table to be passed as "embedded" annotation the.counts <- cbind(r2c.out$mergedann,r2c.out$counts) metaseqr( counts=the.counts, sample.list=targets$samples, contrast="Lcctrl_vs_Lcil22", annotation="embedded", gene.file="/data/results/tools/rnaseq/metaseqr/mm10/gene_data_mm10.txt.gz", id.col=4, # required with embedded annotation gc.col=5, # required with embedded annotation bt.col=8, # required with embedded annotation name.col=7, # required with embedded annotation org="custom", count.type="utr", normalization="deseq", # or whatever supported statistics = c("deseq"), #"edger", "limma", "nbpseq"), # meta.p = "pandora", #statistics = c("deseq", "edger", "noiseq", "bayseq", "limma", "nbpseq"), # meta.p = "pandora", # statistics="deseq", # or whatever supported, more than one also fig.format=c("png","pdf"), export.where=file.path(the.path,"metaseqr_quantseq_LcctrlVSLcil22"), restrict.cores=0.5, # fraction of available cores to use qc.plots=c( "mds","biodetection","countsbio","saturation","readnoise","filtered", "correl","pairwise","boxplot","gcbias","lengthbias", "biodist","volcano","deheatmap" ), exon.filters=NULL, gene.filters=list( length=list( length=500 ), avg.reads=list( average.per.bp=100, quantile=0.25 ), expression=list( median=TRUE, mean=FALSE, quantile=NA, known=NA, custom=NA ), # it's the default anyway biotype=get.defaults("biotype.filter","mm10") ), pcut=0.05, # only for the truncated significant list output, all results are exported anyway export.what=c("annotation","p.value","adj.p.value","fold.change","stats", # export.what=c("annotation","p.value","adj.p.value","fold.change","meta.p.value","adj.meta.p.value","stats", "counts","flags"), # if you use pandora, the fields "meta.p.value" and "adj.meta.p.value" should be added export.scale=c("log2","rpgm"), export.values="normalized", export.stats="mean" ) targets <- read.targets("targets-TbctrlVSTbil22.txt") # Do the counting based with bam files in the targets file r2c.out <- read2count(targets,transcript.data,has.all.fields=TRUE,multic=multic) # Create a counts table to be passed as "embedded" annotation the.counts <- cbind(r2c.out$mergedann,r2c.out$counts) metaseqr( counts=the.counts, sample.list=targets$samples, contrast="Tbctrl_vs_Tbil22", annotation="embedded", gene.file="/data/results/tools/rnaseq/metaseqr/mm10/gene_data_mm10.txt.gz", id.col=4, # required with embedded annotation gc.col=5, # required with embedded annotation bt.col=8, # required with embedded annotation name.col=7, # required with embedded annotation org="custom", count.type="utr", normalization="deseq", # or whatever supported statistics = c("deseq"), #"edger", "limma", "nbpseq"), # meta.p = "pandora", #statistics = c("deseq", "edger", "noiseq", "bayseq", "limma", "nbpseq"), # meta.p = "pandora", # statistics="deseq", # or whatever supported, more than one also fig.format=c("png","pdf"), export.where=file.path(the.path,"metaseqr_quantseq_TbctrlVSTbil22"), restrict.cores=0.5, # fraction of available cores to use qc.plots=c( "mds","biodetection","countsbio","saturation","readnoise","filtered", "correl","pairwise","boxplot","gcbias","lengthbias", "biodist","volcano","deheatmap" ), exon.filters=NULL, gene.filters=list( length=list( length=500 ), avg.reads=list( average.per.bp=100, quantile=0.25 ), expression=list( median=TRUE, mean=FALSE, quantile=NA, known=NA, custom=NA ), # it's the default anyway biotype=get.defaults("biotype.filter","mm10") ), pcut=0.05, # only for the truncated significant list output, all results are exported anyway export.what=c("annotation","p.value","adj.p.value","fold.change","stats", # export.what=c("annotation","p.value","adj.p.value","fold.change","meta.p.value","adj.meta.p.value","stats", "counts","flags"), # if you use pandora, the fields "meta.p.value" and "adj.meta.p.value" should be added export.scale=c("log2","rpgm"), export.values="normalized", export.stats="mean" ) targets <- read.targets("targets-TbctrlVSTdctrl.txt") # Do the counting based with bam files in the targets file r2c.out <- read2count(targets,transcript.data,has.all.fields=TRUE,multic=multic) # Create a counts table to be passed as "embedded" annotation the.counts <- cbind(r2c.out$mergedann,r2c.out$counts) metaseqr( counts=the.counts, sample.list=targets$samples, contrast="Tbctrl_vs_Tdctrl", annotation="embedded", gene.file="/data/results/tools/rnaseq/metaseqr/mm10/gene_data_mm10.txt.gz", id.col=4, # required with embedded annotation gc.col=5, # required with embedded annotation bt.col=8, # required with embedded annotation name.col=7, # required with embedded annotation org="custom", count.type="utr", normalization="deseq", # or whatever supported statistics = c("deseq"), #"edger", "limma", "nbpseq"), # meta.p = "pandora", #statistics = c("deseq", "edger", "noiseq", "bayseq", "limma", "nbpseq"), # meta.p = "pandora", # statistics="deseq", # or whatever supported, more than one also fig.format=c("png","pdf"), export.where=file.path(the.path,"metaseqr_quantseq_TbctrlVSTdctrl"), restrict.cores=0.5, # fraction of available cores to use qc.plots=c( "mds","biodetection","countsbio","saturation","readnoise","filtered", "correl","pairwise","boxplot","gcbias","lengthbias", "biodist","volcano","deheatmap" ), exon.filters=NULL, gene.filters=list( length=list( length=500 ), avg.reads=list( average.per.bp=100, quantile=0.25 ), expression=list( median=TRUE, mean=FALSE, quantile=NA, known=NA, custom=NA ), # it's the default anyway biotype=get.defaults("biotype.filter","mm10") ), pcut=0.05, # only for the truncated significant list output, all results are exported anyway export.what=c("annotation","p.value","adj.p.value","fold.change","stats", # export.what=c("annotation","p.value","adj.p.value","fold.change","meta.p.value","adj.meta.p.value","stats", "counts","flags"), # if you use pandora, the fields "meta.p.value" and "adj.meta.p.value" should be added export.scale=c("log2","rpgm"), export.values="normalized", export.stats="mean" ) targets <- read.targets("targets-Tbil22VSTdil22.txt") # Do the counting based with bam files in the targets file r2c.out <- read2count(targets,transcript.data,has.all.fields=TRUE,multic=multic) # Create a counts table to be passed as "embedded" annotation the.counts <- cbind(r2c.out$mergedann,r2c.out$counts) metaseqr( counts=the.counts, sample.list=targets$samples, contrast="Tbil22_vs_Tdil22", annotation="embedded", gene.file="/data/results/tools/rnaseq/metaseqr/mm10/gene_data_mm10.txt.gz", id.col=4, # required with embedded annotation gc.col=5, # required with embedded annotation bt.col=8, # required with embedded annotation name.col=7, # required with embedded annotation org="custom", count.type="utr", normalization="deseq", # or whatever supported statistics = c("deseq"), #"edger", "limma", "nbpseq"), # meta.p = "pandora", #statistics = c("deseq", "edger", "noiseq", "bayseq", "limma", "nbpseq"), # meta.p = "pandora", # statistics="deseq", # or whatever supported, more than one also fig.format=c("png","pdf"), export.where=file.path(the.path,"metaseqr_quantseq_Tbil22VSTdil22"), restrict.cores=0.5, # fraction of available cores to use qc.plots=c( "mds","biodetection","countsbio","saturation","readnoise","filtered", "correl","pairwise","boxplot","gcbias","lengthbias", "biodist","volcano","deheatmap" ), exon.filters=NULL, gene.filters=list( length=list( length=500 ), avg.reads=list( average.per.bp=100, quantile=0.25 ), expression=list( median=TRUE, mean=FALSE, quantile=NA, known=NA, custom=NA ), # it's the default anyway biotype=get.defaults("biotype.filter","mm10") ), pcut=0.05, # only for the truncated significant list output, all results are exported anyway export.what=c("annotation","p.value","adj.p.value","fold.change","stats", # export.what=c("annotation","p.value","adj.p.value","fold.change","meta.p.value","adj.meta.p.value","stats", "counts","flags"), # if you use pandora, the fields "meta.p.value" and "adj.meta.p.value" should be added export.scale=c("log2","rpgm"), export.values="normalized", export.stats="mean" ) targets <- read.targets("targets-TdctrlVSTdil22.txt") # Do the counting based with bam files in the targets file r2c.out <- read2count(targets,transcript.data,has.all.fields=TRUE,multic=multic) # Create a counts table to be passed as "embedded" annotation the.counts <- cbind(r2c.out$mergedann,r2c.out$counts) metaseqr( counts=the.counts, sample.list=targets$samples, contrast="Tdctrl_vs_Tdil22", annotation="embedded", gene.file="/data/results/tools/rnaseq/metaseqr/mm10/gene_data_mm10.txt.gz", id.col=4, # required with embedded annotation gc.col=5, # required with embedded annotation bt.col=8, # required with embedded annotation name.col=7, # required with embedded annotation org="custom", count.type="utr", normalization="deseq", # or whatever supported statistics = c("deseq"), #"edger", "limma", "nbpseq"), # meta.p = "pandora", #statistics = c("deseq", "edger", "noiseq", "bayseq", "limma", "nbpseq"), # meta.p = "pandora", # statistics="deseq", # or whatever supported, more than one also fig.format=c("png","pdf"), export.where=file.path(the.path,"metaseqr_quantseq_TdctrlVSTdil22"), restrict.cores=0.5, # fraction of available cores to use qc.plots=c( "mds","biodetection","countsbio","saturation","readnoise","filtered", "correl","pairwise","boxplot","gcbias","lengthbias", "biodist","volcano","deheatmap" ), exon.filters=NULL, gene.filters=list( length=list( length=500 ), avg.reads=list( average.per.bp=100, quantile=0.25 ), expression=list( median=TRUE, mean=FALSE, quantile=NA, known=NA, custom=NA ), # it's the default anyway biotype=get.defaults("biotype.filter","mm10") ), pcut=0.05, # only for the truncated significant list output, all results are exported anyway export.what=c("annotation","p.value","adj.p.value","fold.change","stats", # export.what=c("annotation","p.value","adj.p.value","fold.change","meta.p.value","adj.meta.p.value","stats", "counts","flags"), # if you use pandora, the fields "meta.p.value" and "adj.meta.p.value" should be added export.scale=c("log2","rpgm"), export.values="normalized", export.stats="mean" )