On Tue, Oct 14, 2014 at 5:03 PM, Joshua Theisen <joshua.thei...@gmail.com> wrote: > I have a BAM with the @SQ lines of the header in lexigraphical order instead > of numerical order: > > ***Have: > @HD VN:1.0 SO:coordinate > @SQ SN:chr1 LN:249250621 > @SQ SN:chr10 LN:135534747 > @SQ SN:chr11 LN:135006516 > @SQ SN:chr12 LN:133851895 > | | | > @SQ SN:chr19 LN:59128983 > @SQ SN:chr2 LN:243199373 > @SQ SN:chr20 LN:63025520 > @SQ SN:chr21 LN:48129895 > @SQ SN:chr22 LN:51304566 > @SQ SN:chr3 LN:198022430 > | | | > @SQ SN:chrM LN:16571 > @SQ SN:chrX LN:155270560 > @SQ SN:chrY LN:59373566 > @PG ID:TopHat VN:2.0.0 > > ***Want: > @HD VN:1.0 SO:coordinate > @SQ SN:chr1 LN:249250621 > @SQ SN:chr2 LN:243199373 > | | | > @SQ SN:chr9 LN:141213431 > @SQ SN:chr10 LN:135534747 > @SQ SN:chr11 LN:135006516 > | | | > @SQ SN:chr22 LN:51304566 > @SQ SN:chrX LN:155270560 > @SQ SN:chrY LN:59373566 > @SQ SN:chrM LN:16571 > @PG ID:TopHat VN:2.0.0 > > > I'm trying to use samtools reheader using this pipeline: > > # extract header from BAM to SAM > $ samtools view -H accepted_hits.bam > header.sam > > # manually edit header using vi, save as reheader.sam > > # replace header in orginal BAM file > $ samtools reheader reheader.sam accepted_hits.bam > > When I do this I get flickering symbols in the PuTTY terminal and no change > to the BAM. Any ideas?
Those flickering symbols are the output BAM file, like most samtools command the output defaults to stdout, so pipe it: samtools reheader reheader.sam > accepted_hits.bam I'm not sure what reheader did with the extra argument - if it was simply ignored that is probably a bug. Note this will not actually sort the records in the order you want. Why are you trying to do this anyway? Peter ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho _______________________________________________ Samtools-help mailing list Samtools-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/samtools-help