-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0.make-index-files
38 lines (33 loc) · 1.57 KB
/
0.make-index-files
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
###########################################################################
# Load Indexes and create input file
###########################################################################
export REFDIR=/media/drew/easystore/ReferenceGenomes/
export IDXDIR=$REFDIR/GCA_000001405.15_GRCh38_no_alt_analysis_set/
export IDXBASE=$REFDIR/GCA_000001405.15_GRCh38_no_alt_analysis_set.dict
export IDXBASE=$REFDIR/GCA_000001405.15_GRCh38_no_alt_analysis_set.
export REFFA=$IDXDIR/GCA_000001405.15_GRCh38_no_alt_analysis_set.fna
export GATK=$HOME/toolbin/gatk-4.1.8.1/gatk-package-4.1.8.1-local.jar
touch $IDXBASE
declare -A miseqdir=( ["2019_09"]="2019_09" ["2019_12"]="2019_12" )
declare -A datadir=( ["2019_09"]="LVB_fastq_Sept2019" ["2019_12"]="LVB_fastq_Dec2019" )
###########################################################################
# Create fasta dict and fasta index file
###########################################################################
java -jar $GATK CreateSequenceDictionary -R $REFFA > $IDXDIR
samtools faidx $REFFA > $IDXDIR
###########################################################################
# Create samples file that will serve as input for the pipeline
###########################################################################
for pfx in 2019_09 2019_12; do
miseqdir=${miseqdir[$pfx]}
cd $miseqdir
touch ./sm.file.txt
touch ./sm.txt
export INPUTFILE=./sm.file.txt
export INPUT_FILE=./sm.txt
find -iname "*_R1_*.fastq.gz" > $INPUTFILE
for i in $(cat $INPUTFILE); do
basename -s "R1_001.fastq.gz" $i >> $INPUT_FILE
done
done