Hi Francesco,
please replace your registry file with the one enclosed, and see if that
helps.
Syed
On 05/07/2012 13:12, Francesco Marass wrote:
Dear Syed,
Thank you for your reply.
Here are three queries and the size of their output:
## SCENARIO 1 -- Transcript and no flanking regions
$query =
BioMart::Query->new("registry"=>$registry,"virtualSchemaName"=>"default");
$query->setDataset("hsapiens_gene_ensembl");
$query->addFilter("ensembl_transcript_id",[$ensembl_id]);
$query->addAttribute("ensembl_transcript_id");
$query->addAttribute("transcript_exon_intron");
$query->addAttribute("strand");
$query->formatter("FASTA");
# execute query
$query_run=BioMart::QueryRunner->new();
$query_run->uniqueRowsOnly(1);
$query_run->execute($query);
# save results
open($fho,'>',"mart_q3_results.txt");
$query_run->printResults($fho);
close($fho);
## OUTPUT 1
$ wc mart_q3_results.txt
319 319 19395 mart_q3_results.txt
## SCENARIO 2 -- Transcript and flanking regions
$query =
BioMart::Query->new("registry"=>$registry,"virtualSchemaName"=>"default");
$query->setDataset("hsapiens_gene_ensembl");
$query->addFilter("ensembl_transcript_id",[$ensembl_id]);
$query->addFilter("downstream_flank",["100"]);
$query->addFilter("upstream_flank",["100"]);
$query->addAttribute("ensembl_transcript_id");
$query->addAttribute("transcript_exon_intron");
$query->addAttribute("strand");
$query->formatter("FASTA");
# execute query
$query_run=BioMart::QueryRunner->new();
$query_run->uniqueRowsOnly(1);
$query_run->execute($query);
# save results
open($fho,'>',"mart_q3_results2.txt");
$query_run->printResults($fho);
close($fho);
## OUTPUT 2
$ wc mart_q3_results2.txt
319 319 19395 mart_q3_results2.txt
## SCENARIO 3 -- Just flanks
$query =
BioMart::Query->new("registry"=>$registry,"virtualSchemaName"=>"default");
$query->setDataset("hsapiens_gene_ensembl");
$query->addFilter("upstream_flank", ["100"]);
$query->addFilter("ensembl_transcript_id", ["ENST00000396473"]);
$query->addAttribute("ensembl_gene_id");
$query->addAttribute("ensembl_transcript_id");
$query->addAttribute("transcript_flank");
$query->formatter("FASTA");
# execute query
$query_run=BioMart::QueryRunner->new();
$query_run->uniqueRowsOnly(1);
$query_run->execute($query);
# save results
open($fho,'>',"mart_q3_results3.txt");
$query_run->printResults($fho);
close($fho);
## OUTPUT 3
$ wc mart_q3_results3.txt
0 0 0 mart_q3_results3.txt
As you can see, if a ask for a transcript I correctly receive what I want
(#1). If I ask for a transcript with 100bp on either side (#2), I receive
the same transcript as in scenario #1, indicating that the
downstream_flank and upstream_flank conditions are ignored. If I only ask
for the 100bp (upstream) flanking a transcript, I get nothing (#3).
My ensembl.xml is the following:
<MartRegistry>
<MartURLLocation
name = "ensembl"
displayName = "ensembl"
host = "www.biomart.org"
port = "80"
visible = "1"
default = "0"
includeDatasets = "hsapiens_gene_ensembl"
martUser = ""
/>
<MartURLLocation
name = "sequence"
displayName = "sequence"
host = "www.biomart.org"
port = "80"
visible = "1"
default = "0"
includeDatasets = "hsapiens_genomic_sequence"
martUser = ""
/>
<MartURLLocation
database = "snp_mart_67a"
displayName = "ENSEMBL VARIATION 67 (SANGER UK)"
host = "www.biomart.org"
includeDatasets = "hsapiens_structvar,hsapiens_snp_som,hsapiens_snp"
martUser = ""
name = "snp"
path = "/biomart/martservice"
port = "80"
visible = "1"
default = "0"
/>
</MartRegistry>
Best,
Francesco
On 04/07/2012 20:20, "Syed Haider" <[email protected]> wrote:
Francesco,
a- please explain what you mean by "flanks can never be retrieved" ?
b- whats your ensembl.xml file like ?
Syed
On 04/07/2012 12:33, Francesco Marass wrote:
Hello,
I am trying to retrieve a transcript sequence using the BioMart perl
API, and I am also interested in the 100bp flanking the transcript.
When I use the Ensembl BioMart web page, everything works fine. However,
using the perl code automatically generated by the online query (see
below), flanks can never be retrieved. Ensembl's HelpDesk redirected me
to BioMart, where the problem allegedly lies.
Can someone explain how to retrieve flanking regions?
Thank you,
Francesco Marass
###
# An example script demonstrating the use of BioMart API.
# This perl API representation is only available for configuration
versions >= 0.5
use strict;
use BioMart::Initializer;
use BioMart::Query;
use BioMart::QueryRunner;
my $confFile = "ensembl.xml";
#
# NB: change action to 'clean' if you wish to start a fresh
configuration
# and to 'cached' if you want to skip configuration step on subsequent
runs from the same registry
#
my $action='cached';
my $initializer = BioMart::Initializer->new('registryFile'=>$confFile,
'action'=>$action);
my $registry = $initializer->getRegistry;
my $query =
BioMart::Query->new('registry'=>$registry,'virtualSchemaName'=>'default')
;
$query->setDataset("hsapiens_gene_ensembl");
$query->addFilter("downstream_flank", ["100"]);
$query->addFilter("upstream_flank", ["100"]);
$query->addFilter("ensembl_transcript_id", ["ENST00000478798"]);
$query->addAttribute("ensembl_gene_id");
$query->addAttribute("ensembl_transcript_id");
$query->addAttribute("transcript_exon_intron");
$query->formatter("FASTA");
my $query_runner = BioMart::QueryRunner->new();
$query_runner->execute($query);
$query_runner->printHeader();
$query_runner->printResults();
$query_runner->printFooter();
###
NOTICE AND DISCLAIMER
This e-mail (including any attachments) is intended for the above-named
person(s). If you are not the intended recipient, notify the sender
immediately, delete this email from your system and do not disclose or
use for any purpose.
We may monitor all incoming and outgoing emails in line with current
legislation. We have taken steps to ensure that this email and
attachments are free from any virus, but it remains your responsibility
to ensure that viruses do not adversely affect you.
Cancer Research UK
Registered in England and Wales
Company Registered Number: 4325234.
Registered Charity Number: 1089464 and Scotland SC041666
Registered Office Address: Angel Building, 407 St John Street, London
EC1V 4AD.
_______________________________________________
Users mailing list
[email protected]
https://lists.biomart.org/mailman/listinfo/users
NOTICE AND DISCLAIMER
This e-mail (including any attachments) is intended for the above-named
person(s). If you are not the intended recipient, notify the sender
immediately, delete this email from your system and do not disclose or use for
any purpose.
We may monitor all incoming and outgoing emails in line with current
legislation. We have taken steps to ensure that this email and attachments are
free from any virus, but it remains your responsibility to ensure that viruses
do not adversely affect you.
Cancer Research UK
Registered in England and Wales
Company Registered Number: 4325234.
Registered Charity Number: 1089464 and Scotland SC041666
Registered Office Address: Angel Building, 407 St John Street, London EC1V 4AD.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MartRegistry>
<MartRegistry>
<MartDBLocation databaseType="mysql" host="martdb.ensembl.org" database="ensembl_mart_67" name="ensembl" displayName="ENSEMBL 67 GENE (SANGER UK)" port="5316" schema="ensembl_mart_67" user="anonymous" password="" visible="1" default="1" martUser="" includeDatasets="hsapiens_gene_ensembl" />
<MartDBLocation databaseType="mysql" host="martdb.ensembl.org" database="sequence_mart_67" name="seq" displayName="ENSEMBL 67 SEQ (SANGER UK)" port="5316" schema="sequence_mart_67" user="anonymous" password="" visible="067" default="1" martUser="" includeDatasets="hsapiens_genomic_sequence" />
<MartDBLocation databaseType="mysql" host="martdb.ensembl.org" database="snp_mart_67" name="snp" displayName="ENSEMBL 67 SNP (SANGER UK)" port="5316" schema="snp_mart_67" user="anonymous" password="" visible="1" default="1" martUser="" includeDatasets="hsapiens_structvar,hsapiens_snp_som,hsapiens_snp" />
<!--
<MartDBLocation databaseType="mysql" host="localhost" database="ontology_mart_57" name="ontology" displayName="ENSEMBL 67 ONTOLOGY (SANGER UK)" port="3306" schema="ontology_mart_57" user="root" password="" visible="0" default="1" martUser="" includeDatasets="" />
<MartDBLocation databaseType="mysql" host="martdb.ensembl.org" database="genomic_features_mart_67" name="gen_features" displayName="ENSEMBL 67 GENOMIC FEATURES (SANGER UK)" port="5316" schema="genomic_features_mart_67" user="anonymous" password="" visible="0" default="1" martUser="" includeDatasets="" />
-->
</MartRegistry>
_______________________________________________
Users mailing list
[email protected]
https://lists.biomart.org/mailman/listinfo/users