Hi Andrea,
there is a simple example on page 75 of our manual
http://www.biomart.org/other/rc6_documentation.pdf

For downloading and installing BioMart software see sections 1-3 page 5


a



On Thu, Feb 9, 2012 at 7:21 AM, Andrea Gangi <[email protected]> wrote:

> Hi, i want to use our service for my Java application.
> I need to access PRIDE data. The query XML automatically generated by
> central.biomart.org  is:
>
> <!DOCTYPE Query>
> <Query client="true" processor="TSV" limit="-1" header="1">
> <Dataset name="pride" config="pride_config">
> <Attribute name="experiment_ac"/>
> <Attribute name="experiment_title"/>
> <Attribute name="pubmed_id"/>
> <Attribute name="uniprot_id"/>
> <Attribute name="submitted_accession"/>
> </Dataset
> </Query>
>
> How can I use this query from my Java application?
>
> Alternatively: I have generated this Java code too. But where can I find
> the BiomartAPI for Java? I need to install anything or is there a .jar file
> that include Biomart JAVA api?
>
> import org.biomart.api.factory.*;
>> import org.biomart.api.Portal;
>> import org.biomart.api.Query;
>>
>> /*
>>  * This is a runnable Java class that executes the query.
>>  * Please adapt this code as needed, and DON'T forget to change the
>> xmlPath.
>>  */
>>
>> public class QueryTest {
>>     public static void main(String[] args) throws Exception {
>>         String xmlPath = "/path/to/registry_xml"; // Needs to be changed
>>
>>         MartRegistryFactory factory = new XmlMartRegistryFactory(xmlPath,
>> null);
>>         Portal portal = new Portal(factory, null);
>>
>>         Query query = new Query(portal);
>>         query.setProcessor("TSV");
>>         query.setClient("biomartclient");
>>         query.setLimit(-1);
>>         query.setHeader(true);
>>
>>         Query.Dataset ds = query.addDataset("pride", "pride_config");
>>         ds.addAttribute("experiment_ac");
>>         ds.addAttribute("experiment_title");
>>         ds.addAttribute("pubmed_id");
>>         ds.addAttribute("uniprot_id");
>>         ds.addAttribute("submitted_accession");
>>
>>         // Print to System.out, but you can pass in any
>> java.io.OutputStream
>>         query.getResults(System.out);
>>
>>         System.exit(0);
>>     }
>> }
>>
>
> How can I easily access this information by my application?
>
> Thank you
>
> Bye
>
> _______________________________________________
> Users mailing list
> [email protected]
> https://lists.biomart.org/mailman/listinfo/users
>
>


-- 

Arek Kasprzyk, MD, MSc, PhD
BioMart Project Lead
_______________________________________________
Users mailing list
[email protected]
https://lists.biomart.org/mailman/listinfo/users

Reply via email to