-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added to method that cleans up fragment structures
- Loading branch information
Showing
10 changed files
with
154 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
gsrs-module-substance-example/src/test/java/example/chem/VocabFragmentCleanupTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package example.chem; | ||
|
||
import gov.nih.ncats.molwitch.Chemical; | ||
import ix.core.chem.Chem; | ||
import ix.ginas.models.v1.FragmentVocabularyTerm; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
|
||
@Slf4j | ||
public class VocabFragmentCleanupTest { | ||
|
||
@Test | ||
void testQueryFeatures() throws IOException { | ||
FragmentVocabularyTerm fragmentVocabularyTerm = new FragmentVocabularyTerm(); | ||
fragmentVocabularyTerm.setFragmentStructure("[*]N[C@@H](CS[*])C([*])=O |$_R1;;;;;_R3;;_R2;$|"); | ||
String inputStructure = fragmentVocabularyTerm.getFragmentStructure().split(" ")[0]; | ||
Chemical chem = Chemical.parse(inputStructure); | ||
chem = Chem.RemoveQueryFeaturesForPseudoInChI(chem); | ||
String inchiKey = chem.toInchi().getKey(); | ||
log.debug("Created InChIKey: {}", inchiKey); | ||
Assertions.assertTrue(inchiKey.length()>0); | ||
} | ||
|
||
@Test | ||
void testOutput() throws IOException { | ||
FragmentVocabularyTerm fragmentVocabularyTerm = new FragmentVocabularyTerm(); | ||
fragmentVocabularyTerm.setFragmentStructure("[*]N[C@@H](CS[*])C([*])=O |$_R1;;;;;_R3;;_R2;$|"); | ||
String inputStructure = fragmentVocabularyTerm.getFragmentStructure().split(" ")[0]; | ||
Chemical chem = Chemical.parse(inputStructure); | ||
chem = Chem.RemoveQueryFeaturesForPseudoInChI(chem); | ||
String smiles = chem.toSmiles(); | ||
log.debug("Created SMILES: {}", smiles); | ||
Assertions.assertTrue(smiles.length()>0); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters