示例#1
0
def to_molsysmt_MolSys(item,
                       selection='all',
                       structure_indices='all',
                       syntaxis='MolSysMT'):

    if check:

        digest_item(item, 'openmm.GromacsGroFile')
        atom_indices = digest_atom_indices(atom_indices)
        structure_indices = digest_structure_indices(structure_indices)

    from molsysmt.native.molsys import MolSys
    from .to_molsysmt_Topology import to_molsysmt_Topology
    from .to_molsysmt_Structures import to_molsysmt_Structures

    tmp_item = MolSys()
    tmp_item.topology = to_molsysmt_Topology(
        item,
        atom_indices=atom_indices,
        structure_indices=structure_indices,
        check=False)
    tmp_item.structures = to_molsysmt_Structures(
        item,
        atom_indices=atom_indices,
        structure_indices=structure_indices,
        check=False)

    return tmp_item
示例#2
0
def to_molsysmt_MolSys(item,
                       atom_indices='all',
                       structure_indices='all',
                       check=True):

    if check:

        digest_item(item, 'pytraj.Trajectory')
        atom_indices = digest_atom_indices(atom_indices)
        structure_indices = digest_structure_indices(structure_indices)

    from molsysmt.native.molsys import MolSys
    from . import to_molsysmt_Topology
    from . import to_molsysmt_Structures

    tmp_item = MolSys()

    tmp_item.topology = to_molsysmt_Topology(item,
                                             atom_indices=atom_indices,
                                             check=False)
    tmp_item.structures = to_molsysmt_Structures(
        item,
        atom_indices=atom_indices,
        structure_indices=structure_indices,
        check=False)

    return tmp_item
示例#3
0
def to_molsysmt_MolSys(item,
                       atom_indices='all',
                       structure_indices='all',
                       check=True):

    if check:

        digest_item(item, 'openmm.Modeller')
        atom_indices = digest_atom_indices(atom_indices)
        structure_indices = digest_structure_indices(structure_indices)

    from molsysmt.native.molsys import MolSys
    from . import to_molsysmt_Topology
    from . import to_molsysmt_Structures

    tmp_item = MolSys()
    tmp_item.topology = to_molsysmt_Topology(item, atom_indices=atom_indices)
    tmp_item.structures = to_molsysmt_Structures(
        item, atom_indices=atom_indices, structure_indices=structure_indices)

    return tmp_item
示例#4
0
def to_molsysmt_MolSys(item, atom_indices='all', check=True):

    if check:

        digest_item(item, 'pdbfixer.PDBFixer')
        atom_indices = digest_atom_indices(atom_indices)
        structure_indices = digest_structure_indices(structure_indices)

    from molsysmt.native.molsys import MolSys
    from . import to_molsysmt_Topology
    from . import to_molsysmt_Structures as pdbfixer_PDBFixer_to_molsysmt_Structures

    tmp_item = MolSys()

    tmp_item.topology = to_molsysmt_Topology(item,
                                             atom_indices=atom_indices,
                                             check=False)
    tmp_item.structures = pdbfixer_PDBFixer_to_molsysmt_Structures(
        item, atom_indices=atom_indices, check=False)

    return tmp_item
示例#5
0
def to_molsysmt_MolSys(item,
                       selection='all',
                       structure_indices='all',
                       syntaxis='MolSysMT'):

    if check:

        try:
            is_openmm_PDBFile(item)
        except:
            raise WrongFormError('openmm.PDBFile')

        try:
            atom_indices = digest_atom_indices(atom_indices)
        except:
            raise WrongAtomIndicesError()

        try:
            structure_indices = digest_structure_indices(structure_indices)
        except:
            raise WrongStructureIndicesError()

    from molsysmt.native.molsys import MolSys
    from .to_molsysmt_Topology import to_molsysmt_Topology
    from .to_molsysmt_Structures import to_molsysmt_Structures

    tmp_item = MolSys()
    tmp_item.topology = to_molsysmt_Topology(
        item,
        atom_indices=atom_indices,
        structure_indices=structure_indices,
        check=False)
    tmp_item.structures = to_molsysmt_Structures(
        item,
        atom_indices=atom_indices,
        structure_indices=structure_indices,
        check=False)

    return tmp_item
示例#6
0
def to_molsysmt_MolSys(item, atom_indices='all', coordinates=None, box=None, check=True):

    if check:

        try:
            is_openmm_Topology(item)
        except:
            raise WrongFormError('openmm.Topology')

        try:
            atom_indices = digest_atom_indices(atom_indices)
        except:
            raise WrongAtomIndicesError()

        try:
            coordinates = digest_coordinates(coordinates)
        except:
            raise WrongCoordinatesError()

        try:
            box = digest_box(box)
        except:
            raise WrongBoxError()

    from molsysmt.native.molsys import MolSys
    from molsysmt.native.structures import Structures
    from . import to_molsysmt_Topology as to_molsysmt_Topology
    from . import get_box_from_system

    tmp_item = MolSys()
    tmp_item.topology = to_molsysmt_Topology(item, atom_indices=atom_indices, check=False)
    tmp_item.structures = Structures()
    if box is None:
        box = get_box_from_system(item)
    tmp_item.structures.append_structures(coordinates=coordinates, box=box)

    return tmp_item