Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • No BWA alignment output files!

    Hi,

    I have been using Bowtie for the last few months for alignment but now have a file for indexing which is 6Gb and Bowtie cannot deal with so I have moved onto using BWA, the indexing went fine and I got my files.

    When reading the documentation is seemed as though "bwa mem" was the best option for the actual alignment however all the output is being sent to the screen and now an actual file (determined as iy is going to the output file from the cluster we have and no new files have been created).

    Basically was this the correct choice and did I miss something which has caused the output of aligned and unaligned files to not be created?

    here is the code I used:

    bwa index -p 50Gb_index -a bwtsw contigs.fa


    bwa mem -t 20 50Gb_index ../../NZ_bowtie_nonaligned_hungate_thread.done.gz


    THANKS!

  • #2
    Use the redirect operator ">" to pipe to a file:

    bwa mem -t 20 50Gb_index ../../NZ_bowtie_nonaligned_hungate_thread.done.gz > mapped.sam

    Comment


    • #3
      Originally posted by Brian Bushnell View Post
      Use the redirect operator ">" to pipe to a file:

      bwa mem -t 20 50Gb_index ../../NZ_bowtie_nonaligned_hungate_thread.done.gz > mapped.sam

      This would work if I wanted a SAM file output but I am aiming for a similar output to that provided with bowtie where you get a file of the reads that align to the indexed file and a seperate file for reads that dont align to the indexed file.

      Is there a way to do this with BWA?

      Comment


      • #4
        I don't see an option for it, though you can split the output with samtools into mapped and unmapped reads.

        Alternatively, BBMap supports unlimited reference size and also separate files for mapped and unmapped reads, using the "outm=" and "outu=" flags. The output can be in sam or other formats, depending on the file extension.

        Comment


        • #5
          Originally posted by thh32 View Post
          This would work if I wanted a SAM file output but I am aiming for a similar output to that provided with bowtie where you get a file of the reads that align to the indexed file and a seperate file for reads that dont align to the indexed file.

          Is there a way to do this with BWA?
          Untested, but it should work in bash:

          Code:
          bwa mem myIndex myReads.fq.gz \
          | tee >(samtools view -Sh -f4 - > unmapped.sam) \
          | tee >(samtools view -Sh -F4 - > mapped.sam) > /dev/null
          This sends unmapped reads (-f4) to unmapped.sam and mapped reads (-F4) to mapped.sam. You could customize the samtools commands in the subshells to decide what goes in each file (e.g. by using -q options). In fact, while you are at it, I would convert to bam and sort the mapped reads.

          Dario

          Comment

          Latest Articles

          Collapse

          • seqadmin
            Recent Advances in Sequencing Analysis Tools
            by seqadmin


            The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
            05-06-2024, 07:48 AM
          • 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...
            04-22-2024, 07:01 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 05-10-2024, 06:35 AM
          0 responses
          19 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 05-09-2024, 02:46 PM
          0 responses
          22 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 05-07-2024, 06:57 AM
          0 responses
          21 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 05-06-2024, 07:17 AM
          0 responses
          21 views
          0 likes
          Last Post seqadmin  
          Working...
          X