This commit is contained in:
Neil Horner 2022-04-06 09:45:25 +00:00
parent 63c4b5c7a5
commit 07275010c0
2 changed files with 16 additions and 16 deletions

View File

@ -305,9 +305,7 @@ def gff_compare_plots(report, gffcompare_outdirs: Path, sample_ids):
* **Totals**: * **Totals**:
Comparison of the number of stringtie-generated Comparison of the number of stringtie-generated
transcripts, multiexonic transcripts and transcripts, multiexonic transcripts and loci between reference and query.
loci (I'm not exactly sure what defines this class at the moment) between
reference
* **Performance**: * **Performance**:
How accurate are the query transcript annotations with respect to the How accurate are the query transcript annotations with respect to the
@ -411,6 +409,9 @@ def gff_compare_plots(report, gffcompare_outdirs: Path, sample_ids):
tracking.drop(columns=['sample_id', 'Overlaps'], inplace=True) tracking.drop(columns=['sample_id', 'Overlaps'], inplace=True)
tracking = tracking[['Code', 'Description', 'Count', 'Percent']] tracking = tracking[['Code', 'Description', 'Count', 'Percent']]
tracking = tracking.round({
'Percent': 2
})
cols = [TableColumn( cols = [TableColumn(
field=Ci, title=Ci, width=100) for Ci in tracking.columns] field=Ci, title=Ci, width=100) for Ci in tracking.columns]

25
main.nf
View File

@ -133,13 +133,17 @@ process split_bam{
if (params["bundle_min_reads"] != false) if (params["bundle_min_reads"] != false)
""" """
seqkit bam -j ${params.threads} -N ${params.bundle_min_reads} ${bam} -o bam_bundles/ seqkit bam -j ${params.threads} -N ${params.bundle_min_reads} ${bam} -o bam_bundles/
mv bam_bundles/* . mv bam_bundles/* .
for f in *:*; do mv -v "\$f" \$(echo "\$f" | tr ':' '-'); done let i=1
for b in *.bam; do
newname="${sample_id}_batch_\${i}.bam"
mv \$b \$newname
((i++))
done
""" """
else else
""" """
mkdir -p ./${sample_id}_bam_bundles ln -s ${bam} ${sample_id}_batch_1.bam
ln -s ${bam} ${sample_id}_bam_bundles-000000000-ALL-0-1_bundle.bam
""" """
} }
@ -161,17 +165,12 @@ process assemble_transcripts{
output: output:
tuple val(sample_id), path('*.gff'), emit: gff_bundles tuple val(sample_id), path('*.gff'), emit: gff_bundles
script: script:
def out_filename = bam.name.replaceFirst(~/\.[^\.]+$/, '') + "_${sample_id}.gff"
def G_FLAG = ref_annotation.name.startsWith('OPTIONAL_FILE') ? '' : "-G ${ref_annotation}" def G_FLAG = ref_annotation.name.startsWith('OPTIONAL_FILE') ? '' : "-G ${ref_annotation}"
// Convert batch name to stringtie prefix to prevent clashing attribute names def prefix = bam.name.split(/\./)[0]
// eg "0000000123_cluster..." to 123
def prefix = StringUtils.stripStart(bam.name.split('_')[0],"0")
if (!prefix){
prefix = "0"
}
""" """
stringtie --rf ${G_FLAG} -L -v -A gene_abund.tab -p ${params.threads} ${params.stringtie_opts} -o ${out_filename} \ stringtie --rf ${G_FLAG} -L -v -p ${params.threads} ${params.stringtie_opts} \
-l $prefix ${bam} 2>/dev/null -o ${prefix}.gff -l ${prefix} ${bam} 2>/dev/null
""" """
} }