Skip to content

Commit

Permalink
Combine two reports, plus minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-plessy committed Jul 18, 2024
1 parent 9499a67 commit 52bcfac
Showing 1 changed file with 7 additions and 24 deletions.
31 changes: 7 additions & 24 deletions modules/local/custommodule.nf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ process CUSTOMMODULE {
script:
def args = task.ext.args ?: ''
"""
echo "# id: 'base content summary'" > gc_summary_mqc.tsv
echo "# section_name: 'base and contigs summary statistics'" >> gc_summary_mqc.tsv
echo "# id: 'base_content_summary'" > gc_summary_mqc.tsv
echo "# section_name: 'Base frequency'" >> gc_summary_mqc.tsv
echo "# format: 'tsv'" >> gc_summary_mqc.tsv
echo "# plot_type: 'bargraph'" >> gc_summary_mqc.tsv
echo "# description: 'This plot shows a brief summary of each base content/percentage in the query genomes'" >> gc_summary_mqc.tsv
Expand All @@ -34,37 +34,20 @@ process CUSTOMMODULE {
jq -r '[.contig_percent_a, .contig_percent_c, .contig_percent_g, .contig_percent_t, .contig_percent_n, .contig_non_acgtn] | @tsv' \$i >> gc_summary_mqc.tsv
done
echo "# id: 'contigs length statistics'" > contig_length_mqc.tsv
echo "# section_name: 'base and contigs summary statistics'" >> contig_length_mqc.tsv
echo "# id: 'contigs_length_statistics'" > contig_length_mqc.tsv
echo "# section_name: 'Contig length statistics'" >> contig_length_mqc.tsv
echo "# format: 'tsv'" >> contig_length_mqc.tsv
echo "# plot_type: 'heatmap'" >> contig_length_mqc.tsv
echo "# plot_type: 'table'" >> contig_length_mqc.tsv
echo "# description: 'This plot shows a short statistics abouth the length of contigs in the query genomes'" >> contig_length_mqc.tsv
echo "# pconfig:" >> contig_length_mqc.tsv
echo "# id: 'contigs length statistics'" >> contig_length_mqc.tsv
echo "# title: 'contigs length statistics'" >> contig_length_mqc.tsv
echo "# ylab: 'length'" >> contig_length_mqc.tsv
echo "id\tTOTALcontiglen\tMINcontiglen\tMAXcontiglen" >> contig_length_mqc.tsv
echo "id\tTOTALcontiglen\tMINcontiglen\tMAXcontiglen\ttotalcontigs\tcontigs>1k\tcontigs>10k" >> contig_length_mqc.tsv
for i in $json
do
printf "\$(basename \$i .json)\t" >> contig_length_mqc.tsv
jq -r '[.total_contig_length, .min_contig_length, .max_contig_length] | @tsv' \$i >> contig_length_mqc.tsv
done
echo "# id: 'contigs number'" > contig_total_mqc.tsv
echo "# section_name: 'base and contigs summary statistics'" >> contig_total_mqc.tsv
echo "# format: 'tsv'" >> contig_total_mqc.tsv
echo "# plot_type: 'heatmap'" >> contig_total_mqc.tsv
echo "# id: 'contigs length statistics'" >> contig_length_mqc.tsv
echo "# description: 'This plot shows the total number of contigs in each test with threshold length'" >> contig_total_mqc.tsv
echo "# pconfig:" >> contig_total_mqc.tsv
echo "# id: 'number of contigs'" >> contig_total_mqc.tsv
echo "# title: 'number of contigs'" >> contig_total_mqc.tsv
echo "# ylab: 'number'" >> contig_total_mqc.tsv
echo "id\ttotalcontigs\tcontigs>1k\tcontigs>10k" >> contig_total_mqc.tsv
for i in $json
do
printf "\$(basename \$i .json)\t" >> contig_total_mqc.tsv
jq -r '[.total_contig, .contigs_greater_1k, .contigs_greater_10k] | @tsv' \$i >> contig_total_mqc.tsv
jq -r '[.total_contig_length, .min_contig_length, .max_contig_length, .total_contig, .contigs_greater_1k, .contigs_greater_10k] | @tsv' \$i >> contig_length_mqc.tsv
done
"""
}

0 comments on commit 52bcfac

Please sign in to comment.