Re: [BioMart Users] [biohackathon:247] Python API interfaces to Biogateway and BioMart

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [BioMart Users] [biohackathon:247] Python API interfaces to Biogateway and BioMart

Brad Chapman

Joachim;
Thanks very much for the help. I'm copying in the BioMart users list as well.

> > SPARQL-Exception:The following principal mart did not return results:
> > Can any of the BioMart folks point me in the right direction?

>   To understand your problem, I assume you did the following:
>   1. Go to http://bm-test.res.oicr.on.ca:9085/
>   2. Click on "Advanced" under "Database Search"
>   3. Select "Simple Mutations"
>   4. Choose dataset, filters and attributes (let's say, 'Breast Cancer' with
>      attributes 'Cancer type', 'Chromosome', 'Mutation ID', 'Donor ID'
>   5. Clicked on the "SPARQL" button to get the SPARQL query that returns the same resultset

Exactly right -- that's how I got the SPARQL to submit.

> I then copied the query with an added "LIMIT 10" into a file called
> "snp_config.sparql" and ran "./biomart_sparql.rb -h bm-test.res.oicr.on.ca
> -p 9085" which queries the mart with the HTTP GET request

I am doing the equivalent but with the Python SPARQL wrapper
(http://sparql-wrapper.sourceforge.net/). I dug into this more because it
should work based on your feedback. I had some of the prefixes of the query
messed up, which was causing the issue. Awesome, now I've got a basic
query working and can move forward. Thanks so much for the help:

https://github.com/chapmanb/bcbb/blob/master/semantic/biomart.py

>   If you want to query other attributes, you can have a look at the
>   ontology via (for example) Protege by loading the ontology from
>   http://bm-test.res.oicr.on.ca:9085/martsemantics/snp_config/ontology

Thanks for this -- I will dig into the query builder plan more tomorrow.
Can you explain how the attributes are named? It looks like there
are 4 parts in each:

- mart name
- feature group (?)
- where the feature is derived from (?)
- attribute name

attribute:snp__simple_somatic_mutation__dm__consequence_type
attribute:snp__feature__main__chromosome

What I'd like to do is semi-automate the name creation so users can select
based on attribute name in the API. Is there any easy way to query for the
first 3 values based on the attribute name?

Thanks again,
Brad
_______________________________________________
Users mailing list
[hidden email]
https://lists.biomart.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: [BioMart Users] [biohackathon:247] Python API interfaces to Biogateway and BioMart

Joachim Baran-2
Hi!

> Can you explain how the attributes are named? It looks like there
> are 4 parts in each [...]
>   attribute:snp__simple_somatic_mutation__dm__consequence_type
>   attribute:snp__feature__main__chromosome
> [...] Is there any easy way to query for the first 3 values based on the attribute name?
  Actually, everything that appears after the colon is the attribute name. If you look at an Ensembl mart, then you will see that the names are considerably shorter there. For example, genes, transcription and protein IDs are identified by: attribute:ensembl_gene_id, attribute:ensembl_transcript_id, attribute:ensembl_peptide_id

  The only reason why the names in the SNP mart appear longer is due to their automatic generation by an old version of BioMart (BioMart 0.7). A description about how BioMart 0.7 created attribute names can be found in the old documentation on www.biomart.org under the tab "Docs" -- which I cannot link to right now because the web-site appears to be down. Anyway, you will need to treat everything after the colon as an attribute name, because you do not know which version of BioMart was used to create the mart or whether the person who set up the mart changed them manually.

  Hm. I hope I have explained this more or less sensibly, but please do not hesitate to ask again if you would like more clarification.

Joachim
_______________________________________________
Users mailing list
[hidden email]
https://lists.biomart.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: [BioMart Users] [biohackathon:252] Python API interfaces to Biogateway and BioMart

Arek Kasprzyk
www.biomart.org seems to be up and running from here

a

On Thu, Aug 25, 2011 at 10:33 PM, Joachim Baran
<[hidden email]> wrote:

> Hi!
>
>> Can you explain how the attributes are named? It looks like there
>> are 4 parts in each [...]
>>   attribute:snp__simple_somatic_mutation__dm__consequence_type
>>   attribute:snp__feature__main__chromosome
>> [...] Is there any easy way to query for the first 3 values based on the attribute name?
>  Actually, everything that appears after the colon is the attribute name. If you look at an Ensembl mart, then you will see that the names are considerably shorter there. For example, genes, transcription and protein IDs are identified by: attribute:ensembl_gene_id, attribute:ensembl_transcript_id, attribute:ensembl_peptide_id
>
>  The only reason why the names in the SNP mart appear longer is due to their automatic generation by an old version of BioMart (BioMart 0.7). A description about how BioMart 0.7 created attribute names can be found in the old documentation on www.biomart.org under the tab "Docs" -- which I cannot link to right now because the web-site appears to be down. Anyway, you will need to treat everything after the colon as an attribute name, because you do not know which version of BioMart was used to create the mart or whether the person who set up the mart changed them manually.
>
>  Hm. I hope I have explained this more or less sensibly, but please do not hesitate to ask again if you would like more clarification.
>
> Joachim
_______________________________________________
Users mailing list
[hidden email]
https://lists.biomart.org/mailman/listinfo/users