Skip to content

Commit

Permalink
added Flexophore functionality for synthon processing
Browse files Browse the repository at this point in the history
  • Loading branch information
korffmo committed Feb 16, 2024
1 parent 13108b5 commit 46f2577
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ public List<ClusterNode> getClusterCenter(int maxDistance){
}

/**
* The distnce histograms are stored in a single array.
* The distance histograms are stored in a single array.
* @param indexAt1
* @param indexAt2
* @param arrHist
* @param arrHist a deep copy is taken.
*/
public void setDistHist(int indexAt1, int indexAt2, byte [] arrHist) {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.actelion.research.chem.descriptor.flexophore;

import com.actelion.research.chem.Molecule3D;
import com.actelion.research.chem.StereoMolecule;
import com.actelion.research.chem.descriptor.flexophore.redgraph.SubGraphIndices;

import java.util.ArrayList;
import java.util.List;

/*
Created by Modest von Korff
16/02/2024
*/
public class PPNodeVizHelper {

public static PPNodeViz createWithoutCoordinates(SubGraphIndices sgi, int indexPPPoint, Molecule3D mol){
int [] arrIndexAtomFrag = sgi.getAtomIndices();
PPNodeViz ppNodeViz = new PPNodeViz();
ppNodeViz.setIndex(indexPPPoint);
for (int index : arrIndexAtomFrag) {
int interactionType = mol.getInteractionAtomType(index);
ppNodeViz.add(interactionType);
ppNodeViz.addIndexOriginalAtom(index);
}
return ppNodeViz;
}
public static List<PPNodeViz> createWithoutCoordinates(List<SubGraphIndices> liSubGraphIndices, Molecule3D mol){
List<PPNodeViz> liPPNodeViz = new ArrayList<>();
for (int i = 0; i < liSubGraphIndices.size(); i++) {
SubGraphIndices sgi = liSubGraphIndices.get(i);
PPNodeViz ppNodeViz = createWithoutCoordinates(sgi, i, mol);
liPPNodeViz.add(ppNodeViz);
}
return liPPNodeViz;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@
import org.openmolecules.chem.conf.gen.ConformerGenerator;
import org.openmolecules.chem.conf.gen.RigidFragmentCache;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.*;

/**
* CreatorMolDistHistViz
Expand Down Expand Up @@ -460,6 +457,43 @@ public static MolDistHistViz create(List<MultCoordFragIndex> liMultCoordFragInde

return molDistHistViz;

}
public static MolDistHistViz createWithoutCoordinates(List<SubGraphIndices> liMultCoordFragIndex, Molecule3D molecule3D){

MolDistHistViz molDistHistViz = new MolDistHistViz(liMultCoordFragIndex.size(), molecule3D);

List<PPNodeViz> liPPNodeViz = new ArrayList<>();
for (int i = 0; i < liMultCoordFragIndex.size(); i++) {
SubGraphIndices sgi = liMultCoordFragIndex.get(i);

int [] arrIndexAtomFrag = sgi.getAtomIndices();

PPNodeViz ppNodeViz = new PPNodeViz();
ppNodeViz.setIndex(i);

for (int index : arrIndexAtomFrag) {
int interactionType = molecule3D.getInteractionAtomType(index);
ppNodeViz.add(interactionType);
ppNodeViz.addIndexOriginalAtom(index);
}
liPPNodeViz.add(ppNodeViz);
}

molDistHistViz.set(liPPNodeViz);

byte [] arrHistPercent = new byte [ConstantsFlexophoreGenerator.BINS_HISTOGRAM];
Arrays.fill(arrHistPercent, (byte)1);

for (int i = 0; i < liMultCoordFragIndex.size(); i++) {
for (int j = i+1; j < liMultCoordFragIndex.size(); j++) {
molDistHistViz.setDistHist(i,j,arrHistPercent);
}
}

molDistHistViz.realize();

return molDistHistViz;

}

private static Molecule3D createPharmacophorePoints(Molecule3D molecule3D, List<MultCoordFragIndex> liMultCoordFragIndex) {
Expand Down

0 comments on commit 46f2577

Please sign in to comment.