Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fad2012
    Member
    • Sep 2012
    • 62

    #1

    How to pipe Bowtie's commands

    Dear all

    How can i pipe the following bowtie's commands so the terminal on mac would run them all at once

    bowtie-build mainseq.fasta build
    bowtie -S build -f -I 20 -X 7500 -a -m 1 -v 3 --rf -1 reads_1.fasta -2 reads_2.fasta aligned.sam
    samtools view -bS aligned.bam aligned.sam
    samtolls sort aligned.bam aligned.sorted
    samtools index aligned.sorted.bam
    Many thanks for your help.
  • sdarko
    Member
    • Apr 2009
    • 52

    #2
    Code:
    bowtie2 -x $your_ref -U $in | samtools view -bSu - | samtools sort - $out
    That's how I do it.

    Comment

    • mastal
      Senior Member
      • Mar 2009
      • 666

      #3
      put the commands in a shell script and run the shell script.

      you have to have bowtie and samtools installed on your Mac and added to your path.

      use a text editor to create a file called something like 'run_bowtie.sh'.

      put something like '#!/bin/bash' or whatever shell you are using, as the first line of the script,

      paste the rest of the commands into the file and save it.

      then run it from the terminal window.

      $./run_bowtie.sh

      Comment

      • Fad2012
        Member
        • Sep 2012
        • 62

        #4
        Thanks mastal, it has worked.

        Thanks sdarko, it has not worked, it seems i should use bowtie2 to ge it worked.

        I am still wondering if piping would work as efficient as creating a small bash program, which has worked perfectly with me as mastal has suggested.

        Many thanks

        Comment

        • Fad2012
          Member
          • Sep 2012
          • 62

          #5
          Sorry, i should have mentioned that i had to use the following code to add executable permissions to the bash shell file to work:

          chmod u+x run_bowtie

          Then you can run it as mentioned by mastal:
          ./run_bowtie

          Comment

          • EGrassi
            Member
            • Oct 2010
            • 66

            #6
            Originally posted by Fad2012 View Post
            I am still wondering if piping would work as efficient as creating a small bash program, which has worked perfectly with me as mastal has suggested.
            In theory a pipe avoids writing all the intermediate results to the disk thus is more efficient, sadly it is not always possible/easy to combine different tools with pipelines.

            Comment

            • sdarko
              Member
              • Apr 2009
              • 52

              #7
              Originally posted by Fad2012 View Post
              Thanks sdarko, it has not worked, it seems i should use bowtie2 to ge it worked.

              I am still wondering if piping would work as efficient as creating a small bash program, which has worked perfectly with me as mastal has suggested.
              I think this would work for bowtie:
              Code:
              bowtie -S -f -I 20 -X 7500 -a -m 1 -v 3 --rf build -1 reads_1.fasta -2 reads_2.fasta | samtools view -bSu - | samtools sort - aligned.sorted
              I generally generate bash scripts that use piping to be most efficient so as to not make intermediate files.

              Comment

              Latest Articles

              Collapse

              • SEQadmin2
                Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                by SEQadmin2



                Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                ...
                10-14-2026, 09:55 AM
              • SEQadmin2
                New Genomics Technologies Take Aim at Long-Standing Limits
                by SEQadmin2


                Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                ...
                09-28-2026, 10:25 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 10-22-2026, 11:13 AM
              0 responses
              42 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-22-2026, 10:48 AM
              0 responses
              33 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-15-2026, 10:52 AM
              0 responses
              44 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-14-2026, 05:39 AM
              0 responses
              45 views
              0 reactions
              Last Post SEQadmin2  
              Working...