68 using System.Collections.Generic;
141 public void TranPDBtoDEN(
float resolution = DEFAULT_RESOLUTION,
bool cap =
true){
145 delta =
new Vector3(resolution, resolution, resolution);
150 Debug.Log(
"Entering :: Generation of density from PDB");
155 Debug.Log(
"Density point X,Y,Z :: "+ X+
","+Y+
","+Z);
157 gridS =
new float[
X,
Y,
Z];
158 VertColor =
new Color[
X,
Y,
Z];
179 VertColor[i,j,k].b=1f;
186 bool useAtomForCalc =
true;
191 useAtomForCalc =
false;
197 useAtomForCalc =
false;
234 float AtomRadius = 1f;
270 for (
int l = i-8 ;l < i+9 ; l++)
271 for (
int m = j-8 ; m < j+9 ; m++)
272 for (
int n = k-8 ; n < k+9 ; n++){
273 Vector3 v2 =
new Vector3(l,m,n);
274 Dist = Vector3.Distance(v1,v2);
275 density = (float)Math.Exp(-((Dist/AtomRadius)*(Dist/AtomRadius)));
276 if (density > gridS[l,m,n])
279 VertColor[l,m,n] = atomColor;
280 gridS[l,m,n] += density;
284 for (
int l = i-8 ;l < i+9 ; l++) {
285 for (
int m = j-8 ; m < j+9 ; m++) {
286 for (
int n = k-8 ; n < k+9 ; n++) {
287 Vector3 v2 =
new Vector3(l,m,n);
288 Dist = Vector3.Distance(v1,v2);
292 gridS[l,m,n] += (float)Math.Exp(-((Dist/bfactor)*(Dist/bfactor)));
294 gridS[l,m,n] -= (float)Math.Exp(-((Dist/bfactor)*(Dist/bfactor)));
296 if (VertColor[l,m,n].b == 1f && VertColor[l,m,n].r==0f) {
344 points =
new Vector4[ (
X) * (Y) * (
Z)];
345 colors =
new Color[(
X) * (Y) * (
Z)];
347 for (
int j = 0; j <
Y; j++) {
349 for (
int i = 0; i <
Z; i++) {
350 for (
int k = 0; k <
X; k++) {
351 points[j*(
Z)*(X) + i*(
X) + k] =
new Vector4 (k, j, i , gridS[k,j,i]);
352 colors[j*(
Z)*(X) + i*(
X) + k] = VertColor[k,j,i];
371 GC.GetTotalMemory(
true);
377 public static void initColors(
int X,
int Y,
int Z, Color col) {
378 colors =
new Color[(
X) * (Y) * (
Z)];
380 for (
int j = 0; j <
Y; j++) {
381 for (
int i = 0; i <
Z; i++) {
382 for (
int k = 0; k <
X; k++) {
383 colors[j*(
Z)*(X) + i*(
X) + k] = col;
static void initColors(int X, int Y, int Z, Color col)
static void CreateSurfaceObjects(List< Mesh > meshes, int isPos)
static bool useHetatmForSurface
static ColorObject phosphorusColor
static ColorObject carbonColor
static List< string > atomHetTypeList
void TranPDBtoDEN(float resolution=DEFAULT_RESOLUTION, bool cap=true)
const float DEFAULT_RESOLUTION
float CapResolution(float resolution)
First we lower the resolution for bigger molecules.
static void ProSurface(float seuil)
static List< AtomModel > atomsTypelist
The type of each atom.
static Color[,,] VertColor
static ColorObject nitrogenColor
static List< float > BFactorList
Bfactor of each atom.
static ColorObject hydrogenColor
static ColorObject oxygenColor
!WiP Includes FLAGS of GUI.
static Vector3 MaxValue
The "biggest" corner of the bounding box that encloses the molecule.
static Vector3 fudgeFactor
static bool useSugarForSurface
static ColorObject unknownColor
static Vector3 MinValue
The "smallest" corner of the bounding box that encloses the molecule.
static List< string > atomsResnamelist
The name of the residue to which each atom belongs.
static List< string > sugarResname
static ColorObject sulphurColor
static List< float[]> atomsLocationlist
The coordinates of each atom.