-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathumi_realignment.sh
executable file
·29 lines (25 loc) · 1.04 KB
/
umi_realignment.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -o pipefail
set -o errexit
set -o nounset
if [ $# -ne 3 ]
then
echo "Usage: $0 unaligned.bam reference.fa cores"
exit 1
fi
BAM="$1"
REFERENCE="$2"
CORES="$3"
/usr/bin/java -Xmx1g -jar /opt/picard-2.18.1/picard.jar SamToFastq \
"I=$BAM" INCLUDE_NON_PF_READS=true F=/dev/stdout \
INTERLEAVE=true \
| /usr/local/bin/bwa mem -p -t "$CORES" "$REFERENCE" /dev/stdin \
| /usr/bin/java -Xmx4g -jar /opt/picard-2.18.1/picard.jar MergeBamAlignment \
"UNMAPPED=$BAM" ALIGNED=/dev/stdin OUTPUT=realigned.bam "REFERENCE_SEQUENCE=$REFERENCE" \
CLIP_ADAPTERS=false VALIDATION_STRINGENCY=SILENT CREATE_INDEX=true \
EXPECTED_ORIENTATIONS=FR MAX_GAPS=-1 SORT_ORDER=coordinate \
ALIGNER_PROPER_PAIR_FLAGS=false \
ATTRIBUTES_TO_RETAIN=X0 ATTRIBUTES_TO_RETAIN=ZS ATTRIBUTES_TO_RETAIN=ZI \
ATTRIBUTES_TO_RETAIN=ZM ATTRIBUTES_TO_RETAIN=ZC ATTRIBUTES_TO_RETAIN=ZN \
ATTRIBUTES_TO_REVERSE=ad ATTRIBUTES_TO_REVERSE=bd ATTRIBUTES_TO_REVERSE=cd \
ATTRIBUTES_TO_REVERSE=ae ATTRIBUTES_TO_REVERSE=be ATTRIBUTES_TO_REVERSE=ce