Package metlin

Examples of metlin.LineInfo


    final String token = parameters.getParameter(
        MetLinParameters.SECURITY_TOKEN).getValue();

    MetaboliteSearchRequest searchParams = new MetaboliteSearchRequest(
        token, searchMass, adduct, searchTolerance, "Da");
    LineInfo resultsData[][];
    try {
      resultsData = serv.metaboliteSearch(searchParams);
    } catch (AxisFault e) {
      // For some reason, the METLIN SOAP gateway throws AxisFault caused
      // by ArrayStoreException if no result is found. I suspect their
      // SOAP response is malformed and Axis does not like it.
      resultsData = new LineInfo[1][0];
    }

    if (resultsData.length == 0) {
      throw (new IOException("Results could not be retrieved from METLIN"));

    }
    final int totalResults = Math.min(resultsData[0].length, numOfResults);
    String metlinIDs[] = new String[totalResults];

    for (int i = 0; i < totalResults; i++) {
      LineInfo metlinEntry = resultsData[0][i];
      String metlinID = metlinEntry.getMolid();
      retrievedMolecules.put(metlinID, metlinEntry);
      metlinIDs[i] = metlinID;
    }

    return metlinIDs;
View Full Code Here


  public DBCompound getCompound(String ID, ParameterSet parameters)
      throws IOException {

    URL entryURL = new URL(metLinEntryAddress + ID);

    LineInfo metlinEntry = retrievedMolecules.get(ID);

    if (metlinEntry == null) {
      throw new IOException("Unknown ID " + ID);
    }

    String compoundName = metlinEntry.getName();

    if (compoundName == null) {
      throw (new IOException(
          "Could not parse compound name for compound " + ID));
    }

    String compoundFormula = metlinEntry.getFormula();

    URL structure2DURL = new URL(metLinStructureAddress1 + ID
        + metLinStructureAddress2);

    URL structure3DURL = null;
View Full Code Here

TOP

Related Classes of metlin.LineInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.