Example #1
0
    def test_example4(self):
        '''
        Single chain with two multiple-chain domains
        '''

        argstring = \
            '--chain '+self.dimer1+':A '+self.linker+' '+self.dimer2+':B '+\
            '--fixed '+self.dimer1

        args = C.parsing(argstring.split())
        CHAINS = C.create_chains(args)
        build = bu.Builder(CHAINS, args.debug, args.number, args.destination)

        model = build.run()

        self.assertTrue(model.lenChains() == 3)
Example #2
0
    def test_example1(self):
        '''
        Single chain example
        '''
        # testdir = tempfile.mkdtemp('', self.__class__.__name__.lower() + \
        #     '_example1_')

        argstring = '--chain ' + self.mono1 + ' ' + self.linker + ' ' + self.mono2  # +\
        # ' --destination '+testdir ... to write the models to disk

        args = C.parsing(argstring.split())
        CHAINS = C.create_chains(args)
        build = bu.Builder(CHAINS, args.debug, args.number, args.destination)

        model = build.run()

        self.assertTrue(model.lenChains() == 1)
Example #3
0
    def test_symp3(self):
        '''
        Test with symmetry
        '''

        # There is no need to specify chain for the symmetric core
        argstring = \
            '--chain '+self.trimer+' '+self.linker+' '+self.mono1+\
            ' --symmetry p3 --symtemplate '+self.trimer+\
            ' --poolsym s'

        args = C.parsing(argstring.split())
        CHAINS = C.create_chains(args)
        build = bu.Builder(CHAINS, args.debug, args.number, args.destination)

        model = build.run()

        self.assertTrue(model.lenChains() == 3)
Example #4
0
    def test_3ch2(self):
        '''
        Example 2 with three chains
        '''

        argstring = \
            '--chain '+self.mono1+' '+self.linker+' '+self.dimer1+':A '+\
            self.linker+' '+self.mono2+\
            ' --chain '+self.dimer1+':B '+self.linker+' '+self.dimer2+':A'+\
            ' --chain '+self.mono1+' '+self.linker+' '+self.dimer2+':B '+\
            self.linker+' '+self.mono2

        args = C.parsing(argstring.split())
        CHAINS = C.create_chains(args)
        build = bu.Builder(CHAINS, args.debug, args.number, args.destination)

        model = build.run()

        self.assertTrue(model.lenChains() == 3)
Example #5
0
    def setUp(self):

        self.testpath = self.testpath or \
            os.path.join(os.path.abspath(os.path.dirname(__file__)), 'testdata')

        self.mono1 = self.mono1 or os.path.join(self.testpath, '2z6o.pdb')
        self.mono2 = self.mono2 or os.path.join(self.testpath, 'histone.pdb')
        self.mono3 = self.mono3 or os.path.join(self.testpath, '2h5q.pdb')
        self.dimer1 = self.dimer1 or os.path.join(self.testpath, 'domAB1.pdb')
        self.dimer2 = self.dimer2 or os.path.join(self.testpath, 'domAB2.pdb')
        self.dimer3 = self.dimer3 or os.path.join(self.testpath, '2qud.pdb')
        self.trimer = self.trimer or os.path.join(self.testpath, '2ei4.pdb')

        self.linker = self.linker or 'TG' * 15

        #### SINGLE CHAIN EXAMPLES
        # Assemble argument strings
        self.argstring1 = self.argstring1 or \
                '--chain '+self.mono1+' '+self.linker+' '+self.mono2

        # Careful with the names of fixed domains... cannot be repeated in the chain
        # for repeating pdbs that are not fixed or are not symtemplates there
        # should be no problem
        self.argstring4 = self.argstring4 or \
                '--chain '+self.dimer1+':A '+self.linker+' '+\
                self.dimer2+':B --fixed '+self.dimer1

        #### SYMMETRY EXAMPLE
        # Careful with symtemplate name... cannot be repeated in the chain
        self.argstring5 = self.argstring5 or '--chain '+self.dimer1+' '+\
                self.linker+' '+self.dimer2+':A --symmetry p2 --symtemplate '\
                +self.dimer1+' --poolsym s'

        #### DOUBLE CHAIN
        # Not fixed
        self.argstring2ch = self.argstring2ch or '--chain '+self.dimer1+':A '+\
                self.linker+' '+self.dimer3+':A '+self.linker+' '+self.dimer2+':A '+\
                '--chain '+self.dimer1+':B '+self.linker+' '+self.dimer3+':B '+\
                self.linker+' '+self.dimer2+':B'

        # Fixed
        # The model is the same as the previous one, but the coordinates of the
        # dimers will be fixed
        self.argstring2chfixed = self.argstring2chfixed or '--chain '+self.dimer1+\
                ':A '+self.linker+' '+self.dimer3+':A '+self.linker+' '+\
                self.dimer2+':A '+'--chain '+self.dimer1+':B '+self.linker+' '+\
                self.dimer3+':B '+self.linker+' '+self.dimer2+':B --fixed '+\
                self.dimer1+' '+self.dimer2+' '+self.dimer3

        #### TRIPLE CHAIN
        self.argstring3ch = self.argstring3ch or '--chain '+self.trimer+':A '+\
                self.linker+' '+self.mono1+' --chain '+self.trimer+':B '+\
                self.linker+' '+self.mono2+' --chain '+self.trimer+':C '+\
                self.linker+' '+self.mono3

        # Create Chain objects and Builder instance
        args1 = C.parsing(self.argstring1.split())
        CHAINS1 = C.create_chains(args1)
        self.builder1 = Builder(CHAINS1, args1.debug, args1.number,
                                args1.destination)

        args4 = C.parsing(self.argstring4.split())
        CHAINS4 = C.create_chains(args4)
        self.builder4 = Builder(CHAINS4, args4.debug, args4.number,
                                args4.destination)

        args5 = C.parsing(self.argstring5.split())
        CHAINS5 = C.create_chains(args5)
        self.builder5 = Builder(CHAINS5, args5.debug, args5.number,
                                args5.destination)

        args2ch = C.parsing(self.argstring2ch.split())
        CHAINS2ch = C.create_chains(args2ch)
        self.builder2ch = Builder(CHAINS2ch, args2ch.debug, args2ch.number,
                                  args2ch.destination)

        args2chfixed = C.parsing(self.argstring2chfixed.split())
        CHAINS2chfixed = C.create_chains(args2chfixed)
        self.builder2chfixed = Builder(CHAINS2chfixed, args2chfixed.debug,
                                       args2chfixed.number,
                                       args2chfixed.destination)

        args3ch = C.parsing(self.argstring3ch.split())
        CHAINS3ch = C.create_chains(args3ch)
        self.builder3ch = Builder(CHAINS3ch, args3ch.debug, args3ch.number,
                                  args3ch.destination)