Skip to content

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

@BenNiLu

Description

@BenNiLu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions