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

          • SEQadmin2
            Nine Things a Sample Prep Scientist Thinks About Before Sequencing
            by SEQadmin2


            I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

            Here are nine questions we think about, in roughly the order they matter, before...
            06-18-2026, 07:11 AM
          • SEQadmin2
            From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
            by SEQadmin2


            Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


            The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
            ...
            06-02-2026, 10:05 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 06-17-2026, 06:09 AM
          0 responses
          39 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 06-09-2026, 11:58 AM
          0 responses
          102 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 06-05-2026, 10:09 AM
          0 responses
          123 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 06-04-2026, 08:59 AM
          0 responses
          114 views
          0 reactions
          Last Post SEQadmin2  
          Working...