Subsections


molecule.copy

Image molecule Image list-add

Synopsis

Copy all data associated with a molecule.

Defaults

molecule.copy(pipe_from=None, mol_from=None, pipe_to=None, mol_to=None)

Keyword arguments

pipe_from: The data pipe containing the molecule from which the data will be copied. This defaults to the current data pipe.

mol_from: The name of the molecule from which to copy data from.

pipe_to: The data pipe to copy the data to. This defaults to the current data pipe.

mol_to: The name of the new molecule. If left blank, the new molecule will have the same name as the old. This needs to be a molecule ID string, starting with `#'.

Description

This will copy all the data associated with a molecule to a second molecule. This includes all residue and spin system information. The new molecule name must be unique in the destination data pipe.

Spin ID string documentation

The identification string is composed of three components: the molecule ID token beginning with the `#' character, the residue ID token beginning with the `:' character, and the atom or spin system ID token beginning with the `@' character. Each token can be composed of multiple elements - one per spin - separated by the `,' character and each individual element can either be a number (which must be an integer, in string format), a name, or a range of numbers separated by the `-' character. Negative numbers are supported. The full ID string specification is `#<mol_name> :<res_id>[, <res_id>[, <res_id>, ...]] @<atom_id>[, <atom_id>[, <atom_id>, ...]]', where the token elements are `<mol_name>', the name of the molecule, `<res_id>', the residue identifier which can be a number, name, or range of numbers, `<atom_id>', the atom or spin system identifier which can be a number, name, or range of numbers.

If one of the tokens is left out then all elements will be assumed to match. For example if the string does not contain the `#' character then all molecules will match the string. If only the molecule ID component is specified, then all spins of the molecule will match.

Regular expression can be used to select spins. For example the string `@H*' will select the protons `H', `H2', `H98'.

Prompt examples

To copy the molecule data from the molecule `GST' to the new molecule `wt-GST', type:

[numbers=none]
relax> molecule.copy('#GST', '#wt-GST')

[numbers=none]
relax> molecule.copy(mol_from='#GST', mol_to='#wt-GST')

To copy the molecule data of the molecule `Ap4Aase' from the data pipe `m1' to `m2', assuming the current data pipe is `m1', type:

[numbers=none]
relax> molecule.copy(mol_from='#ApAase', pipe_to='m2')

[numbers=none]
relax> molecule.copy(pipe_from='m1', mol_from='#ApAase', pipe_to='m2', mol_to='#ApAase')


The relax user manual (PDF), created 2020-08-26.