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
                Essential Discoveries and Tools in Epitranscriptomics
                by seqadmin


                The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist on Modified Bases...
                Yesterday, 07:01 AM
              • seqadmin
                Current Approaches to Protein Sequencing
                by seqadmin


                Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                04-04-2024, 04:25 PM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 04-11-2024, 12:08 PM
              0 responses
              51 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              50 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 09:21 AM
              0 responses
              44 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-04-2024, 09:00 AM
              0 responses
              55 views
              0 likes
              Last Post seqadmin  
              Working...
              X