コード例 #1
0
ファイル: initiator.py プロジェクト: TengyuMaVandy/mbuild
    def __init__(self):
        super(Initiator, self).__init__()

        # Look for data file in same directory as this python module.
        mb.load('initiator.pdb', compound=self, relative_to_module=self.__module__)

        # Transform the coordinate system such that the two carbon atoms
        # that are part of the backbone are on the y axis, C_1 at the origin.
        mb.y_axis_transform(self, new_origin=self[0], point_on_y_axis=self[21])

        # Add bottom port
        self.add(mb.Port(anchor=self[0]), 'down')
        # Place the port.
        mb.translate(self['down'], self[0].pos + np.array([0.0, -0.07, 0.0]))

        # Add top port.
        self.add(mb.Port(anchor=self[21]), 'up')
        # Place the port.
        mb.translate(self['up'], self[21].pos + np.array([0.0, 0.07, 0.0]))
コード例 #2
0
    def __init__(self):
        super(Initiator, self).__init__()

        # Look for data file in same directory as this python module.
        mb.load('initiator.pdb', compound=self, relative_to_module=self.__module__)

        # Transform the coordinate system such that the two carbon atoms
        # that are part of the backbone are on the y axis, C_1 at the origin.
        mb.y_axis_transform(self, new_origin=self[0], point_on_y_axis=self[21])

        # Add bottom port
        self.add(mb.Port(anchor=self[0]), 'down')
        # Place the port.
        self['down'].translate(np.array([0.0, -0.07, 0.0]))

        # Add top port.
        self.add(mb.Port(anchor=self[21]), 'up')
        # Place the port.
        self['up'].translate(np.array([0.0, 0.07, 0.0]))
コード例 #3
0
ファイル: mpc.py プロジェクト: hainm/mbuild
    def __init__(self, alpha=0):
        super(MPC, self).__init__()

        # Look for data file in same directory as this python module.
        mb.load('mpc.pdb', compound=self, relative_to_module=self.__module__)

        # Transform the coordinate system of mpc such that the two carbon atoms
        # that are part of the backbone are on the y axis, c_backbone at the origin.
        C_top = self[37]
        # this can be achieved with the following alternative syntax:
        # C_top = self.labels["atom[37]"]
        # C_top = self.labels["atom"][37]
        C_bottom = self[1]

        mb.y_axis_transform(self, new_origin=C_top, point_on_y_axis=C_bottom)

        # Add top port.
        self.add(mb.Port(anchor=C_top), label='up')
        mb.translate(self['up'], C_top.pos - (C_top.pos - C_bottom.pos)*1.50)

        # Add bottom port
        self.add(mb.Port(anchor=C_bottom), 'down')
        mb.rotate_around_y(self['down'], alpha)
        mb.translate(self['down'], C_bottom.pos - (C_bottom.pos - C_top.pos)*1.50)