SurfaceColoring: examples of typical usages
- Built-in CPK coloring (new method):
SurfaceColoring sc = new SurfaceColoring(molecules, surface, atomGrid.getStepX());
sc.doColoring(SurfaceColoring.BUILT_IN_CPK_MAPPING);
- Built-in residue coloring (new method):
SurfaceColoring sc = new SurfaceColoring(molecules, surface, atomGrid.getStepX());
sc.doColoring(SurfaceColoring.BUILT_IN_RESIDUE_MAPPING);
- Built-in chain coloring (new method):
SurfaceColoring sc = new SurfaceColoring(molecules, surface, atomGrid.getStepX());
sc.doColoring(SurfaceColoring.BUILT_IN_CHAIN_MAPPING);
- Coloring by parametrized built-in electrostaic potential property and built-in colors (new method):
SurfaceColoring sc = new SurfaceColoring( molecules, surface, atomGrid.getStepX() );
sc.setEnrtyRadiusMode( SurfaceColoring.RADIUS_VDW_EXTENDED );
surfaceColoring.setAtomRadiusExtension( 1 );
sc.setPropertyValueDecreasement( SurfaceColoring.DECREASE_RECIPROCAL_SQUARE );
sc.setReciprocalConstant( 8.854 );
sc.setWeightMode( SurfaceColoring.SUM_OF_VALUES );
sc.setBuiltInColorMapperMethod(SurfaceColoring.COLOR_MAPPER_RED_AND_BLUE);
sc.setPropertyMethod( MoleculeIterators.AtomPropertyInterface.class.getMethod(
"getPartialAtomCharge", new Class[] {int.class} ) );
sc.doColoring();
- Coloring by custom property and built-in rainbow colors:
SurfaceColoring sc = new SurfaceColoring(molecules, surface, atomGrid.getStepX());
sc.setWeightMode( SurfaceColoring.DISTANCE_WEIGHTED );
sc.setPropertyMethod( MoleculeIterators.AtomPropertyInterface.class.getMethod(
"getType", new Class[] {int.class} ) );
sc.setBuiltInColorMapperMethod( SurfaceColoring.COLOR_MAPPER_RAINBOW );
sc.doColoring();
- Coloring by custom property and parametrized colors:
SurfaceColoring sc = new SurfaceColoring(molecules, surface, atomGrid.getStepX());
sc.setWeightMode( SurfaceColoring.DISTANCE_WEIGHTED );
sc.setPropertyMethod( MoleculeIterators.AtomPropertyInterface.class.getMethod(
"getType", new Class[] {int.class} ) );
sc.setHomogeneousPaletteColors( new byte[][] {Colors.lightgray, Colors.yellow} );
sc.doColoring();
- Coloring by custom property and custom colors:
chemaxon.marvin.space.util.Palette palette =
new chemaxon.marvin.space.util.Palette(0, 16);
palette.clear();
palette.putColor( Colors.lightgray );
palette.putColor( Colors.yellow );
SurfaceColoring sc = new SurfaceColoring(molecules, surface, atomGrid.getStepX());
sc.setWeightMode( SurfaceColoring.DISTANCE_WEIGHTED );
sc.setPropertyMethod( MoleculeIterators.AtomPropertyInterface.class.getMethod(
"getType", new Class[] {int.class} ) );
sc.setPropertyColorMapperMethod(
chemaxon.marvin.space.util.Palette.class.getMethod("getByteColor", new Class[] {double.class}) );
sc.setPropertyColorObject(palette);
sc.doColoring();
- Coloring by custom values of a custom object and built-in coloring:
SurfaceColoring sc = new SurfaceColoring( molecules, surface, atomGrid.getStepX() );
sc.setPropertyObject( myGrid );
sc.setPropertyMethod( MyGrid.class.getMethod( "getLinearWeightedValue", new Class[] {float.class, float.class, float.class} ) );
sc.setBuiltInColorMapperMethod( SurfaceColoring.COLOR_MAPPER_RAINBOW );
sc.doColoring();
- Built-in CPK coloring (old method):
acg = new AtomTypeColorGrid(molecules, atomGrid, surfaceType, coalColorStyle);
acg.coloringSurface(surface);
- Built-in residue coloring (old method):
ResidueTypeColorGrid rcg = new ResidueTypeColorGrid(molecules, atomGrid, surfaceType);
rcg.coloringSurface( surface );
- Built-in chain coloring (old method):
ChainTypeColorGrid ccg = new ChainTypeColorGrid(molecules, atomGrid, surfaceType);
ccg.coloringSurface( surface );
- Built-in electrostatic potential coloring (old method):
epPropertyGrid = new ElectrostaticPotentialGrid(atomGrid);
for( java.util.Iterator i = molecules.iterator(); i.hasNext(); ) {
MoleculeIterators.MoleculeInterface mv =
(MoleculeIterators.MoleculeInterface)i.next();
((ElectrostaticPotentialGrid)epPropertyGrid).setMolecule( mv );
}
epPropertyGrid.coloringSurface( surface );