-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-genomics-db.sh
31 lines (21 loc) · 1.04 KB
/
make-genomics-db.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
#!/usr/bin/env bash
#! RUN : bash make-genomics-db.sh <SAMPLE> <REF> [<CHR>]
#! Eg. : bash make-genomics-db.sh samples.list cf4 [38]
SAMPLE_MAP=$1
REF=$2
SCRIPTS=`dirname $0`
CFG="${SCRIPTS}/ngs-pipeline-${REF}.config"
[[ -z "$SAMPLE_MAP" ]] && { echo "ERROR: No SAMPLE map provided for this run"; exit 1; }
[[ -z "$REF" ]] && { echo "ERROR: No REFERENCE provided for this run"; exit 1; }
DIR=$(basename $SAMPLE_MAP .map)
echo "Creating directory ${DIR}"
mkdir -p $DIR/logs; cd $DIR
cp ../${SAMPLE_MAP} .
cp $CFG ${REF}.config; source ${REF}.config
module load ${GATK}
#gatk SplitIntervals -R ${FASTA}/${GENOME}.fasta -L ${INTERVAL_LIST} --scatter-count ${INTERVALS} -O intervals --subdivision-mode BALANCING_WITHOUT_INTERVAL_SUBDIVISION
for s in `cat ${SAMPLE_MAP}| cut -f 1`; do
# Copy g.vcf files from RCS... will only copy if files no present or rcs version is newer
rsync --progress -av ${WGS}/${s}/${s}-${REF}.g.vcf* ./;
done
#sbatch -A ${ACCOUNT} -J GenomicsDB --array=0-$(($INTERVALS-1)) ${SCRIPTS}/slurm/createGenomicsDB.sh ${SAMPLE_MAP} ${REF}