Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

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

    Comment


    • #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


      • #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


        • #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


          • #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


            • #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

              • seqadmin
                Strategies for Sequencing Challenging Samples
                by seqadmin


                Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                03-22-2024, 06:39 AM
              • seqadmin
                Techniques and Challenges in Conservation Genomics
                by seqadmin



                The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                Avian Conservation
                Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                03-08-2024, 10:41 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 03-27-2024, 06:37 PM
              0 responses
              13 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 03-27-2024, 06:07 PM
              0 responses
              12 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 03-22-2024, 10:03 AM
              0 responses
              53 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 03-21-2024, 07:32 AM
              0 responses
              69 views
              0 likes
              Last Post seqadmin  
              Working...
              X