Ejemplo n.º 1
0
def test_save_functions():
    my_emap = pyemap.parse(
        os.path.join(sys.path[0], "pyemap/tests/test_pdbs/4DJA.pdb"))
    #cluster
    fout = tempfile.NamedTemporaryFile(suffix=".png")
    ''' commented out for now until we can find a solution with newer RDKit
    #aromatic eta moiety
    my_emap.residue_to_Image("SF4603(A)")
    my_emap.residue_to_file("SF4603(A)",dest=fout.name)
    my_emap.residue_to_Image("FAD601(A)-1")
    my_emap.residue_to_file("FAD601(A)-1",dest=fout.name)
    '''
    #after file is processed
    pyemap.process(my_emap)
    #standard residue
    ''' commented out for now until we can find a solution with newer RDKit
    my_emap.residue_to_Image("Y443(A)")
    my_emap.residue_to_file("Y443(A)",dest=fout.name)
    '''
    #init graph
    my_emap.init_graph_to_Image()
    my_emap.init_graph_to_file(dest=fout.name)
    pyemap.find_paths(my_emap, "Y443(A)")
    #paths graph
    my_emap.paths_graph_to_Image()
    my_emap.paths_graph_to_file(dest=fout.name)
    #check that report does something
    assert my_emap.report() != None
Ejemplo n.º 2
0
 def test_yens_paths(self):
     pyemap.find_paths(self.my_emap,"Y167(B)",target="Y369(B)")
     assert len(self.my_emap.paths)==10
     pyemap.find_paths(self.my_emap,"Y167(B)",target="Y369(B)",max_paths=15)
     assert len(self.my_emap.paths)==15
     try:
         pyemap.find_paths(self.my_emap,"Y167(B)",target="Y167(A)")
         assert False
     except Exception as e:
         assert True
Ejemplo n.º 3
0
 def test_dijkstras_paths(self):
     pyemap.find_paths(self.my_emap,"Y167(B)")
     assert len(self.my_emap.paths)>0
Ejemplo n.º 4
0
# PyeMap: A python package for automatic identification of electron and hole transfer pathways in proteins.
# Copyright(C) 2017-2020 Ruslan Tazhigulov, James Gayvert, Ksenia Bravaya (Boston University, USA)
import pyemap
my_emap = pyemap.fetch_and_parse("1u3d")
# view residue
my_emap.residue_to_Image("FAD510(A)-2").show()
# process file
pyemap.process(my_emap)
my_emap.init_graph_to_Image().show()
# find paths
pyemap.find_paths(my_emap,"FAD510(A)-2")
my_emap.paths_graph_to_Image().show()
# print report
print(my_emap.report())