
Former-commit-id: 0579e878a69b7c285ca71870e9ca5730649a2fda Former-commit-id: 7cced5b488441d87bf070a9a444317db0e048880
33 lines
303 B
Awk
33 lines
303 B
Awk
#
|
|
# get fasta sequence from genbank
|
|
#
|
|
|
|
/^LOCUS/ {
|
|
locus = $2
|
|
next
|
|
}
|
|
|
|
/^ORIGIN/ {
|
|
inseq = 1
|
|
nln = 0
|
|
delete seq
|
|
}
|
|
|
|
inseq && /^ +[1-9][0-9]*/ {
|
|
s = substr($0, 11)
|
|
gsub(" ", "", s)
|
|
seq[++nln] = s
|
|
next
|
|
}
|
|
|
|
/^\/\// {
|
|
print ">" locus
|
|
for (i = 1 ; i <= nln ; i++)
|
|
print seq[i]
|
|
}
|
|
|
|
|
|
|
|
|
|
|