soprano.properties.linkage.linkage#
Implementation of AtomsProperties that relate to linkage of atoms
Classes
|
Bond graph returns a networkx graph of the molecules in the structure. |
|
Produces an array of tuples identifying all bonds existing within the system (calculated using Van der Waals radii). |
|
Produces an histogram representing, for each pair of species present in the system, how many atoms of species 1 have n bonds with species 2, n being the histogram bins. |
|
Produces a list of dihedral angles found in the system, identified by looking for a bonding pattern. |
|
Produces an array containing the atomic pair distances in a system, reduced to their shortest periodic version and sorted min to max. |
|
Hydrogen Bonds |
|
Number of hydrogen bonds detected in this system, classified by type. |
|
Produces an array containing the atomic pair distances in a system, reduced to their shortest periodic version and sorted min to max. |
|
List of centers of mass for the molecules present in the system. |
|
Linkage list - following the same criteria as the atomic one - calculated for the centers of mass of the molecules present in the system. |
|
Total mass of each of the molecules detected in this system. |
|
Number of molecules detected in this system. |
|
A list of quaternions expressing the rotation of the molecule's intertia tensor principal frame with respect to the cartesian axes. |
|
A list of relative rotations between molecules. |
|
Reorder molecules to have their indices sorted using a spectral sorting method based on the Fiedler vector of their bonding graph. |
|
Produces an array containing multiple AtomSelection objects representing molecules in the system as found by connecting atoms closer than the half sum of their Van der Waals radii. |
- class soprano.properties.linkage.linkage.BondGraph(name=None, **params)[source]#
Bases:
AtomsProperty
Bond graph returns a networkx graph of the molecules in the structure. To use this property you must have the networkx library installed.
Parameters:force_recalc (bool): if True, always recalculate the bond grapheven if already present.save_info (bool): if True, save the bond graph as part of the Atomsobject info. By default True.Returns:graph (nx.Graph): the bond graph for the structureInitialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, force_recalc, save_info)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.Bonds(name=None, **params)[source]#
Bases:
AtomsProperty
Produces an array of tuples identifying all bonds existing within the system (calculated using Van der Waals radii). The tuples are structured as:
(atom_1, atom_2, atom_2_cell, bond_length)
with atom_1 and atom_2 being indices and atom_2_cell being an array of integers identifying the unit cell to which atom_2 belongs with respect to atom_1 (which is assumed to be in (0,0,0), the central cell). This is to account for the possibility of course that the bond exists through the periodic boundary. WARNING: the possibility of an atom bonding with another throughout two different periodic boundaries is not accounted for.
Parameters:vdw_set({ase, jmol, csd}): set of Van der Waals radii to use. Defaultis csd [S. Alvarez, 2013].vdw_scale (float): scaling factor to apply to the base Van der Waalsradii values. Values bigger than one make for moretolerant bonds.default_vdw (float): default Van der Waals radius for species forwhom no data is available.vdw_custom (dict): a dictionary of custom Van der Waals radii to use,overriding the existing ones, expressed as{symbol: radius}.return_matrix (bool): if True, also return an NxN bonding matrix forall N atoms in the systemsave_info (bool): if True, save the found bonds (and in case matrix)as part of the Atoms object info. By default True.Returns:bonds([tuple]): list of bonds in the form of 3-tuples structured asexplained aboveInitialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, vdw_set, vdw_scale, default_vdw, vdw_custom, return_matrix, save_info)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.CoordinationHistogram(name=None, **params)[source]#
Bases:
AtomsProperty
Produces an histogram representing, for each pair of species present in the system, how many atoms of species 1 have n bonds with species 2, n being the histogram bins. The histogram is topped at a ‘maximum coordination’ parameter which is 6 by default but can be user defined; the last bin represents all higher values (so by default ‘6 or more’). Two species or lists of species can be given if one wants to restrict the search; otherwise a full histogram for all pairs of species is returned.
Parameters:vdw_set({ase, jmol, csd}): set of Van der Waals radii to use. Defaultis csd [S. Alvarez, 2013].vdw_scale (float): scaling factor to apply to the base Van der Waalsradii values. Values bigger than one make for moretolerant bonds.default_vdw (float): default Van der Waals radius for species forwhom no data is available.vdw_custom (dict): a dictionary of custom Van der Waals radii to use,overriding the existing ones, expressed as{symbol: radius}.species_1 (str or [str]): list of species to compute the histogramfor. By default all of them.species_2 (str or [str]): list of species whose coordination withspecies_1 should be checked. By default allof them.max_coord (int): what should be the largest coordination numberconsidered for an atom (default 6).Returns:coord_hist (dict): dictionary of dictionaries indexed by species_1followed by species_2. The elements are arrays ofintegers constituting the histogram.Initialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, vdw_set, vdw_scale, default_vdw, vdw_custom, species_1, species_2, max_coord)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.DihedralAngleList(name=None, **params)[source]#
Bases:
AtomsProperty
Produces a list of dihedral angles found in the system, identified by looking for a bonding pattern. The amount of said angles can vary from zero (if the pattern is not present) to an arbitrary number. They will be returned sorted from lowest to highest. Periodic boundary conditions are taken into account. If no pattern is provided, HCCH groups are searched by default.
Parameters:dihedral_pattern ([str]*4): a list of four chemical symbolsidentifying the dihedral pattern to lookforbonds_params (dict): parameters to pass to the Bonds property used tocompute bonds. See the Bonds docstring fordetails. If not provided, defaults are usedReturns:dihedral_angles (np.ndarray): sorted list of dihedral angles foundInitialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, dihedral_pattern, bonds_params)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.ElementPairs(name=None, **params)[source]#
Bases:
AtomsProperty
Produces an array containing the atomic pair distances in a system, reduced to their shortest periodic version and sorted min to max.
This is a modified version of LinkageList that operates only on the subset of atoms that are of the specified elements. The pair_list will therefore always have element 1 in the first index and element 2 in the second index of each tuple.
- Parameters:
element1 (str) – first element to consider
element2 (str) – second element to consider
maxsize (int) –
maximum number of distances to include. If not present, all of them will be included. If present, arrays will be cut reach this size. If the number of pairs is less than
maxsize, only those pairs will be returned. This is different to the behaviour of LinkageList.
rcut (float) – maximum distance to consider (in Angstroms). If rcut is <= 0, no cutoff is applied.
return_pairs (bool) – if True, return the pairs of atoms to which the distances correspond, as a list of tuples of indices.
- Returns:
sorted list of interatomic linkage distances pair_list ([(int, int)]): only if return_pairs is True, list of pairs
corresponding to the distances
- Return type:
link_list ([float])
Initialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, element1, element2, rcut, maxsize, return_pairs)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.HydrogenBonds(name=None, **params)[source]#
Bases:
AtomsProperty
Hydrogen Bonds
Produces a dictionary containing the atom indices defining hydrogen bonds detected in the system - if required, classified by type. By default only O and N atoms are considered for hydrogen bonds (OH..O, OH..N and so on). The type is defined as AH..B where A is the symbol of the atom directly bonded to the proton and B the one of the hydrogen bonded one.
Parameters:vdw_set({ase, jmol, csd}): set of Van der Waals radii to use. Defaultis csd [S. Alvarez, 2013].vdw_scale (float): scaling factor to apply to the base Van der Waalsradii values. Values bigger than one make for moretolerant molecules.default_vdw (float): default Van der Waals radius for species forwhom no data is available.hbond_elems ([str]): chemical symbols of elements considered capableof forming hydrogen bonds (by default O and N)max_length (float): maximum A-B length of the hydrogen bond inAngstrom - default is 3.5 Angmax_angle (float): maximum A-H/A-B angle in the hydrogen bond indegrees - default is 45 degsave_info (bool): if True, save the found hydrogen bonds as part ofthe Atoms object info. By default True.Returns:hbondss ([dict]): list of hydrogen bonds detectedin the system by type (can contain empty arrays).For each hydrogen bond we give index of the Hatom, index and unit cell of the A atom (the onedirectly bonded), index and unit cell of the B atom(the one that’s hydrogen bonded), length and anglein degrees.Initialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, vdw_set, vdw_scale, default_vdw, vdw_custom, hbond_elems, max_length, max_angle, save_info)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.HydrogenBondsNumber(name=None, **params)[source]#
Bases:
AtomsProperty
Number of hydrogen bonds detected in this system, classified by type. By default will use already existing hydrogen bonds if they’re present as a saved array in the system.
Parameters:force_recalc (bool): if True, always recalculate the hydrogen bondseven if already present.Returns:hbonds_n (int): number of hydrogen bonds foundInitialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, force_recalc)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.LinkageList(name=None, **params)[source]#
Bases:
AtomsProperty
Produces an array containing the atomic pair distances in a system, reduced to their shortest periodic version and sorted min to max.
Parameters:size (int): maximum number of distances to include. If not present,all of them will be included. If present, arrays will becut or padded to reach this size.return_pairs (bool): if True, return the pairs of atoms to which thedistances correspond, as a list of tuples ofindices.Returns:link_list ([float]): sorted list of interatomic linkage distancespair_list ([(int, int)]): only if return_pairs is True, list of pairscorresponding to the distancesInitialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, size, return_pairs)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.MoleculeCOM(name=None, **params)[source]#
Bases:
AtomsProperty
List of centers of mass for the molecules present in the system. By default will use already existing molecules if they’re present as a saved array in the system.
Parameters:force_recalc (bool): if True, always recalculate the molecules even ifalready present.Return:mol_com (np.ndarray): list of centers of mass for the system’smoleculesInitialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, force_recalc)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.MoleculeCOMLinkage(name=None, **params)[source]#
Bases:
AtomsProperty
Linkage list - following the same criteria as the atomic one - calculated for the centers of mass of the molecules present in the system. By default will use already existing molecules if they’re present as a saved array in the system.
Parameters:force_recalc (bool): if True, always recalculate the molecules even ifalready present.size (int): maximum number of distances to include. If not present,all of them will be included. If present, arrays will becut or padded to reach this sizeber.Returns:molecule_linkage ([float]): distances between all centers of mass ofmolecules in the system, sorted.Initialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, force_recalc, size)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.MoleculeMass(name=None, **params)[source]#
Bases:
AtomsProperty
Total mass of each of the molecules detected in this system. By default will use already existing molecules if they’re present as a saved array in the system.
Parameters:force_recalc (bool): if True, always recalculate the molecules even ifalready present.size (int): maximum number of distances to include. If not present,all of them will be included. If present, arrays will becut or padded to reach this sizeber.Returns:molecule_m ([float]): mass of each of the molecules present, sorted.Initialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, force_recalc, size)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.MoleculeNumber(name=None, **params)[source]#
Bases:
AtomsProperty
Number of molecules detected in this system. By default will use already existing molecules if they’re present as a saved array in the system.
Parameters:force_recalc (bool): if True, always recalculate the molecules even ifalready present.Returns:molecule_n (int): number of molecules foundInitialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, force_recalc)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.MoleculeQuaternion(name=None, **params)[source]#
Bases:
AtomsProperty
A list of quaternions expressing the rotation of the molecule’s intertia tensor principal frame with respect to the cartesian axes.
Parameters:force_recalc (bool): if True, always recalculate the molecules even ifalready present.Returns:mol_quat ([ase.Quaternion]): list of quaternionsInitialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, force_recalc)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.MoleculeRelativeRotation(name=None, **params)[source]#
Bases:
AtomsProperty
A list of relative rotations between molecules. Uses the inertia tensor eigenvectors to establish a local frame for each molecule, then uses quaternions to define a rotational distance between molecules. It then produces a list of geodesic distances between these quaternions.
Parameters:force_recalc (bool): if True, always recalculate the molecules even ifalready present.size (int): maximum number of distances to include. If not present,all of them will be included. If present, arrays will becut or padded to reach this size.twist_axis ([float]): if present, only compare the Twist component ofquaternion along the given axis. The Twist/Swingdecomposition splits a quaternion in a rotationaround an axis and one around an orthogonaldirection. Only one between this and swing_planecan be present.swing_plane ([float]): if present, only compare the Swing component ofquaternion along the given axis. The Twist/Swingdecomposition splits a quaternion in a rotationaround an axis and one around an orthogonaldirection. Only one between this and twist_axiscan be present.Returns:molecule_relrot ([float]): list of relative rotations, as quaterniondistances, with the required ordering.Initialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, force_recalc, size, swing_plane, twist_axis)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.MoleculeSpectralSort(name=None, **params)[source]#
Bases:
AtomsProperty
Reorder molecules to have their indices sorted using a spectral sorting method based on the Fiedler vector of their bonding graph. This sorting should be equivalent for equivalent molecules - except for the arbitrary ordering of equivalent atoms.
Parameters:force_recalc (bool): if True, always recalculate the molecules even ifalready present.Returns:mol_specsort ([np.ndarray]): list of Molecules with indices sorted by spectral method.Initialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, force_recalc)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- class soprano.properties.linkage.linkage.Molecules(name=None, **params)[source]#
Bases:
AtomsProperty
Produces an array containing multiple AtomSelection objects representing molecules in the system as found by connecting atoms closer than the half sum of their Van der Waals radii. It will return the entire unit cell if the system can not be split in molecules at all.
Parameters:vdw_set({ase, jmol, csd}): set of Van der Waals radii to use. Defaultis csd [S. Alvarez, 2013].vdw_scale (float): scaling factor to apply to the base Van der Waalsradii values. Values bigger than one make for moretolerant molecules.default_vdw (float): default Van der Waals radius for species forwhom no data is available.vdw_custom (dict): a dictionary of custom Van der Waals radii to use,overriding the existing ones, expressed as{symbol: radius}.save_info (bool): if True, save the found molecules as part of theAtoms object info. By default True.Returns:molecules ([AtomSelection]): list of molecules in the form ofAtomSelection objects.Initialize an AtomsProperty and set its parameters. The AtomsProperty instance can then be called with a structure as its only argument to get the property with the given parameters.
Args:name (str): a name to give to this specific instance of theproperty (will be used to store it as array ifrequested)params: named arguments specific to this type of property- __call__(s, store_array=False)#
Calling the AtomsProperty returns the value of the property as extracted with the parameters of this specific instance.
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the given name for this instanceReturns:property: the value of the property for the given structure ora list of values if a collection has been passed
- static extract(s, vdw_set, vdw_scale, default_vdw, vdw_custom, save_info)[source]#
Extract the given property with given parameters from an Atoms object.
Args:s (ase.Atoms): the structure from which to extract the propertyparams: named arguments specific to this type of propertyReturns:property: the value of the property for the given structure andparameters
- classmethod get(s, store_array=False, **kwargs)#
Extract the given property using the default parameters on an Atoms object s
Args:s (ase.Atoms or AtomsCollection): the structure or collectionfrom which to extract thepropertystore_array (bool): if s is a collection, whether to store theresulting data as an array in the collectionusing the default name for this propertyReturns:property: the value of the property for the given structure ora list of values if a collection has been passed