DRL / blobtools

Modular command-line solution for visualisation, quality control and taxonomic partitioning of genome datasets
GNU General Public License v3.0
192 stars 44 forks source link

PySam issue #88

Closed francoissabot closed 5 years ago

francoissabot commented 5 years ago

Hi folks

i installed the last version of blobtools, and have an unexpected issue with Pysam use:

here are my commands and outputs

$ ~/sources/blobtools/blobtools create -i flyeAsmComplete/scaffolds.fasta -b flyeAsmComplete/scaffolds.fasta.Illumina.sam.bam.SORTED.bam --db ~/sources/blobtools/data/nodesDB.txt -t flye_blast_alignement.tsv -o flye_blobtools [+] Parsing FASTA - flyeAsmComplete/scaffolds.fasta [+] names.dmp/nodes.dmp not specified. Retrieving nodesDB from /home/xxxx/sources/blobtools/data/nodesDB.txt [%] : 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.09M/2.09M [00:07<00:00, 267kit/s] [+] Parsing tax0 - /Data/rufipogon/AssemblyW1654/flye_blast_alignement.tsv [+] Computing taxonomy using taxrule(s) bestsum [%] : 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.30k/4.30k [00:06<00:00, 666it/s] [+] Parsing bam0 - /Data/rufipogon/AssemblyW1654/flyeAsmComplete/scaffolds.fasta.Illumina.sam.bam.SORTED.bam [+] -> 100.00 (4297/4297) of sequences have reads aligned to them. [+] -> 99.36 (98958700/99594253) of reads are mapped. [%] : 0%| | 0.00/4.30k [00:00<?, ?it/s] Traceback (most recent call last): File "/home/xxxx/sources/blobtools/blobtools", line 7, in main() File "/home/xxxx/Documents/sources/blobtools/lib/interface.py", line 60, in main create.main() File "/home/xxxx/Documents/sources/blobtools/lib/create.py", line 119, in main blobDb.parseCoverage(covLibObjs=cov_libs, estimate_cov=estimate_cov_flag, prefix=prefix) File "/home/xxxx/Documents/sources/blobtools/lib/BtCore.py", line 369, in parseCoverage base_cov_dict, covLib.reads_total, covLib.reads_mapped, read_cov_dict = BtIO.parseBam(covLib.f, set(self.dict_of_blobs), estimate_cov) File "/home/xxxx/Documents/sources/blobtools/lib/BtIO.py", line 224, in parseBam base_cov_dict, read_cov_dict = estimate_coverage(aln, set_of_blobs) File "/home/xxxx/Documents/sources/blobtools/lib/BtIO.py", line 235, in estimate_coverage read_count = aln.count(header, read_callback=check_mapped_read) File "pysam/calignmentfile.pyx", line 1081, in pysam.calignmentfile.AlignmentFile.count TypeError: count() got an unexpected keyword argument 'read_callback'

Any idea ? My pysam are up to date, my python 3 version is 3.5.2, my system ubuntu 16.04

DRL commented 5 years ago

Hi,

could it be that the BAM is not indexed?

cheers,

dom

francoissabot commented 5 years ago

The bam is indexed :

$ ls flyeAsmComplete/scaffolds.fasta.Illumina.sam.bam.SORTED.bam* flyeAsmComplete/scaffolds.fasta.Illumina.sam.bam.SORTED.bam flyeAsmComplete/scaffolds.fasta.Illumina.sam.bam.SORTED.bam.bai

DRL commented 5 years ago

Hmm, weird ...

the changelog of pysam says that read_callback function of count was implemented in Release 0.9.0, which also requires htslib 1.3

did you install the dependencies via conda? could you check that you have those versions or newer on your system?

cheers,

dom

francoissabot commented 5 years ago

I have installed everything through pip.. I am testing through Conda by now

francoissabot commented 5 years ago

Ok, working in pure conda...