Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions conkit/command_line/conkit_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ def main():
if args.RUN_SVM=='yes':
logger.info(os.linesep + "Running Support Vector Machine.")

validation.calculate_features()

if args.moltype=='Protein':
p = PDBParser()
structure = p.get_structure('structure', args.pdbfile)[0]
Expand Down
23 changes: 15 additions & 8 deletions conkit/plot/modelvalidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,20 @@ def __init__(self, model, prediction, sequence, map_align_exe=None, dist_bins=No
self.prediction = prediction
self.sequence = sequence
self.absent_residues = self._get_absent_residues()
prediction_cmap = self._prepare_contactmap(self.prediction.copy())
predicted_dict = prediction_cmap.as_dict()

self.data = pd.DataFrame()

self.data['RESNUM'] = predicted_dict.keys()
self.data['MISALIGNED'] = False
self.data['SCORE'] = 0
self.data['CONTACTS'] = 0
self.data['PLDDT'] = 0
self.data['Q_IN_ERROR'] = ''

def calculate_features(self):

model_distogram = self._prepare_distogram(self.model.copy())
prediction_distogram = self._prepare_distogram(self.prediction.copy())
model_cmap = self._prepare_contactmap(self.model.copy())
Expand Down Expand Up @@ -296,14 +307,10 @@ def _parse_data(self, predicted_dict, *metrics):
for residue_features in zip(sorted(predicted_dict.keys()), *metrics):
_features.append((*residue_features,))

self.data = pd.DataFrame(_features)
self.data.columns = ALL_VALIDATION_FEATURES

self.data['MISALIGNED'] = False
self.data['SCORE'] = 0
self.data['CONTACTS'] = 0
self.data['PLDDT'] = 0
self.data['Q_IN_ERROR'] = ''
feature_df = pd.DataFrame(_features)
feature_df.columns = ALL_VALIDATION_FEATURES

self.data = self.data.merge(feature_df, how='inner', on =['RESNUM'])



Expand Down
2 changes: 1 addition & 1 deletion conkit/plot/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def get_zscores(model_distogram, predicted_cmap_dict, absent_residues, *metrics)
absent_residues: list, tuple, set
The residues that are missing from the model
*metrics: list
The mertics for which the Z-Scores will be calculated
The metrics for which the Z-Scores will be calculated

Returns
-------
Expand Down
Loading