-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbam2fa.sh
38 lines (33 loc) · 1.21 KB
/
bam2fa.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
30
31
32
33
34
35
36
37
38
#!/bin/bash
#$ -cwd
#$ -l h_vmem=16G
########################################################## ######################
### COPYRIGHT ########################################################## ########
# New York Genome Center
# SOFTWARE COPYRIGHT NOTICE AGREEMENT
# This software and its documentation are copyright (2014) by the New York
# Genome Center. All rights are reserved. This software is supplied without
# any warranty or guaranteed support whatsoever. The New York Genome Center
# cannot be responsible for its use, misuse, or functionality.
# Version: 0.1
# Author: Avinash Abhyankar
########################################################## ####### /COPYRIGHT ###
########################################################## ######################
if [ $# -ne 2 ]
then
echo "Usage: <path_to_bam><sampleID>"
exit 65
fi
bamdir=$(dirname ${1})
fastqdir=$(dirname ${bamdir})/fastq
mkdir -p ${fastqdir}/tmpdir
tmpdir=${fastqdir}/tmpdir
my_java="~/local/bin/java -Djava.io.tmpdir=${tmpdir} -Xmx12g"
picard="${my_java} -jar ~/program/picard-tools-1.128/picard.jar"
## Convert BAM to FASTQ
${picard} SamToFastq \
VALIDATION_STRINGENCY=SILENT \
INPUT=${1} \
OUTPUT_PER_RG=true \
RG_TAG=ID \
OUTPUT_DIR=${fastqdir}