diff --git a/workflow/rna-seq.nf b/workflow/rna-seq.nf index 16aca0e076a28ff696f8f2a2ae5f3fa1d876ef66..e252ec3730958cced1d5d7413434016b4fba0f4f 100755 --- a/workflow/rna-seq.nf +++ b/workflow/rna-seq.nf @@ -336,7 +336,7 @@ process alignData { *dedupData: mark the duplicate reads, specifically focused on PCR or optical duplicates */ process dedupData { - tag "${repRID}"git reset --soft HEAD^ + tag "${repRID}" publishDir "${outDir}/bam", mode: 'copy', pattern: "*.deduped.bam" publishDir "${logsDir}", mode: 'copy', pattern: "*.dedup.{out,err}" @@ -404,3 +404,25 @@ process makeBigWig { """ } +/* + *Run featureCounts and get the counts, tpm, and fpkm +*/ +process makeFeatureCounts { + tag "${repRID}" + publishDir "${outDir}/featureCounts", mode: 'copy', pattern: "${repRID}*.featureCounts*" + publishDir "${logsDir}", mode: 'copy', pattern: "${repRID}.makeFetureCounts.{out,err}" + + input: + path script_calculateTPM + tuple val (repRID1), path (bam), path (bai) from featureCountsIn + tuple val (repRID2), path (genome), path (gtf) from featureCountsRef + + output: + tuple val ("${repRID}"), path ("${repRID}.featureCounts.summary"), path ("${repRID}.featureCounts"), path ("${bam}.featureCounts.sam") into featureCountsOut + + script: + """ + featureCounts -R SAM -p -G ${genome} -T `nproc` -a ${gtf} -o ${repRID}.featureCounts ${repRID}.sorted.deduped.bam + Rscript calculateTPM.R --count "${repRID}.featureCounts" + """ +}