Pysam usage problem
1
1
Entering edit mode
7.3 years ago
Rongbin ▴ 10

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.9k views
ADD COMMENT
2
Entering edit mode
7.3 years ago

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 COMMENT

Login before adding your answer.

Traffic: 2715 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6