Seqanswers Leaderboard Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • rosales
    Junior Member
    • Nov 2013
    • 2

    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
  • swbarnes2
    Senior Member
    • May 2008
    • 910

    #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

    • rosales
      Junior Member
      • Nov 2013
      • 2

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

      Comment

      Latest Articles

      Collapse

      • seqadmin
        Pathogen Surveillance with Advanced Genomic Tools
        by seqadmin




        The COVID-19 pandemic highlighted the need for proactive pathogen surveillance systems. As ongoing threats like avian influenza and newly emerging infections continue to pose risks, researchers are working to improve how quickly and accurately pathogens can be identified and tracked. In a recent SEQanswers webinar, two experts discussed how next-generation sequencing (NGS) and machine learning are shaping efforts to monitor viral variation and trace the origins of infectious...
        03-24-2025, 11:48 AM
      • seqadmin
        New Genomics Tools and Methods Shared at AGBT 2025
        by seqadmin


        This year’s Advances in Genome Biology and Technology (AGBT) General Meeting commemorated the 25th anniversary of the event at its original venue on Marco Island, Florida. While this year’s event didn’t include high-profile musical performances, the industry announcements and cutting-edge research still drew the attention of leading scientists.

        The Headliner
        The biggest announcement was Roche stepping back into the sequencing platform market. In the years since...
        03-03-2025, 01:39 PM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 03-20-2025, 05:03 AM
      0 responses
      41 views
      0 reactions
      Last Post seqadmin  
      Started by seqadmin, 03-19-2025, 07:27 AM
      0 responses
      49 views
      0 reactions
      Last Post seqadmin  
      Started by seqadmin, 03-18-2025, 12:50 PM
      0 responses
      36 views
      0 reactions
      Last Post seqadmin  
      Started by seqadmin, 03-03-2025, 01:15 PM
      0 responses
      192 views
      0 reactions
      Last Post seqadmin  
      Working...