Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • nasepu
    Junior Member
    • Sep 2012
    • 5

    BAM header fix

    I'm having trouble running a BAM file through GATK. I got this error:

    ##### ERROR MESSAGE: SAM/BAM file reanalysis.bam is malformed: SAM file doesn't have any read groups defined in the header. The GATK no longer supports SAM files without read groups

    So i figure I need to replace the header. I checked the header with samtools view -h, and I see an extremely long list that starts like this:

    @HD VN:1.0 SO:unsorted
    @PG ID:novoalign PN:novoalign VN:V2.08.02 CL:novoalign -o SAM -d ./reference/chok1ref.nix -f ./cho9/reads.fq
    @SQ SN:gi|351517969|ref|NW_003613580.1| AS:chok1ref.nix LN:8779783

    and continues with many @SQ lines

    I tried fixing the header with Picard using

    Code:
    java -jar picard/AddOrReplaceReadGroups.jar INPUT=cho9/cho9output.bam OUTPUT=cho9/cho9outputH.bam RGID=RSNS002 RGLB=RSNS002 RGPL=illumina RGPU=RSNS002 RGSM=RSNS002
    But that didn't seem to generate an output file, and I did just put the same thing in every field there, so I'm a little unsure about it.

    So, is it possible to fix the header? If so, what am I missing? If not, do I just need to do the alignment over again and properly set the header using something like:

    Code:
     bwa samse -f out.sam -r "@RQ\tID:<ID>\tLB:<LIBRARY_NAME>\tSM:<SAMPLE_NAME>\tPL:ILLUMINA" hg19 input1.sai input2.sai input1.fq input2.fq
    Help is greatly appreciated!
  • westerman
    Rick Westerman
    • Jun 2008
    • 1104

    #2
    No help here. You have a nicely complex problem for which there may not be an known fix. Certainly a fix is not obvious to me -- I'd have to play around with the files and you are already doing that at a sophisticated level thus I have nothing to add. But since you are a new poster I did want to say "welcome!". You may not get a response to this question but be assured that the rest of us are listening and will help as we can if you have other questions.

    Comment

    • TiborNagy
      Senior Member
      • Mar 2010
      • 329

      #3
      We use the following parameters (version 1.68):
      java AddOrReplaceReadGroups.jar I=input.bam O=output.bam SORT_ORDER=coordinate RGPU=na RGID=1 RGLB=input RGPL=Illumina RGSM=Company CREATE_INDEX=True

      Comment

      • vivek_
        PhD Student
        • Jul 2012
        • 164

        #4
        You could try adding VALIDATION_STRINGENCY=LENIENT and see if this makes a difference with Picard add or replace read groups.

        Do you see any errors or warnings in the stack trace when you run Picard?

        Comment

        • nasepu
          Junior Member
          • Sep 2012
          • 5

          #5
          Thanks for the help. Turns out I forgot to give java enough memory for AddOrReplaceReadGroups. Adding -Xmx4g made it run just fine.

          Comment

          Latest Articles

          Collapse

          • mylaser
            Reply to Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
            by mylaser
            Kheloyar – Everything You Need to Know About Kheloyaar Login and Kheoyar Id
            If you are looking for an online gaming platform that offers a user-friendly experience, Kheloyar has become a name that many users search for. Whether you're interested in creating a new account, accessing your dashboard through Kheloyaar Login, or learning how to obtain a Kheoyar Id, understanding the platform's features and account process is essential.
            This guide explains everything you need to know about...
            07-11-2026, 01:13 AM
          • SEQadmin2
            Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
            by SEQadmin2



            Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
            ...
            07-09-2026, 11:10 AM
          • SEQadmin2
            Cancer Drug Resistance: The Lingering Barrier to Rising Survival
            by SEQadmin2



            Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

            There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
            07-08-2026, 05:17 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 07-09-2026, 10:04 AM
          0 responses
          23 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-08-2026, 10:08 AM
          0 responses
          15 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-07-2026, 11:05 AM
          0 responses
          33 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 07-02-2026, 11:08 AM
          0 responses
          31 views
          0 reactions
          Last Post SEQadmin2  
          Working...