Browse Source

add --strandSpecific

Zhang Xudong 3 years atrás
parent
commit
111b1ed2f1
1 changed files with 2 additions and 1 deletions
  1. 2 1
      run-featurecounts.R

+ 2 - 1
run-featurecounts.R

@@ -10,6 +10,7 @@ p <- add_argument(p, "--gtf", help="input: gtf file", type="character")
 p <- add_argument(p, "--featureType", help="a character string or a vector of character strings giving the feature type or types used to select rows in the GTF annotation which will be used for read summarization", type="character", default="exon")
 p <- add_argument(p, "--attrType", help="a character string giving the attribute type in the GTF annotation which will be used to group features (eg. exons) into meta-features", type="character", default="gene_id")
 p <- add_argument(p, "--isPairedEnd", help="indicating whether libraries contain paired-end reads or not", type="logical", default=TRUE)
+p <- add_argument(p, "--strandSpecific", help="0 (unstranded), 1 (stranded) and 2 (reversely stranded)", type="numeric", default=0)
 p <- add_argument(p, "--output", help="output prefix", type="character")
 
 # Parse the command line arguments
@@ -27,7 +28,7 @@ outFilePref <- argv$output
 outStatsFilePath  <- paste(outFilePref, '.log',  sep = ''); 
 outCountsFilePath <- paste(outFilePref, '.count', sep = ''); 
 
-fCountsList = featureCounts(bamFile, annot.ext=gtfFile, isGTFAnnotationFile=TRUE, nthreads=nthreads, GTF.featureType=argv$featureType, GTF.attrType=argv$attrType, isPairedEnd=argv$isPairedEnd)
+fCountsList = featureCounts(bamFile, annot.ext=gtfFile, isGTFAnnotationFile=TRUE, nthreads=nthreads, GTF.featureType=argv$featureType, GTF.attrType=argv$attrType, isPairedEnd=argv$isPairedEnd, strandSpecific=argv$strandSpecific)
 dgeList = DGEList(counts=fCountsList$counts, genes=fCountsList$annotation)
 fpkm = rpkm(dgeList, dgeList$genes$Length)
 tpm = exp(log(fpkm) - log(sum(fpkm)) + log(1e6))