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
        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, 04-25-2024, 11:49 AM
      0 responses
      19 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-24-2024, 08:47 AM
      0 responses
      20 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-11-2024, 12:08 PM
      0 responses
      62 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      60 views
      0 likes
      Last Post seqadmin  
      Working...
      X