greenelab / connectivity-search-backend

Django backend for hetnet connectivity search
https://search-api.het.io
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

query_node_pair management command #9

Closed dhimmel closed 5 years ago

dhimmel commented 5 years ago

Management command to query the PathCount table for a node pair.

dhimmel commented 5 years ago

Example

Here is an example query that uses the query_node_pair management command:

# Obesity to FTO query
python manage.py query_node_pair \
  --source Disease DOID:9970 \
  --target Gene 79068

The following table is returned:

metapath_id path_count dwpc p_value source_degree target_degree n_dwpcs n_nonzero_dwpcs nonzero_mean nonzero_sd
DaGpBPpG 435 2.81 0.000% 373 32 29,000 29,000 2.10 0.12
DaGeAeG 6,204 2.00 0.000% 373 28 53,000 53,000 1.87 0.02
DpSpDaG 25 4.43 0.013% 17 6 101,000 100,994 2.44 0.45
DrDaG 3 5.14 0.244% 5 6 181,800 32,414 3.92 0.51
DlAlDaG 42 3.74 0.701% 33 6 20,200 20,200 2.73 0.38
DpSpDdG 5 3.38 2.744% 17 2 1,065,000 1,009,309 1.94 0.67
DrDuGiG 1 1.13 3.276% 5 2 2,885,400 124,913 2.00 1.16
DdGuDdG 4 3.84 4.334% 45 2 213,000 142,687 2.94 0.56
DdGeAeG 739 1.57 6.118% 45 28 53,000 53,000 1.49 0.05
DdGcGr>G 1 2.95 6.900% 45 7 69,600 6,278 3.70 1.00
DaG 1 5.27 8.889% 373 6 20,200 3,591 5.27 0.00
DlAdGcG 11 1.96 9.726% 33 6 115,400 105,130 1.15 0.63

Note that we should also look at IRX3 and IRX5 with obesity, as it appears that these genes may actually be causal for the FTO-SNPs-to-obesity GWAS association.

dhimmel commented 5 years ago

As of #20 being merged https://github.com/greenelab/hetmech-backend/commit/d7f6edf3f6156aa9efd41ac34534cdf1e5d8e313, we now have an API endpoint that returns a similar table. So will touch base with @dongbohu on what to do about this management command.