Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • tdoniger
    Member
    • Nov 2010
    • 13

    Convert from bowtie to sam

    Hi,

    I used samtools- bowtie2sam.pl to convert a bowtie file to a sam file. Later, I noticed that some of the alignments were missing in the sam file. Is this expected? Is there another bowtie to sam converter that does not reduce the data? Is it best to choose the sam option from bowtie?

    Much Thanks,
    Tirza Doniger
    Bioinformatics Unit
    Bar Ilan University
    --
    Tirza Doniger, Ph.D.
    Bioinformatics Unit
    The Mina and Everard Faculty of Life Sciences
    Bar Ilan University
  • colindaven
    Senior Member
    • Oct 2008
    • 417

    #2
    Yep, I would choose the SAM option from Bowtie. It has worked consistently well for me

    Comment

    • NicoBxl
      not just another member
      • Aug 2010
      • 264

      #3
      from the bowtie tutorial ( http://bowtie-bio.sourceforge.net/tutorial.shtml )

      Finding variations with SAMtools

      SAMtools is a suite of tools for storing, manipulating, and analyzing alignments such as those output by Bowtie. SAMtools understands alignments in either of two complementary formats: the human-readable SAM format, or the binary BAM format. Because Bowtie can output SAM (using the -S/--sam option), and SAM can can be converted to BAM using SAMtools, Bowtie users can make full use of the analyses implemented in SAMtools, or in any other tools supporting SAM or BAM.
      We will use SAMtools to find SNPs in a set of simulated reads included with Bowtie. The reads cover the first 10,000 bases of the pre-built E. coli genome and contain 10 SNPs throughout. First, we run bowtie to align the reads, being sure to specify the -S option. We also specify an output file that we will use as input for the next step (though pipes can be used to accomplish the same thing without the intermediate file):

      bowtie -S e_coli reads/e_coli_10000snp.fq ec_snp.sam

      Next, we convert the SAM file to BAM in preparation for sorting. We assume that SAMtools is installed and that the samtools binary is accessible in the PATH.

      samtools view -bS -o ec_snp.bam ec_snp.sam

      Next, we sort the BAM file, in preparation for SNP calling:

      samtools sort ec_snp.bam ec_snp.sorted

      Comment

      • tdoniger
        Member
        • Nov 2010
        • 13

        #4
        Thank you.

        What concerns me is that some of the alignments returned in the original bowtie file disappeared when I ran bowtie2sam.pl

        If I understand correctly now---the script bowtie2sam.pl which comes as part of the samtools package only takes the best hit for each read. However, I had run bowtie with the parameter to report all possible alignments.

        I wanted to know if running bowtie with the "SAM" option will exhibit the same behavior as the script bowtie2sam.pl

        Thanks
        Tirza
        --
        Tirza Doniger, Ph.D.
        Bioinformatics Unit
        The Mina and Everard Faculty of Life Sciences
        Bar Ilan University

        Comment

        • Nick
          Member
          • Jun 2009
          • 16

          #5
          allbowtie2sam.pl

          I came across this thread with the same issue. As you said bowtie2sam.pl only takes the best read. That is much harder to do than just converting all the hits. I edited the file to print all the reads in a bowtie file to .sam. Although as was said before it's a much better idea to just use the sam output option as that gives you a header that is missing with this conversion. However sometimes you just need to convert something that was already done.
          Attached Files

          Comment

          • yuelics
            Member
            • Apr 2011
            • 13

            #6
            I have a related question. How can I make bowtie to output both sam and bowtie format without running it twice with two different output options? Some downstream programs need bowtie format, but some need sam/bam.

            Thanks in advance for any reply!

            Comment

            Latest Articles

            Collapse

            • GATTACAT
              Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
              by GATTACAT
              Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
              07-01-2026, 11:43 AM
            • SEQadmin2
              Nine Things a Sample Prep Scientist Thinks About Before Sequencing
              by SEQadmin2


              I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

              Here are nine questions we think about, in roughly the order they matter, before...
              06-18-2026, 07:11 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 07-02-2026, 11:08 AM
            0 responses
            11 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-30-2026, 05:37 AM
            0 responses
            13 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-26-2026, 11:10 AM
            0 responses
            20 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-17-2026, 06:09 AM
            0 responses
            54 views
            0 reactions
            Last Post SEQadmin2  
            Working...