Dear All, I just want to use perl API to fetch some transcripts of one gene, and after search with google, I got some codes from bioperl howto in WiKi. I just followed the instruction on the website of Ensembl to install perl API in the path C:/src of my windows system, but after trying many times, I can not run the following codes successfully; actually, I think the codes are correct, but I can not figure out how to install Ensembl perl API correctly. Is there anybody has some experience with running Ensembl Perl API on windows?
#!/usr/bin/perl
BEGIN{ push @INC,'C:/src/bioperl-live','C:/src/ensembl/modules','C:/src/ensembl-compara/modules','C:/src/ensembl-variation/modules','C:/src/ensembl-functgenomics/modules';};
use strict;
use Bio::EnsEMBL::Registry;
use Getopt::Long;
use Bio::SeqIO;
# old style (deprecated) use the Bio::EnsEMBL::Registry
#use Bio::EnsEMBL::DBSQL::DBAdaptor;
# initialize some defaults
my $species = 'homo_sapiens';
my $source = 'core';# core or vega
# allow identifier being passed as the first argument in the command line or by an option -n or -gene_symbol
my $identifier ="CD55";
GetOptions(
"n|gene_symbol=s" => \$identifier,
"species=s" => \$species,
"source=s" => \$source,
);
my $out_seq = Bio::SeqIO->new(
-fg => \*STDOUT,
-format => 'fasta',
);
# The current way for accesing ensemble is using the registry
# it matches your API with its corresponding ensembl database version
# Also takes care of the mysql port (now is in a non standard port 5306)
my $reg = 'Bio::EnsEMBL::Registry';
$reg->load_registry_from_db(-host => 'ensembldb.ensembl.org', -user=>'anonymous');
my $gene_adaptor = $reg->get_adaptor($species, $source, 'Gene' );
foreach my $gene (@{$gene_adaptor->fetch_all_by_external_name($identifier)}) {
# the seq method in gene returns the nucleotide sequence
# [warning] in transcript and exon objects, the seq method returns a biperl Bio::Seq object
print "gene sequence for " . $identifier.":\n". $gene->seq() . "\n";
foreach my $trans (@{$gene->get_all_Transcripts}) {
# print the spliced sequence in fasta (you can print the raw seq with $trans->seq->seq())
print "\ttranscript " . $trans->stable_id() . ":\n";
$out_seq->write_seq($trans->seq);
}
}
Can you provide details on the error you are seeing when you run your script?
I have installed two month back with lots of effort, it's not easy in Windows though. But, I will try to write in details later with all sources
Can you give link you followed while installing? I have installed two month back with lots of effort, it's not easy though.
Did you checked whether Perl/ BioPerl is working?
first make sure that perl and bioperl are working? After testing that you can follow perl api installation
it is running without output any results, which means it didn't stop running and I can not get results from the scripts.
Previously, I installed bioperl successfully, but when I ran the above codes, the script keep running without no result output. Would you please give me some suggestions about the problem? Thanks!