summaryrefslogtreecommitdiff
path: root/issues/genenetwork1/gn1-network-graph.gmi
blob: f66221c1ebab91b9072deb60f4b07a6f475b56e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Fix GN1 Network Graph

Status: the network graph works on production. PDF output is empty, however.

## Tags

* type: bug
* priority: high
* keywords: GN1, Network Graph
* status: in progress
* kanban: pjotrp
* assigned: pjotrp, zachs

## Tracking

To reproduce this bug: select a 'shopping basket' and click on network graph. No image is shown.

We needed to revert on

=> https://github.com/genenetwork/genenetwork1/commit/88a6cb549cc318a961325666aed06f3196a5475d Commenting out functionality

Reverting on that code still won't show the image contained in

```
<img border="0" alt="the graph" src="/image/tmpzmtq88.gif" usemap="#webqtlGraph" />
```

The interesting thing is that files exist for tmpzmtq88, including PDF, but no GIF.

ripgrep has a useful subsetting command:

```rg --color always --type py image|less -R ```

this got me to web/webqtl/networkGraph/networkGraphPageBody.py with

```
web/webqtl/networkGraph/networkGraphPageBody.py:    def __init__(self, fd, matrix, traits, imageHtmlName, imageName, pdfName, nodes,
web/webqtl/networkGraph/networkGraphPageBody.py:        a <a href="%s" class="normalsize" target="_blank">PDF file</a>.</p> ''' % (imageName, pdfName)
```

The PDF link works but is an empty page! So something is going wrong with generating this image in an earlier step. The page says it is using GraphViz
which brings up

```
web/webqtl/networkGraph/networkGraphPageBody.py
128:        #Adds the html generated by graphviz that displays the graph itself
652:        body += ''' <p>This graph took %s seconds to generate with the <a href="http://www.research.att.com/sw/tools/graphviz/" class="normalsize" target="_blank">                               653:        GraphViz</a> visualization toolkit from <a href="http://www.research.att.com" class="normalsize" target="_blank">AT&amp;T Research</a>.</p>''' % (round(totalTime, 2))
```

So it uses graphviz, but we are not using a python module. There is a tool graphml2gv, but not used. This is used ```import networkGraphUtils```. Ah, I may have found it:

```
neatoExit = os.spawnlp(os.P_WAIT, "/usr/local/bin/neato", "/usr/local/bin/neato", webqtlConfig.IMGDIR + filename, "-T", format, "-o", webqtlConfig.IMGDIR + imageFilename)
```

hard coded bin path is wrong! And of course there are no checks there is any output in the first place :/. There are more local paths - and the good news is that these tools are in the GUIX profile already.

=> Commit aa4048af0f633101f2e723d86b5e99590885f2df fixes the network graph

Still, the PDF is empty. ps2pdf is used - but I think the ps file is missing.