Skip to content

Commit

Permalink
beginning of creating warnings for SGroups with extranous atoms withi…
Browse files Browse the repository at this point in the history
…n the boundaries of their brackets
  • Loading branch information
ChemMitch committed Jun 18, 2024
1 parent 6cab4aa commit 5dd09cf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 28 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
<dependency>
<groupId>gov.nih.ncats</groupId>
<artifactId>smsd-core</artifactId>
<version>2.2.3</version>
<version>2.2.4</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
Expand All @@ -258,7 +258,7 @@
<dependency>
<groupId>gov.nih.ncats</groupId>
<artifactId>smsd-exec</artifactId>
<version>2.2.3</version>
<version>2.2.4</version>
</dependency>
</dependencies>

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/gov/nih/ncats/molwitch/cdk/CdkChemicalImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@

import javax.vecmath.Tuple2d;

import org.junit.Assert;
import org.openscience.cdk.AtomRef;
import org.openscience.cdk.BondRef;
import org.openscience.cdk.CDKConstants;
Expand Down Expand Up @@ -2489,7 +2488,9 @@ public List<String> getSGroupWarnings() {
List<String> messages = new ArrayList<>();
AtomicInteger counter = new AtomicInteger(0);
this.getSGroups().forEach(sg->{
Assert.assertEquals(2, sg.getBrackets().size());
if(sg.getBrackets().size() != 2 ){
Logger.getLogger(CdkChemicalImpl.class.getName()).warning("Expecting SGroups to have 2 brackets. This one has " + sg.getBrackets().size());
}
Logger.getLogger(CdkChemicalImpl.class.getName()).fine(String.format("looking at SGroup %d with %d atoms bracket 0 x: %.2f; y: %.2f; bracket 1 x: %.2f; y: %.2f\n",
counter.incrementAndGet(), sg.getAtoms().count(), sg.getBrackets().get(0).getPoint1().getX(), sg.getBrackets().get(0).getPoint1().getY(),
sg.getBrackets().get(1).getPoint1().getX(), sg.getBrackets().get(1).getPoint1().getY()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,19 @@

package gov.nih.ncats.molwitch.cdk.writer;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Properties;
import java.util.function.Function;

import javax.vecmath.Point2d;
import javax.vecmath.Point3d;

import gov.nih.ncats.molwitch.cdk.CdkUtil;
import org.apache.xpath.operations.Bool;
import org.openscience.cdk.aromaticity.Aromaticity;
import org.openscience.cdk.aromaticity.ElectronDonation;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.graph.Cycles;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.io.IChemObjectWriter;
import org.openscience.cdk.io.listener.PropertiesListener;

import gov.nih.ncats.molwitch.io.ChemFormat.AromaticAwareChemFormatWriterSpecification;
import gov.nih.ncats.molwitch.io.ChemFormat.ChemFormatWriterSpecification;
import gov.nih.ncats.molwitch.io.ChemFormat.KekulizationEncoding;
import gov.nih.ncats.molwitch.io.ChemFormat.MolFormatSpecification;
import gov.nih.ncats.molwitch.io.ChemFormat.MolFormatSpecification.Version;
import gov.nih.ncats.molwitch.spi.ChemicalWriterImpl;
import gov.nih.ncats.molwitch.spi.ChemicalWriterImplFactory;
import org.openscience.cdk.io.setting.IOSetting;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.io.IChemObjectWriter;
import org.openscience.cdk.io.listener.PropertiesListener;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Properties;
import java.util.function.Function;

public abstract class AbstractMdlWriterFactory implements ChemicalWriterImplFactory{

Expand Down

0 comments on commit 5dd09cf

Please sign in to comment.