Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • samtools picard SamFormatConverter

    Hi,

    I'm trying to run SamFormatConverter to convert a BAM to a SAM, and I'm getting an error (see below).

    The text suggests that samtools is trying to parse my BAM as a SAM. However, the file is definitely a BAM, has a '.bam' extension, and appears to have the necessary "magic number" at the top.

    Any ideas if I might be doing something wrong?

    Thanks!

    Command:
    java -jar <location>/SamFormatConverter.jar I=in.bam O=out.sam

    Head in.bam:
    BAM?@HD VN:1.0 GO:none SO:unsorted
    @SQ SN:chrM LN:16571 AS:HG18 UR:/seq/references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta M5:d2ed829b8a1628d16cbeee88e88e39eb SP:Homo sapiens

    Exception:
    Exception in thread "main" net.sf.samtools.SAMFormatException: Error parsing text SAM file. Not enough fields; Line 1
    Line: BAM?@HD VN:1.0 GO:none SO:unsorted
    at net.sf.samtools.SAMTextReader.reportFatalErrorParsingLine(SAMTextReader.java:169)
    at net.sf.samtools.SAMTextReader.access$400(SAMTextReader.java:40)
    at net.sf.samtools.SAMTextReader$RecordIterator.parseLine(SAMTextReader.java:261)
    at net.sf.samtools.SAMTextReader$RecordIterator.next(SAMTextReader.java:224)
    at net.sf.samtools.SAMTextReader$RecordIterator.next(SAMTextReader.java:196)
    at net.sf.picard.sam.SamFormatConverter.doWork(SamFormatConverter.java:64)
    at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:150)
    at net.sf.picard.sam.SamFormatConverter.main(SamFormatConverter.java:72)

  • #2
    Hi,
    Did you figure a solution for this problem? I'm getting exactly the same error message.
    thanks.

    Comment


    • #3
      Validation_stringency=lenient

      Try VALIDATION_STRINGENCY=LENIENT in the java invocation.

      Example:

      java-Xmx67T -jar wherever/SamTowhatevernameis.jar \
      VALIDATION_STRINGENCY=LENIENT \ INPUT=uncle.sam O=nephew.sam


      That might shut up the error message and get Picard to accept the input.

      Comment


      • #4
        In this case the issue is probably the
        "BAM?" on the 1st line in front of "@HD VN:1.0 GO:none SO:unsorted"
        I would try deleting it.

        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
        18 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        22 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 09:21 AM
        0 responses
        16 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-04-2024, 09:00 AM
        0 responses
        47 views
        0 likes
        Last Post seqadmin  
        Working...
        X