Skip to content

Commit

Permalink
Merge branch 'master' into fixInverse
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerperyea committed Nov 9, 2023
2 parents 4f3d448 + e96ad33 commit 75884dd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,23 @@ private static Chemical parseAndComputeCoordsIfNeeded(String input) throws IOExc
}
});
}
c.generateCoordinates();

// It turns out that generating coordinates for a
// structure with 2 charged species in CDK, for some reason
// fails. Looks like it has something to do with trying to put charges near each other
// to imply ionic interaction? Either way, adding 1 new free-floating moiety fixes this,
// and layout can be generated then


try {
c.generateCoordinates();
}catch(Exception e) {
Atom aa=c.addAtom("C");
c.generateCoordinates();
c.removeAtom(aa);
}



} catch (MolwitchException e) {
throw new IOException("error generating coordinates",e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ public void hash(Chemical chem, String mol, BiConsumer<String, String> keyValueC
stringBuilder.setCharAt(layerOffset, '_');
stringBuilder.setCharAt(stringBuilder.length()-2, '_');
String underscoredInsteadOfDash = stringBuilder.toString();
keyValueConsumer.accept(Structure.H_InChI_Key, underscoredInsteadOfDash);

// This used to use the underscore version for the "real" inchikey,
// but switching to use the dash form now.
keyValueConsumer.accept(Structure.H_InChI_Key, key);
keyValueConsumer.accept(Structure.H_EXACT_HASH, underscoredInsteadOfDash);
keyValueConsumer.accept(Structure.H_STEREO_INSENSITIVE_HASH, connectionOnly);
}catch(IOException e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ public String getInChIKey() {
for (Value val : this.properties) {
if(val==null) continue;
if (Structure.H_InChI_Key.equals(val.label)) {
return Objects.toString(val.getValue());
return Objects.toString(val.getValue()).replaceAll("_", "-");
}
}
return getInChIKeyAndThrow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ gsrs.renderers.list=[
}
},
{
"name" : "CLEAN1",
"name" : "MONSTRUOUS",
"renderer" :{
"preset": "CLEAN", //Note this part
"options" : {
Expand Down
2 changes: 1 addition & 1 deletion gsrs-ncats-substance-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<dependency>
<groupId>gov.nih.ncats</groupId>
<artifactId>molwitch</artifactId>
<version>0.6.3-SNAPSHOT</version>
<version>0.6.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
Expand Down

0 comments on commit 75884dd

Please sign in to comment.