-
Notifications
You must be signed in to change notification settings - Fork 0
/
doit00.bash
executable file
·57 lines (40 loc) · 1.81 KB
/
doit00.bash
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! /bin/bash
. doit-preamble.bash
# ------------------------------------------------------------------------
# Step 0. Set up
# ------------------------------------------------------------------------
rm -rf data
mkdir -p data/tmp
echo 1>&2 '# Initializing data/...'
mkdir -p ${INPUTS}
# --------------------------------------------------
(
cd ${INPUTS}
echo 1>&2 '## Downloading "datasets" command.'
curl -s -o datasets 'https://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/LATEST/linux-amd64/datasets'
chmod +x datasets
echo 1>&2 '## Downloading host and bacteria genomes.'
./datasets download genome accession --no-progressbar --include-gbff --include-gtf \
${HOST_ACCESSION} ${BACTERIA_ACCESSION}
unzip -q ncbi_dataset.zip
echo 1>&2 '## Staging genomes'
cp ncbi_dataset/data/${HOST_ACCESSION}/GC?_*.fna genome-host.fna
#cp ncbi_dataset/data/${HOST_ACCESSION}/genomic.gff annotation-host.gff
cp ncbi_dataset/data/${HOST_ACCESSION}/genomic.gtf annotation-host.gtf
cp ncbi_dataset/data/${BACTERIA_ACCESSION}/GC?_*.fna genome-bacteria.fna
#cp ncbi_dataset/data/${BACTERIA_ACCESSION}/genomic.gff annotation-bacteria.gff
cp ncbi_dataset/data/${BACTERIA_ACCESSION}/genomic.gtf annotation-bacteria.gtf
)
if [ "${ADDITIONAL_BACTERIA_GENES}" ] ; then
cat "${ADDITIONAL_BACTERIA_GENES}" >> ${INPUTS}/annotation-bacteria.gtf
fi
# --------------------------------------------------
echo 1>&2 '## Making copies of raw reads.'
for i in $SAMPLES_INDICES ; do
echo 1>&2 '##' $i':' ${INPUTS}/raw_${i}_R1.fastq.gz "<-" "${SAMPLES_R1[$i]}"
cp "${SAMPLES_R1[$i]}" ${INPUTS}/raw_${i}_R1.fastq.gz
if [ "$PE" ] ; then
echo 1>&2 '##' $i':' ${INPUTS}/raw_${i}_R2.fastq.gz "<-" "${SAMPLES_R2[$i]}"
cp "${SAMPLES_R2[$i]}" ${INPUTS}/raw_${i}_R2.fastq.gz
fi
done