This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Picard AddOrReplaceReadGroups for multiple BAM files

Hello,

I would like to do variant calling with freebayes, however it requires the read groups. I am in a difficulty how to add the read groups to each of my 200 bam files, so that I can process it further.

workdir: "/path/to/workdir"

(SAMPLES,) =glob_wildcards('path/to/{sample}.bam')

rule all:
    input: 
        expand("{sample}.mark.bam", sample=SAMPLES)

rule picard_markgroup:
    input:
        sortbam ="/path/to/{sample}.bam"
    output:
        dupbam = "{sample}.mark.bam"
    shell:
        """
        java -jar /Tools/picard/build/libs/picard.jar AddOrReplaceReadGroups I={input.sortbam} O={output.dupbam} SO=coordinate RGID=id RGLB=library RGPL=platform RGPU=machine RGSM=sample VALIDATION_STRINGENCY=SILENT
        """

This is giving me

@RG RGID=id RGLB=library RGPL=platform RGPU=machine RGSM=sample

Could you suggest how to modify this?

picard snp

0 answers

No answers yet.

Log in to answer this question.