Welcome to the Genome Toolbox! I am glad you navigated to the blog and hope you find the contents useful and insightful for your genomic needs. If you find any of the entries particularly helpful, be sure to click the +1 button on the bottom of the post and share with your colleagues. Your input is encouraged, so if you have comments or are aware of more efficient tools not included in a post, I would love to hear from you. Enjoy your time browsing through the Toolbox.

Thursday, May 9, 2013

Change .bam File Header

Each .bam file has an important header that describes a number of characteristics about the read sequences it contains.  The header is usually multiple lines and has information no chromosomes and samples included in the .bam file.   Samtools can be used to view the header of a .bam file with the following command.

If the need arises, Samtools can also be used to modify the header of a .bam file.  Samtools uses the reheader command to do this.  Below is an example where I changed the length of chrM in the header from 16569 to 16571 base pairs.

No comments:

Post a Comment