Files
annotate/detectors/normalize/tools/selectViridiplantae.sh
Eric Coissac 81657a288a Modify script to accept compressed genome files
Former-commit-id: f816e3ce8b10e2ca3f1aa9ae969c24e699368e25
Former-commit-id: 16fb412552debdfd2172926e8a8b63be05257bdf
2018-04-05 17:58:19 +02:00

18 lines
505 B
Bash
Executable File

#!/bin/bash
( \
for f in $* ; do \
if [[ "$f" =~ \.gz$ ]] ; then \
GREP=zgrep; \
else \
GREP=grep; \
fi; \
${GREP} -H -A 1 ' ORGANISM' $f; \
done \
) | \
grep -B 1 Viridiplantae | \
gawk '{print $1}' | \
grep '\.gbk' | \
sed -E 's/(^.*\.gbk(.gz)?).$/\1/' | \
uniq