Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Kennels
    Senior Member
    • Feb 2011
    • 149

    how to maintain headers when piping into samtools

    Hi,

    I am using bowtie2 output (which is sam format natively) to pipe into samtools as such:
    Code:
    bowtie2 <all the arguments> | samtools view -S -F 4 -b - | samtools sort - file.sorted
    but I am losing the headers when piping.

    Is there a way to maintain the headers from bowtie to samtools during the pipe. I can't seem to find an option in samtools view that does this.

    thanks
  • kcchan
    Senior Member
    • Jul 2012
    • 186

    #2
    It works for me when I use -SbF 4 - Not sure why that is, but perhaps -F is stripping out the headers if -b output isn't stated first. You can also use reheader to fix the headers of your already generated files.

    Comment

    • swbarnes2
      Senior Member
      • May 2008
      • 910

      #3
      use -h in samtools view. That will keep the headers.

      Comment

      Latest Articles

      Collapse

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 06-05-2026, 10:09 AM
      0 responses
      16 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 06-04-2026, 08:59 AM
      0 responses
      34 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 06-02-2026, 12:03 PM
      0 responses
      37 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 06-02-2026, 11:40 AM
      0 responses
      24 views
      0 reactions
      Last Post SEQadmin2  
      Working...