Search in sources :

Example 1 with BiomartEnsemblNcbiObjectGenerator

use of ubic.gemma.core.loader.protein.biomart.BiomartEnsemblNcbiObjectGenerator in project Gemma by PavlidisLab.

the class StringBiomartProteinConverterTest method setUp.

@Before
public void setUp() {
    String fileNameBiomartmouse = "/data/loader/protein/biomart/biomartmmusculusShort.txt";
    URL fileNameBiomartmouseURL = this.getClass().getResource(fileNameBiomartmouse);
    File taxonBiomartFile = new File(fileNameBiomartmouseURL.getFile());
    Taxon taxon = Taxon.Factory.newInstance();
    taxon.setIsGenesUsable(true);
    taxon.setNcbiId(10090);
    taxon.setScientificName("Mus musculus");
    taxon.setIsSpecies(true);
    taxa.add(taxon);
    try {
        BiomartEnsemblNcbiObjectGenerator biomartEnsemblNcbiObjectGenerator = new BiomartEnsemblNcbiObjectGenerator();
        biomartEnsemblNcbiObjectGenerator.setBioMartFileName(taxonBiomartFile);
        Map<String, Ensembl2NcbiValueObject> map = biomartEnsemblNcbiObjectGenerator.generate(taxa);
        stringBiomartProteinConverter = new StringProteinProteinInteractionConverter(map);
    } catch (Exception e) {
        e.printStackTrace();
        fail();
    }
    stringProteinProteinInteractionOne = new StringProteinProteinInteraction("ENSMUSP00000111623", "ENSMUSP00000100396");
    StringProteinProteinInteraction stringProteinProteinInteractionTwo = new StringProteinProteinInteraction("ENSMUSP00000100395", "ENSMUSP00000100396");
    StringProteinProteinInteraction stringProteinProteinInteractionThree = new StringProteinProteinInteraction("ENSMUSP00000100407", "ENSMUSP00000100395");
    // add them to array
    stringProteinProteinInteractions.add(stringProteinProteinInteractionOne);
    stringProteinProteinInteractions.add(stringProteinProteinInteractionTwo);
    stringProteinProteinInteractions.add(stringProteinProteinInteractionThree);
}
Also used : Ensembl2NcbiValueObject(ubic.gemma.core.loader.protein.biomart.model.Ensembl2NcbiValueObject) BiomartEnsemblNcbiObjectGenerator(ubic.gemma.core.loader.protein.biomart.BiomartEnsemblNcbiObjectGenerator) Taxon(ubic.gemma.model.genome.Taxon) File(java.io.File) URL(java.net.URL) StringProteinProteinInteraction(ubic.gemma.core.loader.protein.string.model.StringProteinProteinInteraction) Before(org.junit.Before)

Example 2 with BiomartEnsemblNcbiObjectGenerator

use of ubic.gemma.core.loader.protein.biomart.BiomartEnsemblNcbiObjectGenerator in project Gemma by PavlidisLab.

the class StringProteinInteractionLoader method getIdMappings.

/**
 * @param ensembl2entrezMappingFile mapping file
 * @param taxa                      taxa
 * @return map between Ensembl peptide IDs and NCBI gene ids understood by Gemma.
 * @throws IOException io problems
 */
private Map<String, Ensembl2NcbiValueObject> getIdMappings(File ensembl2entrezMappingFile, Collection<Taxon> taxa) throws IOException {
    // retrieve a map of biomart objects keyed on ensembl peptide id to use as map between entrez gene ids and
    // ensemble ids
    BiomartEnsemblNcbiObjectGenerator biomartEnsemblNcbiObjectGenerator = new BiomartEnsemblNcbiObjectGenerator();
    biomartEnsemblNcbiObjectGenerator.setBioMartFileName(ensembl2entrezMappingFile);
    return biomartEnsemblNcbiObjectGenerator.generate(taxa);
}
Also used : BiomartEnsemblNcbiObjectGenerator(ubic.gemma.core.loader.protein.biomart.BiomartEnsemblNcbiObjectGenerator)

Aggregations

BiomartEnsemblNcbiObjectGenerator (ubic.gemma.core.loader.protein.biomart.BiomartEnsemblNcbiObjectGenerator)2 File (java.io.File)1 URL (java.net.URL)1 Before (org.junit.Before)1 Ensembl2NcbiValueObject (ubic.gemma.core.loader.protein.biomart.model.Ensembl2NcbiValueObject)1 StringProteinProteinInteraction (ubic.gemma.core.loader.protein.string.model.StringProteinProteinInteraction)1 Taxon (ubic.gemma.model.genome.Taxon)1