def test2(self): interactionFilter = InteractionFilter(distanceCutoff=3.5, minInteractions=1) interactionFilter.set_query_groups(True, ['ASP']) interactionFilter.set_query_atom_names(True, ['OD1', 'OD2']) interactionFilter.set_target_groups(True, ['ARG']) interactionFilter.set_target_atom_names(True, ['NH1', 'NH2']) interactions = InteractionFingerprinter.get_polymer_interactions(self.pdb, interactionFilter) self.assertTrue(interactions.count() == 2)
def test1(self): interactionFilter = InteractionFilter(distanceCutoff=4.0, minInteractions=10) interactions = InteractionFingerprinter.get_polymer_interactions( self.pdb, interactionFilter) self.assertTrue(interactions.count() == 2)
def test4(self): inFilter = InteractionFilter() inFilter.set_target_groups(False, ["HOH", "ZN"]) self.assertFalse(inFilter.is_target_group('ZN')) self.assertFalse(inFilter.is_target_group('HOH')) self.assertTrue(inFilter.is_target_group('MN'))
def test1(self): inFilter = InteractionFilter() inFilter.set_query_groups(True, ["HOH", "ZN"]) self.assertTrue(inFilter.is_query_group('ZN')) self.assertTrue(inFilter.is_query_group('HOH')) self.assertFalse(inFilter.is_query_group('MN'))
def test11(self): inFilter = InteractionFilter() inFilter.set_target_atom_names(True, ["CA", "CB"]) self.assertFalse(inFilter.is_target_atom_name('C')) self.assertFalse(inFilter.is_target_atom_name('CG')) self.assertTrue(inFilter.is_target_atom_name('CA')) self.assertTrue(inFilter.is_target_atom_name('CB'))
def test9(self): inFilter = InteractionFilter() inFilter.set_target_elements(False, ["N", "O"]) self.assertFalse(inFilter.is_target_element('O')) self.assertFalse(inFilter.is_target_element('N')) self.assertTrue(inFilter.is_target_element('S'))
def test6(self): inFilter = InteractionFilter() inFilter.set_query_elements(True, ["N", "O"]) self.assertTrue(inFilter.is_query_element('O')) self.assertTrue(inFilter.is_query_element('N')) self.assertFalse(inFilter.is_query_element('S'))
def test1(self): interactionFilter = InteractionFilter() #interactionFilter.set_distance_cutoff(4.0) interactionFilter.set_distance_cutoff(3.0) #interactionFilter.set_target_elements(True, ['O']) interactionFilter.set_target_elements(False, ['C','H','P']) metals = {"V", "CR", "MN", "MN3", "FE", "FE2", "CO", "3CO", "NI", "3NI", "CU", "CU1", "CU3", "ZN", "MO", "4MO", "6MO"} interactionFilter.set_query_groups(True, metals) #interactionFilter.set_query_elements(False, ['C', 'H', 'P']) #interactionFilter.set_query_groups(False, "HOH") # ignore water interactions t0 = time.time() interactions = InteractionExtractor.get_ligand_polymer_interactions(self.pdb, interactionFilter, level='group') interactions.show() print(interactions.count()) t1 = time.time() print("Interactions: ", t1-t0)
# ## Download 1OHR structure # In[2]: pdb = mmtfReader.download_mmtf_files(['1OHR'], sc) # ## Find interactions of small molecules (except water) # In[3]: interactionFilter = InteractionFilter() interactionFilter.set_distance_cutoff(4.0) interactionFilter.set_query_groups(False, "HOH") # ignore water interactions interactions = InteractionFingerprinter.get_ligand_polymer_interactions(pdb, interactionFilter) interactions.toPandas().head(10) # ## Terminate Spark # In[3]: sc.stop()
def test5(self): inFilter = InteractionFilter() self.assertTrue(inFilter.is_query_group('ZN')) self.assertTrue(inFilter.is_target_group('ZN')) self.assertTrue(not inFilter.is_prohibited_target_group('ZN'))
# In[14]: pdb = mmtfReader.read_sequence_file(path, sc) pdb = pdb.filter(Pisces(sequenceIdentity = 30, resolution = 2.5)) # ## Setup criteria for metal interactions # In[15]: # Chemical component codes of metals in different oxidation states metals = {"V","CR","MN","MN3","FE","FE2","CO","3CO","NI","3NI", "CU","CU1","CU3","ZN","MO","4MO","6MO"} interactions_filter = InteractionFilter(distanceCutoff = 3.0, minInteractions=4, maxInteractions=6) interactions_filter.set_query_groups(True, metals) # Exclude non-polar interactions interactions_filter.set_target_elements(False, ['H','C','P']) # ## Tabulate interactions in a Dataframe # In[16]: interactions = GroupInteractionExtractor().get_interactions(pdb,interactions_filter).cache() print(f"Metal interactions: {interactions.count()}")
bFactorCutoff = 1.645 includeWaters = True # ## Read PDB and filter by resolution and only include proteins # In[3]: pdb = mmtfReader.read_sequence_file(path, sc) pdb = pdb.filter(Resolution(minResolution=0.0, maxResolution=2.0)).filter( ContainsLProteinChain(exclusive=True)) # ## Setup criteria for metal interactions # In[4]: interactions_filter = InteractionFilter() interactions_filter.set_distance_cutoff(3.0) interactions_filter.set_normalized_b_factor_cutoff(1.645) interactions_filter.set_min_interactions(2) interactions_filter.set_max_interactions(4) interactions_filter.set_query_groups(True, ["HOH"]) interactions_filter.set_query_elements(True, "O") # Only use water oxygen interactions_filter.set_target_elements(True, ["O", "N", "S"]) # ## Exclude "uninteresting" ligands # In[5]: prohibitedGroups = ExcludedLigandSets.ALL_GROUPS if not includeWaters: prohibitedGroups.add("HOH")
# ## Read PDB and create PISCES non-redundant set # In[12]: pdb = mmtfReader.read_sequence_file(path, sc) pdb = pdb.filter(Pisces(sequenceIdentity = sequenceIdentityCutoff, resolution = resolution)) # ## Setup criteria for metal interactions # In[13]: interactions_filter = InteractionFilter() interactions_filter.set_distance_cutoff(distanceCutoff) interactions_filter.set_min_interactions(minInteractions) interactions_filter.set_max_interactions(maxInteractions) interactions_filter.set_query_groups(True, metals) #Exclude non-polar interactions interactions_filter.set_target_elements(False, ['H','C','P']) # ## Tabulate interactions in a Dataframe # In[14]: interactions = GroupInteractionExtractor().get_interactions(pdb,interactions_filter).cache()
# ## Download 1OHR structure # In[2]: pdb = mmtfReader.download_mmtf_files(['1OHR'], sc) # ## Find ASP-ARG salt bridges # In[3]: interactionFilter = InteractionFilter(distanceCutoff=3.5, minInteractions=1) interactionFilter.set_query_groups(True, "ASP") interactionFilter.set_query_atom_names(True, ['OD1','OD2']) interactionFilter.set_target_groups(True, "ARG") interactionFilter.set_target_atom_names(True, ['NH1','NH2']) interactions = InteractionFingerprinter.get_polymer_interactions(pdb, interactionFilter) interactions.toPandas().head(10) # ## Terminate Spark # In[ ]: sc.stop()