Commit 9af9f721 authored by Hanna  JULIENNE's avatar Hanna JULIENNE
Browse files

dynamic text rendering on front page working

parent c468538f
......@@ -4,7 +4,7 @@
The JASS web interface efficiently compute multi-trait genome-wide association study (GWAS) and enable user to interacively explore results.
JASS can increase statistical power by leveraging pleiotropy, but also can deepen our understanding of SNPs functional effect (for a detailed explanation see the citation box below).
Currently this website host {{initmeta.nb_phenotypes}} traits available for analysis with the omnibus test.
All GWAS have been pre-processed using the <a href="https://gitlab.pasteur.fr/statistical-genetics/jass_suite_pipeline">JASS pre-processing pipeline</a> and imputation of missing statistics has been conducted using the <a href="https://gitlab.pasteur.fr/statistical-genetics/raiss">RAISS software</a>, resulting in a total of {{initmeta.nb_SNPs}} SNPs available for analysis.
All GWAS have been pre-processed using the <a href="https://gitlab.pasteur.fr/statistical-genetics/jass_suite_pipeline">JASS pre-processing pipeline</a> and imputation of missing statistics has been conducted using the <a href="https://gitlab.pasteur.fr/statistical-genetics/raiss">RAISS software</a>, resulting in a total of {{initmeta.nb_snps}} SNPs available for analysis.
To analyze data in your own facility and/or access supplementary joint analysis tests, please download and install the JASS python package.
</p>
......@@ -72,7 +72,9 @@ export default {
short_desc: 'Run Region Analysis',
link:'/'
}
]
],
initmeta : [],
}
}
}
......
......@@ -17,13 +17,17 @@ from functools import reduce
options.mode.chained_assignment = None
warnings.filterwarnings("ignore", category=tables.NaturalNameWarning)
class InitMeta(object):
def __init__(self, nb_snps, nb_phenotypes):
self.nb_snps = nb_snps
self.nb_phenotypes = nb_phenotypes
def get_inittable_meta(file_name):
init_store = HDFStore(file_name)
nb_SNPs = init_store.get_storer("SumStatTab").nrows
nb_snps = init_store.get_storer("SumStatTab").nrows
init_store.close()
nb_phenotypes = read_hdf(file_name, "PhenoList").shape[0]
return (nb_SNPs, nb_phenotypes)
return InitMeta(nb_snps, nb_phenotypes)
def get_gwasname(file_name):
return "_".join(os.path.basename(file_name).split("_")[0:3])
......
......@@ -9,6 +9,7 @@ from webargs.flaskparser import FlaskParser
from jass.config import config
from jass.models.phenotype import get_available_phenotypes
from jass.models.inittable import get_inittable_meta
from jass.models.project import Project
from jass.tasks import create_project
from flask_cors import CORS
......@@ -25,10 +26,9 @@ class PhenotypeSchema(ma.Schema):
data_path = ma.fields.String()
class InittableMetaSchema(ma.Schema):
nb_SNPs = ma.fields.Integer()
nb_snps = ma.fields.Integer()
nb_phenotypes = ma.fields.Integer()
class ProjectParamsSchema(ma.Schema):
class Meta:
unknown = ma.EXCLUDE
......@@ -96,9 +96,6 @@ CORS(blp_inittable)
def get_phenotypes():
return get_available_phenotypes(os.path.join(config["DATA_DIR"], "initTable.hdf5"))
def get_inittable_meta():
return get_inittable_meta(os.path.join(config["DATA_DIR"], "initTable.hdf5"))
@blp_phenotypes.route("")
class PhenotypesMethodView(MethodView):
......@@ -109,10 +106,10 @@ class PhenotypesMethodView(MethodView):
@blp_inittable.route("")
class InitMetaMethodView(MethodView):
@blp_inittable.response(200, InittableMetaSchema(many=True))
@blp_inittable.response(200, InittableMetaSchema())
def get(self):
"""Number of phenotype and SNPs"""
return get_init_meta()
return get_inittable_meta(os.path.join(config["DATA_DIR"], "initTable.hdf5"))
@blp_projects.route("")
class ProjectCreateMethodView(MethodView):
......@@ -450,3 +447,4 @@ jass_app = JassApp()
jass_app.register_api_blueprint(blp_phenotypes)
jass_app.register_api_blueprint(blp_projects)
jass_app.register_api_blueprint(blp_local_projects)
jass_app.register_api_blueprint(blp_inittable)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment