Closed psj1722 closed 1 year ago
Hi @psj1722 ,
Looks like there is an issue with the samtools flagstat output format. Do you know which version of samtools you have installed? (samtools --version
)?
Could you also run the profiling command with --no_clean
added? You should then have a bam file in your directory which you can run samtools flagstat -O json <bam_file>
. If you could do that and then post the output here.
Thanks!
Hi @jodyphelan ,
Many thanks for your reply. After adjusting the version of tb-profiler from 4.0.0 to 4.0.1, It seems that samtools run successfully but occurs a new problem. Then I tried to upgrade samtools and bcftools to 1.12 by mamba install -c conda-forge -c bioconda, but it will downgrade tb-profiler to 2.8.14. However tb-profiler 2.8.14 did not have the option --call_whole_genome
{'read1': '1603_R1.fq.gz', 'read2': '1603_R2.fq.gz', 'bam': None, 'platform': 'illumina', 'db': 'tbdb', 'external_db': None, 'prefix': 'prefix', 'dir': '.', 'csv': False, 'txt': False, 'pdf': False, 'add_columns': None, 'add_mutation_metadata': False, 'call_whole_genome': True, 'mapper': 'bwa', 'caller': 'freebayes', 'calling_params': None, 'min_depth': 10, 'af': 0.1, 'reporting_af': 0.1, 'coverage_fraction_threshold': 0, 'missing_cov_threshold': 10, 'suspect': False, 'no_trim': False, 'no_flagstat': False, 'no_clip': True, 'no_delly': False, 'no_lineage': False, 'add_variant_annotations': False, 'threads': 1, 'verbose': 0, 'no_cleanup': False, 'delly_bcf': None, 'func': <function main_profile at 0x7ff6838cfaf0>, 'tmp_prefix': '0cd357dd-cd20-48e5-85e3-53c5f027d74d'}
File "/home/sunnan/mambaforge/envs/python38sn/bin/tb-profiler", line 594, in <module>
args.func(args)
File "/home/sunnan/mambaforge/envs/python38sn/bin/tb-profiler", line 171, in main_profile
results = pp.bam_profiler(
File "/home/sunnan/mambaforge/envs/python38sn/lib/python3.8/site-packages/pathogenprofiler/profiler.py", line 32, in bam_profiler
ann_vcf_obj = vcf_obj.run_snpeff(conf["snpEff_db"],conf["ref"],conf["gff"],rename_chroms= conf["chromosome_conversion"])
File "/home/sunnan/mambaforge/envs/python38sn/lib/python3.8/site-packages/pathogenprofiler/vcf.py", line 62, in run_snpeff
run_cmd("bcftools concat %(tmp_file1)s %(tmp_file2)s | bcftools sort -Oz -o %(vcf_csq_file)s" % vars(self))
File "/home/sunnan/mambaforge/envs/python38sn/lib/python3.8/site-packages/pathogenprofiler/utils.py", line 255, in run_cmd
raise ValueError("Command Failed:\n%s\nstderr:\n%s" % (cmd,stderr.decode()))
Command Failed:
set -u pipefail; bcftools concat 15646a84-f824-437f-8e8c-855b186d94ee.vcf 74f9b827-64d5-46aa-9971-e10c42938e54.vcf | bcftools sort -Oz -o ./0cd357dd-cd20-48e5-85e3-53c5f027d74d.targets.csq.vcf.gz
stderr:
Checking the headers and starting positions of 2 files
Writing to /tmp/bcftools-sort.4WeUTb
[E::bcf_hdr_read] Input is not detected as bcf or vcf format
Failed to parse header: 15646a84-f824-437f-8e8c-855b186d94ee.vcf
[E::bcf_hdr_read] Input is not detected as bcf or vcf format
Could not read VCF/BCF headers from -
Cleaning
tb-profiler error report
I'm hoping to run tb_profiler as tb-profiler profile -1 1603_R1.fq.gz -2 1603_R2.fq.gz -p prefix --call_whole_genome but I can't seem to get that working. The following is the error:
Traceback:
KeyError:
'primary mapped'