aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: ea4736999351f6ad5c567cb30de145361618d0f1 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
[![DOI](https://zenodo.org/badge/5591/genenetwork/genenetwork2.svg)](https://zenodo.org/badge/latestdoi/5591/genenetwork/genenetwork2) [![JOSS](http://joss.theoj.org/papers/10.21105/joss.00025/status.svg)](http://joss.theoj.org/papers/10.21105/joss.00025)
[![Actions Status](https://github.com/genenetwork/genenetwork2/workflows/tests/badge.svg)](https://github.com/genenetwork/genenetwork2/actions)


# GeneNetwork

This repository contains the current source code for GeneNetwork (GN)
(https://www.genenetwork.org/ (version 2). GN2 is a Web
2.0-style framework that includes data and computational tools for online genetics and genomic analysis of
many different populations and many types of molecular, cellular, and physiological data.
The system is used by scientists and clinicians in the field of precision health care and systems genetics.
GN and its predecessors have been in operation since Jan 1994, making it one of the longest-lived web services in biomedical research (https://en.wikipedia.org/wiki/GeneNetwork, and see a partial list of publications using GN and its predecessor, WebQTL (https://genenetwork.org/references/).

## Run

We recommend you use GNU Guix. GNU Guix allows you to deploy
GeneNetwork2 and dependencies as a self contained unit on any machine.
The database can be run separately as well as the source tree (for
developers).

Make sure you have the
[guix-bioinformatics](https://git.genenetwork.org/guix-bioinformatics/guix-bioinformatics)
channel set up. Then, to drop into a development environment with all
dependencies, run
```sh
guix shell -Df guix.scm
```
Or, to drop into a development environment in a container, run
```
guix shell -C --network -Df guix.scm
```

In the development environment, start GeneNetwork2 by running, for
example,
```sh
env SERVER_PORT=5300 \
    GENENETWORK_FILES=~/data/gn2_data/ \
    GN_PROXY_URL="http://localhost:8080"\
    GN3_LOCAL_URL="http://localhost:8081"\
    ./bin/genenetwork2 ./etc/default_settings.py -gunicorn-dev
```

For full examples (you may need to set a number of environment
variables), including running scripts and a Python REPL, also see the
startup script
[./bin/genenetwork2](https://github.com/genenetwork/genenetwork2/blob/testing/bin/genenetwork2).

Also mariadb and redis need to be running, see
[INSTALL](./doc/README.org).

## Testing

To have tests pass, the redis and mariadb instance should be running, because of
asserts sprinkled in the code base.

Right now, the only tests running in CI are unittests. Please make
sure the existing unittests are green when submitting a PR.

See
[./bin/genenetwork2](https://github.com/genenetwork/genenetwork2/blob/testing/doc/docker-container.org)
for more details.

#### Mechanical Rob

We are building 'Mechanical Rob' automated testing using Python
[requests](https://github.com/genenetwork/genenetwork2/tree/testing/test/requests)
which can be run with:

```sh
env ./bin/genenetwork2 \
    GN_PROXY_URL="http://localhost:8080" \
    GN3_LOCAL_URL="http://localhost:8081 "\
    ./etc/default_settings.py -c \
    ../test/requests/test-website.py -a http://localhost:5003
```

The ./bin/genenetwork2 script sets up the environment and executes
test-website.py in a Python interpreter. The -a switch says to run all
tests and the URL points to the running GN2 http server.

#### Unit tests

To run unittests, first `cd` into the genenetwork2 directory:

```sh
# You can use the coverage tool to run the tests
# You could omit the -v which makes the output verbose
runcmd coverage run -m unittest discover -v

# Alternatively, you could run the unittests using:
runpython -m unittest discover -v

# To generate a report in wqflask/coverage_html_report/:
runcmd coverage html
```

The `runcmd` and `runpython` are shell aliases defined in the following way:

```sh
alias runpython="env TMPDIR=/tmp SERVER_PORT=5004 GENENETWORK_FILES=/gnu/data/gn2_data/ GN_PROXY_URL="http://localhost:8080" GN3_LOCAL_URL="http://localhost:8081" ./bin/genenetwork2

alias runcmd="time env TMPDIR=//tmp SERVER_PORT=5004 GENENETWORK_FILES=/gnu/data/gn2_data/ GN_PROXY_URL="http://localhost:8080" GN3_LOCAL_URL="http://localhost:8081" ./bin/genenetwork2 ./etc/default_settings.py -cli"
```

Replace some of the env variables as per your use case.

### Troubleshooting

If the menu does not pop up check your `GN2_BASE_URL`. E.g.

```
curl http://gn2-pjotr.genenetwork.org/api/v_pre1/gen_dropdown
```

check the logs. If there is ERROR 1054 (42S22): Unknown column
'InbredSet.Family' in 'field list' it may be you are trying the small
database.

## Documentation

User documentation can be found
[here](http://gn2.genenetwork.org/help).  The architecture of the
software stack is described [here](./doc/Architecture.org).  The
database schema is (still) shared with GN1 and currently described
[here](http://www.genenetwork.org/webqtl/main.py?FormID=schemaShowPage). Software
documentation is being expanded in the
[source code repository](https://github.com/genenetwork/genenetwork2/tree/master/doc).

## Contributing

Issues can be raised through
[github](https://github.com/genenetwork/genenetwork2/issues).

Contribute to GN2 source code by forking the
[github repository](https://github.com/genenetwork/genenetwork2/) with
git and sending us pull requests.

For development GN2 has a [mailing
list](http://listserv.uthsc.edu/mailman/listinfo/genenetwork-dev) and
an active IRC channel #genenetwork on freenode.net with a [web
interface](http://webchat.freenode.net/).

## License

The GeneNetwork2 source code is released under the Affero General
Public License 3 (AGPLv3). See [LICENSE.txt](LICENSE.txt).


## More information

For more information visit http://www.genenetwork.org/

## Cite

[![JOSS](http://joss.theoj.org/papers/10.21105/joss.00025/status.svg)](http://joss.theoj.org/papers/10.21105/joss.00025)

GeneNetwork was published in the Journal of Open Source Software as 'GeneNetwork: framework for web-based genetics' by Zachary Sloan, Danny Arends, Karl W. Broman, Arthur Centeno, Nicholas Furlotte, Harm Nijveen, Lei Yan, Xiang Zhou, Robert W. WIlliams and Pjotr Prins

You may also cite the software using

[![DOI](https://zenodo.org/badge/5591/genenetwork/genenetwork2.svg)](https://zenodo.org/badge/latestdoi/5591/genenetwork/genenetwork2).

## Contact

IRC on #genenetwork on irc.freenode.net.

Code and primary web service managed by Dr. Robert W. Williams and the
University of Tennessee Health Science Center, Memphis TN, USA.