Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding PCR and optical duplicate removal to pipeline #10

Open
mkent001 opened this issue Aug 5, 2020 · 0 comments
Open

Adding PCR and optical duplicate removal to pipeline #10

mkent001 opened this issue Aug 5, 2020 · 0 comments

Comments

@mkent001
Copy link

mkent001 commented Aug 5, 2020

Optical duplicates are duplicate reads that are created when a single amplification cluster is identified as multiple clusters by the optical sensor of the sequencing equipment.
We have been using Samtools markdup to identify and remove both optical and PCR duplicates.
I have been running these scripts as independent loops so far. The second to last one is the final step in removing the duplicates. The last step creates new index bai files, which may not be necessary in the pipeline.

#collate.sh
#!/bin/bash

enable_lmod
module load container_env ddocent

for i in *RG.bam;do crun samtools collate -o $i.namecollate $i ;done | mv *.namecollate.bam collate/

#fixmate.sh
#!/bin/bash

enable_lmod
module load container_env ddocent

for i in *namecollate.bam;do crun samtools fixmate -m $i $i.fixmate.bam ;done | mv *.fixmate.bam fixmate/

#sort.sh
#!/bin/bash

enable_lmod
module load container_env ddocent

for i in *fixmate.bam;do crun samtools sort -o $i.positionsort.bam $i ;done

#markdups.sh
#!/bin/bash

enable_lmod

module load container_env ddocent

for i in *positionsort.bam;do crun samtools markdup -r -d 100 -l 850 $i $i.markdup.bam ;done

#index.sh
#!/bin/bash

enable_lmod

module load container_env ddocent

for i in *markdup.bam;do crun samtools index -b $i $i.bai ;done

This is the example order that samtools provides:
samtools collate -o namecollate.bam input.bam
samtools fixmate -m namecollate.bam fixmate.bam
samtools sort -o positionsort.bam fixmate.bam
samtools markdup positionsort.bam markdup.bam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant