コード例 #1
0
ファイル: OOBioEuler.py プロジェクト: bolod/bioEuler
    def create_imprints_from_file(self, file, type, max_level=5, oriented=True):

        list = []
        list_impt = []
        a = []
        FILE = open(".." + os.sep + "config" + os.sep + file, "r")
        iter(FILE)

        for line in FILE:
            pdbReader = PDBReader(line[:4], os.path.join("..", "repo"))
            protein = pdbReader.get_protein_from_PDB()
            splitted_line = line.split(" ")
            name = str(splitted_line[0].strip("\n\t"))
            chain_num = (len(splitted_line) - 1) / 2
            atom_list = AtomList()

            if chain_num >= 1:
                start = 0
                end = 0
                i = 1
                while chain_num > 0:
                    start = int(splitted_line[i].strip(("\n\t")))
                    i += 1
                    end = int(splitted_line[i].strip(("\n\t")))
                    i += 1
                    atom_list.add_atom_list(protein.get_typed_atom_list(type).filter(start, end))
                    chain_num -= 1
            else:
                atom_list.add_atom_list(protein.get_typed_atom_list(type))

            list.append(atom_list)
            list[-1].set_name(name)
        FILE.close()

        for atom_list in list:
            impt = atom_list.get_imprint(max_level, oriented)
            list_impt.append(impt)
            name_file = atom_list.get_name() + "." + type + "im"
            impt.write_on_file(name_file)

        return list
コード例 #2
0
ファイル: superimposer.py プロジェクト: bolod/bioEuler
repo = os.path.join("..", "repo")
imprints = os.path.join("..", "imprints")

if __name__ == "__main__":
    prot1 = '1xwc'   #the first protein
    prot2 = '3trx'   #the second protein

    prot3 = '2vb1'   #the third protein
    prot4 = '1alc'   #the fourth protein

    prot5 = '1bb0'   #the fifth protein
    prot6 = '2drp'   #the sixth protein


    #prot1 single chain
    pdbReader = PDBReader(prot1, repo)
    protein1 = pdbReader.get_protein_from_PDB()
    p1cA = protein1.get_chain('A').orient()
    bb1 = protein1.get_backbone().orient()
    batcher_p1cA = Batcher(p1cA, GREEN)
    batcher_bb1 = Batcher(bb1, GREEN)

    #prot2 single chain
    pdbReader = PDBReader(prot2, repo)
    protein2 = pdbReader.get_protein_from_PDB()
    p2cA = protein2.get_chain('A').orient()
    bb2 = protein2.get_backbone().orient()
    batcher_p2cA = Batcher(p2cA, RED)
    batcher_bb2 = Batcher(bb2, RED)

    #prot3 single chain