SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find unmapped read from sam/bam file genelab Bioinformatics 9 03-18-2014 01:35 PM
Convert merged BAM back to per lane BAM or FASTQ file danielsbrewer Bioinformatics 6 10-03-2013 07:29 AM
Replacing FASTA headers for TopHat & Cufflinks brachysclereid Bioinformatics 2 02-16-2011 04:44 AM
BWA: specifying SAM/BAM file header fields before read alignment? nora Bioinformatics 3 12-04-2010 09:11 PM
getting read quality out of a bam file blu78 Bioinformatics 0 07-06-2010 06:39 AM

Reply
 
Thread Tools
Old 06-23-2010, 08:26 AM   #1
blu78
Member
 
Location: italy

Join Date: Apr 2010
Posts: 20
Default replacing read id in bam file

Hi everybody,

I'd like to replace the sequence id for a huge alignment file in .bam format.
I'd rather avoid using the sam format as it would be around 250GB of data, instead I'd like to use samtools c api (writesam/writebam).

I couldn't find much documentation on how to use this library, does anyone know if there is any quick way to replace the read id? I know that the read id is stored in a bam1_t->data array but I cannot understand how to set/replace it.

Any help is much appreciated. Thanks in advance
blu78 is offline   Reply With Quote
Old 06-23-2010, 08:50 AM   #2
nilshomer
Nils Homer
 
nilshomer's Avatar
 
Location: Boston, MA, USA

Join Date: Nov 2008
Posts: 1,285
Default

Quote:
Originally Posted by blu78 View Post
Hi everybody,

I'd like to replace the sequence id for a huge alignment file in .bam format.
I'd rather avoid using the sam format as it would be around 250GB of data, instead I'd like to use samtools c api (writesam/writebam).

I couldn't find much documentation on how to use this library, does anyone know if there is any quick way to replace the read id? I know that the read id is stored in a bam1_t->data array but I cannot understand how to set/replace it.

Any help is much appreciated. Thanks in advance
Modifying that portion is a bit of a pain using the C API since you have to resize the array etc. I would suggest using the Java API (or PERL or Python API) to replace the read name. It will be much easier, and with Java, almost as fast.
nilshomer is offline   Reply With Quote
Old 06-23-2010, 11:14 AM   #3
blu78
Member
 
Location: italy

Join Date: Apr 2010
Posts: 20
Default

Quote:
Originally Posted by nilshomer View Post
Modifying that portion is a bit of a pain using the C API since you have to resize the array etc. I would suggest using the Java API (or PERL or Python API) to replace the read name. It will be much easier, and with Java, almost as fast.

OK I will try and do that. Thanks a lot for the help
blu78 is offline   Reply With Quote
Reply

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 10:11 PM.


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