Skip to content

Commit

Permalink
Update tb profiler v6.2.0 (#36)
Browse files Browse the repository at this point in the history
* update variable name changes

* update tbprofiler version

* remove reporting allele fraction

* update variable names used in updated report

* update all variable names
  • Loading branch information
taranewman authored Apr 18, 2024
1 parent 71f22bd commit 3f8a41d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
12 changes: 6 additions & 6 deletions bin/check_snpit_against_tbprofiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ def main(args):

if snpit_results['Species'] == 'N/A':
tbprofiler_report = json.load(open(args.tbprofiler_report))
pct_reads_mapped = tbprofiler_report['qc']['pct_reads_mapped']
if tbprofiler_report['main_lin'] == 'lineage4' and pct_reads_mapped >= args.min_percent_reads_mapped:
pct_reads_mapped = tbprofiler_report['qc']['percent_reads_mapped']
if tbprofiler_report['main_lineage'] == 'lineage4' and pct_reads_mapped >= args.min_percent_reads_mapped:
snpit_results['Species'] = 'M. tuberculosis'
snpit_results['Lineage'] = tbprofiler_report['main_lin'].replace('lineage', 'Lineage ')
snpit_results['Lineage'] = tbprofiler_report['main_lineage'].replace('lineage', 'Lineage ')
snpit_results['Percentage'] = 'N/A'
elif snpit_results['Percentage'] != 'N/A' and snpit_results['Percentage'] < args.min_snpit_percentage:
tbprofiler_report = json.load(open(args.tbprofiler_report))
pct_reads_mapped = tbprofiler_report['qc']['pct_reads_mapped']
if tbprofiler_report['main_lin'] == 'lineage4' and pct_reads_mapped >= args.min_percent_reads_mapped:
pct_reads_mapped = tbprofiler_report['qc']['percent_reads_mapped']
if tbprofiler_report['main_lineage'] == 'lineage4' and pct_reads_mapped >= args.min_percent_reads_mapped:
snpit_results['Species'] = 'M. tuberculosis'
snpit_results['Lineage'] = tbprofiler_report['main_lin'].replace('lineage', 'Lineage ')
snpit_results['Lineage'] = tbprofiler_report['main_lineage'].replace('lineage', 'Lineage ')
snpit_results['Name'] = 'N/A'
snpit_results['Percentage'] = 'N/A'

Expand Down
2 changes: 1 addition & 1 deletion environments/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ channels:
dependencies:
- python=3
- fastp=0.23.2
- tb-profiler=4.3.0
- tb-profiler=6.2.0
- qualimap=2.2.2d
5 changes: 2 additions & 3 deletions modules/tbprofiler.nf
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ process tbprofiler {
--platform ${params.platform} \
--mapper ${params.mapper} \
--caller ${params.caller} \
--min_depth ${params.min_depth} \
--depth ${params.min_depth} \
--af ${params.min_af_used_for_calling} \
--reporting_af ${params.min_af_used_for_prediction} \
--read1 ${reads_1} \
--read2 ${reads_2} \
--prefix ${sample_id} \
Expand All @@ -78,7 +77,7 @@ process tbprofiler {
mv bam/${sample_id}.bam ./${sample_id}_tbprofiler.bam
mv bam/${sample_id}.bam.bai ./${sample_id}_tbprofiler.bam.bai

mv vcf/${sample_id}.targets.csq.vcf.gz ./${sample_id}_tbprofiler_targets.vcf.gz
mv vcf/${sample_id}.targets.vcf.gz ./${sample_id}_tbprofiler_targets.vcf.gz
gunzip ./${sample_id}_tbprofiler_targets.vcf.gz

mv vcf/${sample_id}.vcf.gz ./${sample_id}_tbprofiler_whole_genome.vcf.gz
Expand Down

0 comments on commit 3f8a41d

Please sign in to comment.