diff options
author | zsloan | 2022-03-22 15:41:45 -0500 |
---|---|---|
committer | GitHub | 2022-03-22 15:41:45 -0500 |
commit | f4b02281cdf0a29d82caf8c06ce96f947e5cf623 (patch) | |
tree | a81c350a5a08b3b7cdf8375b728b48951791a14c /gn3/api | |
parent | 7b2901817a1aabd947483f87b5a2a2d33618de7e (diff) | |
parent | a75634cc5637168165e601f09dc9ad820e6e443f (diff) | |
download | genenetwork3-f4b02281cdf0a29d82caf8c06ce96f947e5cf623.tar.gz |
Merge pull request #29 from zsloan/feature/add_rqtl_pairscan
Feature/add rqtl pairscan
Diffstat (limited to 'gn3/api')
-rw-r--r-- | gn3/api/rqtl.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gn3/api/rqtl.py b/gn3/api/rqtl.py index b5627c5..70ebe12 100644 --- a/gn3/api/rqtl.py +++ b/gn3/api/rqtl.py @@ -6,7 +6,8 @@ from flask import current_app from flask import jsonify from flask import request -from gn3.computations.rqtl import generate_rqtl_cmd, process_rqtl_output, process_perm_output +from gn3.computations.rqtl import generate_rqtl_cmd, process_rqtl_mapping, \ + process_rqtl_pairscan, process_perm_output from gn3.computations.gemma import do_paths_exist rqtl = Blueprint("rqtl", __name__) @@ -25,7 +26,7 @@ run the rqtl_wrapper script and return the results as JSON # Split kwargs by those with values and boolean ones that just convert to True/False kwargs = ["covarstruct", "model", "method", "nperm", "scale", "control_marker"] - boolean_kwargs = ["addcovar", "interval", "pstrata"] + boolean_kwargs = ["addcovar", "interval", "pstrata", "pairscan"] all_kwargs = kwargs + boolean_kwargs rqtl_kwargs = {"geno": genofile, "pheno": phenofile} @@ -48,9 +49,11 @@ run the rqtl_wrapper script and return the results as JSON "output", rqtl_cmd.get('output_file'))): os.system(rqtl_cmd.get('rqtl_cmd')) - rqtl_output['results'] = process_rqtl_output(rqtl_cmd.get('output_file')) + if "pairscan" in rqtl_bool_kwargs: + rqtl_output['results'] = process_rqtl_pairscan(rqtl_cmd.get('output_file'), genofile) + else: + rqtl_output['results'] = process_rqtl_mapping(rqtl_cmd.get('output_file')) - rqtl_output['results'] = process_rqtl_output(rqtl_cmd.get('output_file')) if int(rqtl_kwargs['nperm']) > 0: rqtl_output['perm_results'], rqtl_output['suggestive'], rqtl_output['significant'] = \ process_perm_output(rqtl_cmd.get('output_file')) |