Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Errors: Mapped mate should have mate reference name and MAPQ should be 0 for unmappe

    Hi,

    I want to convert my bam file (from tophat) to a fasta file. First, I used samtools view to convert sam to bam and then I used picard's SamToFastq to convert to fastq, but I received the following error:

    Exception in thread "main" net.sf.samtools.SAMFormatException: Error parsing text SAM file. MAPQ must be zero if RNAME is not specified; Line 1
    Line: DB775P1:275:C27JRACXX:1:2307:16302:100526 133 * 0 255 * * 0 0 CGGAAACCTTGTTACGACTTTTACTTCCTCTAGATAGTCAAGTTCGACCGTCTTCTCAGCGCTCCGCCAGGGCCGTGGGCCGACCCCGGCGGGGCCGATCC CCCFFFFFHHHHHJJJJJJJJJJJJJJJJJJJJJJJJJJIJJJJJJIJJJJJJJJJJJIJJHHFFFDDDDDDDDDDDDDCDDDDDDDDDDDDDDDDDDDD?


    Here is the command I ran:
    java -jar picard-tools-1.103/SamToFastq.jar INPUT=unmapped1.sam FASTQ=tophat_1914_unmapped_R1.fq SECOND_END_FASTQ=tophat_1914_unmapped_R2.fq


    Also I used Picards ValidateSamFile program to check my samfile and the output is as follows:
    ERROR: Record 1, Read name DB775P1:275:C27JRACXX:1:1101:1661:1847, Mapped mate should have mate reference name
    ERROR: Record 1, Read name DB775P1:275:C27JRACXX:1:1101:1661:1847, MAPQ should be 0 for unmapped read.

    Does anyone know how to fix this problem or another way to convert bam to fastq or fasta.

    I used the below command to convert bam to fasta, but it looks like I loose the pair-end data information.
    samtools view unmapped.bam | awk '{OFS="\t"; print ">"$1"\n"$10}' - > unmapped.fasta

    So I need something that takes into consideration that I have pair-end data.

    Thanks

  • #2
    Well, Picard is complaining because your .bam is weird. There's no indication of what the mate is named, and there's no information about how it aligned in the binary flag either. That's weird.

    You could try running Picard with VALIDATION_STRINGENCY=LENIENT, but maybe you should figure out why your .bams are so weird. Maybe the mate got trimmed away by some kind of QC? In which case, the remaining read should have been treated like a single end read, not a paired one.

    Comment


    • #3
      Using VALIDATION_STRINGENCY=LENIENT did the trick. I was able to convert sam to fastq.
      THANKS!!!!!!!

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