use of de.ipbhalle.metfraglib.process.ProcessingStatus in project MetFragRelaunched by ipb-halle.
the class MetFusionMoNASpectralSimilarityInitialiser method initScoreParameters.
@Override
public void initScoreParameters(Settings settings) throws Exception {
/*
*
*/
// initialise MoNA web service
MoNARestWebService webService = new MoNARestWebService(settings);
((ProcessingStatus) settings.get(VariableNames.PROCESS_STATUS_OBJECT_NAME)).setProcessStatusString("Retrieving Results from MoNA");
CandidateList candidatesFromMoNA = null;
try {
candidatesFromMoNA = webService.performSpectrumSimilaritySearch();
} catch (Exception e) {
settings.set(VariableNames.METFUSION_MONA_SPECTRAL_SIMILARITY_CANDIDATES_NAME, new CandidateList());
e.printStackTrace();
return;
}
for (int i = 0; i < candidatesFromMoNA.getNumberElements(); i++) {
IBitFingerprint fingerprint = TanimotoSimilarity.calculateFingerPrint(candidatesFromMoNA.getElement(i).getAtomContainer());
candidatesFromMoNA.getElement(i).setProperty("Fingerprint", fingerprint);
}
settings.set(VariableNames.METFUSION_MONA_SPECTRAL_SIMILARITY_CANDIDATES_NAME, candidatesFromMoNA);
}
use of de.ipbhalle.metfraglib.process.ProcessingStatus in project MetFragRelaunched by ipb-halle.
the class OnlineExtendedPubChemDatabase method getCandidateByIdentifier.
/**
* @throws Exception
*/
public ICandidate getCandidateByIdentifier(String identifier) throws Exception {
ICandidate candidate = super.getCandidateByIdentifier(identifier);
if (candidate == null)
return null;
ArrayList<String> cid = new ArrayList<String>();
cid.add(identifier);
ProcessingStatus processingStatus = null;
if (this.settings.containsKey(VariableNames.PROCESS_STATUS_OBJECT_NAME) && this.settings.get(VariableNames.PROCESS_STATUS_OBJECT_NAME) != null)
processingStatus = (ProcessingStatus) this.settings.get(VariableNames.PROCESS_STATUS_OBJECT_NAME);
logger.info("Fetching PubMed references");
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving References");
this.assignNumberOfPubMedReferences(cid);
logger.info("Fetching patents");
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving Patents");
this.assignNumberOfPatents(cid);
this.addExtendedInformation(candidate);
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving Candidates");
return candidate;
}
use of de.ipbhalle.metfraglib.process.ProcessingStatus in project MetFragRelaunched by ipb-halle.
the class LocalExtendedMetChemDatabase method getCandidateByIdentifier.
public CandidateList getCandidateByIdentifier(ArrayList<String> identifiers) {
CandidateList candidateList = super.getCandidateByIdentifier(identifiers);
ArrayList<String> cids = new ArrayList<String>();
for (int i = 0; i < candidateList.getNumberElements(); i++) {
cids.add(candidateList.getElement(i).getIdentifier());
}
ProcessingStatus processingStatus = null;
if (this.settings.containsKey(VariableNames.PROCESS_STATUS_OBJECT_NAME) && this.settings.get(VariableNames.PROCESS_STATUS_OBJECT_NAME) != null)
processingStatus = (ProcessingStatus) this.settings.get(VariableNames.PROCESS_STATUS_OBJECT_NAME);
logger.info("Fetching PubMed references");
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving References");
this.assignNumberOfPubMedReferences(cids);
logger.info("Fetching patents");
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving Patents");
this.assignNumberOfPatents(cids);
logger.info("Fetching XLogP");
this.assignXlogpValues(cids);
for (int i = 0; i < candidateList.getNumberElements(); i++) {
this.addExtendedInformation(candidateList.getElement(i));
}
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving Candidates");
return candidateList;
}
use of de.ipbhalle.metfraglib.process.ProcessingStatus in project MetFragRelaunched by ipb-halle.
the class LocalExtendedPubChemDatabase method getCandidateByIdentifier.
public ICandidate getCandidateByIdentifier(String identifier) throws DatabaseIdentifierNotFoundException {
ICandidate candidate = super.getCandidateByIdentifier(identifier);
ArrayList<String> cid = new ArrayList<String>();
cid.add(identifier);
ProcessingStatus processingStatus = null;
if (this.settings.containsKey(VariableNames.PROCESS_STATUS_OBJECT_NAME) && this.settings.get(VariableNames.PROCESS_STATUS_OBJECT_NAME) != null)
processingStatus = (ProcessingStatus) this.settings.get(VariableNames.PROCESS_STATUS_OBJECT_NAME);
logger.info("Fetching PubMed references");
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving References");
this.assignNumberOfPubMedReferences(cid);
logger.info("Fetching patents");
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving Patents");
this.assignNumberOfPatents(cid);
this.assignNumberOfPatents(cid);
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving Candidates");
return candidate;
}
use of de.ipbhalle.metfraglib.process.ProcessingStatus in project MetFragRelaunched by ipb-halle.
the class OnlineExtendedPubChemDatabase method getCandidateByIdentifier.
/**
* @throws Exception
*/
public CandidateList getCandidateByIdentifier(java.util.ArrayList<String> identifiers) throws Exception {
CandidateList candidates = super.getCandidateByIdentifier(identifiers);
ArrayList<String> cids = new ArrayList<String>();
for (int i = 0; i < candidates.getNumberElements(); i++) {
cids.add(candidates.getElement(i).getIdentifier());
}
ProcessingStatus processingStatus = null;
if (this.settings.containsKey(VariableNames.PROCESS_STATUS_OBJECT_NAME) && this.settings.get(VariableNames.PROCESS_STATUS_OBJECT_NAME) != null)
processingStatus = (ProcessingStatus) this.settings.get(VariableNames.PROCESS_STATUS_OBJECT_NAME);
logger.info("Fetching PubMed references");
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving References");
this.assignNumberOfPubMedReferences(cids);
logger.info("Fetching patents");
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving Patents");
this.assignNumberOfPatents(cids);
for (int i = 0; i < candidates.getNumberElements(); i++) {
this.addExtendedInformation(candidates.getElement(i));
}
if (processingStatus != null)
processingStatus.setRetrievingStatusString("Retrieving Candidates");
return candidates;
}
Aggregations