Chain alignment fixes - #1220
Conversation
|
This needs testing still. |
There was a problem hiding this comment.
Tests are below. Should I test something more?
Results:
@> PDB file is found in working directory (5ir5.pdb.gz).
@> 626 atoms and 1 coordinate set(s) were parsed in 0.03s.
@> PDB file is found in working directory (5ir4.pdb.gz).
@> 657 atoms and 1 coordinate set(s) were parsed in 0.03s.
5IR5 atoms: 626
5IR5 residues: 626
5IR4 atoms: 657
5IR4 residues: 657
--- Testing alignChains ---
@> Trying to map atoms based on residue numbers and identities:
@> Comparing Chain A from 5IR4_ca (len=657) with Chain A from 5IR5_ca:
@> Mapped: 624 residues match with 100% sequence identity and 100% overlap.
@> Finding the atommaps based on their coverages...
@> Identified that there exists 1 atommap(s) potentially.
[OK] Number of AtomMaps: 1
[OK] AtomMap atoms: 626
[OK] Mapped atoms: 624
--- Testing buildPDBEnsemble with labels ---
@> Ensemble (2 conformations) were built in 0.09s.
[OK] Number of conformations: 2
[OK] Number of ensemble atoms: 626
[OK] Labels: ['5IR5', '5IR4']
[OK] Mapped atoms in 5IR5: 626
[OK] Mapped atoms in 5IR4: 624
[OK] RMSDs before superposition: [ 0. 37.93748796]
@> Superposition completed in 0.00 seconds.
[OK] RMSDs after superposition: [8.98738513e-15 9.44748579e-01]
[OK] Minimum occupancy: 1.0
[OK] Maximum occupancy: 2.0
--- Final result ---
OVERALL RESULT: PASS
Code:
from prody import *
import numpy as np
structure_5ir5 = parsePDB('5IR5', subset='ca').select('protein and chain A')
structure_5ir4 = parsePDB('5IR4', subset='ca').select('protein and chain A')
print('5IR5 atoms:', structure_5ir5.numAtoms())
print('5IR5 residues:', structure_5ir5.numResidues())
print('5IR4 atoms:', structure_5ir4.numAtoms())
print('5IR4 residues:', structure_5ir4.numResidues())
print('\n--- Testing alignChains ---')
try:
atommaps = alignChains(structure_5ir4, structure_5ir5)
print('[OK] Number of AtomMaps:', len(atommaps))
if len(atommaps):
print('[OK] AtomMap atoms:', atommaps[0].numAtoms())
print('[OK] Mapped atoms:', int(np.count_nonzero(atommaps[0].getFlags('mapped'))))
except Exception as error:
print('[ERROR] alignChains:', type(error).name, error)
print('\n--- Testing buildPDBEnsemble with labels ---')
try:
ensemble = buildPDBEnsemble([structure_5ir5, structure_5ir4], labels=['5IR5', '5IR4'], title='LOX', superpose=False)
print('[OK] Number of conformations:', ensemble.numConfs())
print('[OK] Number of ensemble atoms:', ensemble.numAtoms())
print('[OK] Labels:', ensemble.getLabels())
weights = ensemble.getWeights()
for i, label in enumerate(ensemble.getLabels()):
print('[OK] Mapped atoms in {0}: {1}'.format(label, int(np.count_nonzero(weights[i]))))
print('[OK] RMSDs before superposition:', ensemble.getRMSDs())
ensemble.superpose()
print('[OK] RMSDs after superposition:', ensemble.getRMSDs())
occupancies = calcOccupancies(ensemble)
print('[OK] Minimum occupancy:', occupancies.min())
print('[OK] Maximum occupancy:', occupancies.max())
print('\n--- Final result ---')
if ensemble.numConfs() == 2 and list(ensemble.getLabels()) == ['5IR5', '5IR4']:
print('OVERALL RESULT: PASS')
else:
print('OVERALL RESULT: CHECK THE OUTPUT')
except Exception as error:
print('[ERROR] buildPDBEnsemble:', type(error).name, error)
print('\nOVERALL RESULT: FAIL')
|
I think there was something about labels relating to mappings from a dictionary or dali but I don't remember how to run that. I can check the scipion plugin code and get back to you |
Ok. Thanks. |
|
looks like it's not there in the scipion plugin, so I still don't know |
Allows buildPDBEnsemble to pass labels through alignChains to getDictMapping as alternative keys for mapping dict.
Also includes cleaning up of daliFilterMultimer, which has been tested and causes no problems.