def setUpClass(cls): cls.pdb_structure = Bio.PDB.PDBParser(QUIET=True).get_structure( cls.name, data_dir + '%s.pdb' % cls.name) cls.converter = numberconverter.NumberConverter(cls.pdb_structure) cls.model = random.choice(cls.pdb_structure) with warnings.catch_warnings(record=True): cls.struct = structure.Structure(cls.model, cls.converter)
def test_init(self): pdb_structure = Bio.PDB.PDBParser(QUIET=True).get_structure( self.name, data_dir + '%s.pdb' % self.name) converter = numberconverter.NumberConverter(pdb_structure) for model in pdb_structure: with warnings.catch_warnings(record=True) as wlist: warnings.simplefilter("always") structure.Structure(model, converter) syntax_check.warning_message(self, wlist)
def setUpClass(cls): cls.pdb_structure = Bio.PDB.PDBParser(QUIET=True).get_structure( cls.name, data_dir + '%s.pdb' % cls.name) cls.converter = numberconverter.NumberConverter(cls.pdb_structure) cls.model = random.choice(cls.pdb_structure) with warnings.catch_warnings(record=True): cls.struct = structure.Structure(cls.model, cls.converter) #~ crit = contacts.ContactsAlternative(contacts.CaContact(), contacts.CbxContact(), contacts.RaContact()) #~ cls.struct.set_contact_map(crit) cls.struct.set_contact_map()
def setUpClass(cls): cls.basic_sel_cls = [ random_selection_set, random_selection_range, random_selection_chain, random_selection_monomername, random_selection_monomertype, random_selection_everything, random_selection_nothing ] cls.pdb_structure = Bio.PDB.PDBParser(QUIET=True).get_structure( cls.name, data_dir + '%s.pdb' % cls.name) cls.converter = numberconverter.NumberConverter(cls.pdb_structure) cls.model = random.choice(cls.pdb_structure) with warnings.catch_warnings(record=True): cls.struct = structure.Structure(cls.model, cls.converter)
def load_structure_to_class(cls, strname): if strname in struct_dict: cls.pdb_structure, cls.converter, cls.model, cls.struct = struct_dict[ strname] else: cls.pdb_structure = Bio.PDB.PDBParser(QUIET=True).get_structure( strname, data_dir + '%s.pdb' % strname) cls.converter = numberconverter.NumberConverter(cls.pdb_structure) cls.model = random.choice(cls.pdb_structure) with warnings.catch_warnings(record=True): cls.struct = structure.Structure(cls.model, cls.converter) struct_dict[strname] = (cls.pdb_structure, cls.converter, cls.model, cls.struct)
def test_select(self): nc = numcon.NumberConverter(self.pdb_structure) class S: converter = nc for i in self.ress: for res in i.values(): res.structure = S pid = res.pdb_residue.get_full_id() pids = numcon.PDB_id.from_string(pid[2] + str(pid[3][1]) + pid[3][2]) res.ind = nc.get_ind(pids) s = res.select() self.assertEquals(len(s.ids), 1) self.assertEquals(pids, s.ids[0])
def setUpClass(cls): cls.structs = [] if not skip_slow: for strname in cls.struct_names: pdb_structure = Bio.PDB.PDBParser(QUIET=True).get_structure( strname, data_dir + '%s.pdb' % strname) converter = numberconverter.NumberConverter(pdb_structure) model = random.choice(pdb_structure) with warnings.catch_warnings(record=True): try: cls.structs.append( structure.Structure(model, converter)) except: print "Failed to load %s" % strname if len(cls.structs) == 0: print "All structures failed to load!!!" cls.points1 = [syntax_check.randomcoord() for dummy in range(100)] cls.points2 = [syntax_check.randomcoord() for dummy in range(100)]