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
        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
      • 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

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 04-11-2024, 12:08 PM
      0 responses
      21 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      23 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      18 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-04-2024, 09:00 AM
      0 responses
      49 views
      0 likes
      Last Post seqadmin  
      Working...
      X