⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 proteinpocketfinder.java

📁 化学图形处理软件
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
			dimL = dimM;		}		Vector line = new Vector();		int pspEvent = 0;		int m = 0;		for (int j = dimM; j >= 1; j--) {// z			line.removeAllElements();			pspEvent = 0;			for (int k = 0; k <= dimK; k++) {// min -> max; y				m = dimM;// m==x				line.removeAllElements();				pspEvent = 0;				for (int l = dimL; l >= 0; l--) {// z					//gridPoints++;					if (grid[m][k][l] < 0) {						if (pspEvent < 2) {							line.removeAllElements();							pspEvent = 1;						} else if (pspEvent == 2) {							firePSPEvent(line);							line.removeAllElements();							pspEvent = 1;						}					} else {						if (pspEvent == 1 | pspEvent == 2) {							line.add(new Point3d(m, k, l));							pspEvent = 2;						}					}					m--;				}// for l			}			dimL = j;		}		// logger.debug(" #gridPoints>"+gridPoints);	}	/**	 * Method performs a scan; works only for cubic grids!	 *	 * @param dimK first dimension 	 * @param dimL second dimension 	 * @param dimM third dimension	 */	public void diagonalAxisScanYXZ(int dimK, int dimL, int dimM) {		// y min -> y max; left lower corner z max->min, x min->max//2		// logger.debug.print(" diagonalAxisScanYXZ");		//int gridPoints = 0;//Debugging		if (dimM < dimL) {			dimL = dimM;		} else {			dimM = dimL;		}		Vector line = new Vector();		int pspEvent = 0;		int l = 0;		for (int j = dimL; j >= 1; j--) {// z			line.removeAllElements();			pspEvent = 0;			for (int k = 0; k <= dimK; k++) {// min -> max; y				line.removeAllElements();				pspEvent = 0;				l = 0;// x				for (int m = dimM; m >= 0; m--) {// z					//gridPoints++;					if (grid[l][k][m] < 0) {						if (pspEvent < 2) {							line.removeAllElements();							pspEvent = 1;						} else if (pspEvent == 2) {							firePSPEvent(line);							line.removeAllElements();							pspEvent = 1;						}					} else {						if (pspEvent == 1 | pspEvent == 2) {							line.add(new Point3d(l, k, m));							pspEvent = 2;						}					}					l++;				}// for m;z			}// for k;y			dimM = j;		}		// logger.debug(" #gridPoints>"+gridPoints);	}	/**	 * Method performs a scan; works only for cubic grids!	 *	 * @param dimK first dimension	 * @param dimL second dimension	 * @param dimM third dimension	 */	public void diagonalAxisScanXYZ(int dimK, int dimL, int dimM) {		// x min -> xmax;left lower corner z max->min, y min->max//3		// logger.debug.print(" diagonalAxisScanXYZ");		//int gridPoints = 0;//Debugging		if (dimM < dimL) {			dimL = dimM;		} else {			dimM = dimL;		}		Vector line = new Vector();		int pspEvent = 0;		int l = 0;		for (int j = dimL; j >= 1; j--) {// z			line.removeAllElements();			pspEvent = 0;			for (int k = 0; k <= dimK; k++) {// min -> max;x				line.removeAllElements();				pspEvent = 0;				l = 0;// y				for (int m = dimM; m >= 0; m--) {// z					//gridPoints++;					if (grid[k][l][m] < 0) {						if (pspEvent < 2) {							line.removeAllElements();							pspEvent = 1;						} else if (pspEvent == 2) {							firePSPEvent(line);							line.removeAllElements();							pspEvent = 1;						}					} else {						if (pspEvent == 1 | pspEvent == 2) {							line.add(new Point3d(k, l, m));							pspEvent = 2;						}					}					l++;				}// for m;z			}// for k;x			dimM = j;		}		// logger.debug(" #gridPoints>"+gridPoints);	}	/**	 * Method performs a scan; works only for cubic grids!	 *	 * @param dimK first dimension	 * @param dimL second dimension	 * @param dimM third dimension	 */	public void axisScanX(int dimK, int dimL, int dimM) {		// z,y,x//		logger.debug.print("	diagonalAxisScanX");		//int gridPoints = 0;//Debugging		Vector line = new Vector();		int pspEvent = 0;		for (int k = 0; k <= dimK; k++) {			line.removeAllElements();			pspEvent = 0;			for (int l = 0; l <= dimL; l++) {				line.removeAllElements();				pspEvent = 0;				for (int m = 0; m <= dimM; m++) {					//gridPoints++;					if (grid[m][l][k] < 0) {						if (pspEvent < 2) {							pspEvent = 1;							line.removeAllElements();						} else if (pspEvent == 2) {							firePSPEvent(line);							line.removeAllElements();							pspEvent = 1;						}					} else {						if (pspEvent == 1 | pspEvent == 2) {							line.add(new Point3d(m, l, k));							pspEvent = 2;						}					}				}			}		}//		logger.debug(" #gridPoints>" + gridPoints);	}	/**	 * Method performs a scan; works only for cubic grids!	 *	 * @param dimK first dimension	 * @param dimL second dimension	 * @param dimM third dimension	 */	public void axisScanY(int dimK, int dimL, int dimM) {		// z,x,y		Vector line = new Vector();		int pspEvent = 0;		for (int k = 0; k <= dimK; k++) {			line.removeAllElements();			pspEvent = 0;			for (int l = 0; l <= dimL; l++) {				line.removeAllElements();				pspEvent = 0;				for (int m = 0; m <= dimM; m++) {					if (grid[l][m][k] < 0) {						if (pspEvent < 2) {							pspEvent = 1;							line.removeAllElements();						} else if (pspEvent == 2) {							// if (line.size()>2){							firePSPEvent(line);							// }							line.removeAllElements();							pspEvent = 1;						}					} else {						if (pspEvent > 0) {							line.add(new Point3d(l, m, k));							pspEvent = 2;						}					}				}			}		}	}	/**	 * Method performs a scan; works only for cubic grids!	 *	 * @param dimK first dimension	 * @param dimL second dimension	 * @param dimM third dimension	 */	public void axisScanZ(int dimK, int dimL, int dimM) {		// x,y,z		Vector line = new Vector();		int pspEvent = 0;		for (int k = 0; k <= dimK; k++) {			line.removeAllElements();			pspEvent = 0;			for (int l = 0; l <= dimL; l++) {				line.removeAllElements();				pspEvent = 0;				for (int m = 0; m <= dimM; m++) {					if (grid[k][l][m] < 0) {						if (pspEvent < 2) {							pspEvent = 1;							line.removeAllElements();						} else if (pspEvent == 2) {							firePSPEvent(line);							line.removeAllElements();							pspEvent = 1;						}					} else {						if (pspEvent > 0) {							line.add(new Point3d(k, l, m));							pspEvent = 2;						}					}				}			}		}	}	/**	 * Method which assigns van der Waals radii to the biopolymer	 * default org/openscience/cdk/config/data/pdb_atomtypes.xml	 * stored in the variable String vanDerWaalsFile.	 */	public void assignVdWRadiiToProtein() {		AtomTypeFactory atf = null;		IAtom[] atoms = AtomContainerManipulator.getAtomArray(protein);		try {			atf = AtomTypeFactory.getInstance(                vanDerWaalsFile, atoms[0].getBuilder()            );		} catch (Exception ex1) {			System.out.println("Problem with AtomTypeFactory due to:"					+ ex1.toString());		}		for (int i = 0; i < atoms.length; i++) {			try {				atf.configure(atoms[i]);			} catch (Exception ex2) {				logger.error("Problem with atf.configure due to:"						+ ex2.toString());			}		}	}	/**	 * Method writes the grid to pmesh format.	 */	public void gridToPmesh(String outPutFileName) {		try {			gridGenerator.writeGridInPmeshFormat(outPutFileName);		} catch (IOException e) {			logger.debug(e);		}	}	/**	 * Method writes the PSP points (>=minPSPocket) to pmesh format.	 */	public void pspGridToPmesh(String outPutFileName) {		try {			gridGenerator.writeGridInPmeshFormat(outPutFileName, minPSPocket);		} catch (IOException e) {			logger.debug(e);		}	}	/**	 * Method writes the protein grid points to pmesh format.	 */	public void proteinGridToPmesh(String outPutFileName) {		try {			gridGenerator.writeGridInPmeshFormat(outPutFileName, -1);		} catch (IOException e) {			logger.debug(e);		}	}	/**	 * Method writes the pockets to pmesh format.	 */	public void writePocketsToPMesh(String outPutFileName) {		try {			for (int i = 0; i < pockets.size(); i++) {// go through every				// pocket				BufferedWriter writer = new BufferedWriter(new FileWriter(						outPutFileName + "-" + i + ".pmesh"));				Vector pocket = (Vector) pockets.get(i);				writer.write(pocket.size() + "\n");				for (int j = 0; j < pocket.size(); j++) {// go through every					// grid point of the					// actual pocket					Point3d actualGridPoint = (Point3d) pocket.get(j);					Point3d coords = gridGenerator							.getCoordinatesFromGridPoint(actualGridPoint);					writer.write(coords.x + "\t" + coords.y + "\t" + coords.z							+ "\n");				}				writer.close();			}		} catch (IOException e) {			logger.debug(e);		}	}	/**	 * @return 	Returns the grid.	 */	public double[][][] getGrid() {		return grid;	}	/**	 * @param  grid The grid to set.	 */	public void setGrid(double[][][] grid) {		this.grid = grid;	}	/**	 * @return Returns the latticeConstant.	 */	public double getLatticeConstant() {		return latticeConstant;	}	/**	 * @param latticeConstant The latticeConstant to set.	 */	public void setLatticeConstant(double latticeConstant) {		this.latticeConstant = latticeConstant;	}	/**	 * @return Returns the linkageRadius.	 */	public double getLinkageRadius() {		return linkageRadius;	}	/**	 * @param linkageRadius The linkageRadius to set.	 */	public void setLinkageRadius(double linkageRadius) {		this.linkageRadius = linkageRadius;	}	/**	 * @return Returns the minPSCluster.	 */	public int getMinPSCluster() {		return minPSCluster;	}	/**	 * @param  minPSCluster The minPSCluster to set.	 */	public void setMinPSCluster(int minPSCluster) {		this.minPSCluster = minPSCluster;	}	/**	 * @return Returns the minPSPocket.	 */	public int getMinPSPocket() {		return minPSPocket;	}	/**	 * @param minPSPocket The minPSPocket to set.	 */	public void setMinPSPocket(int minPSPocket) {		this.minPSPocket = minPSPocket;	}	/**	 * @return Returns the pocketSize.	 */	public int getPocketSize() {		return pocketSize;	}	/**	 * @param pocketSize The pocketSize to set.	 */	public void setPocketSize(int pocketSize) {		this.pocketSize = pocketSize;	}	/**	 * @return Returns the protein.	 */	public IBioPolymer getProtein() {		return protein;	}	/**	 * @param protein The protein to set.	 */	public void setProtein(IBioPolymer protein) {		this.protein = protein;	}	/**	 * @return Returns the proteinInterior.	 */	public int getProteinInterior() {		return proteinInterior;	}	/**	 * @param proteinInterior The proteinInterior to set.	 */	public void setProteinInterior(int proteinInterior) {		this.proteinInterior = proteinInterior;	}	/**	 * @return Returns the rAtom.	 */	public double getRAtom() {		return rAtom;	}	/**	 * @param atom The rAtom to set.	 */	public void setRAtom(double atom) {		rAtom = atom;	}	/**	 * @return Returns the rSolvent.	 */	public double getRSolvent() {		return rSolvent;	}	/**	 * @param solvent The rSolvent to set.	 */	public void setRSolvent(double solvent) {		rSolvent = solvent;	}	/**	 * @return Returns the solvantValue.	 */	public int getSolvantValue() {		return solvantValue;	}	/**	 * @param solvantValue The solvantValue to set.	 */	public void setSolvantValue(int solvantValue) {		this.solvantValue = solvantValue;	}	/**	 * @return Returns the vanDerWaalsFile.	 */	public String getVanDerWaalsFile() {		return vanDerWaalsFile;	}	/**	 * @param vanDerWaalsFile The vanDerWaalsFile to set.	 */	public void setVanDerWaalsFile(String vanDerWaalsFile) {		this.vanDerWaalsFile = vanDerWaalsFile;	}	/**	 * @return 	Returns the pockets.	 */	public Vector getPockets() {		return pockets;	}	/**	 * @param atomCheckRadius The atomCheckRadius to set.	 */	public void setAtomCheckRadius(double atomCheckRadius) {		this.atomCheckRadius = atomCheckRadius;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -