[biomart-users] registry file to access HGNC biomart service

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

[biomart-users] registry file to access HGNC biomart service

lewicki.birgit
Hello,

I'm trying to query the HGNC Biomart service via the Biomart Java API.
My question for that is how can I create the registry file for the new
HGNC Biomart service.

Before HGNC released the new Biomart at biomart.genenames.org I could
create the registry file with the MartConfigurator that is provided by
www.biomart.org together with their Java API. There I entered as host
www.genenames.org and as path /biomart/martservice.

This does not work anymore with the new HGNC Biomart. Trying to enter as
host biomart.genenames.org and as path /biomart/martservice does not
give me any result. I guess the path is wrong. It also appears
differently in the URL
http://biomart.genenames.org/martform/#!/default/HGNC?datasets=hgnc_gene_mart.

Please tell me how I can create the registry xml file that I need to
give in the example code below:


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("hgnc_gene_mart",
"hgnc_gene_config");
        ds.addFilter("hgnc_gene__ensembl_gene__ensembl_gene_id_104",
"ENSG00000127720,ENSG00000275852,ENSG00000224440,ENSG00000261140,ENSG00000221200,ENSG00000237787,ENSG00000051596,ENSG00000250532,ENSG00000236211,ENSG00000214684");
        ds.addAttribute("hgnc_gene__hgnc_gene_id_1010");
        ds.addAttribute("hgnc_gene__status_1010");
        ds.addAttribute("hgnc_gene__approved_symbol_1010");
        ds.addAttribute("hgnc_gene__approved_name_1010");
        ds.addAttribute("hgnc_gene__ncbi_gene__gene_id_1026");
        ds.addAttribute("hgnc_gene__ensembl_gene__ensembl_gene_id_104");

        // Print to System.out, but you can pass in any java.io.OutputStream
        query.getResults(System.out);

        System.exit(0);
    }
}

Thanks and regards

Birgit Lewicki
Qiagen GmbH

--
You received this message because you are subscribed to the Google Groups "biomart-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at http://groups.google.com/group/biomart-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [biomart-users] registry file to access HGNC biomart service

Syed Haider-5
hi Birgit,

It appears HGNC is now setup on BioMart v0.9, and therefore you would need to access it through v0.9 webservice request as shown on this page:


Best,
Syed

On 26 October 2015 at 12:53, lewicki.birgit <[hidden email]> wrote:
Hello,

I'm trying to query the HGNC Biomart service via the Biomart Java API.
My question for that is how can I create the registry file for the new
HGNC Biomart service.

Before HGNC released the new Biomart at biomart.genenames.org I could
create the registry file with the MartConfigurator that is provided by
www.biomart.org together with their Java API. There I entered as host
www.genenames.org and as path /biomart/martservice.

This does not work anymore with the new HGNC Biomart. Trying to enter as
host biomart.genenames.org and as path /biomart/martservice does not
give me any result. I guess the path is wrong. It also appears
differently in the URL
http://biomart.genenames.org/martform/#!/default/HGNC?datasets=hgnc_gene_mart.

Please tell me how I can create the registry xml file that I need to
give in the example code below:


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("hgnc_gene_mart",
"hgnc_gene_config");
        ds.addFilter("hgnc_gene__ensembl_gene__ensembl_gene_id_104",
"ENSG00000127720,ENSG00000275852,ENSG00000224440,ENSG00000261140,ENSG00000221200,ENSG00000237787,ENSG00000051596,ENSG00000250532,ENSG00000236211,ENSG00000214684");
        ds.addAttribute("hgnc_gene__hgnc_gene_id_1010");
        ds.addAttribute("hgnc_gene__status_1010");
        ds.addAttribute("hgnc_gene__approved_symbol_1010");
        ds.addAttribute("hgnc_gene__approved_name_1010");
        ds.addAttribute("hgnc_gene__ncbi_gene__gene_id_1026");
        ds.addAttribute("hgnc_gene__ensembl_gene__ensembl_gene_id_104");

        // Print to System.out, but you can pass in any java.io.OutputStream
        query.getResults(System.out);

        System.exit(0);
    }
}

Thanks and regards

Birgit Lewicki
Qiagen GmbH

--
You received this message because you are subscribed to the Google Groups "biomart-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at http://groups.google.com/group/biomart-users.
For more options, visit https://groups.google.com/d/optout.



--
<font color="green">Please consider environment before you print this!</font>

--
You received this message because you are subscribed to the Google Groups "biomart-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at http://groups.google.com/group/biomart-users.
For more options, visit https://groups.google.com/d/optout.