This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bam in python

Hello!

I am trying to calculate some probabilities via python and for that, I need a bam file in it.

I'd like to know what is the best way of uploading bam into jupyter notebook, so I can see how reads are laying against reference

Thanks!

python bam

1 answer

You can try pysam, or if you want a general genomic framework, try Hail. Keep in mind that there are many useful functions related to BAM file manipulation and analysis in software tools like samtools and bedtools, so it might be worth checking these out before you start developing your own scripts.

Thanks! However, there are some challenges with pysam installation. Just cannot do it via conda...

What's the problem? I was able to install it using conda/mamba with no special issues. If you are running into dependency conflicts, try installing in a clean conda environment.

I've already dealt with all installing problems. Thanks for your answer!

Log in to answer this question.