[Biopython] comparing bam files

Abhishek Pratap abhishek.vit at gmail.com
Tue Sep 20 21:46:15 UTC 2011


Thanks for the reply Peter. I know my requirement sure does confusing but
this is something we need to do in order to extract the reads which are
stranded. In our case we want the reads where read 1 maps to same strand and
read 2 on the other strand and eliminate the cases where read 2 falls on the
same strand and read 1 on the opposite strand.

I am looking into pysam to see if it can help me . Does pysam have another
mailing list  or this is the right forum to ask pysam related questions ? I
am sure I will have some as soon as I begin poking into it.

-Abhi

On Sat, Sep 17, 2011 at 2:44 PM, Peter Cock <p.j.a.cock at googlemail.com>wrote:

> On Fri, Sep 16, 2011 at 11:42 PM, Abhishek Pratap
> <abhishek.vit at gmail.com> wrote:
> > Hi All
> >
> > This is my first post to the biopython mailing list. Basically I am
> > new to both Python and BioP.
> >
>
> Welcome.
>
> >
> > So I have two bam files one contains the properly paired reads (file
> > A) and the other has some of the singeltons (file B) either (read 1 /
> > read 2).
> >
> > I have to find the mates of all the singletons from the properly
> > paired bam file (file A) and then generate a bam file  (file C)which
> > has all the proper pairs for all the singletons I had.
> >
> > PS: Also the file A is guaranteed to have all the pairs which might
> > exist as a singleton in file B.
>
> I don't understand what you're trying to do - why are there
> singletons in file A if that is the file of properly paired reads?
>
> > I want to do this on the binary files and avoid reading in the sam
> > files. Is that something I can do using some of the bam readers in
> > biopython ?
>
> Biopython doesn't have a SAM/BAM interface, instead there
> is pysam which binds the samtools C API:
>
> http://code.google.com/p/pysam/
>
> Try that.
>
> Peter
>



More information about the Biopython mailing list