diff --git a/detectors/normalize/tools/selectViridiplantae.sh b/detectors/normalize/tools/selectViridiplantae.sh index 895dd06..a75a6f3 100755 --- a/detectors/normalize/tools/selectViridiplantae.sh +++ b/detectors/normalize/tools/selectViridiplantae.sh @@ -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 \ No newline at end of file