This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Picard AddOrReplaceReadGroups unable to read my argument?

Hi, I am trying to run Picard's AddOrReplaceReadGroups on a bam file called exome_mtExtractremap.csort.bam (code below). the error messages states ERROR: Option 'RGPL' is required., however I have included RGPL, so I don't understand why it is occuering.

I've tried RGLB=ILLUMINA, RGLB="ILLUMINA", and RGLB=illumina. What am I doing wrong?

i=exome_mtExtractremap.csort.bam
java -Xmx2g \
  -Djava.io.tmpdir=`pwd`/tmp \
  -jar /opt/applications/picard/current/AddOrReplaceReadGroups.jar \
  INPUT="${i}" \
  OUTPUT="${i}.rg.bam" \
  SORT_ORDER=coordinate \
  RGLB="$(echo $OUTPUT | sed 's/_mtExtractremap.csort.bam.rg.bam//')" \
  RGPL="illumina" \
  RGPU="L002" \
  RGSM="${RGLB}" \
  RGID="${RGLB}_${RGPU}";
picard read-group

1 answer

I suspect there something wrong in the line just before RGPL

This solved a problem for me. GATK was reporting "Invalid Argument" for my entry after --RGPU <platform.unit>. It turned out I had removed a space in the line before:

bad:

--RGPL= sample_num\
--RGPU= platform.unit \

good:

--RGPL= sample_num \
--RGPU= platform.unit \

Log in to answer this question.