Skip to content

Commit

Permalink
removed debug lines
Browse files Browse the repository at this point in the history
  • Loading branch information
dkatzel-ncats committed Oct 1, 2020
1 parent 835927b commit 90af363
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 918 deletions.
8 changes: 2 additions & 6 deletions src/test/java/TestChemicalValidation.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public void testPentavalent() throws Exception {
"M END");

long terror=c.atoms()
.peek(ca->System.out.println(ca.getValence().getAsInt()))
.filter(ca->ca.hasValenceError()).count();

assertEquals(1,terror);
Expand All @@ -80,11 +79,9 @@ public void testInchiAromatic() throws Exception {
" 5 6 4 0 0 0 0\n" +
" 4 6 4 0 0 0 0\n" +
"M END");

System.out.println(c.toMol());

InChiResult result = c.toInchi();
String key = result.getKey();
System.out.println(key);
assertEquals("UHOVQNZJYSORNB-UHFFFAOYSA-N", key);


Expand Down Expand Up @@ -113,8 +110,7 @@ public void testSimplestDearomatization() throws Exception {

long l=c.bonds().filter(b->b.getBondType().equals(BondType.SINGLE) || b.getBondType().equals(BondType.DOUBLE))
.count();

System.out.println(c.toMol());

assertEquals(6,l);


Expand Down
56 changes: 11 additions & 45 deletions src/test/java/TestChiralRead.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.IOException;
import java.util.Collections;
import java.util.List;
import static org.junit.Assert.assertFalse;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

import org.junit.Test;
Expand Down Expand Up @@ -186,16 +182,14 @@ public void ensureChiralityIsTheSameRegardlessOfSDFOrMolOrAgnosticRead() throws
" 67 69 2 0 0 0 0\n" +
"M END";
Chemical c=Chemical.parse(mm);

System.out.println(mm);


String genChiral = c.atoms()
.map(ca->ca.getChirality())
.filter(ch->!ch.equals(Chirality.Non_Chiral))
.map(ch->ch.toString())
.collect(Collectors.joining());

System.out.println("CHIRALITY FROM GENERIC PARSE:" + genChiral);


c=Chemical.parseMol(mm);
String molChiral = c.atoms()
Expand All @@ -204,7 +198,6 @@ public void ensureChiralityIsTheSameRegardlessOfSDFOrMolOrAgnosticRead() throws
.map(ch->ch.toString())
.collect(Collectors.joining());

System.out.println("CHIRALITY FROM MOL PARSE:" + molChiral);

c=new Chemical(ChemicalReaderFactory.read("sdf", mm + "\n$$$$"));

Expand All @@ -213,8 +206,7 @@ public void ensureChiralityIsTheSameRegardlessOfSDFOrMolOrAgnosticRead() throws
.filter(ch->!ch.equals(Chirality.Non_Chiral))
.map(ch->ch.toString())
.collect(Collectors.joining());

System.out.println("CHIRALITY FROM SDF PARSE:" + sdfChiral);


assertEquals(genChiral,molChiral);
assertEquals(genChiral,sdfChiral);
Expand Down Expand Up @@ -263,10 +255,6 @@ public void testSimpleTetrahedralStereoMarkedAsCenter() throws Exception {
" 2 5 1 0 0 0 0\n" +
"M END\n" +
"");
// c1.getAllStereocenters()
// .forEach(s->{
// System.out.println(s.getChirality());
// });

Optional<Chirality> opChi=c1.getAllStereocenters().stream()
.map(ca->ca.getChirality())
Expand All @@ -275,12 +263,6 @@ public void testSimpleTetrahedralStereoMarkedAsCenter() throws Exception {
assertEquals(Chirality.Parity_Either, opChi.get());
}



/*
*/

@Test
public void testSimpleTetrahedralStereoMarked2() throws Exception {
Chemical c1=Chemical.parse("\n" +
Expand Down Expand Up @@ -427,8 +409,7 @@ public void testRemoveNonDescriptHydrogensDoesntRemoveStereoInformationOnMol() t
if(!mol2.hasCoordinates()){
mol2.generateCoordinates();
}
System.out.println(mol2.hasCoordinates());
System.out.println(mol2.toMol());

mol2.removeNonDescriptHydrogens();
mol2.generateCoordinates();
mol2=Chemical.parse(mol2.toMol());
Expand Down Expand Up @@ -467,7 +448,7 @@ public void testReadingSmilesShouldNotGenerateCoordinates() throws Exception {
Chemical mol2= Chemical.createFromSmiles(mol.toSmiles());


assertEquals("false", mol2.hasCoordinates()+"");
assertFalse(mol2.hasCoordinates());
}


Expand Down Expand Up @@ -510,12 +491,8 @@ public void testSimpleExtendedTetrahedralStereoMarkedAsCenter() throws Exception
" 3 6 1 6 0 0 0\n" +
" 3 7 1 1 0 0 0\n" +
"M END");
// c1.getAllStereocenters()
// .forEach(s->{
// System.out.println(s);
// System.out.println(s.getChirality());
// });
//


Optional<Chirality> opChi=c1.getAllStereocenters().stream()
.map(ca->ca.getChirality())
.findFirst();
Expand Down Expand Up @@ -547,12 +524,7 @@ public void testSimpleTetrahedralStereoOnQuatAmineMarkedAsCenter() throws Except
"M CHG 1 2 1\n" +
"M END\n" +
"");
// c1.getAllStereocenters()
// .forEach(s->{
// System.out.println(s);
// System.out.println(s.getChirality());
// });
//

Optional<Chirality> opChi=c1.getAllStereocenters().stream()
.map(ca->ca.getChirality())
.findFirst();
Expand All @@ -562,17 +534,11 @@ public void testSimpleTetrahedralStereoOnQuatAmineMarkedAsCenter() throws Except
@Test
public void testQueryStructureSimpleTetrahedralStereoDoesntError() throws Exception {
Chemical c1=Chemical.parse("S(=O)(=O)(O)O-C-[#6]");
// c1.getAllStereocenters()
// .forEach(s->{
// System.out.println(s);
// System.out.println(s.getChirality());
// });
//

Optional<Chirality> opChi=c1.getAllStereocenters().stream()
.map(ca->ca.getChirality())
.findFirst();
assertTrue(!opChi.isPresent());
// assertEquals(Chirality.Parity_Either, opChi.get());
assertFalse(opChi.isPresent());
}

}
Loading

0 comments on commit 90af363

Please sign in to comment.