improved parameter comments, param annotations, cleanup

This commit is contained in:
rdk
2019-11-09 17:30:15 +01:00
parent de39f85331
commit 1b7809a667
15 changed files with 372 additions and 81 deletions

View File

@@ -215,6 +215,10 @@ class Dataset implements Parametrized {
return getLoader(attributes.get(PARAM_PREDICTION_METHOD), item)
}
/**
* Get configured instance of prediction loader.
* @param method LBS prediction method name
*/
private PredictionLoader getLoader(String method, Item item) {
PredictionLoader res
switch (method) {

View File

@@ -18,7 +18,7 @@ import static cz.siret.prank.utils.Formatter.format
import static cz.siret.prank.utils.Formatter.formatNumbers
/**
* (not intended o be reused with mode proteins)
* (not intended to be reused with mode proteins)
*/
@Slf4j
@CompileStatic

View File

@@ -8,7 +8,7 @@ import groovy.util.logging.Slf4j
import org.biojava.nbio.structure.Atom
/**
*
* Labels points according to nearest residue.
*/
@Slf4j
@CompileStatic

View File

@@ -7,7 +7,7 @@ import groovy.transform.CompileStatic
import javax.annotation.Nullable
/**
* Holds partiticular assignment of labels to a set of residues.
* Holds particular assignment of labels to a set of residues.
*/
@CompileStatic
class ResidueLabeling<L> {
@@ -15,7 +15,7 @@ class ResidueLabeling<L> {
private List<LabeledResidue<L>> labeledResidues
private Map<Residue.Key, LabeledResidue<L>> labeledMap
ResidueLabeling(List<LabeledResidue> labeledResidues) {
ResidueLabeling(List<LabeledResidue<L>> labeledResidues) {
this.labeledResidues = labeledResidues
this.labeledMap = Maps.uniqueIndex(labeledResidues, { it.residue.key })
}

View File

@@ -23,7 +23,7 @@ import static cz.siret.prank.utils.Futils.mkdirs
import static cz.siret.prank.utils.Futils.writeFile
/**
* Logic for calculating residue lebalings during P2Rank prediction
* Logic for calculating residue labelings during P2Rank prediction
*/
@Slf4j
class ResidueLabelings implements Parametrized {

View File

@@ -37,15 +37,9 @@ class PrankFeatureExtractor extends FeatureExtractor<PrankFeatureVector> impleme
List<String> atomTableFeatures
List<String> residueTableFeatures
// tied to a protein
private PointSampler pocketPointSampler
/**
* if set to true extractorFactory will use zero vectors for unknown residues
* otherwise throws exception (so the whole pocket can be ignored)
*/
private boolean MASK_UNKNOWN_RESIDUES = params.mask_unknown_residues
private double NEIGH_CUTOFF_DIST = params.neighbourhood_radius
private boolean DO_SMOOTH_REPRESENTATION = params.smooth_representation
private double SMOOTHING_CUTOFF_DIST = params.smoothing_radius
@@ -112,7 +106,6 @@ class PrankFeatureExtractor extends FeatureExtractor<PrankFeatureVector> impleme
return res
}
@Override
void prepareProteinPrototypeForPockets() {
pocketPointSampler = PointSampler.create(protein, trainingExtractor)
@@ -143,7 +136,6 @@ class PrankFeatureExtractor extends FeatureExtractor<PrankFeatureVector> impleme
this.protein = protein
this.pocket = pocket
this.MASK_UNKNOWN_RESIDUES = proteinPrototype.MASK_UNKNOWN_RESIDUES
this.headerAdditionalFeatures = proteinPrototype.headerAdditionalFeatures
this.pocketPointSampler = proteinPrototype.pocketPointSampler
this.extraFeaturesHeader = proteinPrototype.extraFeaturesHeader
@@ -156,10 +148,6 @@ class PrankFeatureExtractor extends FeatureExtractor<PrankFeatureVector> impleme
this.surfaceLayerAtoms = proteinPrototype.surfaceLayerAtoms
this.properties = proteinPrototype.properties
this.smoothRepresentations = proteinPrototype.smoothRepresentations
}
@Override

View File

@@ -1,5 +1,9 @@
package cz.siret.prank.features.api
import cz.siret.prank.features.api.FeatureCalculator
import cz.siret.prank.features.api.ResidueToAtomicFeatWrapper
import cz.siret.prank.features.api.ResidueToSasFeatWrapper
import cz.siret.prank.features.implementation.AAIndexFeature
import cz.siret.prank.features.implementation.Asa2Feature
import cz.siret.prank.features.implementation.AsaFeature

View File

@@ -5,7 +5,7 @@ import cz.siret.prank.domain.Residue
import org.biojava.nbio.structure.Atom
/**
*
* Maps a residue features to atom feature
*/
class ResidueToAtomicFeatWrapper extends AtomFeatureCalculator {

View File

@@ -10,7 +10,7 @@ import groovy.transform.CompileStatic
import org.biojava.nbio.structure.Atom
/**
* Mapping Closest Residue to SAS
* Mapping Closest Residue to SAS point
*/
@CompileStatic
class ResidueToSasFeatWrapper extends SasFeatureCalculator {

View File

@@ -6,7 +6,7 @@ import cz.siret.prank.geom.Atoms
import groovy.transform.CompileStatic
/**
* Context for calculation of SAS feature.
* Context for calculation of a SAS feature.
*/
@CompileStatic
class SasFeatureCalculationContext {

View File

@@ -0,0 +1,13 @@
package cz.siret.prank.program.params
/**
* Marks parameters of the prediction model (including feature extraction params) i.e. algorithm params.
* The notion of "model" here is seen wholesomely as a pocket prediction model = the whole algorithm, which includes feature extraction, classification and aggregation to binding sites.
*
* These are the parameters that must be the same in training and prediction phase.
*
* Currently annotation serves only documentation purposes.
*/
@interface ModelParam {
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
package cz.siret.prank.program.params
/**
* Marks parameters of the program execution (training or prediction phase)
* i.e. parameters not directly related to the prediction algorithm itself.
*
* Currently annotation serves only documentation purposes.
*/
@interface RuntimeParam {
}

View File

@@ -7,7 +7,7 @@ import java.util.List;
import java.util.stream.Collectors;
/**
*
* Utility for debugging and profiling cutoffAtoms methods
*/
public class CutoffAtomsCallLog {

View File

@@ -6,7 +6,7 @@ import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
/**
*
* Encapsulates system (command line) process
*/
@Slf4j
@CompileStatic