How can I construct the adjacency matrix for gene ontology between genes
1
0
Entering edit mode
7 weeks ago

Hi, I've been trying construct the adjacency matrix by counting the matched GO terms between two genes.

For example, when I insert three genes, the result should be like this:

Genes: {7038, 7157, 472}

GO: Biological Function (BF)

Each number represents the matched number of gene ontology term between two genes.

Unfortunately, there are huge number of genes, I need the tool that calculate it automatically.

Which tool or python package can do this job?

GeneOntology python GO • 382 views
1
Entering edit mode
7 weeks ago
barslmn ★ 1.3k

Networkx has a function called adjacency_matrix. Here is an example with obonet and networkx.

0
Entering edit mode

I guess that obonet represents the network containing nodes (=GO term) and edges (=hierarchical relation).

But I need gene-gene adjacency matrix. If two genes have a common GO term, the value of them is set to 1 in the matrix.

Can obonet and networkx make this matrix?

0
Entering edit mode

I don't know really. GO has annotation files with the gene symbols. Maybe something can be written from that file if you can't find a tool that already does this.