Skip to content

Commit

Permalink
Changed quantification in Stringtie
Browse files Browse the repository at this point in the history
Changed Stringtie module to use native quantification from Stringtie instead of subread featureCounts
  • Loading branch information
N-Hoffmann committed Nov 20, 2024
1 parent c5f0724 commit d8f2fcb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
4 changes: 3 additions & 1 deletion bin/qc.R
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,10 @@ sub_cover <- textGrob(sub_cover_text,
grid.arrange(cover, sub_cover)

# Command line
formatted_command <- gsub("(^|\\s)(-{1,2}\\w+)", "\n\\1\\2", command)

grid.arrange(textGrob(
paste(command)
paste(formatted_command)
))

# Gene
Expand Down
10 changes: 8 additions & 2 deletions modules/stringtie/stringtie_quant.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@ process STRINGTIE_QUANTIFY {
path merged_gtf

output:
path 'stringtie_quant.gtf', emit: stringtie_quant_qtf
path "${bam.simpleName}.counts_transcript.txt", emit: counts_transcript
path "${bam.simpleName}.counts_gene.txt", emit: counts_gene

script:
"""
stringtie \
-L \
-eB \
-p ${params.maxCpu} \
-G ${merged_gtf} \
-o stringtie_quant.gtf \
-A gene_abundance.tab \
-p ${params.maxCpu} \
${bam}
# Extract tx and gene counts
awk -v bam="${bam.simpleName}" 'BEGIN {OFS="\t"; print "transcript_id", "gene_id", bam} NR>1 {print \$6, \$9, \$11}' t_data.ctab > ${bam.simpleName}.counts_transcript.txt
awk -v bam="${bam.simpleName}" 'BEGIN {OFS="\t"; print "gene_id", bam} NR>1 {print \$1, \$7}' gene_abundance.tab > ${bam.simpleName}.counts_gene.txt
"""
}
14 changes: 5 additions & 9 deletions modules/stringtie/stringtie_workflow.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ workflow STRINGTIE {
STRINGTIE_ASSEMBLE.out.stringtie_assemble_gtf.collect(),
input_gtf)

STRINGTIE_QUANTIFY(
samples,
STRINGTIE_MERGE.out.stringtie_merged_gtf)

GFFCOMPARE(
input_gtf,
ref_fa,
Expand All @@ -34,13 +30,13 @@ workflow STRINGTIE {
STRINGTIE_MERGE.out.stringtie_merged_gtf,
GFFCOMPARE.out.tracking_file)

SUBREAD_FEATURECOUNTS(
samples,
FORMAT_GFFCOMPARE.out.stringtie_gtf)
STRINGTIE_QUANTIFY(
samples,
STRINGTIE_MERGE.out.stringtie_merged_gtf)

MERGE_COUNTS(
SUBREAD_FEATURECOUNTS.out.gene_counts.collect(),
SUBREAD_FEATURECOUNTS.out.tx_counts.collect())
STRINGTIE_QUANTIFY.out.counts_gene.collect(),
STRINGTIE_QUANTIFY.out.counts_transcript.collect())

emit:
stringtie_gtf = FORMAT_GFFCOMPARE.out.stringtie_gtf
Expand Down

0 comments on commit d8f2fcb

Please sign in to comment.