cortes-ciriano-lab / SComatic

A tool for detecting somatic variants in single cell data
Other
145 stars 20 forks source link

AttributeError: 'pysam.calignedsegment.PileupColumn' object has no attribute 'get_num_aligned' is occurred in step2 #18

Closed yasuhikohaga closed 11 months ago

yasuhikohaga commented 1 year ago

Thank you for great tool.

I am running snRNA-seq data and AttributeError: 'pysam.calignedsegment.PileupColumn' object has no attribute 'get_num_aligned' is occurred in step 2 : Collecting base count information.

I just changed path from example code and run like this

python $SCOMATIC/scripts/BaseCellCounter/BaseCellCounter.py --bam $bam \ --ref $REF \ --chrom all \ --out_folder $SCOMATIC/data_haga/PC9_1/Step2_BaseCellCounts \ --min_bq 30 \ --tmp_dir $temp \ --nprocs 1

and got an error like this

Traceback (most recent call last): File "SCOMATIC/scripts/BaseCellCounter/BaseCellCounter.py", line 410, in main() File "SCOMATIC/scripts/BaseCellCounter/BaseCellCounter.py", line 402, in main collect_result(run_interval(row, BAM, FASTA, MIN_COV, MIN_CC, MIN_AF, MIN_AC,tmp_dir, MIN_BQ, MIN_MQ)) File "SCOMATIC/scripts/BaseCellCounter/BaseCellCounter.py", line 202, in run_interval DP = p.get_num_aligned() AttributeError: 'pysam.calignedsegment.PileupColumn' object has no attribute 'get_num_aligned'

pysam version is 0.16.0.1, and should I change pysam version? or is there any solution?

Best regards,

Yasu

Francesc-Muyas commented 1 year ago

Dear user, Thanks for bringing this up. Could you let me know if you managed to run the example sample?

Cheers, Fran

yasuhikohaga commented 1 year ago

Thanks for your reply and sorry for my late response.

I got same error even running example sample.

version of my tools are shown under here Name Version Build Channel about-time 3.1.1 pypi_0 pypi numpy 1.21.6 pypi_0 pypi numpy-groupies 0.9.14 pypi_0 pypi pandas 1.3.5 pypi_0 pypi pybedtools 0.8.1 py37he513fc3_0 bioconda pysam 0.16.0.1 pypi_0 pypi rpy2 2.9.4 py37r36hd767a1f_3 conda-forge scipy 1.7.3 pypi_0 pypi

pybedtools and rpy2 were installed by conda because these couldn't be installed by pip in my environment.

best regards, Yasu

evelyn-schmidt commented 1 year ago

Hello all,

I just tried running the test data today and am getting the same issue. My version of pysam is 0.9.1 and was installed with bioconda.

thanks, Evelyn

Francesc-Muyas commented 1 year ago

Dear users, It seems to be a problem with the pysam package. Could you try to install pysam using conda instead, and let me know if can run the example?

Cheers, Fran

Renty9 commented 11 months ago

Dear users, It seems to be a problem with the pysam package. Could you try to install pysam using conda instead, and let me know if can run the example?

Cheers, Fran

It works with all versions of pysam. And I run the example successfully. I think the reason for the error is that the wrong reference sequence was used

yasuhikohaga commented 11 months ago

Fran I tried your suggestion, but still occurred same issue...

I probably used correct reference, chr10.fa. So i have no idea how to solve this problem.

best regards, Yasu

Francesc-Muyas commented 11 months ago

Hi people! A couple of questions:

  1. Are you running SComatic in a Linux env?
  2. Could you try, for instance, this pysam version (pysam==0.16.0.1)?
  3. Could you paste the command line you are using?

Cheers, Fran

LASeeker commented 6 months ago

Hello everyone, I got the same error with both my data and the provided example data (thank you! Very helpful to have it!). I de-installed Pysam and installed its most recent version (0.22.0) with pip and now it works with both the example dataset and my own. Cheers, Luise