Skip to content
Snippets Groups Projects
Commit 9f6d0f8f authored by Brandi Cantarel's avatar Brandi Cantarel
Browse files

adding rmdup bamqc

parent f98571cb
Branches
Tags
No related merge requests found
...@@ -8,11 +8,12 @@ usage() { ...@@ -8,11 +8,12 @@ usage() {
echo "-n --NucType" echo "-n --NucType"
echo "-p --Prefix for output file name" echo "-p --Prefix for output file name"
echo "-c --Capture Bedfile" echo "-c --Capture Bedfile"
echo "-d --RemoveDuplicates 1=yes, 0=no default=no"
echo "Example: bash bamqc.sh -p prefix -r /project/shared/bicf_workflow_ref/human/GRCh38 -b SRR1551047.bam -n dna -c target.bed" echo "Example: bash bamqc.sh -p prefix -r /project/shared/bicf_workflow_ref/human/GRCh38 -b SRR1551047.bam -n dna -c target.bed"
exit 1 exit 1
} }
OPTIND=1 # Reset OPTIND OPTIND=1 # Reset OPTIND
while getopts :r:b:c:n:p:h opt while getopts :r:b:c:n:p:d:h opt
do do
case $opt in case $opt in
r) index_path=$OPTARG;; r) index_path=$OPTARG;;
...@@ -20,6 +21,7 @@ do ...@@ -20,6 +21,7 @@ do
c) bed=$OPTARG;; c) bed=$OPTARG;;
n) nuctype=$OPTARG;; n) nuctype=$OPTARG;;
p) pair_id=$OPTARG;; p) pair_id=$OPTARG;;
d) dedup=$OPTARG;;
h) usage;; h) usage;;
esac esac
done done
...@@ -42,6 +44,12 @@ then ...@@ -42,6 +44,12 @@ then
SLURM_CPUS_ON_NODE=1 SLURM_CPUS_ON_NODE=1
fi fi
if [[ $dedup == 1 ]]
then
mv $sbam ori.bam
samtools view -@ $SLURM_CPUS_ON_NODE -F 1024 -b -o ${sbam} ori.bam
fi
if [[ $nuctype == 'dna' ]]; then if [[ $nuctype == 'dna' ]]; then
module load bedtools/2.26.0 picard/2.10.3 module load bedtools/2.26.0 picard/2.10.3
samtools view -@ $SLURM_CPUS_ON_NODE -b -L ${bed} -o ${pair_id}.ontarget.bam ${sbam} samtools view -@ $SLURM_CPUS_ON_NODE -b -L ${bed} -o ${pair_id}.ontarget.bam ${sbam}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment