Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
no effect for picard cleansam liuxq Bioinformatics 0 12-29-2011 10:26 PM
Effect of outlier sample on CuffDiff analysis? cw11 Bioinformatics 3 12-21-2011 07:56 AM
Batch effect, SNPs YKay Genomic Resequencing 0 12-13-2011 06:42 AM
Effect of %AT content of genome on shearing Smriti Sample Prep / Library Generation 0 11-11-2011 01:12 PM
effect of mRNA contamination eren Genomic Resequencing 0 08-23-2011 10:43 PM

Thread Tools
Old 07-06-2011, 12:07 PM   #1
Junior Member
Location: Canada

Join Date: May 2011
Posts: 2
Default Samtools seek like effect.

I am currently implementing a module in c++ using samtools's c library and I seem to encounter many problems in trying to implement a Seek like effect for the bamfile. I have browse through everything I though would help within samtools without success.

I am using bam_plp_next and bam_plp_next to do a continuous read of the bamfile but I want to be able to say : Seek(int chrmTid); or something like that and then continue reading from the first available position of this chromosome.

Every function that access the index file is of the form
bam_iter_t bam_iter_query(const bam_index_t *idx, int tid, int beg, int end);
where beg and end are positions in this chromosome.

My question is : Is there a way that I can achieve the described functionality while only providing a tid and a beginning position?

What I use currently is the above mentionned function which I provide with 0 as beg position and arbitrairy 15000 as end.
malavv is offline   Reply With Quote
Old 07-07-2011, 01:55 AM   #2
Peter (Biopython etc)
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543

You should be able to get the full length of the references from the BAM header (I'm sure there is an API for that), and then you don't have to guess.
maubp is offline   Reply With Quote

samtools, seek

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 05:58 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO