Ecogenomics / CheckM

Assess the quality of microbial genomes recovered from isolates, single cells, and metagenomes
https://ecogenomics.github.io/CheckM/
GNU General Public License v3.0
347 stars 73 forks source link

checkm coverage NameError #401

Open mv-mendes opened 3 months ago

mv-mendes commented 3 months ago

When I run the "checkm coverage" i keep getting the "NameError: name 'pysam' is not defined". I am using sorted and indexed bam files generated through Bowtie2+samtools. I am using CheckM v1.2.3 with the command:

$ checkm coverage -x fasta dir_bins/ coverage.tsv align_sorted.bam

The error that i get is:

Unexpected error: <class 'NameError'>
Traceback (most recent call last):
  File "/home/mvm/anaconda3/envs/checkM/bin/checkm", line 856, in <module>
    checkmParser.parseOptions(args)
  File "/home/mvm/anaconda3/envs/checkM/lib/python3.8/site-packages/checkm/main.py", line 1013, in parseOptions
    self.coverage(options)
  File "/home/mvm/anaconda3/envs/checkM/lib/python3.8/site-packages/checkm/main.py", line 746, in coverage
    coverage.run(binFiles, options.bam_files, options.output_file, options.all_reads,
  File "/home/mvm/anaconda3/envs/checkM/lib/python3.8/site-packages/checkm/coverage.py", line 91, in run
    coverageInfo[bamFile] = self._processBam(bamFile, bAllReads, minAlignPer, maxEditDistPer, minQC, coverageInfo[bamFile])
  File "/home/mvm/anaconda3/envs/checkM/lib/python3.8/site-packages/checkm/coverage.py", line 131, in _processBam
    bamfile = pysam.Samfile(bamFile, 'rb')
NameError: name 'pysam' is not defined

thank you for your help :)

permia commented 1 month ago

add import pysam at the first regions of "/home/mvm/anaconda3/envs/checkM/lib/python3.8/site-packages/checkm/coverage.py"