Example #1
0
 def is_valid(self, mol, ene):
     if ene < self.legal_min_ene:
         return "L"
     if self.chiral_idxs and tuple(chiral.chiral_types(mol, self.chiral_idxs)) != self._chirals:
         return "C"
     if self.check_minimal and not tinker.isminimal(mol, self.forcefield):
         return "M"
     return "V"
Example #2
0
 def is_valid(self, mol, ene):
     if ene < self.legal_min_ene:
         return 'L'
     if self.chiral_idxs \
             and tuple(chiral.chiral_types(mol, self.chiral_idxs)) \
             != self._chirals:
         return 'C'
     if self.check_minimal and not tinker.isminimal(mol, self.forcefield):
         return 'M'
     return 'V'
Example #3
0
    def init_check(self):
        if self.chiral_idxs is None:
            if self.chiral_index_file:
                self.chiral_idxs = sum(
                    [
                        [int(x) - 1 for x in line.split() if line.strip() and line[0] != "#"]
                        for line in file(os.path.join(self.olddir, self.chiral_index_file)).readlines()
                    ],
                    [],
                )

        if self.chiral_idxs:
            self._chirals = tuple(chiral.chiral_types(self.seedmol, self.chiral_idxs))

        if self.head_tail == "auto":
            if self.moltypekey == "peptide":
                self.head_tail = -1
            else:
                self.head_tail = 0
        else:
            self.head_tail = int(self.head_tail)

        if self.is_achiral == "auto":
            if self.moltypekey == "peptide":
                self.is_achiral = False
            else:
                self.is_achiral = True
        else:
            self.is_achiral = self.config.getboolean("DEFAULT", "is_achiral")

        if self.loopstep == "auto":
            if self.moltypekey == "peptide" or self.is_chain:
                self.loopstep = 0
            else:
                self.loopstep = 1
        else:
            self.loopstep = int(self.loopstep)

        if self.cmptors is None:
            if self.cmptorsfile:
                self.cmptors = [
                    [int(x) - 1 for x in line.split() if line.strip() and line[0] != "#"]
                    for line in file(self.cmptorsfile).readlines()
                ]

        if self.cmptors is None:
            if self.is_chain:
                self.cmptors = [self.loopatoms[i : i + 4] for i in range(len(self.loopatoms) - 3)]
            else:
                self.cmptors = [(self.loopatoms * 2)[i : i + 4] for i in range(len(self.loopatoms))]

        for x in self.cmptors:
            assert len(x) == 4
        return True
Example #4
0
    def init_check(self):
        if self.chiral_idxs is None:
            if self.chiral_index_file:
                self.chiral_idxs = sum([[int(x) - 1 \
                        for x in line.split()
                        if line.strip() and line[0] != '#']
                        for line in file(os.path.join(self.olddir,
			                              self.chiral_index_file)).readlines()], [])

        if self.chiral_idxs:
            self._chirals = tuple(chiral.chiral_types(self.seedmol, self.chiral_idxs))

        if self.head_tail is None:
            if self.moltypekey == 'peptide':
                self.head_tail = -1
            else:
                self.head_tail = 0
            
        if self.is_achiral is None:
            if self.moltypekey == 'peptide':
                self.is_achiral = False
            else:
                self.is_achiral = True
                
        if self.loopstep == -1:
            if self.moltypekey == 'peptide' or self.is_chain:
                self.loopstep = 0
            else:
                self.loopstep = 1

        if self.cmptors is None:
            if self.cmptorsfile:
                self.cmptors = [[int(x)-1 for x in line.split()
                    if line.strip() and line[0] != '#']
                    for line in file(self.cmptorsfile).readlines()]

        if self.cmptors is None:
            if self.is_chain:
                self.cmptors = \
                    [self.loopatoms[i:i+4] for i in range(len(self.loopatoms)-3)]
            else:
                self.cmptors = \
                    [(self.loopatoms*2)[i:i+4] for i in range(len(self.loopatoms))]

        for x in self.cmptors:
            assert len(x) == 4
        return True