String pklDir = "E:\\FG\\FTICRDATA\\140815";
ArrayList<String> theBSPropertyNames = new ArrayList<>();
theBSPropertyNames.add("SciName");
theBSPropertyNames.add("Biological_Source");
IMoleculeSet theResultMoleculeSet = new MoleculeSet();
double theTolerance = 0.0005;
IMoleculeSet inputMolSet = new MoleculeSet();
inputMolSet.add(ModifyClass.readFolderWithTag(theGinsengMoleculeFolder, "SciName", "Panax ginseng"));
inputMolSet.add(ModifyClass.readFolderWithTag(theLamMoleculeFolder, "SciName", "Laminaria japonica"));
inputMolSet.add(ModifyClass.readFolderWithTag(theScutellariaMoleculeFolder, "SciName", "Scutellaria baicalensis"));
inputMolSet.add(ModifyClass.readFolderWithTag(thePoriaMoleculeFolder, "SciName", "Poria cocos"));
inputMolSet.add(ModifyClass.readFolderWithTag(theOphiopogonMoleculeFolder, "SciName", "Ophiopogon japonicus"));
for (File[] theInputMoleculeFolder : theFileLists) {
String theDBSourceText = theInputMoleculeFolder[0].getParent().split("\\\\")[3];
for (File inputSDF : theInputMoleculeFolder) {
try {
IteratingMDLReader reader = new IteratingMDLReader(new FileInputStream(inputSDF), DefaultChemObjectBuilder.getInstance());
while (reader.hasNext()) {
inputMolSet.addMolecule((IMolecule) reader.next());
//inputMolSet.getAtomContainer(inputMolSet.getMoleculeCount()).setProperty("DBSourceText", theDBSourceText);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
/*
try {
IteratingMDLReader reader = new IteratingMDLReader(new FileInputStream(theInputMoleculeFile), DefaultChemObjectBuilder.getInstance());
while (reader.hasNext()) {
inputMolSet.addMolecule((IMolecule) reader.next());
}
} catch (Exception e) {
e.printStackTrace();
}
String[] drg = {"Platycodon grandiflorum"};
String[] sbc = {"Saururus chinensis", "Houttuynia cordata"};
String[] hso = {"Polygonum multiflorum"};
*/
//Main.calculateExactMass(inputMolSet, "IDE.MF");
Module.addHydrogen(inputMolSet, "cdkErrors.txt");
ModifyClass.setMF(inputMolSet);
ModifyClass.calculateExactMass(inputMolSet, "Molecular_Formula");
//Main.calculateExactMass(inputMolSet, "Formula");
//inputMolSet = Main.getMoleculesWithMuchInfo(inputMolSet);
//inputMolSet = Main.filterMoleculeByBiologicalSource(inputMolSet, "SciName", drg);
System.out.println("found " + inputMolSet.getMoleculeCount());
//inputMolSet = Main.filterMoleculeByBiologicalSource(inputMolSet, "Biological_Source", sbc);
/*
for (String[] theBSText : Main.readBScsv(theBSInformationFile)){
ArrayList<String> theFilterString = new ArrayList<>();
for (int i = 2; i<theBSText.length; i++){