0

I have done some looking but I cant figure out why picard markduplicates is deleting my bam files and replacing with bai files? I am wanting the metrics and bam files. I am also wanting the bai files and then rename this file to .bam.bai for downstream work. When I leave out CREATE_INDEX=true, I get my metrics and bam. With it in, I get bai files and that isn't renamed either.

rule picard_dupes:
    input: rules.star_aligner.output.bam
    output:
        bam = 'picard/{sampleID}_marked_duplicates.bam',
        metric = 'picard/{sampleID}_marked_dup_metrics.txt'
    threads: 12
    run:
        shell('picard MarkDuplicates \
            -Xmx4G \
            I={input} \
            O={output.bam} \
            M={output.metric} \
            ASSUME_SORT_ORDER=coordinate CREATE_INDEX=true \
            -XX:ParallelGCThreads={threads}')
        shell('mv /PATH/{sampleID}_marked_duplicates.bai /Path/{sampleID}_marked_duplicates.bam.bai')
Genetics
  • 279
  • 2
  • 11
  • 1
    Hi @Genetics, I doubt `create_index` doing anything wrong here, I think you need to make sure the `mv` command path is correct, I don't think the `mv` command is able to find bam index file there. I tried your sample rule on my test data, and it is completed successfully in the desired way:) – c_bfx Apr 19 '22 at 14:34
  • Hi c_bfx, turns out the order matters, it shouldnt but it ides. When I switch ASSUME_SORT_ORDER and CREATE_INDEX, it works fine. Thank you for checking! – Genetics Apr 20 '22 at 15:27

0 Answers0