更新时间:2023-01-30 19:29:02
您的数据看起来像是用制表符分隔的.
It looks like your data is tab-separated.
此Perl程序将从第三列中所有具有exon
的所有记录中打印第1、4和5列.您需要将open
语句中的文件名更改为您的实际文件名.
This Perl program will print columns 1, 4 and 5 from all records that have exon
in the third column. You need to change the file name in the open
statement to your actual file name.
use strict;
use warnings;
open my $fh, '<', 'genes.gff3' or die $!;
while (<$fh>) {
chomp;
my @fields = split /\t/;
next unless @fields >= 5 and $fields[2] eq 'exon';
print join("\t", @fields[0,3,4]), "\n";
}
输出
PITG_00002 2 397
PITG_00004 1 1275
PITG_00004 1397 1969