Sublime text также позволяет это сделать. Просто откройте изображение, и оно автоматически -обновится без каких-либо дополнительных настроек.
Учитывая этот образец ввода:
$ cat file1.gbk
DEFINITION sca_32_chr11_3_0.
foo
Orig. start :: 381231
Orig. end :: 428233
/product="T1PKS"
/product="T1PKS"
bar
/product="T1PKS"
/product="T1PKS"
//
stuff
DEFINITION sca_32_chr11_3_0.
Orig. start :: 464307
Orig. end :: 486217
/product="terpene"
nonsense
/product="terpene"
/product="terpene"
/product="terpene"
//
DEFINITION sca_33_chr6_1_0.
Orig. start :: 140267
Orig. end :: 227928
/product="NRPS-like"
/product="T1PKS"
whatever
/product="NRPS-like"
/product="T1PKS"
/product="NRPS-like"
/product="NRPS-like"
/product="NRPS-like"
/product="T1PKS"
/product="T1PKS"
/product="T1PKS"
$ cat file2.gbk
here we go
DEFINITION sca_39_chr11_5_0.
Orig. start :: 270154
more irrelevant text
Orig. end :: 324310
/product="NRPS"
/product="NRPS"
/product="NRPS"
/product="NRPS"
Этот скрипт:
$ cat tst.awk
BEGIN { OFS="\t" }
$1 == "DEFINITION" {
if ( ++cnt == 1 ) {
print "Locus name", "start", "end", "ClusterType"
}
prt()
locus = $2
}
/Orig\. start/ { start = $NF }
/Orig\. end/ { end = $NF }
sub(".*/product=","") { gsub(/"/,""); types[$NF] }
END { prt() }
function prt( ct, type) {
if ( locus != "" ) {
for (type in types) {
ct = (ct=="" ? "" : ct ",") type
}
print locus, start, end, ct
}
delete types
locus = ""
}
будет производить этот вывод:
$ awk -f tst.awk *.gbk
Locus name start end ClusterType
sca_32_chr11_3_0. 381231 428233 T1PKS
sca_32_chr11_3_0. 464307 486217 terpene
sca_33_chr6_1_0. 140267 227928 T1PKS,NRPS-like
sca_39_chr11_5_0. 270154 324310 NRPS