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
            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, Yesterday, 06:37 PM
          0 responses
          11 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, Yesterday, 06:07 PM
          0 responses
          10 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 03-22-2024, 10:03 AM
          0 responses
          51 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 03-21-2024, 07:32 AM
          0 responses
          68 views
          0 likes
          Last Post seqadmin  
          Working...
          X