Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c45c3dd

Browse filesBrowse files
committed
Bugfix: ASA calculation was by default using all models. Now it will use model 1 by default. Added new constructor to choose model.
1 parent e170fc9 commit c45c3dd
Copy full SHA for c45c3dd

1 file changed

+32-2Lines changed: 32 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java‎

Copy file name to clipboardExpand all lines: biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java
+32-2Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,37 @@ static class IndexAndDistance {
126126
* Constructs a new AsaCalculator. Subsequently call {@link #calculateAsas()}
127127
* or {@link #getGroupAsas()} to calculate the ASAs
128128
* Only non-Hydrogen atoms are considered in the calculation.
129-
* @param structure the structure, all non-H atoms will be used
129+
* @param structure the structure, all non-H atoms of given model number will be used
130+
* @param probe the probe size
131+
* @param nSpherePoints the number of points to be used in generating the spherical
132+
* dot-density, the more points the more accurate (and slower) calculation
133+
* @param nThreads the number of parallel threads to use for the calculation
134+
* @param hetAtoms if true HET residues are considered, if false they aren't, equivalent to
135+
* @param modelNr the model number from which we want atoms extracted
136+
* NACCESS' -h option
137+
*/
138+
public AsaCalculator(Structure structure, double probe, int nSpherePoints, int nThreads, boolean hetAtoms, int modelNr) {
139+
this.atoms = StructureTools.getAllNonHAtomArray(structure, hetAtoms, modelNr);
140+
this.atomCoords = Calc.atomsToPoints(atoms);
141+
this.probe = probe;
142+
this.nThreads = nThreads;
143+
144+
this.useSpatialHashingForNeighbors = DEFAULT_USE_SPATIAL_HASHING;
145+
146+
// initialising the radii by looking them up through AtomRadii
147+
radii = new double[atomCoords.length];
148+
for (int i=0;i<atomCoords.length;i++) {
149+
radii[i] = getRadius(atoms[i]);
150+
}
151+
152+
initSpherePoints(nSpherePoints);
153+
}
154+
155+
/**
156+
* Constructs a new AsaCalculator. Subsequently call {@link #calculateAsas()}
157+
* or {@link #getGroupAsas()} to calculate the ASAs
158+
* Only non-Hydrogen atoms are considered in the calculation.
159+
* @param structure the structure, all non-H atoms of model 1 will be used
130160
* @param probe the probe size
131161
* @param nSpherePoints the number of points to be used in generating the spherical
132162
* dot-density, the more points the more accurate (and slower) calculation
@@ -135,7 +165,7 @@ static class IndexAndDistance {
135165
* NACCESS' -h option
136166
*/
137167
public AsaCalculator(Structure structure, double probe, int nSpherePoints, int nThreads, boolean hetAtoms) {
138-
this.atoms = StructureTools.getAllNonHAtomArray(structure, hetAtoms);
168+
this.atoms = StructureTools.getAllNonHAtomArray(structure, hetAtoms, 1);
139169
this.atomCoords = Calc.atomsToPoints(atoms);
140170
this.probe = probe;
141171
this.nThreads = nThreads;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.