-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathestimateGenomeSize
28 lines (25 loc) · 964 Bytes
/
estimateGenomeSize
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
#! /usr/bin/env bash
if [[ -z $1 ]]; then
echo "Perform the Kmer-frequency genome estimate method on a range of Kmer sizes"
echo "Requires the software Jellyfish: https://github.com/gmarcais/Jellyfish"
echo ""
echo "[usage] estimateGenomeSize <# threads> <K start> <K end> <output prefix> <fastq.forward> <fastq.reverse>"
echo "[example] estimateGenomeSize 10 17 22 tripletail TT_001.F.fq.gz TT_001.R.fq.gz"
exit 1
fi
#$1 is the number of threads
#$2 is the range start
#$3 is the range end
#$4 is outfile prefix
#$5 is forward reads
#$6 is reverse reads
for i in $(seq $2 $3); do
echo "Running jellyfish on k = $i"
if (file $5 | grep -q compressed ) ; then
jellyfish count -t $1 -C -m $i -s 7G -o $4_${i}mer <(zcat $5) <(zcat $6)
else
jellyfish count -t $1 -C -m $i -s 7G -o $4_${i}mer $5 $6
fi
echo "Jellyfish histo on k = $i"
jellyfish histo -o $4_${i}mer.hist $4_${i}mer && rm $4_${i}mer
done