Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

checkm coverage NameError #401

Open
mv-mendes opened this issue Jul 26, 2024 · 1 comment
Open

checkm coverage NameError #401

mv-mendes opened this issue Jul 26, 2024 · 1 comment

Comments

@mv-mendes
Copy link

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
Copy link

permia commented Oct 15, 2024

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants