From 2c22e593c59a9b4f9129a2e669443709d9c5154a Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 9 Feb 2022 16:52:00 +0300 Subject: doc: Document how to fetch case-attribute data from a sample-list --- doc/database.org | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'doc') diff --git a/doc/database.org b/doc/database.org index d5462d4e..99d2905a 100644 --- a/doc/database.org +++ b/doc/database.org @@ -1370,6 +1370,27 @@ Empty set (0.00 sec) Hmmm. This is the test database. Then there are the plink files and VCF files. +** How to fetch case attribute data + +To fetch case attribute data, you need the PublixshXRef Id and it's +PhenotypeId. Run the following query (as an example): + +#+begin_src sql +SELECT concat(st.Name, ',', ifnull(pd.value, 'x'), ',', + ifnull(ps.error, 'x'), ',', ifnull(ns.count, 'x')) as 'Data', + ifnull(ca.Name, 'x') as 'CaseAttr', ifnull(cxref.value, 'x') as 'Value' +FROM PublishFreeze pf +JOIN PublishXRef px ON px.InbredSetId = pf.InbredSetId +JOIN PublishData pd ON pd.Id = px.DataId +JOIN Strain st ON pd.StrainId = st.Id +LEFT JOIN PublishSE ps ON ps.DataId = pd.Id AND ps.StrainId = pd.StrainId +LEFT JOIN NStrain ns ON ns.DataId = pd.Id AND ns.StrainId = pd.StrainId +LEFT JOIN CaseAttributeXRefNew cxref ON + cxref.InbredSetId = px.InbredSetId +LEFT JOIN CaseAttribute ca ON ca.Id = cxref.CaseAttributeId +WHERE px.Id = 10006 AND px.PhenotypeId = 28409 LIMIT 10; +#+end_src + * Optimize SQL? We were facing some issues with slow queries. A query -- cgit v1.2.3 From 16276bd6a158d7190f50e6a83ad736b335cdc567 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 16 Feb 2022 16:48:36 +0300 Subject: doc: Update query for fetching case attribute data * doc/database.org: Also join on StrainId for case-attribute data. --- doc/database.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/database.org b/doc/database.org index 99d2905a..32f1f8e0 100644 --- a/doc/database.org +++ b/doc/database.org @@ -1386,7 +1386,8 @@ JOIN Strain st ON pd.StrainId = st.Id LEFT JOIN PublishSE ps ON ps.DataId = pd.Id AND ps.StrainId = pd.StrainId LEFT JOIN NStrain ns ON ns.DataId = pd.Id AND ns.StrainId = pd.StrainId LEFT JOIN CaseAttributeXRefNew cxref ON - cxref.InbredSetId = px.InbredSetId + (cxref.InbredSetId = px.InbredSetId AND + cxref.StrainId = st.Id) LEFT JOIN CaseAttribute ca ON ca.Id = cxref.CaseAttributeId WHERE px.Id = 10006 AND px.PhenotypeId = 28409 LIMIT 10; #+end_src -- cgit v1.2.3 From 78be8330ada45715a9af29c84a04556d839d3dac Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 18 Mar 2022 06:38:01 +0300 Subject: Document configurations Document the configurations for the service, and how to use them when invoking the service. --- README.md | 32 ++++++++++++++++++ doc/configurations.org | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 doc/configurations.org (limited to 'doc') diff --git a/README.md b/README.md index 7fde7fc2..d2df1673 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,38 @@ deploy GN2 and dependencies as a self contained unit on any machine. The database can be run separately as well as the source tree (for developers). See the [installation docs](doc/README.org). +## Configuration + +GeneNetwork2 comes with a [default configuration file](./etc/default_settings.py) +which can be used as a starting point. + +The recommended way to deal with the configurations is to **copy** this default configuration file to a location outside of the repository, say, + +```sh +.../genenetwork2$ cp etc/default_settings.py "${HOME}/configurations/gn2.py" +``` + +then change the appropriate values in the new file. You can then pass in the new +file as the configuration file when launching the application, + +```sh +.../genenetwork2$ bin/genenetwork "${HOME}/configurations/gn2.py" +``` + +The other option is to override the configurations in `etc/default_settings.py` +by setting the configuration you want to override as an environment variable e.g. +to override the `SQL_URI` value, you could do something like: + +```sh +.../genenetwork2$ env SQL_URI="mysql://:@:/" \ + bin/genenetwork "${HOME}/configurations/gn2.py" +``` + +replacing the placeholders in the angle brackets with appropriate values. + +For a detailed breakdown of the configuration variables and their use, see the +[configuration documentation](doc/configurations.org) + ## Run Once having installed GN2 it can be run through a browser diff --git a/doc/configurations.org b/doc/configurations.org new file mode 100644 index 00000000..54c97d52 --- /dev/null +++ b/doc/configurations.org @@ -0,0 +1,92 @@ +#+TITLE: Configurations for GeneNetwork2 Service +#+OPTIONS: toc:3 + +* Configuration Variables + +** Basic Configurations + +- *GN_VERSION*: The current version of GN2 +- *GN2_PROXY*: URL to the GN2 proxy service +- *GN_SERVER_URL*: URL to the GN3 REST API server +- *GN2_BASE_URL*: ?? +- *GN2_BRANCH_URL*: +- *SERVER_PORT*: The port on which to run GN2. This is passed on to Flask. +- *SECRET_HMAC_CODE*: +- *GENENETWORK_FILES*: Base directory for all static data files +- *HOME*: The home directory of the user that GN2 runs as + +** Redis Configurations + +- *REDIS_URL*: The url to use to connect to the running redis instance +- *USE_REDIS*: Redis caching + + +** Database (MySQL) Configurations + +- *SQL_URI*: The URI to the database server in the form + ~mysql://:@:/~. Replace the items in + the angle brackets with the appropriate values for each item. +- *SQL_ALCHEMY_POOL_RECYCLE*: Probably obsoleted - the use of ORMs (ha/i)s + be(en/ing) phased off + +# ---- Flask configuration (see website) +** Flask-Specific Configurations +- *TRAP_BAD_REQUEST_ERRORS*: +- *SECURITY_CONFIRMABLE*: +- *SECURITY_TRACKABLE*: +- *SECURITY_REGISTERABLE*: +- *SECURITY_RECOVERABLE*: +- *SECURITY_EMAIL_SENDER*: +- *SECURITY_POST_LOGIN_VIEW*: + +** External Services + +*** GitHub Configurations + +- *GITHUB_CLIENT_ID*: Client identifier key for GitHub OAuth authentication +- *GITHUB_CLIENT_SECRET*: Client authentication token for github +- *GITHUB_AUTH_URL*: The url to use for authenticating the client (GN2) with + GitHub. Default: https://github.com/login/oauth/authorize +- *GITHUB_API_URL*: Once the client (GN2) is authenticated with GitHub, this URI + is the used to authenticate users using GitHub. The default value is + https://api.github.com/user + +*** ORCID Configurations + +- *ORCID_CLIENT_ID*: Client identifier key for ORCID OAuth authentication +- *ORCID_CLIENT_SECRET*: Client authentication token for ORCID +- *ORCID_AUTH_URL*: The url to use for authenticating the client (GN2) with + ORCID. Default: https://orcid.org/oauth/authorize +- *ORCID_TOKEN_URL*: The URI to acquire a token once GN2 has been authenticated + with ORCID. This token is used to authenticate users with the ORCID service. + The default value is https://orcid.org/oauth/token + +** Mail Configurations +- *SMTP_CONNECT*: +- *SMTP_USERNAME*: +- *SMTP_PASSWORD*: + +** Javascript Configurations +- *JS_GN_PATH*: Path to local javascript libraries for development purposes only. + See [[./development.org]] for more details + +** External Commands Configurations +- *REAPER_COMMAND*: The path to the reaper command/executable + +** Behavioral Settings +# ---- Behavioural settings (defaults) note that logger and log levels can +# be overridden at the module level and with enviroment settings +- *WEBSERVER_MODE*: Determines how the service is run. + If the value is ~DEBUG~, the service is run in debug mode - debug tools are + activated for the application. + If the value is ~DEV~, the service is run in development mode; logging is + activated. +- *WEBSERVER_BRANDING*: Probably unused - verify and remove. +- *WEBSERVER_DEPLOY*: Probably unused - verify and remove. +- *WEBSERVER_URL*: Probably unused - verify and remove. +- *LOG_LEVEL*: +- *LOG_LEVEL_DEBUG*: +- *LOG_SQL*: +- *LOG_SQL_ALCHEMY*: +- *LOG_BENCH*: +- *USE_GN_SERVER*: ?? -- cgit v1.2.3