通用代码是:
use strict;
use warnings;
my $f = $ARGV[0];
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::ApiVersion;
my $registry = 'Bio::EnsEMBL::Registry';
$registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous',
-port => '5306'
);
my $adaptor = $registry->get_adaptor( 'Homo sapiens', 'core', 'transcript' );
my $transcript =
$adaptor->fetch_by_translation_stable_id($f);
最后一行
#对于最后一行,我无法将两个值打印为同一行中的两列:
尝试 1 代码:打印 $f 。$transcript->display_id。"\n";
结果:api.test.pl ENSP00000418690
ENSP00000418690ENST00000488594
尝试 2 代码:打印 $f,$transcript->display_id。"\n";
结果:perl api.test.pl ENSP00000418690:
ENSP00000418690ENST00000488594
任何其他尝试都会影响访问 display_id。我想要的格式是:ENSP00000418690 ENST00000488594