mirror of
https://github.com/rdk/p2rank.git
synced 2026-06-04 12:44:24 +08:00
improved parameter comments, param annotations, cleanup
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -8,7 +8,7 @@ import groovy.util.logging.Slf4j
|
||||
import org.biojava.nbio.structure.Atom
|
||||
|
||||
/**
|
||||
*
|
||||
* Labels points according to nearest residue.
|
||||
*/
|
||||
@Slf4j
|
||||
@CompileStatic
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
@@ -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 {
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* Utility for debugging and profiling cutoffAtoms methods
|
||||
*/
|
||||
public class CutoffAtomsCallLog {
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import groovy.transform.CompileStatic
|
||||
import groovy.util.logging.Slf4j
|
||||
|
||||
/**
|
||||
*
|
||||
* Encapsulates system (command line) process
|
||||
*/
|
||||
@Slf4j
|
||||
@CompileStatic
|
||||
|
||||
Reference in New Issue
Block a user