Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Bam to Fastq on discordant mate pairs

    Hi all!

    I am trying to convert a BAM file from a paired-end alignment back to Fastq (Read1.fq and Read2.fq).

    The BAM file I'm working on actually contains ONLY discordant pairs that have been filtered from the original BAM file (that's because I am interested ONLY in discordant pairs).

    I have tried this on my sorted (-n) bam file:

    bedtools bamtofastq -i alnSORTED.bam -fq read1.fq -fq2 read2.fq

    but I get the following error message:

    Query HISEQ:272AJYACXX:2:1110:4931:73600 is marked as paired, but it's mate does not occur next to it in your BAM file. Skipping.

    So apparently Bedtools skips the discordant pairs...but I need to work only on them!
    Any possible solution?

    Thank you in advance!

  • #2
    I'm guessing that you used tophat to do the alignments, it's known to create these sorts of situations (unless you specified --no-mixed, if only one read of a pair is mapped, the unmapped read is excluded from the alignment file). The thing is, the BAM file is telling bedtools that the reads are paired, so it needs to write them as such to the fastq files or else the files will become out of sync (the Nth read in read1.fq needs to be the mate of the Nth read in read2.fq). If these alignments are from tophat, then you might be to filter the unmapped.bam to extract the missing mates and then just merge them back in.

    If instead you want to treat the reads as single-end, you could just:
    Code:
    samtools view alnSORTED.bam | awk '{OFS="\n"}{print $1,$10,"+",$11}' > reads.fq
    Last edited by dpryan; 11-08-2013, 01:47 AM.

    Comment


    • #3
      Hi dpryan,

      The bam file was produced with bwa-mem.
      For this original BAM file, flagstat counted something around 600.000 discordant mate pairs ("with mate mapped on different chromosome"), that I then filtered out in a new BAM file containing exclusively such pairs, so I have no "unmapped.bam"!

      I will try to use the data by ignoring the pairing information and see what happens...
      thanks and best regards!

      Comment


      • #4
        Ah, if this was done with bwa-mem then these are chimeric alignments. I'm not surprised that bedtools doesn't yet deal with them.

        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...
          04-22-2024, 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, Yesterday, 08:47 AM
        0 responses
        12 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-11-2024, 12:08 PM
        0 responses
        60 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        59 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 09:21 AM
        0 responses
        54 views
        0 likes
        Last Post seqadmin  
        Working...
        X