diff --git a/bin/qc.R b/bin/qc.R index 7e24355..7d8ee42 100755 --- a/bin/qc.R +++ b/bin/qc.R @@ -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 diff --git a/modules/stringtie/stringtie_quant.nf b/modules/stringtie/stringtie_quant.nf index 4f7fc9f..2e4afa6 100644 --- a/modules/stringtie/stringtie_quant.nf +++ b/modules/stringtie/stringtie_quant.nf @@ -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 """ } \ No newline at end of file diff --git a/modules/stringtie/stringtie_workflow.nf b/modules/stringtie/stringtie_workflow.nf index 0339aea..15c264a 100644 --- a/modules/stringtie/stringtie_workflow.nf +++ b/modules/stringtie/stringtie_workflow.nf @@ -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, @@ -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