Oops. Sorry.
> From: Arek Kasprzyk [mailto:[EMAIL PROTECTED]
> > I modified the simple example script from biomart-plib. It's
attached.
> > (The registry file is just a copy of the default one.)
> >
>
> Hi Amir,
> can you copy your script in the body of this email and post
> it again so
> we can look into this
> in more detail? (This lists only accepts text and no attachments).
use strict;
use warnings;
use lib "ensembl/modules";
use lib "biomart-plib";
use BioMart::Initializer;
use BioMart::Query;
use BioMart::AttributeTable;
use BioMart::QueryPlanner;
use BioMart::ResultTable;
my $dataset = "hsapiens_gene_ensembl";
#my $confFile = (grep { m/biomart-plib+$/ }
@INC)[0]."/conf/defaultMartRegistry.xml";
my $confFile = "ensemblMartRegistry.xml";
die ("Cant find configuration file $confFile\n") unless (-f $confFile);
my $initializer = BioMart::Initializer->new('registryFile'=>$confFile);
my $registry = $initializer->getRegistry;
my $virtual_schema_name = "default";
my $confTree = $registry->getDatasetByName($virtual_schema_name,
$dataset)->getConfigurationTree();
my $query = BioMart::Query->new(
'registry'=>$registry,'virtualSchemaName'=>$virtual_schema_name
);
####################
# attribute
#my $name1 = "gene_stable_id";
my @names = qw(hsapiens_gene_ensembl_structure.gene_stable_id
);
@names= qw(
hsapiens_gene_ensembl_structure.gene_stable_id
hsapiens_gene_ensembl_structure.exon_stable_id
description
);
foreach my $name (@names) {
warn $name;
my $att = $confTree->getAttributeByName($name)
or die("No such attribute $name \n");
$query->addAttribute($att);
}
####################
# filter
my $filter_name1 = "hgnc_symbol";
my $filter1 =$confTree->getFilterByName($filter_name1)
or die("No such filter: $filter_name1 \n");
my @filter_vals = qw(BRCA1 BRCA2);
my $atbl1 = BioMart::AttributeTable->new();
$atbl1->addRow([ @filter_vals ]);
$filter1->setTable($atbl1);
$query->addFilter($filter1);
####################
# Run the query
my $query_planner = BioMart::QueryPlanner->new();
my $rtable = $query_planner->getResultTable($query);
die("No Rows Returned\n") unless ($rtable->hasMoreRows);
while ($rtable->hasMoreRows) {
my $row = $rtable->nextRow;
foreach my $result (@{$row}){
print "$result\t";
}
print "\n";
}
> > When I try to run it, I get the results below. If I delete
> > hsapiens_gene_ensembl_structure.exon_stable_id from @names, it works
> > just fine and gives me ID & description for the two genes (although
> > there's two copies of BRCA2. Hm). Why am I getting a web
> > server error
> > by
> > adding an extra attribute?
There's definitely something special about the exon_id attribute,
because gene_id works fine but exon_id doesn't.
> >
> > In order to avoid you rhaving to answer more questions... is there a
> > good biomart-plib tutorial or documentation to read?
>
> The only documentation that we have at the moment is on
> http://www.biomart.org/install.html (pdf). I don't think this contains
> a lot of info but you should find something there. We'll try to write
> a better section about API for 0.5
About a third of a page...
Thanks,
- Amir Karger
Computational Biology Group
Bauer Center for Genomics Research
Harvard University
617-496-0626
---------------------
# perl try.pl
Software/configuration version check: 0.4 DICTYBASE (NORTHWESTERN) OK
Software/configuration version check: 0.4 ENSEMBL 38 (SANGER) OK
Software/configuration version check: 0.4 SEQUENCE 38 (SANGER) OK
Software/configuration version check: 0.4 SNP 38 (SANGER) OK
Software/configuration version check: 0.4 VEGA 38 (SANGER) OK
Software/configuration version check: 0.4 UNIPROT 4-5 (EBI) OK
Software/configuration version check: 0.4 MSD 4 (EBI) OK
Software/configuration version check: 0.4 WORMBASE CURRENT (CSHL) OK
DATASET default ... ENSEMBL 38 (SANGER) ...... ..........
hsapiens_gene_ensembl ..................... (WEB) www.biomart.org:80
............ OK
hsapiens_gene_ensembl_structure.gene_stable_id at try.pl line 43.
description at try.pl line 43.
ENSG00000012048 Breast cancer type 1 susceptibility protein (RING finger
protein 53). [Source:Uniprot/SWISSPROT;Acc:P38398]
ENSG00000139618 Breast cancer type 2 susceptibility protein (Fanconi
anemia group D1 protein). [Source:Uniprot/SWISSPROT;Acc:P51587]
ENSG00000139618 Breast cancer type 2 susceptibility protein (Fanconi
anemia group D1 protein). [Source:Uniprot/SWISSPROT;Acc:P51587]
testportal:~/src/ensembl_api>perl try.pl
Software/configuration version check: 0.4 DICTYBASE (NORTHWESTERN) OK
Software/configuration version check: 0.4 ENSEMBL 38 (SANGER) OK
Software/configuration version check: 0.4 SEQUENCE 38 (SANGER) OK
Software/configuration version check: 0.4 SNP 38 (SANGER) OK
Software/configuration version check: 0.4 VEGA 38 (SANGER) OK
Software/configuration version check: 0.4 UNIPROT 4-5 (EBI) OK
Software/configuration version check: 0.4 MSD 4 (EBI) OK
Software/configuration version check: 0.4 WORMBASE CURRENT (CSHL) OK
DATASET default ... ENSEMBL 38 (SANGER) ...... ..........
hsapiens_gene_ensembl ..................... (WEB) www.biomart.org:80
............ OK
hsapiens_gene_ensembl_structure.gene_stable_id at try.pl line 44.
hsapiens_gene_ensembl_structure.exon_stable_id at try.pl line 44.
description at try.pl line 44.
Problems with the web server: 500 Internal Server Error