我正在尝试提取以下文件中的 11 列中的每一列:
http://bioinfo.mc.vanderbilt.edu/TSGene/Human_716_TSGs.txt
...进入初级大学生物信息学项目的标量列表。请参见下文,我的努力是有效的,但并不完美,因为各列之间的空白量不同(请参阅文件顶部了解详细信息)。
use strict;
use warnings;
open FH, '<', 'tsg.txt' or die $!;
my $data = do {local $/; <FH>};
close FH or die $!;
my($id, $sym, $alias, $xref, $chromo, $band, $name, $gene_t, $desc, $nuc_seq,
$pro_seq) = $data =~ /(\S+)\s+
(\S+)\s+
(\S+)\s+
(\S+)\s+
(\S+)\s+
(\S+)\s+
(\S+)\s+
/xms;
print "GeneID: $id", "\n";
print "Gene_symbol: $sym", "\n";
print "Alias: $alias", "\n";
print "XRef: $xref", "\n";
print "Chromosome: $chromo", "\n";
print "Cytoband: $band", "\n";
print "Full_name: $name", "\n";
#print "Gene_type: $gene_t", "\n";
#print "Description: $desc", "\n";
#print "Nucleotide_sequence: $nuc_seq", "\n";
#print "Protein_sequence: $pro_seq", "\n";
谢谢您的帮助。