We've moved!
This site is now read-only. You can find our new documentation site and support forum for posting questions here.
Be sure to read our welcome blog!

Picard tool AddOrReplaceReadGroups

fkhirokofkhiroko Tsukuba University, JapanMember

Hi, I am analyzing NGS data from same individual which is generated from SOLiD 5500.
This time, I sequenced only 1 sample, so that I had to add at least 4 bar-cord for this one sample.

I treated generated data as one data as which was generated from one sample (1 library).
So I did sort and merge (samtools) whole data.
Then I did the AddOrReplaceReadGroups.jar (picard) and got some bam file.
However, which has no information in it (=0 bite).
I just wonder if I need to analyze those data as 4 samples.
I wonder if anyone know how I can merge whole data to generate one VCF file from this file.

Thanks, Hiroko


  • SheilaSheila Broad InstituteMember, Broadie ✭✭✭✭✭

    Hi Hiroko,

    Can you please post the exact commands you used at each step (samtools, picard)?


  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    @fkhiroko You can treat this data as one sample if it originates from the same individual. It is good to distinguish if subsets of the data come from different lanes by indicating this appropriately in the read group information.

    But based on your description I do not think the problem is due to how you treated the data. Probably there was a problem that prevented the Picard tool from running to completion. Was there any error message in the log when you ran the tool?

  • fkhirokofkhiroko Tsukuba University, JapanMember

    Thank you for your advice. I will check the error message and command again and will post it.

  • fkhirokofkhiroko Tsukuba University, JapanMember

    Thank you Geraldine and Shelia

    I wrote the command as


    java -Xmx2G -jar $PICARD_dir/AddOrReplaceReadGroups.jar INPUT=out.bam OUTPUT=L004_2.sorted_rem.bam RGID=1 RGLB=Library13 RGPL=SOLID RGPU=1 RGSM=LFS004_2 RGCN=AA RGDS=AD


    Then, get those errors


    [Mon Apr 20 13:47:53 JST 2015] net.sf.picard.sam.AddOrReplaceReadGroups INPUT=out.bam OUTPUT=L004_2.sorted_rem.bam RGID=1 RGLB=Library13 RGPL=SOLID RGPU=1 RGSM=L004_2 RGCN=Tsukuba RGDS=AD VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false
    [Mon Apr 20 13:47:53 JST 2015] Executing as [email protected] on Linux 3.5.0-21-generic amd64; Java HotSpot(TM) 64-Bit Server VM 1.7.0_60-b19; Picard version: 1.112(1930) IntelDeflater
    INFO 2015-04-20 13:47:54 AddOrReplaceReadGroups Created read group ID=1 PL=SOLID LB=Library13 SM=L004_2

    [Mon Apr 20 13:47:54 JST 2015] net.sf.picard.sam.AddOrReplaceReadGroups done. Elapsed time: 0.00 minutes.
    To get help, see http://picard.sourceforge.net/index.shtml#GettingHelp
    Exception in thread "main" net.sf.samtools.SAMFormatException: SAM validation error: ERROR: Record 1, Read name 511_1276_593, RG ID on SAMRecord not found in header: Library6_6
    at net.sf.samtools.SAMUtils.processValidationErrors(SAMUtils.java:452)
    at net.sf.samtools.BAMFileReader$BAMFileIterator.advance(BAMFileReader.java:629)
    at net.sf.samtools.BAMFileReader$BAMFileIterator.(BAMFileReader.java:602)
    at net.sf.samtools.BAMFileReader$BAMFileIterator.(BAMFileReader.java:590)
    at net.sf.samtools.BAMFileReader.getIterator(BAMFileReader.java:302)
    at net.sf.samtools.SAMFileReader.iterator(SAMFileReader.java:340)
    at net.sf.samtools.SAMFileReader.iterator(SAMFileReader.java:43)
    at net.sf.picard.sam.AddOrReplaceReadGroups.doWork(AddOrReplaceReadGroups.java:101)
    at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:179)
    at net.sf.picard.cmdline.CommandLineProgram.instanceMainWithExit(CommandLineProgram.java:120)
    at net.sf.picard.sam.AddOrReplaceReadGroups.main(AddOrReplaceReadGroups.java:68)


    Maybe I need some treatment for header ??

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin


    The error message suggests that the program did not replace all of the existing read group information. This could be a bug, please try again with the latest version of Picard and let us know if the issue persists.

Sign In or Register to comment.