Ejemplo n.º 1
0
        "get_contacts_config":
        GetContactsConfig(
            contacts_dir="../examples/contacts/",
            pdb_dir="../examples/contacts/",
        ),
        "dssp_config":
        DSSPConfig(),
    }

    config = ProteinGraphConfig(**configs)

    config.edge_construction_functions = [
        salt_bridge,
        hydrogen_bond,
        van_der_waals,
        pi_cation,
        pi_stacking,
        hydrophobic,
        t_stacking,
    ]
    # Test High-level API

    # Iterate over rows to produce Graph, pickle graph and label
    for row in tqdm(range(len(df))):
        example = df.iloc[row]
        file_path = f'pdbs/{example["Free PDB"]}.pdb'
        contact_file = f'contacts/{example["Free PDB"]}_contacts.tsv'

        g = construct_graph(config=config, pdb_code=example["Free PDB"])

        print(g)
Ejemplo n.º 2
0
    from graphein.protein.edges.distance import add_k_nn_edges
    from graphein.protein.features.sequence.sequence import molecular_weight

    configs = {
        "granularity": "CA",
        "keep_hets": False,
        "insertions": False,
        "verbose": False,
        "get_contacts_config": GetContactsConfig(),
        "dssp_config": DSSPConfig(),
        "graph_metadata_functions": [molecular_weight],
    }
    config = ProteinGraphConfig(**configs)
    config.edge_construction_functions = [
        partial(add_k_nn_edges, k=3, long_interaction_threshold=0)
    ]
    # Test High-level API
    g = construct_graph(
        config=config,
        pdb_path="../examples/pdbs/3eiy.pdb",
    )
    """
    # Test Low-level API
    raw_df = read_pdb_to_dataframe(
        pdb_path="../../examples/pdbs/3eiy.pdb",
        verbose=config.verbose,
    )

    processed_pdb_df = process_dataframe(
        protein_df=raw_df,
Ejemplo n.º 3
0
    # v, f, a = create_mesh(pdb_code="3eiy")
    # m = convert_verts_and_face_to_mesh(v, f)
    # plot_pointcloud(m, "Test")
    # TEST PROTEIN STRUCTURE GRAPH PLOTTING
    configs = {
        "granularity": "atom",
        "keep_hets": False,
        "deprotonate": True,
        "insertions": False,
        "verbose": False,
    }

    config = ProteinGraphConfig(**configs)
    config.edge_construction_functions = [
        add_atomic_edges,
        add_ring_status,
        add_bond_order,
    ]

    config.node_metadata_functions = [meiler_embedding, expasy_protein_scale]

    g = construct_graph(
        config=config, pdb_path="../examples/pdbs/3eiy.pdb", pdb_code="3eiy"
    )

    p = plotly_protein_structure_graph(
        g,
        30,
        (1000, 2000),
        colour_nodes_by="element_symbol",
        colour_edges_by="kind",