Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Problem with pysam: ValueError: fetch called on bamfile without index #22

Open
BenNiLu opened this issue Mar 12, 2024 · 1 comment
Open

Comments

@BenNiLu
Copy link

BenNiLu commented Mar 12, 2024

So I'm trying to run clear_quant on a RNA-seq file I obtained online (Ribo-), but I cannot seem to move past the following error:

###Parameters:
Namespace(bowtie1='/home/nilu/Alignment_db/base_files/ensembl/bowtie/bowtie_index', genome='/home/nilu/Alignment_db/base_files/ensembl/base_files/Homo_sapiens.GRCh38.dna.primary_assembly.fa', gtf='/home/nilu/Alignment_db/base_files/ensembl/base_files/Homo_sapiens.GRCh38.109.gtf', hisat='/home/nilu/Alignment_db/base_files/ensembl/HISAT2/genome_tran_ensembl', m1='SRR1637089_1.fastq', m2='SRR1637089_2.fastq', output='/home/nilu/Alignment_db/analysis_files/SRX749316/SRR1637089/CLEAR', thread='30')
###Parameters

###Start hisat2 mapping
start to get sp sites for hisat mapping
start to align to genome by hisat
get mapped and unmapped reads
Traceback (most recent call last):
File "/home/nilu/.conda/envs/CLEAR/bin/clear_quant", line 11, in
load_entry_point('CLEAR==1.0.1', 'console_scripts', 'clear_quant')()
File "/home/nilu/.conda/envs/CLEAR/lib/python2.7/site-packages/CLEAR-1.0.1-py2.7.egg/src/run.py", line 258, in main
hisat_align(args.m1, args.m2, args.hisat, args.gtf, hisat_dir, args.thread)
File "/home/nilu/.conda/envs/CLEAR/lib/python2.7/site-packages/CLEAR-1.0.1-py2.7.egg/src/run.py", line 121, in hisat_align
for read in samfile.fetch():
File "pysam/calignmentfile.pyx", line 874, in pysam.calignmentfile.AlignmentFile.fetch (pysam/calignmentfile.c:10986)
ValueError: fetch called on bamfile without index

I read the run.py and it it does index the bamfile later on, but I cannot seem to get past the pysam error to the actual indexing step.
Thanks in advance

@BenNiLu
Copy link
Author

BenNiLu commented Mar 13, 2024

I managed to solve it. It seems to be because the order in which I installed the package was wrong. I reinstalled it according to this site: https://cloud.tencent.com/developer/article/1921029, and now it works normally.

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

No branches or pull requests

1 participant