コード例 #1
0
def get_overall_residue_distribution():
    from ve.util.load_pdb import load_complexes, complex_ids
    from ve.fp.test.common import GeometryResidue

    cs = load_complexes(complex_ids(), complex_cls=ComplexWithResidueSpatialDistribution, residue_cls=GeometryResidue)
    overall_atg_dist, overall_atb_dist, overall_tri_dist = OverallSpatialDistribution.overall_dist(cs)

    return overall_atg_dist, overall_atb_dist, overall_tri_dist
コード例 #2
0
    def setUp(self):
        from ve.util.load_pdb import load_complexes, complex_ids
        from ve.fp.fp_80 import Residue

        from random import sample

        sample_count = 10
        sampled_ids = sample(complex_ids(), sample_count)

        self.complexes = load_complexes(sampled_ids, complex_cls = ResiduePlaneBasedComplex, residue_cls = Residue)
コード例 #3
0
def main():
    from ve.util.complex import BaseComplex
    from ve.fp.fp_80 import Residue as Residue80

    class Complex(BaseComplex, ResidueTriangleTrait):
        pass

    from ve.util.load_pdb import load_complexes, complex_ids
    for c in load_complexes(complex_ids(), complex_cls = Complex, residue_cls = Residue80):
        c.get_triangles(refresh = True)
コード例 #4
0
def main(fp_dir, use_complex_plane = True, atg_as_rec = True, use_tri = True, use_cache = True):
    from ve.fp.fp_80 import Residue
    from ve.util.load_pdb import complex_ids, load_complexes
    from ve.config import data237_fp175_padded_root, data480_complex_root
    
    complex_cls = ComplexPlaneBasedComplex if use_complex_plane else ResiduePlaneBasedComplex

    cids = complex_ids()
    
    cs = load_complexes(cids, complex_cls = complex_cls, residue_cls = Residue)
    for c in cs:
        try:
            fp_str = c.gen_fp_str(atg_as_receptor = atg_as_rec, use_cache = use_cache, use_tri = use_tri)
            #print c.c_id
            with open(fp_dir + "/" + c.c_id + ".fp", "w") as f:
                f.write(fp_str)
        except:
            print "%s encountered error" %c.c_id
コード例 #5
0
def main(fp_dir, res_or_tri= "tri", atg_as_rec = True, use_cache = True):
    from ve.fp.fp_80 import Residue
    from ve.util.load_pdb import complex_ids, load_complexes
    from ve.config import data237_fp175_padded_root, data480_complex_root
    
    cids = complex_ids()
    cids = ["1FJ1_F", "3BN9_B","3B9K_EF"]
    
    cs = load_complexes(cids, complex_cls = Complex, residue_cls = Residue)
    for c in cs:
        print c.c_id
        fp_str = c.gen_fp_str(res_or_tri, atg_as_receptor = atg_as_rec, use_cache = use_cache)

        try:
            #fp_str = c.gen_fp_str(res_or_tri, atg_as_receptor = atg_as_rec, use_cache = use_cache)
            with open(fp_dir + "/" + c.c_id + ".fp", "w") as f:
                f.write(fp_str)
        except:
            print "%s encountered error" %c.c_id
コード例 #6
0
ファイル: fp_16.py プロジェクト: xiaohan2012/Virus-Experiment
def main(complex_cls, residue_cls = Residue):
    from ve.util.load_pdb import complex_ids, load_complexes
    from ve.config import data480_complex_root
    from ve.fp.complex_util.paraepi  import ParatopeNotFoundError, EpitopeNotFoundError
    
    #ids = complex_ids(data480_complex_root)
    ids = ["3B2U_E","3DVN_XY","2ARJ_R","3RKD_A","3RKD_B","3L5W_J","1BZQ_D","3NFP_I","3DVN_UV","3HI1_J","3B9K_AB","3IU3_K","3HI1_G","3B2U_A","3BN9_A","1BZQ_A","4ETQ_X","3U4E_J","3B2U_B","2ARJ_Q","1BZQ_B","3NFP_K","3IU3_I"]
    
    cs = load_complexes(ids, directory = data480_complex_root, complex_cls = complex_cls, residue_cls = residue_cls)
    
    for c in cs:
        #c.fp_to_cache()
        try:
            c.fp_to_cache()
        except EpitopeNotFoundError:
            print "EpitopeNotFoundError %s" %c.c_id
        except ParatopeNotFoundError:
            print "ParatopeNotFoundError %s" %c.c_id
        except:
            print "other error %s" %c.c_id
コード例 #7
0
def main2(which_as_rec):
    import os
    from ve.util.load_pdb import complex_ids, load_complexes
    from ve.config import data480_root, data480_complex_root
    ids = complex_ids(data480_complex_root)
    
    cs = load_complexes(ids, directory = data480_complex_root,complex_cls = MyComplex, residue_cls = MyResidue)

    fp_dir = os.path.join(data480_root, "fp_370_%s" %which_as_rec)

    for c in cs:
        fp_path = os.path.join(fp_dir, "%s.fp" %c.c_id)
        if os.path.exists(fp_path):
            print "%s preexists\n" %c.c_id
        else:
            print "processing", c.c_id

            try:
                fp = c.get_fp(which_as_rec)
                fp.tofile(fp_path)
            except Exception as e:
                from ve.util.error import get_error_info
                print c.c_id, get_error_info(e)
            print c.c_id, "processed\n"
コード例 #8
0
        if only_paratope:
            self.find_epitope()
            self.write_epitope(complex_dir, paraepi_dir)
        
            
    
if __name__ == "__main__":
    import sys
    from ve.util.load_pdb import complex_ids, load_complexes
    from ve.fp.complex_util.paraepi  import ParatopeNotFoundError, EpitopeNotFoundError
    from ve.config import data_root
    
    var = sys.argv[1]

    complex_dir = os.path.join(data_root,"three-groups/split-complexes", var)
    
    #get the complex ids
    ids = complex_ids(complex_dir)
    
    print ids

    cs = load_complexes(ids, directory =  complex_dir, complex_cls = ParaEpiGen, residue_cls =  TestResidue)
    
    for c in cs:
        try:
            c.gen_paraepi(complex_dir, os.path.join(data_root,"three-groups/paraepi", var), only_paratope = True)
        except ParatopeNotFoundError:
            print "paratope not found"
        except EpitopeNotFoundError:
            print "epitope not found"