Modify script to accept compressed genome files

Former-commit-id: f816e3ce8b10e2ca3f1aa9ae969c24e699368e25
Former-commit-id: 16fb412552debdfd2172926e8a8b63be05257bdf
This commit is contained in:
2018-04-05 17:58:19 +02:00
parent 962ff827dc
commit 81657a288a

View File

@ -1,8 +1,18 @@
#!/bin/bash
grep -A 1 ' ORGANISM' $* | \
( \
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).$/\1/' | \
sed -E 's/(^.*\.gbk(.gz)?).$/\1/' | \
uniq