This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bwa samse: invalid option 'R'

When creating .bam files from single-end read fastq's, I ran into difficulties with mutect because the .bam files didn't contain read groups. I attempted to recreate the .bams by rerunning bwa samse with the -R <readgroup> option, but I get an error stating that -R is an invalid option with samse (in contrast, it works with sampe). Is there an option and argument that I should use with bwa sampe to generate read groups?

bwa

2 answers

Try -r in both samse and sampe...

Right, I think I was confusing the -R for read groups in bwa mem (-r is something else) with -r for reads in bwa sampe

Alternatively, you can use Picard AddOrReplaceReadGroups

java -jar AddOrReplaceReadGroups.jar I= infile.bam O= outfile.bam SORT_ORDER= coordinate RGID=foo RGLB=bar RGPL=illumina RGSM=Sample RGPU=NONE CREATE_INDEX=True

Log in to answer this question.