Question: Pysam usage problem
gravatar for Rongbin
3.1 years ago by
Rongbin10 wrote:

Hi BioStars,

I am using pysam to count read from bam file. I use pysam.AlignmentFile to read bam file and pysam.AlignmentFile.count to do read count, but it requires bai file which is an index should in the same path where bam file is. However I have no writing permission in bam file path. Is it possible to input index bai file from other path, I mean save bam file and its bai file in different path? Thanks very much if some guys can help this!

software error • 1.1k views
ADD COMMENTlink modified 9 months ago by Biostar ♦♦ 20 • written 3.1 years ago by Rongbin10
gravatar for WouterDeCoster
3.1 years ago by
WouterDeCoster42k wrote:

Easiest is probably to create a symbolic link to the bam (ln - s) in a directory where you can write, or /tmp/, and write the index there. You can probably fix this using the os module

ADD COMMENTlink modified 9 months ago by RamRS25k • written 3.1 years ago by WouterDeCoster42k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2475 users visited in the last hour