Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jorvis
    Junior Member
    • Feb 2017
    • 3

    #1

    Read direction lost with BWA in SAM output?

    I've tried two different header styles in my input FASTQ headers when running BWA:

    @SN7001163:162:C4A1UACXX:1:1101:1062:2076/1

    and

    @SN7001163:162:C4A1UACXX:1:1101:1062:2076 1:N:0:GTCCGCA

    My goal is to be able to tell which mate I'm looking at in the FASTQ file, but it seems to get stripped in the SAM output, where from "bwa sampe" I get lines like this:

    Code:
    SN7001163:162:C4A1UACXX:1:1101:1062:2076	77	*	0	0	*	*	0	0	GTTTGCTTGGCTGTGAGCTTGTCCGACACGGGCCACCAGGAGAGTGAGATACACCGAGACGAGCATCCTGTCTTTCTCTCGGACGGTTCCACAACAAATAA	@?@DDD?;<;F>?<2A<E<FFC9:FE8):8@?FFF@FF=;=;D;).).7>77==EB'93;;3=@@:@(:3,+(4::@B>@5?-<@B<?<34>ABB1<8:43
    SN7001163:162:C4A1UACXX:1:1101:1062:2076	141	*	0	0	*	*	0	0	GCCATGTTGAGTGAGAATTTATTATTTGTTGTGGAACC	;<;;(42@9)@)84):46=69416)2@:@:<=1(66@?
    How can I tell which of these alignment lines refers to which input mate?
  • jorvis
    Junior Member
    • Feb 2017
    • 3

    #2
    I realize that those two reads didn't actually align, so the SAM lines were pretty minimal. Here are a pair which did:

    Code:
    SN7001163:162:C4A1UACXX:1:1101:1174:2116        81      Locus_14841_Transcript_1__1_Confidence_0.750_Length_603 292     37      101M    =       294     -99     CTCGTCATTTCAATGCCCCCTCTCATATCAGAAGGAAAATCATGAGTGCTCCTTTGTCAAAAGAGCTGAGAGCAAAGTACAATGTGAGAAGTATGCCCATT   >BBDDDDDDDDDDDBDFFHHHHIIHJJJJJJJJJJJJJJIIJJJJJJJJJJJJJJIIIJJJJIJJJJJJJIJJJJJJJHJJJIJJJJJHHHHHFFFFFCCC   XT:A:U  NM:i:0  SM:i:37 AM:i:37 X0:i:1  X1:i:0  XM:i:0  XO:i:0  XG:i:0  MD:Z:101
    SN7001163:162:C4A1UACXX:1:1101:1174:2116        161     Locus_14841_Transcript_1__1_Confidence_0.750_Length_603 294     37      101M    =       292     99      CGTCATTTCAATGCCCCCTCTCATATCAGAAGGAAAATCATGAGTGCTCCTTTGTCAAAAGAGCTGAGAGCAAAGTACAATGTGAGAAGTATGCCCATTAG   BCBFFFFFHHHH?HIJJJJJJJJJJJJJJJJJJJJJJJJJJJJJHIJJJJGHIIHHIJJJJJJJJJIJJJJJHHHHHHFFFFFFFEEEEEEEEDDDDDDDC   XT:A:U  NM:i:1  SM:i:37 AM:i:37 X0:i:1  X1:i:0  XM:i:1  XO:i:0  XG:i:0  MD:Z:99C1

    Comment

    • WhatsOEver
      Senior Member
      • Apr 2012
      • 215

      #3
      [original post deleted because I misunderstood the question]

      gingers answer below is correct. You can simply confirm this by swapping R1 and R2 reads.
      Last edited by WhatsOEver; 05-11-2017, 12:36 AM.

      Comment

      • gringer
        David Eccles (gringer)
        • May 2011
        • 845

        #4
        There are flags in the SAM file for the first (and last) read attached to a template sequence. If a bitwise and of the flag field with 0x40 returns non-zero, then it is the first read of a template sequence. In the case of the two examples you have, here is the full flag breakdown:

        Code:
        81 = 0101 0001
                     Paired
                Reverse-complemented
              [B]First read in the template[/B]
        
        161 = 1010 0001
                      Paired
                Other read is reverse-complemented
              [B]Last read in the template[/B]
        See https://samtools.github.io/hts-specs/SAMv1.pdf

        These flags can be filtered using samtools view:

        Code:
        samtools view -b -f 0x40 in.bam > out_FirstRead.bam
        samtools view -b -F 0x40 in.bam > out_notFirst.bam
        The distinction between "last" and "second" is not important for most purposes, but there are some situations where more than two reads can be associated with the same template sequence.

        Whether or not a read is first or last is particularly important for strand-specific sequencing, because it allows you to distinguish between templates that are oriented in the same direction as the primary transcript, and those that are not (e.g. siRNA).
        Last edited by gringer; 05-11-2017, 12:14 AM.

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
          by SEQadmin2



          CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

          Despite this, “CRISPR helped turn genome editing from a specialized technique into
          ...
          07-31-2026, 11:01 AM
        • SEQadmin2
          Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
          by SEQadmin2


          Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

          The systematic characterization of the human proteome has
          ...
          07-20-2026, 11:48 AM
        • SEQadmin2
          Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
          by SEQadmin2



          Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
          ...
          07-09-2026, 11:10 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, Yesterday, 07:41 AM
        0 responses
        9 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 08-03-2026, 10:13 AM
        0 responses
        25 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-31-2026, 02:55 AM
        0 responses
        38 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-24-2026, 12:17 PM
        0 responses
        25 views
        0 reactions
        Last Post SEQadmin2  
        Working...