Small changes

Former-commit-id: bf83f19efe2590803c089697858590aee4720089
Former-commit-id: e7d0bae099d6449b97c431f7ba82568f45bcc005
This commit is contained in:
2023-05-11 14:29:43 +02:00
parent 79843c2540
commit 3d9be22e1d
2 changed files with 28 additions and 10 deletions

View File

@ -1,12 +1,29 @@
#!/bin/bash
egrep "^FT (CDS|rRNA|tRNA) |/gene=" $1 \
| awk '
/\/gene=/ && (gene!=1) {
print $0;
gene=1
}
/^FT (CDS|rRNA|tRNA)/ {
print $0;
gene=0
}'
resume_ft() {
local input=$1
grep -E "^FT (CDS|rRNA|tRNA) |/gene=" ${input} \
| awk '
/\/gene=/ && (gene!=1) {
print $0;
gene=1
}
/^FT (CDS|rRNA|tRNA)/ {
print $0;
gene=0
}'
}
count_tRNA() {
local input=$1
resume_ft $input \
| grep '^FT tRNA' \
| wc -l
}
printf "tRNA genes : %d\n" "$(count_tRNA $1)"