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
                The Impact of AI in Genomic Medicine
                by seqadmin



                Artificial intelligence (AI) has evolved from a futuristic vision to a mainstream technology, highlighted by the introduction of tools like OpenAI's ChatGPT and Google's Gemini. In recent years, AI has become increasingly integrated into the field of genomics. This integration has enabled new scientific discoveries while simultaneously raising important ethical questions1. Interviews with two researchers at the center of this intersection provide insightful perspectives into...
                02-26-2024, 02:07 PM
              • seqadmin
                Multiomics Techniques Advancing Disease Research
                by seqadmin


                New and advanced multiomics tools and technologies have opened new avenues of research and markedly enhanced various disciplines such as disease research and precision medicine1. The practice of merging diverse data from various ‘omes increasingly provides a more holistic understanding of biological systems. As Maddison Masaeli, Co-Founder and CEO at Deepcell, aptly noted, “You can't explain biology in its complex form with one modality.”

                A major leap in the field has
                ...
                02-08-2024, 06:33 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, Yesterday, 06:12 AM
              0 responses
              17 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 02-23-2024, 04:11 PM
              0 responses
              67 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 02-21-2024, 08:52 AM
              0 responses
              73 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 02-20-2024, 08:57 AM
              0 responses
              62 views
              0 likes
              Last Post seqadmin  
              Working...
              X