YangLab / CLEAR

direct comparison of circular and linear RNA expression
20 stars 11 forks source link

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

Open BenNiLu opened 6 months ago

BenNiLu commented 6 months ago

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 commented 6 months ago

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.