All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.actelion.research.chem.descriptor.flexophore.PPNodeVizHelper Maven / Gradle / Ivy

There is a newer version: 2024.11.2
Show newest version
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.generator.MultCoordFragIndex;
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 PPNodeVizMultCoord createWithoutCoordinates(MultCoordFragIndex multCoordFragIndex, int indexPPPoint, Molecule3D mol){
        PPNodeViz ppNodeViz = new PPNodeViz();
        ppNodeViz.setIndex(indexPPPoint);
        for (int index : multCoordFragIndex.getArrIndexFrag()) {
            int interactionType = mol.getInteractionAtomType(index);
            ppNodeViz.add(interactionType);
            ppNodeViz.addIndexOriginalAtom(index);
        }
        ppNodeViz.realize();

        PPNodeVizMultCoord nodeVizMultCoord = new PPNodeVizMultCoord(ppNodeViz, multCoordFragIndex);

        return nodeVizMultCoord;
    }
    public static PPNodeViz createWithoutCoordinates(int [] arrIndexAtomFrag, int indexPPPoint, Molecule3D mol){

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy