Open cmgrulke opened 3 years ago
This code snippet might help.
for(String name : names){ //for each gsid we need to get the cas and print
count++;
OpsinResult opsR = nts.parseChemicalName(name);
Molecule mol = new Molecule();
if(opsR.getSmiles()!=null){
mol = MolImporter.importMol(opsR.getSmiles());
}
mol.setProperty("Input_Name",name);
mol.setProperty("Message",opsR.getMessage());
molExp.write(mol);
completePercent = (int) (100*Float.valueOf(count)/Float.valueOf(size));
}
As a developer I want a Name2Structure conversion microservice So that I can use it to complete ticket #154
OPSIN is a nice java package that will perform name to structure conversions. I currently use it in old ChemReg. https://opsin.ch.cam.ac.uk/. However, it is a java package and won't place nice with our python flask code. Therefore, we need to wrap it in a simple RESTful API and call it.
GET https://api.chemreg.epa.gov/name2Structure?name=$$$$$$$
Acceptance Criteria:
Test: