Metric(simulations, skip=1, metricdata=None)¶
Class for calculating projections of a simlist.
skip (int) – Frame skipping. Setting i.e. to 3 will keep only every third frame of each simulation.
MetricData object) – If a MetricData object is passed in the constructor, Metric will try to update it by only adding simulations
which don’t exist in it yet.
>>> metr = Metric(sims) >>> metr.set(MetricSelfDistance('protein and name CA', metric='contacts')) >>> data = metr.project() >>> >>> # Or define your own function which accepts as first argument a Molecule object. Further arguments are passed as >>> # function/argument tuples >>> def foo(mol, ref): >>> from moleculekit.util import molRMSD >>> mol.wrap('protein') >>> mol.align('protein and name CA', refmol=ref) >>> return molRMSD(mol, ref, mol.atomselect('protein and name CA'), ref.atomselect('protein and name CA')) >>> >>> metr = Metric(sims) >>> metr.set( (foo, (ref,)) ) >>> data2 = metr.project()
Returns the description of each projected dimension.
Molecule object) – A Molecule object which will be used to calculate the descriptions of the projected dimensions.
map – A DataFrame containing the descriptions of each dimension
Applies all projections stored in Metric on all simulations.
njobs (int) – Number of parallel jobs to spawn for projection of trajectories. Take care that this can use large amounts of memory as multiple trajectories are loaded at once. If None it will use the default from htmd.config.
data – Returns a MetricData object containing the projected data.