-
Notifications
You must be signed in to change notification settings - Fork 0
/
doit01-filtlong.bash
executable file
·32 lines (23 loc) · 1.01 KB
/
doit01-filtlong.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
#! /bin/bash
. $(dirname ${BASH_SOURCE[0]})/doit-preamble.bash
# ------------------------------------------------------------------------
# Run filtlong, "Some light read QC"
# (https://github.com/rrwick/Trycycler/wiki/Generating-assemblies-for-Trycycler)
# ------------------------------------------------------------------------
rm -rf ${FILTLONG}
mkdir -p ${FILTLONG}
echo 1>&2 '# Running filtlong...'
filtlong --min_length 1000 --keep_percent 95 \
${INPUTS}/raw_nanopore.fastq.gz \
| gzip > ${FILTLONG}/filtered_nanopore.fastq.gz
mean_length=$(seqtk comp ${FILTLONG}/filtered_nanopore.fastq.gz | awk '{count++; bases += $2} END{print bases/count}')
read_count=$(echo $SAMPLE_DEPTH"*"$GENOME_SIZE"/"$mean_length | bc)
(
echo mean_length=$mean_length
echo read_count=$read_count
) | tee ${FILTLONG}/stats.bash
# ------------------------------------------------------------------------
# Done.
# ------------------------------------------------------------------------
echo 1>&2 ''
echo 1>&2 '# Done.'