From 624ece086d026da9150cd35b2404874ccf607b07 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 17 May 2021 21:56:51 +0000 Subject: Created compose_rqtl_command and generate_rqtl_command to create the actual command to be run from the command line; used the same pattern as for GEMMA for consistency --- gn3/computations/rqtl.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 gn3/computations/rqtl.py (limited to 'gn3/computations') diff --git a/gn3/computations/rqtl.py b/gn3/computations/rqtl.py new file mode 100644 index 0000000..087a99f --- /dev/null +++ b/gn3/computations/rqtl.py @@ -0,0 +1,25 @@ +"""Procedures related rqtl computations""" +import os + +from typing import Dict +from gn3.commands import compose_rqtl_cmd +from gn3.fs_helpers import get_hash_of_files + +def generate_rqtl_cmd(rqtl_wrapper_cmd: str, + output_dir: str, + rqtl_wrapper_kwargs: Dict) -> Dict: + + _hash = get_hash_of_files( + [v for k, v in rqtl_wrapper_kwargs.items() if k in ["g", "p", "addcovar", + "model", "method", + "interval", "nperm", + "scale", "control"]]) + + _output_filename = f"{_hash}-output.json" + return { + "output_file": + _output_filename, + "rqtl_cmd": + compose_rqtl_cmd(rqtl_wrapper_cmd=rqtl_wrapper_cmd, + rqtl_wrapper_kwargs=rqtl_wrapper_kwargs) + } \ No newline at end of file -- cgit v1.2.3 From 0a8754a582f057bd335441eab15da3f629df9ad7 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 17 May 2021 23:56:10 +0000 Subject: Fixed variety of issues detected by pylint --- gn3/api/rqtl.py | 13 ++++++------- gn3/computations/rqtl.py | 50 ++++++++++++++++++++++++------------------------ 2 files changed, 31 insertions(+), 32 deletions(-) (limited to 'gn3/computations') diff --git a/gn3/api/rqtl.py b/gn3/api/rqtl.py index 82cf34f..7756310 100644 --- a/gn3/api/rqtl.py +++ b/gn3/api/rqtl.py @@ -1,5 +1,4 @@ -import os - +"""Endpoints for running the rqtl cmd""" from flask import Blueprint from flask import current_app from flask import jsonify @@ -12,8 +11,10 @@ rqtl = Blueprint("rqtl", __name__) @rqtl.route("/compute", methods=["POST"]) def compute(): - working_dir = os.path.join(current_app.config.get("TMPDIR")) + """Given at least a geno_file and pheno_file, generate and +run the rqtl_wrapper script and return the results as JSON + """ genofile = request.form['geno_file'] phenofile = request.form['pheno_file'] @@ -28,10 +29,8 @@ def compute(): rqtl_kwargs[kwarg] = request.form[kwarg] results = generate_rqtl_cmd( - rqtl_wrapper_cmd = current_app.config.get("RQTL_WRAPPER_CMD"), - output_dir = current_app.config.get('TMPDIR'), - rqtl_wrapper_kwargs = rqtl_kwargs + rqtl_wrapper_cmd=current_app.config.get("RQTL_WRAPPER_CMD"), + rqtl_wrapper_kwargs=rqtl_kwargs ) return jsonify(results) - diff --git a/gn3/computations/rqtl.py b/gn3/computations/rqtl.py index 087a99f..0e8cd1f 100644 --- a/gn3/computations/rqtl.py +++ b/gn3/computations/rqtl.py @@ -1,25 +1,25 @@ -"""Procedures related rqtl computations""" -import os - -from typing import Dict -from gn3.commands import compose_rqtl_cmd -from gn3.fs_helpers import get_hash_of_files - -def generate_rqtl_cmd(rqtl_wrapper_cmd: str, - output_dir: str, - rqtl_wrapper_kwargs: Dict) -> Dict: - - _hash = get_hash_of_files( - [v for k, v in rqtl_wrapper_kwargs.items() if k in ["g", "p", "addcovar", - "model", "method", - "interval", "nperm", - "scale", "control"]]) - - _output_filename = f"{_hash}-output.json" - return { - "output_file": - _output_filename, - "rqtl_cmd": - compose_rqtl_cmd(rqtl_wrapper_cmd=rqtl_wrapper_cmd, - rqtl_wrapper_kwargs=rqtl_wrapper_kwargs) - } \ No newline at end of file +"""Procedures related rqtl computations""" + +from typing import Dict +from gn3.commands import compose_rqtl_cmd +from gn3.fs_helpers import get_hash_of_files + +def generate_rqtl_cmd(rqtl_wrapper_cmd: str, + rqtl_wrapper_kwargs: Dict) -> Dict: + """Given the base rqtl_wrapper command and +dict of keyword arguments, return the full rqtl_wrapper command and an +output filename generated from a hash of the genotype and phenotype files + + """ + + _hash = get_hash_of_files( + [v for k, v in rqtl_wrapper_kwargs.items() if k in ["g", "p"]]) + + _output_filename = f"{_hash}-output.json" + return { + "output_file": + _output_filename, + "rqtl_cmd": + compose_rqtl_cmd(rqtl_wrapper_cmd=rqtl_wrapper_cmd, + rqtl_wrapper_kwargs=rqtl_wrapper_kwargs) + } -- cgit v1.2.3 From 74bc179807e80c1ee0f89cd98953263f68a05661 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 18 May 2021 19:40:46 +0000 Subject: Fixed generate_rqtl_cmd to make the kwarg hash from a combination of keywords and arguments + account for boolean kwargs without values (like --interval or --covar) --- gn3/computations/rqtl.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'gn3/computations') diff --git a/gn3/computations/rqtl.py b/gn3/computations/rqtl.py index 0e8cd1f..855a819 100644 --- a/gn3/computations/rqtl.py +++ b/gn3/computations/rqtl.py @@ -2,24 +2,36 @@ from typing import Dict from gn3.commands import compose_rqtl_cmd +from gn3.computations.gemma import generate_hash_of_string from gn3.fs_helpers import get_hash_of_files def generate_rqtl_cmd(rqtl_wrapper_cmd: str, - rqtl_wrapper_kwargs: Dict) -> Dict: + rqtl_wrapper_kwargs: Dict, + rqtl_wrapper_bool_kwargs: list) -> Dict: """Given the base rqtl_wrapper command and dict of keyword arguments, return the full rqtl_wrapper command and an output filename generated from a hash of the genotype and phenotype files """ + # Generate a hash from contents of the genotype and phenotype files _hash = get_hash_of_files( [v for k, v in rqtl_wrapper_kwargs.items() if k in ["g", "p"]]) + # Append to hash a hash of keyword arguments + _hash += generate_hash_of_string( + ",".join([f"{k}:{v}" for k, v in rqtl_wrapper_kwargs.items() if k not in ["g", "p"]])) + + # Append to hash a hash of boolean keyword arguments + _hash += generate_hash_of_string( + ",".join(rqtl_wrapper_bool_kwargs)) + _output_filename = f"{_hash}-output.json" return { "output_file": _output_filename, "rqtl_cmd": compose_rqtl_cmd(rqtl_wrapper_cmd=rqtl_wrapper_cmd, - rqtl_wrapper_kwargs=rqtl_wrapper_kwargs) + rqtl_wrapper_kwargs=rqtl_wrapper_kwargs, + rqtl_wrapper_bool_kwargs=rqtl_wrapper_bool_kwargs) } -- cgit v1.2.3 From e29a349b46d932411879a810fb0be3a0042bf540 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 19 May 2021 20:03:01 +0000 Subject: Temporarily replace forward-slashes with underscores, since they can be included in the hashes used for filenames --- gn3/computations/rqtl.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gn3/computations') diff --git a/gn3/computations/rqtl.py b/gn3/computations/rqtl.py index 855a819..605e0e1 100644 --- a/gn3/computations/rqtl.py +++ b/gn3/computations/rqtl.py @@ -26,6 +26,9 @@ output filename generated from a hash of the genotype and phenotype files _hash += generate_hash_of_string( ",".join(rqtl_wrapper_bool_kwargs)) + # Temporarily substitute forward-slashes in hash with underscores + _hash = _hash.replace("/", "_") + _output_filename = f"{_hash}-output.json" return { "output_file": -- cgit v1.2.3 From d3a4146fd38fc1d372091cecadfcf7c8fb377f3b Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 25 May 2021 20:27:05 +0000 Subject: Include code that processes rqtl output files and returns actual results instead of just the output filename --- gn3/api/rqtl.py | 16 +++++++++--- gn3/computations/rqtl.py | 64 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 75 insertions(+), 5 deletions(-) (limited to 'gn3/computations') diff --git a/gn3/api/rqtl.py b/gn3/api/rqtl.py index de620f7..0194b6f 100644 --- a/gn3/api/rqtl.py +++ b/gn3/api/rqtl.py @@ -1,10 +1,13 @@ """Endpoints for running the rqtl cmd""" +import os + from flask import Blueprint from flask import current_app from flask import jsonify from flask import request -from gn3.computations.rqtl import generate_rqtl_cmd +from gn3.commands import run_cmd +from gn3.computations.rqtl import generate_rqtl_cmd, process_rqtl_output, process_perm_output from gn3.computations.gemma import do_paths_exist rqtl = Blueprint("rqtl", __name__) @@ -35,10 +38,17 @@ run the rqtl_wrapper script and return the results as JSON if kwarg in boolean_kwargs: rqtl_bool_kwargs.append(kwarg) - results = generate_rqtl_cmd( + rqtl_cmd = generate_rqtl_cmd( rqtl_wrapper_cmd=current_app.config.get("RQTL_WRAPPER_CMD"), rqtl_wrapper_kwargs=rqtl_kwargs, rqtl_wrapper_bool_kwargs=boolean_kwargs ) - return jsonify(results) + os.system(rqtl_cmd.get('rqtl_cmd')) + + rqtl_output = {} + 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')) + + return jsonify(rqtl_output) diff --git a/gn3/computations/rqtl.py b/gn3/computations/rqtl.py index 605e0e1..22d9faf 100644 --- a/gn3/computations/rqtl.py +++ b/gn3/computations/rqtl.py @@ -1,6 +1,11 @@ """Procedures related rqtl computations""" - +import os +import numpy as np from typing import Dict +from typing import List + +from flask import current_app + from gn3.commands import compose_rqtl_cmd from gn3.computations.gemma import generate_hash_of_string from gn3.fs_helpers import get_hash_of_files @@ -29,7 +34,9 @@ output filename generated from a hash of the genotype and phenotype files # Temporarily substitute forward-slashes in hash with underscores _hash = _hash.replace("/", "_") - _output_filename = f"{_hash}-output.json" + _output_filename = f"{_hash}-output.csv" + rqtl_wrapper_kwargs["filename"] = _output_filename + return { "output_file": _output_filename, @@ -38,3 +45,56 @@ output filename generated from a hash of the genotype and phenotype files rqtl_wrapper_kwargs=rqtl_wrapper_kwargs, rqtl_wrapper_bool_kwargs=rqtl_wrapper_bool_kwargs) } + + +def process_rqtl_output(file_name: str) -> List: + """Given an output file name, read in R/qtl results and return + a List of marker objects + + """ + marker_obs = [] + # Later I should probably redo this using csv.read to avoid the + # awkwardness with removing quotes with [1:-1] + with open(os.path.join(current_app.config.get("TMPDIR"), "output", file_name), "r") as the_file: + for line in the_file: + line_items = line.split(",") + if line_items[1][1:-1] == "chr" or not line_items: + # Skip header line + continue + else: + # Convert chr to int if possible + try: + the_chr = int(line_items[1][1:-1]) + except: + the_chr = line_items[1][1:-1] + this_marker = { + "name": line_items[0][1:-1], + "chr": the_chr, + "cM": float(line_items[2]), + "Mb": float(line_items[2]), + "lod_score": float(line_items[3]) + } + marker_obs.append(this_marker) + + return marker_obs + + +def process_perm_output(file_name: str): + """Given base filename, read in R/qtl permutation output and calculate + suggestive and significant thresholds + + """ + perm_results = [] + with open(os.path.join(current_app.config.get("TMPDIR"), "output", "PERM_" + file_name), "r") as the_file: + for i, line in enumerate(the_file): + if i == 0: + # Skip header line + continue + else: + line_items = line.split(",") + perm_results.append(float(line_items[1])) + + suggestive = np.percentile(np.array(perm_results), 67) + significant = np.percentile(np.array(perm_results), 95) + + return perm_results, suggestive, significant -- cgit v1.2.3 From 07464f44f48895cc31ba2b088d6125e7777e1073 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Sun, 30 May 2021 13:26:15 +0300 Subject: fix index error (#16) --- gn3/computations/correlations.py | 2 +- tests/unit/computations/test_correlation.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gn3/computations') diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py index 25dd26d..f0ce502 100644 --- a/gn3/computations/correlations.py +++ b/gn3/computations/correlations.py @@ -247,7 +247,7 @@ def fetch_lit_correlation_data( cursor.execute(query_formatter(query, *tuple(reversed(query_values)))) lit_corr_results = cursor.fetchone() - lit_results = (gene_id, lit_corr_results[1])\ + lit_results = (gene_id, lit_corr_results[0])\ if lit_corr_results else (gene_id, 0) return lit_results return (gene_id, 0) diff --git a/tests/unit/computations/test_correlation.py b/tests/unit/computations/test_correlation.py index d264738..5746adf 100644 --- a/tests/unit/computations/test_correlation.py +++ b/tests/unit/computations/test_correlation.py @@ -276,7 +276,7 @@ class TestCorrelation(TestCase): input trait mouse gene id and mouse gene id """ - expected_db_results = [("val", x*0.1) + expected_db_results = [[x*0.1] for x in range(1, 4)] conn = DataBase(expected_results=expected_db_results) expected_results = ("1", 0.1) -- cgit v1.2.3 From cd921a4778d141b6dbbf9f60c178a4f681d47860 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 16 Jun 2021 19:40:03 +0000 Subject: Fixed spelling of coeffient to coefficient --- gn3/computations/correlations.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'gn3/computations') diff --git a/gn3/computations/correlations.py b/gn3/computations/correlations.py index f0ce502..0fe46ab 100644 --- a/gn3/computations/correlations.py +++ b/gn3/computations/correlations.py @@ -68,8 +68,8 @@ pearson,spearman and biweight mid correlation return value is rho and p_value "spearman": scipy.stats.spearmanr } use_corr_method = corr_mapping.get(corr_method, "spearman") - corr_coeffient, p_val = use_corr_method(primary_values, target_values) - return (corr_coeffient, p_val) + corr_coefficient, p_val = use_corr_method(primary_values, target_values) + return (corr_coefficient, p_val) def compute_sample_r_correlation(trait_name, corr_method, trait_vals, @@ -84,13 +84,13 @@ def compute_sample_r_correlation(trait_name, corr_method, trait_vals, if num_overlap > 5: - (corr_coeffient, p_value) =\ + (corr_coefficient, p_value) =\ compute_corr_coeff_p_value(primary_values=sanitized_traits_vals, target_values=sanitized_target_vals, corr_method=corr_method) - if corr_coeffient is not None: - return (trait_name, corr_coeffient, p_value, num_overlap) + if corr_coefficient is not None: + return (trait_name, corr_coefficient, p_value, num_overlap) return None @@ -140,10 +140,10 @@ def compute_all_sample_correlation(this_trait, for sample_correlation in results: if sample_correlation is not None: - (trait_name, corr_coeffient, p_value, + (trait_name, corr_coefficient, p_value, num_overlap) = sample_correlation corr_result = { - "corr_coeffient": corr_coeffient, + "corr_coefficient": corr_coefficient, "p_value": p_value, "num_overlap": num_overlap } @@ -151,7 +151,7 @@ def compute_all_sample_correlation(this_trait, corr_results.append({trait_name: corr_result}) return sorted( corr_results, - key=lambda trait_name: -abs(list(trait_name.values())[0]["corr_coeffient"])) + key=lambda trait_name: -abs(list(trait_name.values())[0]["corr_coefficient"])) def benchmark_compute_all_sample(this_trait, @@ -174,12 +174,12 @@ def benchmark_compute_all_sample(this_trait, trait_vals=this_vals, target_samples_vals=target_vals) if sample_correlation is not None: - (trait_name, corr_coeffient, + (trait_name, corr_coefficient, p_value, num_overlap) = sample_correlation else: continue corr_result = { - "corr_coeffient": corr_coeffient, + "corr_coefficient": corr_coefficient, "p_value": p_value, "num_overlap": num_overlap } @@ -195,20 +195,20 @@ def tissue_correlation_for_trait( compute_corr_p_value: Callable = compute_corr_coeff_p_value) -> dict: """Given a primary tissue values for a trait and the target tissues values compute the correlation_cooeff and p value the input required are arrays - output -> List containing Dicts with corr_coefficient value,P_value and + output -> List containing Dicts with corr_coefficient value, P_value and also the tissue numbers is len(primary) == len(target) """ # ax :todo assertion that length one one target tissue ==primary_tissue - (tissue_corr_coeffient, + (tissue_corr_coefficient, p_value) = compute_corr_p_value(primary_values=primary_tissue_vals, target_values=target_tissues_values, corr_method=corr_method) tiss_corr_result = {trait_id: { - "tissue_corr": tissue_corr_coeffient, + "tissue_corr": tissue_corr_coefficient, "tissue_number": len(primary_tissue_vals), "tissue_p_val": p_value}} -- cgit v1.2.3 From 476b146562070cee6a55c55c03c37ef3e19a1474 Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 18 Jun 2021 20:54:18 +0000 Subject: Resolve mypy errors in computations/rqtl.py --- gn3/computations/rqtl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gn3/computations') diff --git a/gn3/computations/rqtl.py b/gn3/computations/rqtl.py index 22d9faf..7b1a35c 100644 --- a/gn3/computations/rqtl.py +++ b/gn3/computations/rqtl.py @@ -1,8 +1,7 @@ """Procedures related rqtl computations""" import os import numpy as np -from typing import Dict -from typing import List +from typing import Dict, List, Union from flask import current_app @@ -55,7 +54,7 @@ def process_rqtl_output(file_name: str) -> List: marker_obs = [] # Later I should probably redo this using csv.read to avoid the # awkwardness with removing quotes with [1:-1] - with open(os.path.join(current_app.config.get("TMPDIR"), "output", file_name), "r") as the_file: + with open(os.path.join(current_app.config.get("TMPDIR", "/tmp"), "output", file_name), "r") as the_file: for line in the_file: line_items = line.split(",") if line_items[1][1:-1] == "chr" or not line_items: @@ -63,6 +62,7 @@ def process_rqtl_output(file_name: str) -> List: continue else: # Convert chr to int if possible + the_chr: Union[int, str] try: the_chr = int(line_items[1][1:-1]) except: @@ -85,7 +85,7 @@ def process_perm_output(file_name: str): """ perm_results = [] - with open(os.path.join(current_app.config.get("TMPDIR"), "output", "PERM_" + file_name), "r") as the_file: + with open(os.path.join(current_app.config.get("TMPDIR", "/tmp"), "output", "PERM_" + file_name), "r") as the_file: for i, line in enumerate(the_file): if i == 0: # Skip header line -- cgit v1.2.3 From d42b85ae5fcea1b71a7165fd6e64745a228c48f9 Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 18 Jun 2021 21:13:03 +0000 Subject: Fixed pylint issues --- gn3/api/rqtl.py | 7 ++++--- gn3/computations/rqtl.py | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 28 insertions(+), 24 deletions(-) (limited to 'gn3/computations') diff --git a/gn3/api/rqtl.py b/gn3/api/rqtl.py index 38f4c1e..ebb746c 100644 --- a/gn3/api/rqtl.py +++ b/gn3/api/rqtl.py @@ -6,7 +6,6 @@ from flask import current_app from flask import jsonify from flask import request -from gn3.commands import run_cmd from gn3.computations.rqtl import generate_rqtl_cmd, process_rqtl_output, process_perm_output from gn3.computations.gemma import do_paths_exist @@ -45,13 +44,15 @@ run the rqtl_wrapper script and return the results as JSON ) rqtl_output = {} - if not os.path.isfile(os.path.join(current_app.config.get("TMPDIR"), "output", rqtl_cmd.get('output_file'))): + if not os.path.isfile(os.path.join(current_app.config.get("TMPDIR"), + "output", rqtl_cmd.get('output_file'))): os.system(rqtl_cmd.get('rqtl_cmd')) rqtl_output['results'] = process_rqtl_output(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')) + rqtl_output['perm_results'], rqtl_output['suggestive'], rqtl_output['significant'] = \ + process_perm_output(rqtl_cmd.get('output_file')) return jsonify(rqtl_output) diff --git a/gn3/computations/rqtl.py b/gn3/computations/rqtl.py index 7b1a35c..0433b3f 100644 --- a/gn3/computations/rqtl.py +++ b/gn3/computations/rqtl.py @@ -1,8 +1,9 @@ """Procedures related rqtl computations""" import os -import numpy as np from typing import Dict, List, Union +import numpy as np + from flask import current_app from gn3.commands import compose_rqtl_cmd @@ -54,27 +55,28 @@ def process_rqtl_output(file_name: str) -> List: marker_obs = [] # Later I should probably redo this using csv.read to avoid the # awkwardness with removing quotes with [1:-1] - with open(os.path.join(current_app.config.get("TMPDIR", "/tmp"), "output", file_name), "r") as the_file: + with open(os.path.join(current_app.config.get("TMPDIR", "/tmp"), + "output", file_name), "r") as the_file: for line in the_file: line_items = line.split(",") if line_items[1][1:-1] == "chr" or not line_items: # Skip header line continue - else: - # Convert chr to int if possible - the_chr: Union[int, str] - try: - the_chr = int(line_items[1][1:-1]) - except: - the_chr = line_items[1][1:-1] - this_marker = { - "name": line_items[0][1:-1], - "chr": the_chr, - "cM": float(line_items[2]), - "Mb": float(line_items[2]), - "lod_score": float(line_items[3]) - } - marker_obs.append(this_marker) + + # Convert chr to int if possible + the_chr: Union[int, str] + try: + the_chr = int(line_items[1][1:-1]) + except ValueError: + the_chr = line_items[1][1:-1] + this_marker = { + "name": line_items[0][1:-1], + "chr": the_chr, + "cM": float(line_items[2]), + "Mb": float(line_items[2]), + "lod_score": float(line_items[3]) + } + marker_obs.append(this_marker) return marker_obs @@ -85,14 +87,15 @@ def process_perm_output(file_name: str): """ perm_results = [] - with open(os.path.join(current_app.config.get("TMPDIR", "/tmp"), "output", "PERM_" + file_name), "r") as the_file: + with open(os.path.join(current_app.config.get("TMPDIR", "/tmp"), + "output", "PERM_" + file_name), "r") as the_file: for i, line in enumerate(the_file): if i == 0: # Skip header line continue - else: - line_items = line.split(",") - perm_results.append(float(line_items[1])) + + line_items = line.split(",") + perm_results.append(float(line_items[1])) suggestive = np.percentile(np.array(perm_results), 67) significant = np.percentile(np.array(perm_results), 95) -- cgit v1.2.3