Question: Fetching All Alignments From A Sam/Bam By Read Header In Perl
1
gravatar for Abhi
2.2 years ago by
Abhi970
Abhi970 wrote:

Hey Guys

I am wondering if there is a slick way access all the possible alignments for a read present in sam or bam file given the read header. Since the existing codebase is in perl I would prefer something which can be done in/via perl.

By default BAM's are indexed by location so the inbuilt samtools indexing wont work I guess.

I should also say the input bam file will have in the order of 500 million total alignments and many reads are expected to be aligned to more than one place in the genome. Given the size of the data loading it all in one big hash is not turning out to be memory friendly.

Thanks! -Abhi

ADD COMMENTlink written 2.2 years ago by Abhi970
2
gravatar for SES
2.2 years ago by
SES4.3k
Athens
SES4.3k wrote:

Have a look at Bio::DB::Sam. This does not ship with the core BioPerl, and to compile this you will need to get the Kent source tree. Building this can be tricky depending on your OS, but I'm sure there are plenty of people that can offer advice.

ADD COMMENTlink written 2.2 years ago by SES4.3k
1

Actually, you don't need the Kent source tree (that would be needed for Bio::DB::BigFile), but you do need a recent version of samtools

ADD REPLYlink written 2.2 years ago by Chris Fields490

Actually, you don't need the Kent source tree (that would be Bio::DB::BigFile), but you do need a recent version of samtools.

ADD REPLYlink written 2.2 years ago by Chris Fields490

Thanks, Chris. That was my error in memory. It looks like Bio::DB::BigFile is for BigWig and BigBed anyway, so at least Bio::DB::Sam is appropriate for the original question.

ADD REPLYlink written 2.2 years ago by SES4.3k

@SES @Chris : Thanks guys .. on my weekend test list

ADD REPLYlink written 2.2 years ago by Abhi970
Please log in to add an answer.

Help
Access
  • RSS
  • Stats
  • API

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