aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/conftest.py24
-rw-r--r--tests/integration/test_correlation.py8
-rw-r--r--tests/integration/test_gemma.py14
-rw-r--r--tests/integration/test_general.py8
-rw-r--r--tests/integration/test_partial_correlations.py225
-rw-r--r--tests/integration/test_wgcna.py3
-rw-r--r--tests/performance/perf_query.py20
-rw-r--r--tests/unit/computations/partial_correlations_test_data/pcor_rec_blackbox_test.txt1009
-rw-r--r--tests/unit/computations/test_correlation.py80
-rw-r--r--tests/unit/computations/test_diff.py3
-rw-r--r--tests/unit/computations/test_gemma.py10
-rw-r--r--tests/unit/computations/test_parsers.py4
-rw-r--r--tests/unit/computations/test_partial_correlations.py147
-rw-r--r--tests/unit/computations/test_pca.py101
-rw-r--r--tests/unit/computations/test_qtlreaper.py4
-rw-r--r--tests/unit/computations/test_rqtl.py2
-rw-r--r--tests/unit/computations/test_slink.py13
-rw-r--r--tests/unit/computations/test_wgcna.py8
-rw-r--r--tests/unit/db/test_audit.py3
-rw-r--r--tests/unit/db/test_correlation.py100
-rw-r--r--tests/unit/db/test_datasets.py35
-rw-r--r--tests/unit/db/test_db.py8
-rw-r--r--tests/unit/db/test_genotypes.py6
-rw-r--r--tests/unit/db/test_genotypes2.py13
-rw-r--r--tests/unit/db/test_sample_data.py188
-rw-r--r--tests/unit/db/test_species.py5
-rw-r--r--tests/unit/db/test_traits.py60
-rw-r--r--tests/unit/test_authentication.py9
-rw-r--r--tests/unit/test_commands.py22
-rw-r--r--tests/unit/test_csvcmp.py170
-rw-r--r--tests/unit/test_data_helpers.py37
-rw-r--r--tests/unit/test_db_utils.py7
-rw-r--r--tests/unit/test_file_utils.py14
-rw-r--r--tests/unit/test_heatmaps.py14
34 files changed, 2150 insertions, 224 deletions
diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py
new file mode 100644
index 0000000..be927a4
--- /dev/null
+++ b/tests/integration/conftest.py
@@ -0,0 +1,24 @@
+"""Module that holds fixtures for integration tests"""
+import pytest
+
+from gn3.app import create_app
+from gn3.db_utils import database_connector
+
+@pytest.fixture(scope="session")
+def client():
+ """Create a test client fixture for tests"""
+ # Do some setup
+ app = create_app()
+ app.config.update({"TESTING": True})
+ app.testing = True
+ yield app.test_client()
+ # Do some teardown/cleanup
+
+
+@pytest.fixture
+def db_conn():
+ """Create a db connection fixture for tests"""
+ ## Update this to use temp db once that is in place
+ conn = database_connector()
+ yield conn
+ conn.close()
diff --git a/tests/integration/test_correlation.py b/tests/integration/test_correlation.py
index bdd9bce..d52ab01 100644
--- a/tests/integration/test_correlation.py
+++ b/tests/integration/test_correlation.py
@@ -1,6 +1,7 @@
"""module contains integration tests for correlation"""
from unittest import TestCase
from unittest import mock
+import pytest
from gn3.app import create_app
@@ -10,6 +11,7 @@ class CorrelationIntegrationTest(TestCase):
def setUp(self):
self.app = create_app().test_client()
+ @pytest.mark.integration_test
@mock.patch("gn3.api.correlation.compute_all_sample_correlation")
def test_sample_r_correlation(self, mock_compute_samples):
"""Test /api/correlation/sample_r/{method}"""
@@ -61,6 +63,7 @@ class CorrelationIntegrationTest(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.get_json(), api_response)
+ @pytest.mark.integration_test
@mock.patch("gn3.api.correlation.compute_all_lit_correlation")
@mock.patch("gn3.api.correlation.database_connector")
def test_lit_correlation(self, database_connector, mock_compute_corr):
@@ -68,7 +71,9 @@ class CorrelationIntegrationTest(TestCase):
mock_compute_corr.return_value = []
- database_connector.return_value = (mock.Mock(), mock.Mock())
+ database_connector.return_value = mock.Mock()
+ database_connector.return_value.__enter__ = mock.Mock()
+ database_connector.return_value.__exit__ = mock.Mock()
post_data = {"1426678_at": "68031",
"1426679_at": "68036",
@@ -80,6 +85,7 @@ class CorrelationIntegrationTest(TestCase):
self.assertEqual(mock_compute_corr.call_count, 1)
self.assertEqual(response.status_code, 200)
+ @pytest.mark.integration_test
@mock.patch("gn3.api.correlation.compute_tissue_correlation")
def test_tissue_correlation(self, mock_tissue_corr):
"""Test api/correlation/tissue_corr/{corr_method}"""
diff --git a/tests/integration/test_gemma.py b/tests/integration/test_gemma.py
index f871173..0515539 100644
--- a/tests/integration/test_gemma.py
+++ b/tests/integration/test_gemma.py
@@ -7,6 +7,8 @@ from dataclasses import dataclass
from typing import Callable
from unittest import mock
+import pytest
+
from gn3.app import create_app
@@ -30,6 +32,7 @@ class GemmaAPITest(unittest.TestCase):
"TMPDIR": "/tmp"
}).test_client()
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.run_cmd")
def test_get_version(self, mock_run_cmd):
"""Test that the correct response is returned"""
@@ -38,6 +41,7 @@ class GemmaAPITest(unittest.TestCase):
self.assertEqual(response.get_json(), {"status": 0, "output": "v1.9"})
self.assertEqual(response.status_code, 200)
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.redis.Redis")
def test_check_cmd_status(self, mock_redis):
"""Test that you can check the status of a given command"""
@@ -52,6 +56,7 @@ class GemmaAPITest(unittest.TestCase):
name="cmd::2021-02-1217-3224-3224-1234", key="status")
self.assertEqual(response.get_json(), {"status": "test"})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.queue_cmd")
@mock.patch("gn3.computations.gemma.get_hash_of_files")
@mock.patch("gn3.api.gemma.jsonfile_to_dict")
@@ -94,6 +99,7 @@ class GemmaAPITest(unittest.TestCase):
"unique_id": "my-unique-id"
})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.queue_cmd")
@mock.patch("gn3.computations.gemma.get_hash_of_files")
@mock.patch("gn3.api.gemma.jsonfile_to_dict")
@@ -137,6 +143,7 @@ class GemmaAPITest(unittest.TestCase):
"unique_id": "my-unique-id"
})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.queue_cmd")
@mock.patch("gn3.computations.gemma.get_hash_of_files")
@mock.patch("gn3.api.gemma.jsonfile_to_dict")
@@ -187,6 +194,7 @@ class GemmaAPITest(unittest.TestCase):
"output_file": "hash-output.json"
})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.queue_cmd")
@mock.patch("gn3.computations.gemma.get_hash_of_files")
@mock.patch("gn3.api.gemma.jsonfile_to_dict")
@@ -240,6 +248,7 @@ class GemmaAPITest(unittest.TestCase):
"output_file": "hash-output.json"
})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.queue_cmd")
@mock.patch("gn3.computations.gemma.get_hash_of_files")
@mock.patch("gn3.api.gemma.jsonfile_to_dict")
@@ -292,6 +301,7 @@ class GemmaAPITest(unittest.TestCase):
"output_file": "hash-output.json"
})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.queue_cmd")
@mock.patch("gn3.computations.gemma.get_hash_of_files")
@mock.patch("gn3.api.gemma.jsonfile_to_dict")
@@ -346,6 +356,7 @@ class GemmaAPITest(unittest.TestCase):
"output_file": "hash-output.json"
})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.queue_cmd")
@mock.patch("gn3.computations.gemma.get_hash_of_files")
@mock.patch("gn3.api.gemma.jsonfile_to_dict")
@@ -401,6 +412,7 @@ class GemmaAPITest(unittest.TestCase):
"output_file": "hash-output.json"
})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.queue_cmd")
@mock.patch("gn3.computations.gemma.get_hash_of_files")
@mock.patch("gn3.api.gemma.jsonfile_to_dict")
@@ -465,6 +477,7 @@ class GemmaAPITest(unittest.TestCase):
"output_file": "hash-output.json"
})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.queue_cmd")
@mock.patch("gn3.computations.gemma.get_hash_of_files")
@mock.patch("gn3.api.gemma.jsonfile_to_dict")
@@ -530,6 +543,7 @@ class GemmaAPITest(unittest.TestCase):
"output_file": "hash-output.json"
})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.gemma.queue_cmd")
@mock.patch("gn3.computations.gemma.get_hash_of_files")
@mock.patch("gn3.api.gemma.jsonfile_to_dict")
diff --git a/tests/integration/test_general.py b/tests/integration/test_general.py
index 8fc2b43..9d87449 100644
--- a/tests/integration/test_general.py
+++ b/tests/integration/test_general.py
@@ -1,8 +1,10 @@
"""Integration tests for some 'general' API endpoints"""
import os
import unittest
-
from unittest import mock
+
+import pytest
+
from gn3.app import create_app
@@ -11,6 +13,7 @@ class GeneralAPITest(unittest.TestCase):
def setUp(self):
self.app = create_app().test_client()
+ @pytest.mark.integration_test
def test_metadata_endpoint_exists(self):
"""Test that /metadata/upload exists"""
response = self.app.post("/api/metadata/upload/d41d86-e4ceEo")
@@ -19,6 +22,7 @@ class GeneralAPITest(unittest.TestCase):
{"status": 128,
"error": "Please provide a file!"})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.general.extract_uploaded_file")
def test_metadata_file_upload(self, mock_extract_upload):
"""Test correct upload of file"""
@@ -37,6 +41,7 @@ class GeneralAPITest(unittest.TestCase):
{"status": 0,
"token": "d41d86-e4ceEo"})
+ @pytest.mark.integration_test
def test_metadata_file_wrong_upload(self):
"""Test that incorrect upload return correct status code"""
response = self.app.post("/api/metadata/upload/d41d86-e4ceEo",
@@ -47,6 +52,7 @@ class GeneralAPITest(unittest.TestCase):
{"status": 128,
"error": "gzip failed to unpack file"})
+ @pytest.mark.integration_test
@mock.patch("gn3.api.general.run_cmd")
def test_run_r_qtl(self, mock_run_cmd):
"""Test correct upload of file"""
diff --git a/tests/integration/test_partial_correlations.py b/tests/integration/test_partial_correlations.py
new file mode 100644
index 0000000..4bf352a
--- /dev/null
+++ b/tests/integration/test_partial_correlations.py
@@ -0,0 +1,225 @@
+"""Test partial correlations"""
+from unittest import mock
+
+import pytest
+
+from gn3.computations.partial_correlations import partial_correlations_entry
+
+@pytest.mark.integration_test
+@pytest.mark.parametrize(
+ "post_data", (
+ None, {}, {
+ "primary_trait": None,
+ "control_traits": None,
+ "method": None,
+ "target_db": None
+ }, {
+ "primary_trait": None,
+ "control_traits": None,
+ "method": None,
+ "target_db": "a_db"
+ }, {
+ "primary_trait": None,
+ "control_traits": None,
+ "method": "a_method",
+ "target_db": None
+ }, {
+ "primary_trait": None,
+ "control_traits": None,
+ "method": "a_method",
+ "target_db": "a_db"
+ }, {
+ "primary_trait": None,
+ "control_traits": ["a_trait", "another"],
+ "method": None,
+ "target_db": None
+ }, {
+ "primary_trait": None,
+ "control_traits": ["a_trait", "another"],
+ "method": None,
+ "target_db": "a_db"
+ }, {
+ "primary_trait": None,
+ "control_traits": ["a_trait", "another"],
+ "method": "a_method",
+ "target_db": None
+ }, {
+ "primary_trait": None,
+ "control_traits": ["a_trait", "another"],
+ "method": "a_method",
+ "target_db": "a_db"
+ }, {
+ "primary_trait": "a_trait",
+ "control_traits": None,
+ "method": None,
+ "target_db": None
+ }, {
+ "primary_trait": "a_trait",
+ "control_traits": None,
+ "method": None,
+ "target_db": "a_db"
+ }, {
+ "primary_trait": "a_trait",
+ "control_traits": None,
+ "method": "a_method",
+ "target_db": None
+ }, {
+ "primary_trait": "a_trait",
+ "control_traits": None,
+ "method": "a_method",
+ "target_db": "a_db"
+ }, {
+ "primary_trait": "a_trait",
+ "control_traits": ["a_trait", "another"],
+ "method": None,
+ "target_db": None
+ }, {
+ "primary_trait": "a_trait",
+ "control_traits": ["a_trait", "another"],
+ "method": None,
+ "target_db": "a_db"
+ }, {
+ "primary_trait": "a_trait",
+ "control_traits": ["a_trait", "another"],
+ "method": "a_method",
+ "target_db": None
+ }))
+def test_partial_correlation_api_with_missing_request_data(client, post_data):
+ """
+ Test /api/correlations/partial endpoint with various expected request data
+ missing.
+ """
+ response = client.post("/api/correlation/partial", json=post_data)
+ assert (
+ response.status_code == 400 and response.is_json and
+ response.json.get("status") == "error")
+
+@pytest.mark.integration_test
+@pytest.mark.slow
+@pytest.mark.parametrize(
+ "post_data",
+ ({# ProbeSet
+ "primary_trait": {"dataset": "a_dataset", "trait_name": "a_name"},
+ "control_traits": [
+ {"dataset": "a_dataset", "trait_name": "a_name"},
+ {"dataset": "a_dataset2", "trait_name": "a_name2"}],
+ "method": "a_method",
+ "target_db": "a_db"
+ }, {# Publish
+ "primary_trait": {
+ "dataset": "a_Publish_dataset", "trait_name": "a_name"},
+ "control_traits": [
+ {"dataset": "a_dataset", "trait_name": "a_name"},
+ {"dataset": "a_dataset2", "trait_name": "a_name2"}],
+ "method": "a_method",
+ "target_db": "a_db"
+ }, {# Geno
+ "primary_trait": {"dataset": "a_Geno_dataset", "trait_name": "a_name"},
+ "control_traits": [
+ {"dataset": "a_dataset", "trait_name": "a_name"},
+ {"dataset": "a_dataset2", "trait_name": "a_name2"}],
+ "method": "a_method",
+ "target_db": "a_db"
+ }, {# Temp
+ "primary_trait": {"dataset": "a_Temp_dataset", "trait_name": "a_name"},
+ "control_traits": [
+ {"dataset": "a_dataset", "trait_name": "a_name"},
+ {"dataset": "a_dataset2", "trait_name": "a_name2"}],
+ "method": "a_method",
+ "target_db": "a_db"
+ }))
+def test_partial_correlation_api_with_non_existent_primary_traits(
+ client, post_data, mocker):
+ """
+ Check that the system responds appropriately in the case where the user
+ makes a request with a non-existent primary trait.
+ """
+ mocker.patch("gn3.api.correlation.redis.Redis", mock.MagicMock())
+ response = client.post("/api/correlation/partial", json=post_data)
+ assert (
+ response.status_code == 200 and response.is_json and
+ response.json.get("status") == "success")
+
+@pytest.mark.integration_test
+@pytest.mark.slow
+@pytest.mark.parametrize(
+ "post_data",
+ ({# ProbeSet
+ "primary_trait": {
+ "dataset": "UCLA_BXDBXH_CARTILAGE_V2",
+ "trait_name": "ILM103710672"},
+ "control_traits": [
+ {"dataset": "a_dataset", "trait_name": "a_name"},
+ {"dataset": "a_dataset2", "trait_name": "a_name2"}],
+ "method": "a_method",
+ "target_db": "a_db"
+ }, {# Publish
+ "primary_trait": {"dataset": "BXDPublish", "trait_name": "BXD_12557"},
+ "control_traits": [
+ {"dataset": "a_dataset", "trait_name": "a_name"},
+ {"dataset": "a_dataset2", "trait_name": "a_name2"}],
+ "method": "a_method",
+ "target_db": "a_db"
+ }, {# Geno
+ "primary_trait": {"dataset": "AKXDGeno", "trait_name": "D4Mit16"},
+ "control_traits": [
+ {"dataset": "a_dataset", "trait_name": "a_name"},
+ {"dataset": "a_dataset2", "trait_name": "a_name2"}],
+ "method": "a_method",
+ "target_db": "a_db"
+ }
+ # Temp -- the data in the database for these is ephemeral, making it
+ # difficult to test for this
+ ))
+def test_partial_correlation_api_with_non_existent_control_traits(client, post_data, mocker):
+ """
+ Check that the system responds appropriately in the case where the user
+ makes a request with a non-existent control traits.
+
+ The code repetition here is on purpose - valuing clarity over succinctness.
+ """
+ mocker.patch("gn3.api.correlation.redis.Redis", mock.MagicMock())
+ response = client.post("/api/correlation/partial", json=post_data)
+ assert (
+ response.status_code == 200 and response.is_json and
+ response.json.get("status") == "success")
+
+@pytest.mark.integration_test
+@pytest.mark.slow
+@pytest.mark.parametrize(
+ "primary,controls,method,target", (
+ (# Probeset
+ "UCLA_BXDBXH_CARTILAGE_V2::ILM103710672", (
+ "UCLA_BXDBXH_CARTILAGE_V2::nonExisting01",
+ "UCLA_BXDBXH_CARTILAGE_V2::nonExisting02",
+ "UCLA_BXDBXH_CARTILAGE_V2::ILM380019"),
+ "Genetic Correlation, Pearson's r", "BXDPublish"),
+ (# Publish
+ "BXDPublish::17937", (
+ "BXDPublish::17940",
+ "BXDPublish::nonExisting03"),
+ "Genetic Correlation, Spearman's rho", "BXDPublish"),
+ (# Geno
+ "AKXDGeno::D4Mit16", (
+ "AKXDGeno::D1Mit170",
+ "AKXDGeno::nonExisting04",
+ "AKXDGeno::D1Mit135",
+ "AKXDGeno::nonExisting05",
+ "AKXDGeno::nonExisting06"),
+ "SGO Literature Correlation", "BXDPublish")
+ )
+ # Temp -- the data in the database for these is ephemeral, making it
+ # difficult to test for these without a temp database with the temp
+ # traits data set to something we are in control of
+ )
+
+def test_part_corr_api_with_mix_of_existing_and_non_existing_control_traits(
+ db_conn, primary, controls, method, target):
+ """
+ Check that calling the function with a mix of existing and missing control
+ traits raises an warning.
+ """
+ criteria = 10
+ with pytest.warns(UserWarning):
+ partial_correlations_entry(
+ db_conn, primary, controls, method, criteria, target)
diff --git a/tests/integration/test_wgcna.py b/tests/integration/test_wgcna.py
index 078449d..5880b40 100644
--- a/tests/integration/test_wgcna.py
+++ b/tests/integration/test_wgcna.py
@@ -3,6 +3,8 @@
from unittest import TestCase
from unittest import mock
+import pytest
+
from gn3.app import create_app
@@ -12,6 +14,7 @@ class WgcnaIntegrationTest(TestCase):
def setUp(self):
self.app = create_app().test_client()
+ @pytest.mark.integration_test
@mock.patch("gn3.api.wgcna.call_wgcna_script")
def test_wgcna_endpoint(self, mock_wgcna_script):
"""test /api/wgcna/run_wgcna endpoint"""
diff --git a/tests/performance/perf_query.py b/tests/performance/perf_query.py
index 12cb944..e534e9b 100644
--- a/tests/performance/perf_query.py
+++ b/tests/performance/perf_query.py
@@ -28,21 +28,19 @@ def timer(func):
def query_executor(query: str,
fetch_all: bool = True):
"""function to execute a query"""
- conn, _ = database_connector()
+ with database_connector() as conn:
+ with conn.cursor() as cursor:
+ cursor.execute(query)
- with conn:
- cursor = conn.cursor()
- cursor.execute(query)
-
- if fetch_all:
- return cursor.fetchall()
- return cursor.fetchone()
+ if fetch_all:
+ return cursor.fetchall()
+ return cursor.fetchone()
def fetch_probeset_query(dataset_name: str):
"""contains queries for datasets"""
- query = """SELECT * from ProbeSetData
+ query = f"""SELECT * from ProbeSetData
where StrainID in (4, 5, 6, 7, 8, 9, 10, 11, 12,
14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28,
29, 30, 31, 35, 36, 37, 39, 98, 99, 100, 103,
@@ -53,8 +51,8 @@ def fetch_probeset_query(dataset_name: str):
and id in (SELECT ProbeSetXRef.DataId
FROM (ProbeSet, ProbeSetXRef, ProbeSetFreeze)
WHERE ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id
- and ProbeSetFreeze.Name = '{}'
- and ProbeSet.Id = ProbeSetXRef.ProbeSetId)""".format(dataset_name)
+ and ProbeSetFreeze.Name = '{dataset_name}'
+ and ProbeSet.Id = ProbeSetXRef.ProbeSetId)"""
return query
diff --git a/tests/unit/computations/partial_correlations_test_data/pcor_rec_blackbox_test.txt b/tests/unit/computations/partial_correlations_test_data/pcor_rec_blackbox_test.txt
new file mode 100644
index 0000000..6254902
--- /dev/null
+++ b/tests/unit/computations/partial_correlations_test_data/pcor_rec_blackbox_test.txt
@@ -0,0 +1,1009 @@
+------------------------------------------------------------
+function_name: pcor.rec
+count: 18
+x: 27.0465861540288, 85.84661539644, 23.6260315869004, -6.64654695428908, 66.0871273837984, -74.3310157675296, -7.09130000323057, -11.6802562493831, 24.9050020240247, -22.3750857636333, 68.0144839920104, 16.7857648339123, -26.3561313506216, 57.9470653086901, -9.12516843527555, -36.0829488374293, 68.283180333674, -83.6802623700351
+y: 12.4649536795914, -20.5139847937971, -33.6048585828394, 19.9723906349391, 35.5448212940246, 31.2940447591245, -14.5105968695134, 79.1401757858694, -13.6585284024477, -57.8275624662638, -81.5757951233536, -34.5542138442397, 99.8554266057909, 31.5982210449874, 36.1663243733346, 7.66049646772444, -49.2159572429955, 87.6347878947854
+z: -45.889978017658, 50.1325799152255, -25.5673226900399, 87.3435476794839, -98.9604395348579, -45.4698990099132, 13.7257359456271, -81.9015400484204, 53.4290503710508, 9.70146018080413, 80.2283481229097, 76.1991834267974, 73.4845123719424, 28.7944686599076, -57.0716312620789, -62.2007157187909, -95.3627366572618, -57.3240759316832
+method: s
+rm: FALSE
+result: -0.458362369707244
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: 21.083299908787, -98.2076421380043, -45.41100054048, 33.6558640468866, 33.8769129477441, 90.4809392523021, -83.2292538136244, -53.039117064327, -26.2141453567892, -40.8924567047507, -13.2970791775733
+y: -71.2343545164913, -33.0757538322359, -30.886987876147, -62.0309396646917, -46.2347051594406, -45.9761362057179, 16.1026658024639, -30.2154338918626, 10.4190110228956, -6.23724199831486, -19.9442820157856
+method: k
+rm: TRUE
+result: -0.158592651153528
+input.z.1: -69.6558590978384, 76.5958794392645, -74.462781380862, -55.6329038925469, -34.0182736050338, -81.8313004914671, 80.8752333279699, 73.2946038711816, -49.8568836599588, 12.4631694052368, 71.3077447377145
+input.z.2: -55.6238626595587, 71.5313264168799, 49.0649917162955, -96.4836423750967, 31.4231107011437, 98.5001483000815, -60.020112991333, 5.04361470229924, -21.7608422972262, 3.66116226650774, 37.4486085027456
+input.z.3: -9.95428394526243, -51.5089114196599, -84.7546851728112, 90.5390536878258, -12.833157973364, 21.4086377061903, 59.5765900798142, -57.5253647286445, 35.5521977413446, -55.1964603364468, -82.078071590513
+------------------------------------------------------------
+function_name: pcor.rec
+count: 19
+x: -25.1664641778916, -56.7158963531256, 98.2197014149278, -39.1562284901738, 69.8500068392605, -98.8793865777552, 64.3333005718887, 2.49145850539207, -13.4482780471444, 15.8296941313893, -14.4610319286585, 8.14920198172331, 26.8839774187654, -94.38610766083, 73.5400937031955, -41.284476686269, -72.5798789411783, -45.4698437359184, -94.7900563944131
+y: 73.5157749149948, 69.8058058042079, 38.3851455990225, -15.4582026414573, 39.7315986920148, 27.1629291586578, 66.9298667926341, 26.3044673483819, -62.2310540173203, 28.8334564771503, 4.62915268726647, -17.3412421252578, -62.9840137436986, 24.5139833539724, -64.8512890096754, 53.5849830601364, 84.3197864014655, 62.4854291789234, -33.11452944763
+z: -14.3098634667695, 66.4927227422595, 16.3307644892484, 6.14525671117008, -68.4833894949406, -96.6041945386678, 46.0874481592327, 64.1859616152942, 45.0831798370928, -51.5323319006711, 81.7438598722219, 57.8951288480312, 82.2177275083959, -95.4358763061464, -99.8694028239697, 66.1022247746587, -37.5455300789326, 57.4841354973614, 2.12362264283001
+method: s
+rm: FALSE
+result: -0.204204149462281
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: 42.9641991853714, -33.6526750586927, 64.5110571291298, -3.50967179983854, -62.1003251988441, 75.9439217858016, -40.5138825066388, 61.7869598791003, 65.514537319541, -32.6844135764986, 98.1214119587094
+y: -87.1564343106002, -31.8151163868606, -98.0668175034225, -48.0268982239068, -65.0074473116547, 29.7599448822439, -78.1958315055817, -98.9310230594128, -37.0073825120926, 99.8306283261627, -65.8631965983659
+method: k
+rm: FALSE
+result: -0.143621272076104
+input.z.1: -27.1912457421422, -84.1915388125926, -86.4654324017465, 0.588246434926987, 19.5371210109442, -89.7052477579564, -69.2373412195593, 37.7897844649851, 52.10354286246, 86.67849637568, -26.65113247931
+input.z.2: -6.18069735355675, -45.4417984467, 71.68323029764, 40.7072803471237, 30.662393476814, -58.0406312830746, 11.6332073230296, 83.1229616422206, -79.0208636317402, -44.603179441765, -41.5212479420006
+input.z.3: -5.77356708236039, 71.4390681125224, -48.5977551434189, -33.8404927402735, 46.5380611363798, -93.3157123159617, -0.389049109071493, -38.7082135304809, -4.53768568113446, -70.9879754111171, 68.8483240548521
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: 60.9317239839584, -31.2905447091907, 53.948915284127, -95.7576057408005, 35.007868334651, -85.5168207548559, 73.7568661570549, -20.455909660086, 10.8152956236154, 39.7627064492553, -44.756277743727, -71.251277718693, 99.0610776469111, 29.1336865630001, 53.8847446907312, 54.8433600459248
+y: -69.0110558643937, 74.3098065257072, -93.1558133102953, -48.1973732821643, 3.78763284534216, -45.7135255914181, 14.0458890702575, 57.1197693236172, -63.5192428249866, -80.8886671904474, -54.2279600631446, 79.5978177338839, -13.394229626283, -2.99848061986268, -82.9510015901178, -27.8741750866175
+z: -68.4228350874037, -11.2382180523127, -74.2924707010388, -91.1819029133767, -58.1376497633755, -70.0835255905986, -58.3644146099687, -73.0489106848836, 68.5998952481896, 60.6510613579303, 61.4266434684396, 40.6665476504713, 49.3221402168274, 56.9117167964578, -5.39970770478249, -69.6209676098078
+method: k
+rm: TRUE
+result: -0.200111203789521
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: 40.2440257836133, -46.3242933154106, 72.7708220481873, -36.3226366229355, -92.5043274182826, -13.0487341899425, -46.8136807903647, 55.9087499044836, 11.1851918045431, -41.1343066487461
+y: 44.3925043102354, 79.2225563433021, 12.92391307652, -94.4711372256279, 8.49277810193598, -37.1448263991624, 77.1530977915972, 67.4801368732005, -41.9478724244982, 72.7613130584359
+z: -2.98054488375783, -41.6941301431507, 65.8284252975136, 80.405295919627, 56.1443844810128, -67.8014985751361, -96.869227103889, -59.2089117504656, 45.6999542657286, 16.634497186169
+method: s
+rm: FALSE
+result: -0.20778140910639
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: -93.3505594264716, -2.47896937653422, -97.1759914420545, -38.2430272176862, 99.4149339385331, 0.428299093618989, 90.4291214887053, -60.8191690873355, -17.9825736675411, -87.1595453470945, -36.4918932318687
+y: -5.86937200278044, 40.7252304255962, -82.1171450894326, 80.3501662798226, -27.133903093636, 40.9038231242448, 64.1522381454706, -94.5180553942919, -79.7904842533171, 49.5809083338827, -67.2030501067638
+method: k
+rm: FALSE
+result: -0.00415066820058267
+input.z.1: 54.7301535494626, 31.2304168008268, 92.258932441473, -77.6000469457358, -95.9519237745553, -67.8663256578147, 45.4026754945517, 76.5307268127799, -9.65234781615436, -50.799378240481, 19.5994042325765
+input.z.2: 89.8357455153018, -50.7813970558345, -44.0238927956671, 82.4097864795476, -35.6187962926924, -82.3095034342259, -57.0411204826087, 55.669168708846, 37.2431641444564, -7.40567096509039, -74.2486072704196
+input.z.3: -21.2622028309852, 2.9518733266741, 76.1393244378269, -73.8079617731273, -71.1744130123407, 37.7846655901521, -8.74427421949804, -4.20535416342318, 39.9581101723015, 8.55288412421942, 79.2008865159005
+------------------------------------------------------------
+function_name: pcor.rec
+count: 13
+x: 55.8748798910528, 51.0572876781225, 82.5137235689908, 14.2397709656507, 2.99776284955442, 65.2987132780254, -59.7197342664003, -12.6050740480423, -46.4378262404352, 55.494225025177, 41.8674737215042, 82.1887638885528, -2.28542112745345
+y: 88.4641766548157, 27.435901388526, -79.5164803043008, -9.17457146570086, -38.7884174473584, -42.7281686104834, 29.9447605852038, 42.1490131877363, 6.86571071855724, -10.5507157277316, 34.6828168723732, -11.884824372828, -11.3106375560164
+z: -8.47988268360496, -62.9638673271984, 76.2596300803125, 72.5790326483548, -89.2584360204637, -62.1974066831172, -19.7280053514987, 25.6929714698344, -76.6775759402663, 28.7336804438382, 60.828927019611, -95.1663577463478, -59.2235392890871
+method: s
+rm: TRUE
+result: -0.486706898961164
+------------------------------------------------------------
+function_name: pcor.rec
+count: 14
+x: -0.0649684108793736, -9.12190317176282, -97.854143474251, -13.7245919555426, -98.3851981814951, -52.1242694463581, -80.3953207563609, -1.50988507084548, -67.9019027389586, 53.890549344942, 76.6144499648362, 94.333418738097, 42.1835497952998, -82.3511867318302
+y: -51.941104978323, 29.7715055756271, 96.8885408248752, -93.3864999562502, 71.9892789144069, 33.8113908655941, -73.2613898813725, -80.6048061698675, 74.224327551201, 57.013650611043, 9.70671167597175, 79.8423840198666, -69.2205078434199, 89.1150287352502
+z: 23.4675401821733, 84.267854411155, -51.1970835737884, -98.0038798414171, 47.583898389712, -48.8845239859074, -0.850127916783094, 7.31711369007826, 13.4415757842362, -57.4014388024807, -17.8407940082252, -40.6244638841599, -13.1918888073415, -63.6225790716708
+method: k
+rm: TRUE
+result: -0.202860566215319
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: -61.3124287221581, 18.1583377532661, -58.751318231225, 14.6944977343082, 74.491372751072, 64.7918365430087, 88.5010475292802, 46.6877995524555, 32.0965091697872, 98.7485934048891, 22.8932307101786, -79.3458161875606, 29.175332095474, 85.9066780656576, 32.5589253101498
+y: 74.3193860165775, -1.54028623364866, 14.3234346993268, 22.6996371522546, 34.6773494500667, 68.9461726229638, -70.669891545549, 6.67718132026494, -70.8217049948871, -96.8078156001866, 98.5030621755868, 35.5320736765862, 1.35495862923563, -66.8200423009694, 87.3174419160932
+method: k
+rm: TRUE
+result: -0.403444240007549
+input.z.1: 63.1398477125913, -93.6047930736095, -82.9460870008916, 17.1801930759102, -56.8764031399041, 14.5227553322911, 67.7316694986075, -36.5888524800539, -6.70271222479641, -87.9417958203703, 96.0809137206525, -18.8335922546685, 13.2128197699785, -32.5581130571663, -90.6071182340384
+input.z.2: 88.5960716288537, -13.0231159739196, 66.9877568725497, 57.8428873792291, -19.4016022607684, -33.0764503218234, 68.1236225645989, -33.8005813304335, -32.7262029517442, 90.8223036210984, 58.4868327714503, -76.5773380175233, -0.575498351827264, 42.7307121455669, -62.9820253234357
+input.z.3: -65.5557164456695, 34.7501182928681, -11.9676230940968, -55.2262251731008, -36.8215633556247, -68.8912406563759, -60.3880607523024, -8.90412745065987, 76.2590947095305, -98.0812083929777, -22.7019656449556, 54.0401803329587, -31.2883075326681, -94.085031747818, 26.6006113030016
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: -66.0635123960674, -67.4732076469809, 42.8204931784421, 83.9072343893349, 64.1622506547719, -31.2235444784164, 45.2104966156185, -77.7350789867342, -41.6209270711988, 77.8038220480084, 4.94705736637115, -47.8676947765052, -40.3655698057264, 87.1949778869748, 59.282084601
+y: -44.0877958200872, 43.1024875491858, 29.3431533966213, 54.0742883924395, 30.3691518027335, -71.8555608764291, 62.1317124925554, 8.58862511813641, 7.24410070106387, 83.5120551753789, -63.7099585030228, -96.2103466968983, -49.2979577742517, 83.7898887228221, 35.5132043361664
+method: k
+rm: TRUE
+result: 0.384008728398402
+input.z.1: -4.6655245590955, 70.4251590184867, -80.6666431482881, 85.5599484872073, -4.1441548615694, 77.3068489506841, 65.8226968720555, 94.5305422879755, -63.2336198817939, 86.3333691377193, 79.903667466715, 51.2524782679975, 99.025963479653, -75.7371618878096, -61.1681820824742
+input.z.2: -2.65423716045916, -78.2148709055036, 98.3434916473925, -22.4563017021865, 12.9930391907692, 53.0512262135744, -38.8523698784411, -54.1274403687567, 57.2192461229861, -85.3108969051391, 36.1713513266295, 52.4544527288526, 62.3474055435508, -82.7991028316319, -48.1557835824788
+input.z.3: 71.8588098417968, -7.05220480449498, 69.235354475677, -38.4673862252384, 53.1879930756986, 74.1162660066038, -33.3680822513998, 66.3322701584548, -36.8293787818402, -77.0495353732258, -31.3548975624144, -38.8354785274714, -59.7352970857173, -33.5001980420202, -52.4871282279491
+------------------------------------------------------------
+function_name: pcor.rec
+count: 13
+x: -78.5274708177894, 54.6583318617195, -10.7358992099762, -45.4171522054821, 25.4497814457864, -64.0730748418719, 68.9721046481282, -49.2593355942518, -29.5779021456838, -52.45715030469, 16.8660826049745, 97.6588599383831, -60.2859176229686
+y: 48.7125545274466, -86.9950996246189, -88.7554660905153, 91.8915181886405, -77.034616516903, 88.2693362422287, 58.6634032428265, 14.3693041522056, -41.9572623912245, -49.6693043969572, 97.597514744848, -14.9741226341575, 99.4055413641036
+method: s
+rm: TRUE
+result: -0.22769505950471
+input.z.1: -71.1109426803887, 15.6759196892381, 94.438049569726, -37.2807722073048, 39.3087625037879, 15.7282522879541, 79.2091070208699, -16.5951025206596, 56.8437909707427, -48.6758518964052, -93.334536626935, 41.8724854942411, 89.190365979448
+input.z.2: -0.60031795874238, 44.824774377048, -81.4030232839286, -95.4328638501465, -5.63060604035854, -11.984769301489, 71.3819028344005, 82.8589734155685, -12.7086061518639, -16.8309166561812, -26.7068251501769, 43.9979130867869, -56.4366859849542
+input.z.3: -16.3842175621539, -8.85082990862429, -95.985221164301, -73.4366697724909, -28.4655119758099, -52.8220290318131, -61.4263267721981, 64.5336702931672, -39.0190409030765, -1.5689545776695, 11.0946391709149, 56.4090613275766, -60.4540335014462
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: -65.7591099850833, 80.7566788513213, 88.1564508192241, -48.9770147949457, -55.7247276883572, -57.5253066141158, -83.2564804237336, 57.4012059252709, 35.2928108070046, -72.2103993408382, -63.602004526183, -56.8528092466295, -36.7954559158534, -51.8933654297143, 62.31161900796, 39.0559389255941
+y: -29.5054595451802, 78.5674630198628, 57.8101953491569, -23.3210172038525, 68.2822681497782, -56.1916985549033, 69.3101673386991, -23.5763778910041, 42.4868553876877, -80.7561526075006, 53.3658074680716, -46.6725745704025, -48.636918887496, 77.6377590373158, -98.6770060379058, 69.6450849529356
+method: p
+rm: FALSE
+result: 0.286445562770149
+input.z.1: -80.6849138811231, -90.7679206226021, 7.13438023813069, -86.4396455232054, -16.7458149138838, -51.5618403907865, 46.1916353553534, 63.4878667071462, -98.7970676738769, -86.5430972073227, -52.745211077854, -87.5790499150753, 4.79577607475221, 2.6803994551301, 10.9007480088621, -45.8506872877479
+input.z.2: 8.42293403111398, -80.3381159901619, -15.9135971218348, 89.8643282707781, 90.3070626314729, 12.7958082128316, 97.4500481039286, -59.7645458299667, -50.2175740431994, -33.6365795694292, -37.7593765966594, -59.8080027848482, 14.1750884708017, 84.0673042926937, 2.86107184365392, -15.2980412356555
+input.z.3: 18.416645983234, 8.72256266884506, -27.135418029502, 66.9198032002896, 11.7570180911571, -81.8186190910637, 55.6397127918899, -42.1071819029748, -27.3977108299732, 87.2775603551418, -31.7873003892601, -0.830735079944134, 14.7588836960495, 24.6488864067942, -4.1443657130003, -22.5756781641394
+------------------------------------------------------------
+function_name: pcor.rec
+count: 19
+x: 72.941006347537, 88.5350834578276, -61.3946152850986, -94.1264885943383, -59.6083014272153, 0.0383354723453522, 38.962951535359, -33.1267971079797, -14.1101143322885, 11.0402037389576, 66.5075759869069, -39.2349756322801, 1.62258669734001, 63.6307552922517, -53.3561239019036, -57.0986500941217, 63.9509742613882, 69.1873391158879, 92.4651104025543
+y: 68.2863459456712, 32.8301987610757, -12.0631097815931, -77.5489529129118, -9.26943984813988, -53.196216467768, 99.207640811801, 45.8405578043312, 70.8663184195757, 2.17023831792176, -30.1671982742846, -87.5547814648598, 53.4424650482833, 91.9836340006441, 14.094074908644, -81.96129957214, -66.6266257409006, 26.5053286217153, 88.7426108587533
+z: 26.3681552372873, 45.7198408432305, 68.2894596364349, -66.7965121567249, -8.64458661526442, 40.5387890059501, 24.7470463160425, -55.4631956387311, 43.0947626940906, 40.5702913645655, -94.7409357409924, 80.7332515716553, 98.3253448270261, 38.5890654288232, -92.7877118811011, -41.1318491213024, 68.1029357016087, 81.3247045036405, -64.87777819857
+method: k
+rm: TRUE
+result: 0.370885040886946
+------------------------------------------------------------
+function_name: pcor.rec
+count: 17
+x: 47.7815555874258, 0.757466396316886, -78.5694096237421, -10.5338782072067, 6.84339161962271, -12.5417194329202, -79.6884837560356, -50.4556390456855, -18.0644971318543, -43.5523690190166, -31.3758133444935, -64.514737483114, -35.6566301546991, 24.6359940152615, -52.1337051875889, -81.0267004650086, 9.79939419776201
+y: 9.00454632937908, -92.5409240182489, 82.6424018014222, 37.390052061528, 39.1525054816157, -32.2375071700662, 33.1057799514383, 60.8027548994869, 49.1245619021356, -1.29677709192038, 59.6215286292136, -5.71877667680383, -64.2789027653635, 7.67776034772396, -85.6839925516397, 87.0561090763658, 53.9691422134638
+z: 94.1489060875028, 5.35360146313906, -45.0954835861921, 13.4744525421411, 70.4065824393183, -37.5215549487621, -53.9351030252874, -95.9617306943983, 95.8626475185156, 56.3450652174652, -78.2765238545835, 49.8751151841134, -40.399710368365, 70.9471312351525, 67.7706296090037, -44.7566135320812, 18.9933343790472
+method: s
+rm: TRUE
+result: -0.0307253503097024
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: 77.0224547944963, -7.21212634816766, 94.6494690608233, -19.8536953888834, 60.6895769014955, -18.8230661675334, 46.6576409060508, 20.9713363554329, 29.2338462080806, 81.9798021577299, -46.1181710008532, 57.9514958895743, -10.7711394317448, 47.9182483628392, 60.8951596543193
+y: 71.0176297463477, -19.332714471966, 3.20451441220939, 63.0101921502501, 18.177311681211, 18.1690010707825, 12.173681287095, 10.6716933194548, -85.9119288157672, -7.69144585356116, -95.4866513609886, 53.3560248091817, -56.3376172445714, 98.2990854419768, 34.0318501461297
+method: k
+rm: TRUE
+result: 0.215514678797688
+input.z.1: 75.5163984373212, 97.6738740224391, -16.5575933642685, -35.9448304865509, 30.2785072475672, -4.58882753737271, 19.8265417013317, -68.4901964850724, 84.9371602758765, -71.9693731982261, -56.5736060962081, -36.8734282441437, 19.3909254390746, 86.3937048241496, -90.9074582159519
+input.z.2: -82.2815494611859, -62.3412929475307, -75.7495530415326, -85.9084845986217, 38.5769664309919, -14.2082320991904, 51.2620362918824, -27.3738067597151, -52.3408399429172, -0.0353863462805748, 52.8306930325925, 47.6732281967998, 40.0251228827983, 10.1307895034552, 81.8184955511242
+input.z.3: -24.4488768745214, 88.5539114940912, -76.0014849714935, -20.0668734498322, -17.3311269376427, 53.2966234721243, 28.3089226577431, -10.4635909199715, 3.67960454896092, 54.5719591900706, -79.4869703240693, -76.6309262719005, 41.3653851021081, -68.3333130553365, 86.5088677499443
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: -17.6799289416522, 49.4767578784376, 69.4365380797535, 62.0824650395662, -14.5133852958679, 92.8273646626621, -35.5502421967685, 26.3818026985973, -47.6345511619002, -81.7291165236384, 90.68892756477, 87.9910979419947, -96.1814912967384, 34.966702433303, 44.7223367169499
+y: 77.5102899409831, 71.6682025231421, 30.0063323695213, 30.9808460995555, 16.6262952145189, 80.4908129386604, -92.2186760231853, 54.273960320279, 7.27685410529375, -20.4685146920383, -50.272509874776, 27.1341995336115, 15.8458969090134, -98.8356848247349, -37.4736201483756
+method: p
+rm: TRUE
+result: -0.0604063399963708
+input.z.1: 62.3108414001763, -12.2461723163724, -45.8216614555568, 91.8788344599307, 91.6252538561821, -0.413994630798697, 90.2596836909652, 56.2185476068407, 91.5859371889383, -15.2596113737673, -43.3501244522631, -68.923271773383, -19.7409045416862, -86.2786957528442, -89.9489548057318
+input.z.2: -22.556777484715, -5.61479208990932, -47.4028566852212, 30.8866687119007, -16.6167206130922, 0.758961960673332, -97.7107268758118, 49.8969595879316, 5.41947395540774, 76.3401997741312, 38.9869387727231, -69.9544305447489, -62.7304617781192, -28.9641594514251, -98.7272569909692
+input.z.3: 96.6044981963933, 1.57265784218907, 45.9907903335989, -3.32801463082433, 96.9419070053846, 54.3271706439555, -27.2647544741631, 68.1218984071165, -35.9079149086028, -80.5656238924712, 19.4677114021033, 61.2382191233337, -17.1889714431018, -66.9516512192786, -77.3835943546146
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: -71.562309935689, 61.2971490249038, -67.2613488975912, -67.605738947168, -44.75500555709, -27.0675545092672, 6.42645112238824, 34.9141472950578, -70.4944793600589, -65.8430821727961
+y: -97.3966186866164, 30.0345255527645, 1.98479322716594, 35.255804983899, 97.4348559975624, 51.2336597312242, 37.0358873624355, -43.8290268182755, 73.1889605987817, -83.4334774874151
+method: k
+rm: FALSE
+result: 0.101975707913878
+input.z.1: 96.5124187991023, 59.7589443437755, -28.1401800457388, -48.1452223844826, -69.1250930074602, -1.13946236670017, -33.8115575257689, 92.0685294549912, -65.9486766438931, -50.8275568950921
+input.z.2: 0.635389657691121, -48.1256590690464, -73.9453377667814, 36.4519818220288, 14.4354915246367, -30.946854641661, 75.4334991797805, -78.7696894258261, -84.3629696406424, -68.5122138820589
+input.z.3: -42.2178110573441, -84.9118709564209, 10.6240403372794, 47.0018105581403, 76.3429581187665, -98.3215926680714, 23.1543749570847, -66.7542746756226, 51.0812507942319, 51.7371312715113
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: 37.3612422030419, -62.2976862825453, -20.3225356992334, 35.1625409442931, 7.00941164977849, 10.8022364787757, 85.6041926890612, 2.7432450093329, 55.2531471475959, -46.698701241985, -32.8795406967402, 56.1582171358168, -53.7892970722169, -29.8783036880195, 5.5769944563508
+y: 84.9823753815144, 20.0704097282141, -57.9668726306409, 80.5891362018883, -93.7707980629057, 82.1314251981676, 30.4476763121784, 64.8252506740391, 2.73968982510269, 56.2543767504394, -51.3445142190903, 1.49674671702087, 76.8511690199375, -92.6638629753143, 9.00869187898934
+z: 35.5673008598387, 21.8645379412919, -19.9136686045676, 17.4843213986605, -32.0220090914518, -98.673325125128, -53.7705447990447, -30.4427234455943, -88.6013784445822, 49.2624955251813, 47.7439268957824, -80.527631752193, -21.2106753140688, 95.8693802822381, 55.6788475718349
+method: k
+rm: FALSE
+result: 0.0376521663149937
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: -12.6099046785384, 62.9503787495196, -41.7074305936694, 57.2416189592332, -14.5429391879588, -21.0340389516205, -75.441445922479, -53.8398617412895, 50.1939499285072, 80.4451046511531, 7.77875101193786
+y: -91.1863091867417, -45.6564084161073, 18.2509679812938, 12.5384614802897, -87.7081437502056, -59.8072885535657, 38.1740126293153, -90.6736130360514, -80.6179660372436, 67.7958796266466, -48.2190220616758
+method: k
+rm: FALSE
+result: 0.00487774919045338
+input.z.1: 82.2277778759599, -71.9359886832535, -81.6467982716858, 87.6012657303363, 66.7304196860641, 15.4578864574432, 82.6261980924755, 79.0331508498639, 11.5147780161351, -38.4340744931251, -51.4472227077931
+input.z.2: 61.85322124511, -16.4658469613642, -17.9835374001414, 36.6121453233063, -53.3555198460817, 95.8382083568722, 87.7777935471386, 31.6483219154179, 8.8566864375025, -72.558317007497, 6.72606155276299
+input.z.3: 1.57859744504094, 96.2870470248163, 78.9755351375788, -5.87459797970951, -89.8536934517324, 99.9234729912132, -11.5885237697512, -94.2207021638751, -19.373999722302, 74.6413060463965, -58.9515981264412
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: -26.585637498647, 76.3977353926748, 22.9591794777662, -57.9062177799642, -97.8634255006909, 9.66014945879579, 94.0443340688944, 76.1497691739351, -19.7134216316044, 2.45499121956527
+y: -18.0846814997494, -19.364173989743, -96.0522200912237, 87.5091985799372, -64.7892713081092, -90.5939534306526, -65.4118294361979, 17.4070830456913, -31.0635536443442, 4.03321231715381
+z: 80.9113253839314, -81.8780994042754, -10.1767265703529, 12.6185321249068, 31.2433938495815, 40.1075961999595, -88.4132706094533, -0.259516015648842, -67.1224204823375, 4.2356951162219
+method: p
+rm: FALSE
+result: -0.133460373384683
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: 69.5500911679119, 85.6129388790578, -59.8321632482111, -16.6489555500448, -23.689411021769, 7.28359869681299, 11.7851179093122, 0.971409818157554, 14.6698507014662, 12.5228200107813, -82.5623630546033, 10.7475840020925, 64.5495726261288, 33.6947743780911, 17.5113253761083
+y: -23.2205286622047, 79.4048092793673, -25.0229370314628, 93.0385292042047, 85.515082301572, -71.9814633019269, -32.8320536762476, 4.79555446654558, 11.8861138820648, 35.2179647423327, 53.5490271635354, -38.2638583891094, 47.7496858686209, -81.6408428829163, -51.109107490629
+z: -51.3139498885721, 91.0043549723923, -29.6979720238596, 64.7927256301045, 24.9896527733654, -49.5973426382989, -61.108489241451, -79.4058836530894, 56.8568713963032, -31.4483558293432, -81.7292190622538, 99.1093489807099, -31.6041610203683, 51.2187057640404, -1.86318131163716
+method: s
+rm: TRUE
+result: -0.220132277259967
+------------------------------------------------------------
+function_name: pcor.rec
+count: 17
+x: 90.7971289940178, 64.8458667099476, -26.1766018811613, -21.0994517896324, -99.1302272770554, -50.7842414081097, -3.6383499391377, 27.4873042944819, -38.7462536804378, 68.3057898655534, 98.1881877873093, -45.7978362683207, -17.603207891807, 25.2952293958515, -22.7400164585561, 60.9401299152523, 62.4521202407777
+y: 29.2903814464808, -65.5612081754953, -78.4191365353763, -4.56041805446148, -30.2704517263919, -21.605000179261, 1.48401004262269, -44.5922049693763, 84.3162531964481, -4.89589110948145, -26.2383857276291, -76.1553710792214, 5.88274369947612, -78.4085688181221, 36.7778526153415, -39.9336752016097, -28.1932056415826
+z: -17.2037285752594, 13.8319098390639, 34.7095286007971, -27.703050384298, 9.93002681061625, 44.7098897304386, 54.4988644309342, 1.10581130720675, 42.3894800245762, -23.5900762956589, 83.1359798554331, -3.49259204231203, 37.7722999081016, 66.1500211339444, 51.4814839698374, -78.5076813772321, 24.2365219630301
+method: s
+rm: FALSE
+result: 0.0274828394860458
+------------------------------------------------------------
+function_name: pcor.rec
+count: 13
+x: -80.7853449136019, -38.3992948569357, -22.2798614297062, 75.4607704933733, 33.0631603021175, -73.7780206371099, 5.96331777051091, -50.5084481555969, -31.7969931289554, 19.0575924701989, 85.3613562881947, -30.7409678120166, -73.8598890602589
+y: -19.4839437957853, -90.817145537585, 89.9142569396645, -7.78982224874198, -80.0989099312574, -58.8081724476069, -77.3309513460845, -16.1730996333063, -87.9085985478014, -17.9587779100984, -0.581334996968508, -42.1605377923697, 21.935287443921
+method: k
+rm: FALSE
+result: 0.229681482630548
+input.z.1: -63.2329418789595, 50.4205111879855, 1.37699875049293, 31.9463331252337, 90.1739185210317, -49.1128060501069, -6.9747703615576, -59.983176458627, -86.428006272763, -11.0352266114205, -48.7479498144239, 34.5943303313106, -78.9999180007726
+input.z.2: -40.928622148931, 97.1864043734968, -52.0364633761346, 65.8855800982565, -22.5181400310248, -12.0427423156798, 8.44123368151486, -70.3309573233128, -48.4425970353186, -76.6650391276926, 60.1132703013718, -98.2566928025335, 40.263629052788
+input.z.3: -45.1057865284383, 16.6654115542769, -58.5233464371413, 61.7927123326808, -47.9555701836944, -22.6161092054099, 28.3364725764841, -68.6806954909116, 54.0026980917901, 27.6144355069846, -17.2973237466067, 64.1560755204409, -59.8855725023896
+------------------------------------------------------------
+function_name: pcor.rec
+count: 13
+x: 92.2603438608348, -56.4207409042865, 83.6725204717368, -80.7003829162568, 67.8985660895705, -75.0979449599981, -32.0562332868576, 56.0634645167738, -85.5500471778214, 33.3249835297465, 47.6551554165781, 66.1726305726916, 48.9350370597094
+y: 71.4295863639563, -18.2109759189188, 91.2296816706657, 93.7020284123719, -38.427047431469, -5.06591922603548, -71.242788201198, -43.5830219183117, -50.5092308390886, -32.3183794040233, -48.7796126864851, -84.1315757483244, -79.6182266902179
+method: k
+rm: TRUE
+result: 0.00477210789686704
+input.z.1: -4.25235852599144, 30.4247013293207, 22.6726256776601, 88.1398701108992, -14.9512176867574, -22.8902320377529, 15.2597426902503, 90.1389559265226, -87.9985238891095, 79.24031810835, 48.9382231608033, -63.0733355879784, 81.9164112210274
+input.z.2: 15.7161565031856, -86.386077105999, -11.9819261599332, 12.0433977805078, -84.1572615318, -88.4014238603413, -78.5426302812994, 6.74741943366826, 17.4219592940062, 42.3801865894347, 57.2220828849822, 18.5213928110898, 13.8206535484642
+input.z.3: -25.2769957762212, -79.8697541002184, 47.9512831196189, -40.2225833386183, 61.2570276018232, -89.5395552739501, 57.2230133228004, -6.20145709253848, -81.831949763, 37.4231112189591, 3.57026224955916, -6.8920056335628, 15.1464655529708
+------------------------------------------------------------
+function_name: pcor.rec
+count: 13
+x: 60.5032597202808, -55.3992924746126, -57.1532733272761, 39.3540678545833, 41.2322402000427, 94.9976013973355, -25.1228974200785, 69.2301294766366, -62.8194462973624, 83.1489353906363, 64.4181499723345, 27.0436024758965, 54.5952781569213
+y: 50.8026732131839, -59.9888855125755, -26.8583768047392, 95.3958404250443, 71.0329591296613, -5.07162217982113, -57.6757784001529, 5.96255329437554, -26.5671603847295, 74.9519627541304, 55.9876888524741, -56.6113821230829, -65.2430968359113
+method: p
+rm: TRUE
+result: 0.564561996864683
+input.z.1: 25.9787803515792, -20.9894978906959, 42.6014113239944, 2.97193983569741, 31.9062470458448, -48.1516422238201, 75.1286832150072, 11.4769574254751, -55.0779395271093, -5.5713998619467, -42.5516823772341, -73.3385164290667, 61.5631113294512
+input.z.2: 52.3108799010515, -13.4730744641274, -26.2112704571337, -94.4241392426193, -87.1290047187358, 44.8173874057829, 16.0077110864222, -88.8399564195424, 32.9815314617008, 92.6361351739615, 64.8398043587804, -30.7204295415431, 84.6931307576597
+input.z.3: -77.9948043171316, -66.0049752797931, 62.4562206678092, 77.8233026154339, 42.9607164580375, 57.5163295958191, -70.2494252007455, 31.4489458687603, 10.7635230291635, 30.1841662731022, -80.0336173269898, -22.9067022912204, 67.9993652738631
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: 37.9142162390053, -8.26726146042347, -61.9123779702932, -57.8167630825192, 23.4680826310068, -99.7927295975387, 33.9280273765326, 79.8843482043594, -43.2324070017785, 56.6228452604264
+y: -62.526094680652, 61.9219188578427, -75.2686517313123, -74.1751136723906, -96.7679353430867, 1.48558439686894, 76.4188889879733, -61.2491626292467, 80.3087358362973, -45.7866244483739
+method: k
+rm: FALSE
+result: 0.0164627901375515
+input.z.1: 35.9344144817442, 98.7220860086381, -36.6842451039702, 48.8638223614544, -52.5896870996803, 23.3808947727084, -10.3175325319171, -89.9521626532078, -39.3597731832415, -21.7722129542381
+input.z.2: 40.9232123754919, 25.3107699099928, 31.3104595988989, 29.8185504972935, -80.9525416232646, 5.50809823907912, 57.8906395006925, -22.5699768867344, -12.0202441699803, 4.25414703786373
+input.z.3: 9.19963982887566, -56.4450024627149, -81.8353800103068, -71.7948751524091, -8.96710567176342, -0.098739517852664, -49.8610728420317, 68.7743380665779, 7.88735868409276, -84.7688094712794
+------------------------------------------------------------
+function_name: pcor.rec
+count: 19
+x: -56.1894082464278, -12.6557477749884, -63.4441782720387, 0.33514741808176, 60.3243499062955, -64.7020475938916, 50.4497223068029, -2.1715194452554, 9.01610897853971, 76.9646459724754, -47.7160341106355, -41.9100993778557, -15.766973933205, 27.5259118992835, -35.4518753942102, -85.60910099186, 24.0823043975979, 93.0186438839883, 93.6028228607029
+y: -20.745520433411, -9.38104907982051, -74.1150409914553, -4.49656955897808, 69.9145309627056, -31.7319374531507, -59.7572867292911, -15.8576601184905, -12.6222641207278, -80.7064605411142, -55.2672634832561, 99.9313631560653, -6.02937843650579, -9.62814935483038, 48.0359378270805, -78.4953159280121, 99.3151890579611, -46.1329385638237, 48.141875769943
+method: p
+rm: TRUE
+result: 0.211991511824896
+input.z.1: 1.58806922845542, 86.8181970436126, 31.5542962402105, 55.2137501072139, -39.5924519281834, 33.013613242656, 14.7862681187689, -74.0772366523743, 58.9972470421344, -7.06596486270428, -21.0627525113523, 99.2032013833523, 56.6067849751562, -98.3875119592994, 41.2923750467598, -30.0579020753503, 4.85188476741314, 10.3777845390141, -27.4298328906298
+input.z.2: 34.8385723307729, 20.5119372811168, 77.690208144486, 44.7117544244975, 92.1282112132758, -90.9193224273622, 27.3936607409269, 44.8808068875223, -86.0024070832878, 92.0378822367638, -10.629472322762, 55.4692803882062, -25.0772546976805, 41.4051091298461, 6.33945902809501, 10.3499594610184, 54.4835149776191, 7.99261094070971, 89.524426497519
+input.z.3: 70.5266479868442, 56.8428464233875, 79.8325890209526, 48.6981757450849, 20.3497425187379, 14.0441357623786, -51.5891078859568, -7.34991990029812, 32.2692793328315, 68.6593409627676, 4.454291658476, 84.4771948643029, -73.7373711075634, 8.70008966885507, 71.2375602219254, -45.4772807657719, 35.3090388700366, -77.8953650034964, 56.713536940515
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: -73.061874229461, -13.9738537371159, 64.2177643720061, 15.2220948133618, -66.5882191620767, -6.66814856231213, 95.0206854380667, 53.7092166487128, 79.339360864833, -73.5059819649905, 26.2280288618058
+y: -17.2816875390708, 95.8707445301116, -79.8597431275994, 23.603032855317, 1.01680792868137, 27.7978147845715, -46.8073261901736, 60.1170611102134, -14.4904991146177, 80.4983365815133, 35.0678949151188
+method: s
+rm: FALSE
+result: -0.533103656117009
+input.z.1: 24.0054220892489, -38.2218769751489, -36.391848186031, 39.4758492242545, 82.74105344899, -14.3297997768968, -85.4651961009949, -86.8203293066472, -44.1936294082552, -47.1563939470798, 45.3097125981003
+input.z.2: -57.668925030157, -99.2560090962797, 73.3224391471595, 74.1201536729932, 81.7828055471182, -9.52679859474301, 14.1464875079691, 37.1397321112454, 31.4963829703629, 19.5132269058377, 54.907073546201
+input.z.3: 5.39321177639067, 51.5115650836378, -48.5234751366079, 59.8083338700235, 20.2424349728972, 7.82965249381959, -62.3213066253811, -52.3974419105798, -46.1440681945533, -96.0028395056725, -92.1209430787712
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: -75.8598148822784, -57.8679403290153, -70.5489284358919, 79.6496780589223, 83.6893404368311, -3.89578277245164, 30.8455263730139, 43.4356688987464, -93.7735083512962, 64.8750048596412, -27.4969315156341
+y: 10.6346141081303, 97.3708054516464, 77.6781819760799, 32.1429692208767, 44.3270593881607, -51.0296199470758, 53.1075953040272, -56.6818379797041, 82.5988807249814, 76.4641304500401, 67.2767641022801
+method: k
+rm: FALSE
+result: -0.372011732403109
+input.z.1: -30.0938377622515, 88.116044877097, -9.76424408145249, 89.2513517756015, 77.7156874071807, -77.6198823004961, -66.8529264628887, 74.9286437407136, 79.5354966074228, 39.1315433662385, 8.71772766113281
+input.z.2: -26.1263587512076, -62.1837942395359, 38.3388991933316, -42.6557110622525, -5.76013564132154, -60.0944366771728, 63.1011837162077, -62.5058522913605, 48.8114280160517, 1.21210310608149, -50.4604283254594
+input.z.3: -17.3055913764983, -79.3155479244888, 28.9295102003962, -18.9371800981462, 74.2997703608125, -40.0637871120125, -94.551969319582, -62.8503665328026, -7.13514289818704, 49.9038027599454, -51.9183388911188
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: -54.107921756804, 42.0997333712876, -6.38097845949233, 9.82502051629126, -28.6193792242557, -34.3836144544184, -3.67244216613472, 22.6311068516225, 13.8194078113884, -22.9492321144789
+y: 60.5207195039839, -81.0600532218814, 49.1948895156384, 64.3602961674333, -23.8067456521094, 48.5145658254623, -19.1302789840847, -57.330949883908, -92.603252409026, -34.9809643812478
+method: s
+rm: FALSE
+result: -0.522505562585742
+input.z.1: 73.3824520371854, -81.4419587142766, 59.7223955206573, -1.82209219783545, 84.9416411016136, -54.7515032812953, 2.77886907570064, -14.5639284979552, -18.736483482644, 56.108499923721
+input.z.2: 67.43677794002, -99.9857230111957, -97.4766474217176, -52.3709758650512, 65.8947822172195, -71.7632448300719, -15.8094623591751, 82.0473594591022, -14.198503177613, -16.3246036507189
+input.z.3: 62.8384766634554, 19.0266913268715, 35.5061936192214, -95.0661971699446, 28.3454976044595, -89.0745501965284, -14.7294794674963, -76.8557195086032, -18.2478179223835, 86.78869898431
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: -1.2142707593739, 1.14291775971651, -7.26283476687968, -61.8523230310529, 78.1381260138005, 28.326230077073, 88.5825785808265, 91.083605773747, 21.5207824483514, -8.56816032901406, -25.5072731059045
+y: 14.1181503422558, -36.2708885222673, -35.4297156445682, -1.67753333225846, -34.6098212525249, -62.3401450458914, -56.7325585987419, -19.2465652711689, 72.2250512335449, -30.4523368366063, 37.1804839931428
+method: s
+rm: TRUE
+result: -0.375187368938524
+input.z.1: 68.2266510091722, 26.6301542986184, 25.1655354164541, 95.4604937694967, -14.2991234082729, 12.1803054586053, 80.9723742306232, 74.5170688722283, -9.39638176932931, 13.0635335110128, 6.38360045850277
+input.z.2: 14.1705195885152, -74.5514953974634, 27.798350667581, 34.9743040278554, -4.05116858892143, -91.3039809092879, 8.21988149546087, 80.3523061797023, 30.8039418887347, -55.6892755441368, 88.9822357334197
+input.z.3: 45.2729779761285, -96.8037121929228, -1.97316566482186, 18.6038000043482, 98.2673170976341, 33.5015752818435, 63.8064842671156, -14.044907130301, -52.3745216429234, 21.3815015740693, -63.2074198685586
+------------------------------------------------------------
+function_name: pcor.rec
+count: 19
+x: 94.328890228644, 5.75797557830811, 25.441690068692, 88.1982096005231, 45.7035119645298, 16.9675328303128, -87.1538819279522, -98.0717894155532, -91.5767922997475, -6.85307481326163, -9.82285114005208, 67.6100679673254, 58.5152864456177, -97.2691165748984, 91.1229528021067, -32.0776640437543, -69.0255750901997, -7.09530152380466, -6.81365500204265
+y: -80.5371531285346, -10.2979036048055, -38.8368986546993, -61.8645419366658, -83.1780408043414, 79.711103765294, 21.272880397737, -54.3522239662707, -86.3086901139468, -38.0223195534199, 52.8202678076923, -84.461157117039, 47.7731225080788, 7.32796876691282, 77.0558503456414, 31.592853507027, -87.3366552405059, 31.9443213287741, -37.1386748738587
+method: k
+rm: TRUE
+result: 0.0980405314826719
+input.z.1: 23.2567406725138, 21.890681842342, -89.1896610148251, 96.3604890275747, 49.5936496648937, -63.1400676444173, 14.4897532183677, -67.2666956204921, 49.4363921228796, 62.1179447509348, 47.1755699720234, 44.8309970088303, -12.7215121872723, 19.4518850184977, 17.0972461346537, -80.8160409796983, 88.3082031738013, -12.9626977723092, -81.6842820961028
+input.z.2: -55.4383310489357, 47.4879994057119, -0.869575794786215, 45.0101721100509, 3.4380410797894, 73.0201048310846, -25.7476052735001, 86.2380142789334, -52.0658289082348, 45.1091858092695, -55.0217658746988, 74.9276738613844, 92.2757615335286, 90.0036279112101, 74.9076794832945, 83.3363148383796, -64.1434239689261, 57.4586546048522, 25.7639687042683
+input.z.3: 6.6876329947263, 40.4029506258667, 94.9899430852383, 4.70264269970357, 17.7098400890827, 79.6689927112311, -46.7597783543169, -29.3036337476224, -9.24668917432427, -87.3026769608259, -67.9541712626815, 99.6626032050699, 33.7271203286946, -6.46288637071848, 1.44459712319076, -66.6438368149102, 26.0329113807529, 90.9082849510014, -29.0545757859945
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: -39.9631946347654, -38.9883862808347, -50.3526273649186, -9.96270119212568, -48.5522696282715, -11.14162793383, -24.0112878382206, 9.39341643825173, -80.0630148500204, -59.9971971008927, 69.5586620829999
+y: 52.67443805933, -48.463183036074, 90.0137397460639, 95.1239809859544, -98.6111979465932, -70.7381737418473, -97.7023174054921, -4.86181387677789, -99.9695376493037, -84.6450063865632, 35.2110210806131
+method: k
+rm: FALSE
+result: 0.288504241332419
+input.z.1: 80.2214500959963, -16.4790869224817, 14.9447090923786, -76.3074616901577, -95.7911690697074, -42.1649531461298, -10.7618189882487, -37.5353710725904, 75.4259538371116, 0.160726672038436, -84.0096296742558
+input.z.2: 79.9426295794547, -98.1330295559019, 20.2024064492434, -83.4212276618928, 81.9087484385818, 15.698215784505, -59.1874286532402, 2.41743079386652, -56.4012502320111, -29.0360070765018, -61.3683750387281
+input.z.3: 31.0607691761106, -70.0570112094283, -50.5196814890951, 81.6438420210034, -50.414383225143, -7.72223989479244, -13.9937483239919, 98.8766676280648, -96.4582050219178, 44.9282119981945, -58.7133090011775
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: 54.5031766872853, -48.0435361154377, -48.2549458742142, 13.5190900415182, -99.9459353275597, -43.1967475451529, -51.7230877652764, 85.8822505921125, 98.8075927365571, -23.5670748632401, 95.2128172852099
+y: -33.1321520730853, 75.4384634085, 41.4772017393261, 68.0324987508357, 96.748707164079, 36.6900125518441, 47.0263858791441, -6.55903057195246, 70.0058882124722, 1.28378001973033, 9.69074643217027
+z: -61.9628706481308, -42.8054075222462, -81.5592133905739, 48.7764513585716, -8.34423061460257, -73.7232564948499, 51.6754065640271, -52.4331694003195, -32.1930185891688, -79.7134197782725, -7.73797025904059
+method: s
+rm: FALSE
+result: -0.506675300750236
+------------------------------------------------------------
+function_name: pcor.rec
+count: 17
+x: -79.6152154449373, 78.4319852013141, 49.7870131861418, 40.9128565341234, -38.9413299970329, 57.6212736777961, 95.6886244937778, -13.8690806459635, -14.3649831879884, -40.1887675281614, -35.8756079338491, -88.0116830579937, -76.4377722982317, -38.2442264817655, 22.5824641063809, 83.3017565310001, -18.2699847500771
+y: -56.8321019876748, -6.38408325612545, -6.54365173541009, 25.2405792940408, 77.7101498097181, 81.7850700579584, -23.5927077010274, 70.0163369532675, 13.4725551586598, -93.8025828450918, 82.9350834712386, -19.1807002294809, -96.641027694568, -13.9271743129939, 24.2437047883868, -33.1552400719374, -93.8347009476274
+z: -8.44970187172294, 9.03076659888029, -18.9505951944739, 60.2045745123178, 56.0176801867783, -57.2494097519666, 51.5992518980056, -28.4653120208532, -67.6779610104859, -84.3946997541934, -16.2014594767243, 97.8818096686155, -62.7145827747881, -66.8768094852567, 42.6931785885245, -18.1804189458489, -58.9151185937226
+method: s
+rm: TRUE
+result: 0.245647438689431
+------------------------------------------------------------
+function_name: pcor.rec
+count: 14
+x: -8.95535191521049, 83.1295024137944, 26.2705389875919, 67.8139599040151, -69.8907925281674, -67.5867159385234, 59.5211905892938, -61.4588709548116, 20.9577512461692, -88.4819873142987, 21.290334360674, 43.7073293607682, 61.680910969153, 62.1506804600358
+y: 86.6269668098539, -32.5135345570743, 59.5476369839162, -55.8229512535036, 52.6881521567702, -83.0401647370309, -92.1478198841214, 54.4313754420727, -83.3293351810426, -62.313958723098, 60.8884260989726, 61.8840378709137, 57.433863170445, 18.0313312448561
+z: -69.2746695596725, -54.081470426172, 21.0898623801768, 18.5468762181699, 0.908048637211323, -63.3753003552556, 91.7176062241197, 0.488004460930824, 79.7440263442695, 4.30610617622733, -34.7610086202621, 22.1601004712284, 89.4652825780213, 48.7705412320793
+method: k
+rm: FALSE
+result: 0.0111111111111111
+------------------------------------------------------------
+function_name: pcor.rec
+count: 14
+x: -50.7522673346102, -73.3074016869068, 14.5340465009212, -66.5852255187929, 2.34679142013192, 73.8169429823756, -64.9932525586337, 46.2075220886618, -18.173229880631, 12.1496684849262, -71.3544078636914, -47.5662395823747, -21.4743808377534, -4.69422470778227
+y: -13.8064284808934, -12.5385803636163, -65.9088707063347, 44.2371282726526, -82.2711412794888, -51.4188673347235, 95.4864253755659, -31.0616248752922, -23.6471280455589, -74.6061203535646, 66.8357694987208, -22.5880632176995, 21.1619397625327, 13.0164582282305
+z: 77.0700187422335, -88.5332877282053, 6.34226612746716, 27.1646889857948, -0.0974785536527634, -26.363241719082, 60.9230055008084, -31.0812496580184, 5.27547332458198, 9.03973975218832, -88.1527445744723, -48.2249503489584, -81.6687730140984, -53.646367136389
+method: p
+rm: FALSE
+result: -0.670943883857255
+------------------------------------------------------------
+function_name: pcor.rec
+count: 12
+x: 85.8026267029345, -88.8567392714322, 71.1906284093857, -42.287467001006, -87.2793929185718, 89.4890809431672, 43.1974852457643, -9.35818273574114, -17.5565235316753, -0.453179562464356, 43.4112564660609, 23.7805525306612
+y: -62.8617578186095, -89.3592846114188, -95.8116262685508, -41.6362321935594, -35.4687537997961, -28.9752063341439, 15.1240817271173, -81.4014834351838, 25.7772642653435, -83.8245145976543, -74.7226158156991, 63.2226870860904
+method: p
+rm: FALSE
+result: -0.0154314221847857
+input.z.1: -8.85584801435471, -76.0518108960241, -90.1860152371228, -27.0599717739969, -93.4562219306827, -93.58797124587, -23.47795618698, -94.6772815193981, -22.2225652541965, 41.5394491516054, -80.6787559762597, 86.2606703769416
+input.z.2: -38.7689351569861, -40.2000843081623, -99.1867681965232, 80.4073409643024, -44.9677177704871, 93.8172904308885, 59.8454762250185, 94.3912515882403, 34.1965254861861, 16.6013369802386, 67.8427397739142, -38.8580628670752
+input.z.3: 83.9653053786606, 95.5453366506845, 31.6075063310564, -49.3629164528102, 39.3006291706115, 58.262199210003, 36.9852046016604, -51.8655603285879, 14.8231557570398, 65.4056573286653, -76.6185896005481, -9.75128882564604
+------------------------------------------------------------
+function_name: pcor.rec
+count: 17
+x: 42.2951359767467, -98.0670476797968, 72.95155916363, -97.5872188806534, 29.4609900098294, 53.7210481241345, -33.2761470228434, 18.8987899105996, -66.2275532726198, -79.557922296226, 29.3099474161863, 9.5911558251828, 95.1384756248444, -33.7378962431103, -10.1655352395028, -44.7425982914865, -50.7976255379617
+y: 33.169471565634, -84.5846886280924, 62.4898296315223, 75.4857927095145, 68.9234993886203, -54.5816842000932, 91.2322744727135, 1.25600299797952, -54.1735134553164, -12.8964414354414, 80.9569772332907, 82.643111422658, -64.9629856459796, 71.2960900738835, -58.9118956122547, 34.2774460092187, 79.9432563595474
+method: k
+rm: FALSE
+result: -0.0840388092297653
+input.z.1: 24.8670800123364, 96.9902894925326, 18.2047539856285, 29.9416149966419, -67.6683164667338, -94.5415789727122, -94.464895548299, -89.070585463196, -93.1418780237436, 7.63960015028715, -27.3726081941277, -20.9940173197538, -40.1839104946703, 22.9435044806451, 79.4069023337215, 82.1736453101039, -1.15302046760917
+input.z.2: 81.2827946152538, 18.1390372104943, 42.039096634835, 3.42075540684164, -88.2026459556073, 26.7978167627007, -13.1311344914138, -82.1488615125418, -74.8239930719137, 19.9365015141666, 30.6700795423239, -12.6407288946211, 25.2683679107577, 80.5456896778196, 3.72873861342669, 61.0932228621095, 94.7194188367575
+input.z.3: 18.1032594759017, 81.0059050098062, 0.533604482188821, -31.8593421019614, -82.4320225045085, 59.2174014076591, 12.148222932592, 32.3002810589969, 15.2615524362773, -20.450661983341, 83.4245914593339, -59.7416742704809, -37.4349432997406, -35.7613458298147, 45.3094141557813, -48.7132341135293, -60.4963214602321
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: 39.8641279432923, 36.6818822920322, -40.780941862613, -87.3267628718168, -28.2410716172308, 42.4047458916903, 0.0225101597607136, -8.9056434109807, -2.91150966659188, 39.6428920328617, -75.8707294706255, -73.5319286584854, 63.4615595918149, 22.4617537111044, -41.1442595068365
+y: -55.4940924514085, -64.180206740275, -80.1653628237545, 3.60332592390478, -41.3710146211088, -47.208951972425, 50.7955606561154, 68.0279347579926, 24.1804163902998, -58.5063801147044, 53.4048205241561, -62.6482892315835, 74.8165004421026, -35.8001246582717, -16.7477594222873
+z: 57.1126049384475, 13.7041463050991, 92.6308101508766, -98.5024768393487, -2.28023235686123, -23.9749090280384, 59.5866456627846, 37.3168694321066, -49.8011747840792, -61.9211140088737, 35.5470598209649, 27.0186287350953, 84.0462429448962, -53.7428881041706, -20.3638930339366
+method: p
+rm: FALSE
+result: -0.0698817922106879
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: 90.9256948158145, -42.5652571022511, -67.079691728577, -44.3737761117518, 39.7340807132423, -60.089198499918, 35.8762004878372, 22.369765676558, 82.5496308971196, 54.5133300125599, 85.3771304246038
+y: -83.5164808668196, -2.3147423285991, 54.9748376943171, 58.0427039414644, -64.0521888621151, -2.81249335967004, 98.0928914155811, 73.602551035583, 51.3121796306223, -34.7387288231403, -72.9273286648095
+method: s
+rm: TRUE
+result: -0.523042743416072
+input.z.1: 85.7249903026968, 83.893974032253, 35.4516032617539, -28.1841973308474, 17.7539859898388, 28.1705584842712, 62.0195430703461, 6.89598307944834, -43.7137708067894, -6.51348838582635, 64.4391702953726
+input.z.2: -77.2161093074828, -34.4602860976011, -31.7707217298448, 69.7988425847143, 24.0384986624122, 2.52298396080732, 67.1068411786109, -59.9436047486961, -6.02900786325336, 14.7358069196343, -39.7780386731029
+input.z.3: 27.5480494368821, 80.7176610920578, 45.4240935388952, -25.5288687068969, -8.32626689225435, 18.6241313349456, 56.0617660637945, -99.768823524937, -32.49516421929, 57.5501822866499, 84.3718754593283
+------------------------------------------------------------
+function_name: pcor.rec
+count: 14
+x: 45.8342797122896, -77.0667779725045, -64.2237342894077, 4.22732839360833, -46.0417157970369, -47.2304744645953, 29.3592920526862, 63.4333388879895, -71.0418430157006, 70.1868168544024, -6.70211175456643, 88.2698916830122, -16.8335956986994, -10.7731471769512
+y: -66.40481101349, 46.3921690359712, 20.5301644280553, 2.09054443985224, -38.9518717769533, -82.9474763479084, 33.7044085841626, 96.5075950138271, -63.3534894324839, -20.2410046011209, -43.0850372184068, 92.0669205486774, 47.347361408174, 66.1714978050441
+z: 85.8965543098748, -37.6489527057856, -4.43430640734732, -76.9130968954414, 73.8492679782212, -9.16740805841982, -69.2597345914692, -95.8653298206627, -12.3851452954113, -1.94358341395855, 95.0880268588662, 13.8634593226016, 64.1506760846823, -61.8146073073149
+method: p
+rm: FALSE
+result: 0.362686685201407
+------------------------------------------------------------
+function_name: pcor.rec
+count: 18
+x: 4.83486847952008, -33.575087832287, 5.45295123010874, -7.36544406972826, -51.7337966710329, -76.9358182325959, -35.6409954372793, 76.3785248622298, -39.3296065274626, 49.9114766716957, -54.7522674780339, 45.3345373272896, 44.5223123300821, -3.24754253961146, -81.5377961844206, 86.3679833710194, 36.4841728005558, -98.1516223866493
+y: -62.7916551660746, -98.1929061934352, -95.5918425694108, 85.3282696101815, 45.650498336181, 91.1865540314466, 18.8234640751034, -35.8555696438998, -78.9908673148602, -93.5970240272582, 61.6506161633879, -19.7622532490641, 20.6596003379673, -13.2536272518337, -34.9431619979441, -77.814610209316, -96.883852686733, -87.7667313441634
+method: p
+rm: TRUE
+result: -0.166800709155144
+input.z.1: 0.114683574065566, 76.4428338501602, 55.6030308827758, -12.6116141211241, 22.8804398793727, 28.3099383115768, 70.0053324922919, 8.81802220828831, -76.2668633367866, 51.8301085103303, -11.9479915592819, 58.2237378694117, 49.3079916574061, 61.2620721571147, -8.63581006415188, 44.7254316415638, -27.6764208450913, 97.5463242735714
+input.z.2: 73.784694634378, 99.4395392481238, -50.6187239196151, -32.5045205187052, -47.0645889639854, -29.0419731289148, 46.5196094475687, -26.6453473828733, 73.8187781535089, -14.7704138420522, -5.36934426054358, -84.8333730362356, -71.3679736480117, -72.7307432331145, -39.5870515611023, -47.0888705458492, -41.963919159025, -77.1274531260133
+input.z.3: 43.4523142874241, 39.5262993406504, -99.5481145102531, 43.935475917533, 90.169087331742, -1.52269233949482, 57.9886345658451, -58.3146122284234, 96.0287448484451, -77.5498211849481, 82.5941725168377, -6.65150554850698, -80.9493550099432, -73.9797147922218, -67.7011332008988, -17.1580271329731, -43.8098904676735, 44.4789375178516
+------------------------------------------------------------
+function_name: pcor.rec
+count: 12
+x: 75.4411236383021, -19.5394861511886, 54.8095060512424, -92.0215208083391, -21.294112643227, 26.4304304961115, 95.5353437922895, 25.3490419127047, 37.6811063848436, 22.0898760482669, 51.9865156151354, -0.527428183704615
+y: -2.90723177604377, -99.8164829332381, 86.0683097504079, -96.8761240597814, 97.06368483603, 14.7922529838979, -77.4926966521889, 86.5167673677206, 60.2897321805358, -38.285131752491, 10.3472337592393, -51.6168985515833
+method: p
+rm: FALSE
+result: 0.275501840529125
+input.z.1: -93.3178124949336, 63.9247000217438, 52.2618164308369, 52.2421864327043, 7.9075523186475, 29.9971995875239, -1.57735198736191, -43.6246140860021, 33.8648134842515, 23.0104923713952, 96.1260831449181, -43.5764740686864
+input.z.2: -42.9460354615003, 72.2460472024977, 9.14394510909915, 41.6251530405134, -12.9338803701103, 60.1190572604537, 69.2696672864258, 53.0324925202876, 2.6995662599802, 78.4068618901074, 78.4405670128763, 91.7038987390697
+input.z.3: -48.3382353559136, -20.7997158169746, -82.1640026755631, -54.2279165703803, 50.1300446689129, -71.9413852319121, 46.1742796003819, 86.1585101578385, 36.9840029627085, 72.7105645928532, -3.33922882564366, 27.4154386017472
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: -28.5778240300715, 44.3743884563446, 33.4759910590947, -60.2454300504178, -41.7592494748533, 50.522102182731, -85.6955510564148, -66.6345450095832, -89.569599321112, 47.7078658994287
+y: -67.8200133610517, 27.5062628090382, 71.7565322294831, 67.6066937856376, -74.0544877480716, 17.2822214663029, 36.4111427217722, -46.7251748312265, 82.4704122263938, 41.7229991871864
+method: p
+rm: FALSE
+result: -0.604998498254511
+input.z.1: -58.7718021590263, -96.4335916098207, 32.5497580226511, -70.9680902771652, -47.4293766077608, 78.2334991265088, 59.4156378414482, -34.6753363031894, -34.3722300603986, 65.5848338268697
+input.z.2: 23.9919899962842, -38.0485058296472, 47.6243172306567, -77.3341711610556, -41.7488056235015, -20.8688801620156, -69.1063681617379, 60.9236182179302, -64.5143582485616, -26.092412089929
+input.z.3: -32.6844338327646, -59.2932476196438, -68.7602701596916, 2.40732813253999, 27.1003542467952, 14.0520400833338, 84.4277138821781, -70.8949789404869, -9.41576450131834, 20.9310320671648
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: -69.387745950371, -49.2386457044631, 78.5358119290322, -84.7651823423803, -6.51485347189009, 39.3126453272998, -72.8123931214213, -61.9186998344958, -18.6902535147965, -88.9804591890424, -91.7242038995028, 86.5591046400368, -34.7955056931823, 33.6816429160535, 64.656486036256
+y: -54.2493806686252, -62.5815090723336, -53.7531255278736, -48.4718740917742, 10.1653558667749, -3.61327603459358, 98.8740086555481, 78.1578201800585, 29.4536428991705, -72.3204976413399, -61.3744611851871, -58.5085956379771, 34.6117965877056, 18.9841146115214, 90.7721454277635
+method: p
+rm: TRUE
+result: 0.152489072601148
+input.z.1: -17.8637297824025, -29.0924018714577, 12.0219393633306, 89.730524783954, 20.4635892994702, -40.1110864710063, 97.1969441976398, 24.2813416291028, -7.22711877897382, -6.58672391436994, 85.9623525757343, 13.9038019813597, -1.48428776301444, 70.1985373161733, 99.4452722370625
+input.z.2: -24.2749121971428, 11.0093058086932, 1.79093312472105, 34.6534831449389, 77.1981728728861, -47.0347272697836, -38.3209746796638, 14.4402433186769, 25.9882995393127, -37.2800651006401, 33.4694077260792, -54.7662175260484, -18.9552983269095, 24.5075556915253, 77.4359260685742
+input.z.3: -54.5507300645113, -58.4174287971109, 3.50196729414165, 70.3624501358718, -85.4037730023265, 16.6389497928321, 46.1369656492025, -26.1817390564829, 27.9330456629395, 19.4141190964729, -51.5585941262543, -81.4289728645235, 52.6618564967066, 88.6152235791087, -3.4073153976351
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: -52.5501887779683, 76.0798906907439, -6.81492239236832, 51.8030108883977, -86.934806779027, -98.4599460382015, -38.9213243033737, -4.49495259672403, -87.9419339820743, -30.7407310698181, -20.1296131126583, -84.7388334106654, 95.9355524275452, 37.6330619677901, 11.805298179388, 71.3551525957882
+y: -35.7584306504577, -27.3668797221035, -72.6249604485929, -57.6672877185047, 89.3170366995037, 38.8797192834318, 66.2799593992531, -96.7583430930972, 71.8599527608603, 3.1670056283474, 6.21368275023997, 97.4829965736717, -74.2258692160249, -85.100900195539, 93.3626578655094, -6.60710437223315
+z: 68.3757029939443, -93.1859899777919, 73.9776723086834, 63.8459702953696, 4.1983631439507, 92.5801522098482, 58.4410866722465, -54.9838863313198, -18.4496367815882, 52.0247212145478, 41.2156102247536, 1.31171490065753, -86.6873883642256, -3.71779990382493, 53.2298434525728, -49.8276673723012
+method: k
+rm: TRUE
+result: -0.390867979985286
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: -75.3095431718975, 77.2476399783045, -30.7190073654056, -76.5569956507534, -38.3892927318811, -97.640515351668, 40.7633638009429, 80.9929232578725, 69.9184333905578, 37.5527075491846
+y: 83.5916271433234, -26.9137156195939, 97.4208392202854, 7.80353010632098, 0.348421139642596, -91.0831026732922, -46.7444436624646, -29.6432333532721, 73.4219971578568, -78.7570051383227
+z: 34.0024248231202, 31.6505118273199, -34.0259387623519, -88.8631666544825, 34.7183919977397, -9.8018751014024, 19.560739537701, -16.2760076113045, -64.0254020690918, 91.1820934619755
+method: s
+rm: FALSE
+result: -0.0560875688519553
+------------------------------------------------------------
+function_name: pcor.rec
+count: 17
+x: -38.3992325514555, 32.8475083690137, 79.121769266203, 21.0495824925601, 44.6178534068167, 4.39555062912405, -51.3640556950122, -55.6133981328458, 79.1281075682491, -95.4117084853351, -35.9894464723766, 91.6743733920157, 7.56984488107264, 73.7063893117011, -94.4896949455142, -69.728662725538, 34.1863818001002
+y: -1.27204842865467, 15.5883238650858, 52.7721991296858, 35.2760184090585, 50.1832047477365, -34.9931715521961, -60.3594477288425, 53.8173413835466, 82.5948101934046, 97.0483394339681, 55.829929606989, 2.9106458183378, 1.44075509160757, -25.6358910351992, -89.6978388074785, -55.6567288935184, -13.0775235593319
+z: -48.5710377339274, 64.2419253010303, 41.1617243662477, 70.234408415854, -10.9620631206781, 95.1862500514835, -40.9594263415784, 45.6709728576243, 56.5230576787144, -32.0230093318969, -73.3659269753844, -57.5494988355786, -26.7636676784605, 68.3923695702106, -4.33183843269944, 28.4814916085452, -7.51618449576199
+method: p
+rm: TRUE
+result: 0.262299008214051
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: 63.9999500010163, 6.35658605024219, -61.2774891313165, -55.0585428252816, 87.6808669418097, 30.6727230083197, 25.9130414575338, -88.0746370647103, -32.165707834065, -21.940717799589, 14.2026159446687, -23.0245357844979, -52.1892547141761, -12.0932789519429, -79.3347698170692, -98.9265380427241
+y: 97.3826597910374, -99.0675398614258, 73.9090912975371, 34.971971809864, 25.0468590762466, 18.0295334663242, 17.503083543852, -87.189973378554, -39.5246281754225, 30.6683254428208, 92.4373132176697, 62.0077466126531, 86.7115816101432, 10.9139364678413, 78.7267089821398, -20.369843300432
+method: s
+rm: TRUE
+result: 0.152631744587296
+input.z.1: 95.2498456928879, 10.1988882757723, 82.5301209464669, -63.0169591400772, -80.2177854347974, -92.172612156719, 81.9323406554759, -98.8836394157261, -55.1519786007702, -9.92068941704929, 69.03902948834, -64.8831372149289, -59.4855682458729, -43.2437205221504, 32.601273059845, 51.8672341480851
+input.z.2: 98.8599751610309, 61.2078364472836, -79.2565326672047, -91.2782166618854, 4.95080463588238, -74.4587088469416, -58.5738305002451, -11.1764627043158, -42.7475158125162, -19.5871444884688, 15.3298336546868, -76.2663461267948, 35.0223543122411, -17.0931177213788, -53.7032708991319, 39.0595389995724
+input.z.3: -82.2170123457909, -61.1209249123931, 75.4895146936178, 24.8059226665646, 2.35008695162833, 20.5680044833571, 22.843256406486, -54.538040002808, 53.478835709393, -32.7691012993455, 73.4401112888008, -48.4993967227638, -32.6875764410943, 16.6579740121961, -35.9389083925635, 48.6933783162385
+------------------------------------------------------------
+function_name: pcor.rec
+count: 14
+x: -38.0344086326659, -69.9757680296898, -96.0218561347574, 69.8170815128833, 84.4397103879601, -59.2046371195465, -25.6243887357414, -34.0098573360592, -18.5869125649333, 20.9443704690784, -17.8864942863584, 71.729579847306, -10.980512201786, 19.9342513456941
+y: 13.3373680990189, -28.0795010738075, 60.10332996957, -18.4444782789797, -98.1782922986895, 24.3794317822903, -76.4999823644757, 55.177218047902, 63.7693482451141, -21.0158154368401, 46.3093394879252, 38.5526302736253, -20.9319279063493, 43.4511065948755
+z: 91.1088630091399, -80.6348104495555, 14.3109522294253, -30.541270179674, -45.445510186255, -70.923288539052, -42.259228695184, -32.2218311950564, 26.1644289363176, 72.1342351287603, 58.3190027624369, 37.6866820268333, -47.4517594091594, 9.29418164305389
+method: k
+rm: FALSE
+result: -0.283731050383254
+------------------------------------------------------------
+function_name: pcor.rec
+count: 12
+x: 95.6271091010422, 3.03470036014915, 16.5275795850903, 39.0536304097623, 64.3952058628201, 60.8842697460204, 77.1877882070839, 7.39374337717891, -35.8326355461031, -96.9841248355806, -2.37456695176661, -66.4348848164082
+y: 52.346898894757, -0.568210193887353, -57.0029267109931, -55.1746561657637, 41.1318924743682, -48.4784295782447, -11.867310013622, 58.9504377450794, 49.1472533904016, -48.130969516933, 87.50881687738, 95.0276869349182
+z: -27.8131592553109, -58.7517556268722, -79.0835770312697, -62.2862636577338, -40.9212727565318, 40.4043748509139, 60.9704895410687, 80.6037961505353, -29.821108514443, -72.1863387618214, 73.8867315929383, -71.3265169877559
+method: s
+rm: FALSE
+result: -0.498847227000007
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: -17.7215591538697, 33.0656519625336, 73.2753658201545, 66.6529010981321, 55.8624967001379, -18.1828083004802, -56.0154461767524, -80.258708121255, 74.527901597321, 22.4931557662785, 87.0472464710474, -68.2707403320819, -57.8954718075693, -55.7025399059057, 1.64373158477247, 89.0081748832017
+y: -11.6898256354034, -31.8874595686793, -27.6948968414217, -93.0535418447107, 94.3694983609021, -15.3473258949816, -30.3451092448086, 47.9080203920603, -12.34792903997, 70.1379578560591, 28.4610396251082, 82.0771362166852, -52.1409922279418, 73.4910554252565, 70.6270689610392, 29.6015367377549
+z: -3.16192414611578, 91.681189648807, -8.44467529095709, 61.7250246461481, -39.3754992168397, 10.0268266629428, -80.2241073921323, -30.7949334383011, 38.7846238911152, 99.9698612838984, -10.4493941180408, -79.5240023173392, 84.4389423727989, -90.3318281285465, -0.888433260843158, -9.30486363358796
+method: s
+rm: TRUE
+result: 0.00723744241918376
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: 34.7738367971033, 79.1716305539012, 76.4990594238043, -81.775622535497, -27.1493992302567, 10.8191972598433, -30.871396837756, -0.714902393519878, 61.4628181327134, -36.771080410108
+y: 53.3137893304229, -50.2570678945631, -41.6580128017813, -7.47664775699377, -88.6360401753336, -91.5539033245295, 12.6738691702485, 40.7443516887724, 83.883469318971, 49.5867451652884
+method: s
+rm: FALSE
+result: -0.282719593431579
+input.z.1: -84.4675720669329, -67.0466589275748, -18.3911125641316, 98.2628283090889, 51.9808443728834, -30.4428660310805, 21.8935457058251, -90.0795019697398, -70.4285278450698, 5.32920747064054
+input.z.2: 45.5949940253049, -83.0156840384007, -35.4019852355123, -30.4982414469123, 24.3814556859434, -71.7630771454424, -88.9764131512493, -57.2371034882963, 70.5831084866077, 35.4439703281969
+input.z.3: -14.7715406492352, -59.8912607412785, -99.6177072636783, -28.8444213569164, 59.2899556737393, 12.0164824649692, 99.4955199304968, 24.3026872631162, 19.8734523262829, 86.9021194986999
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: -56.3390923663974, -93.8485420309007, -76.1460797395557, 87.2354988474399, -9.28768664598465, -31.4640353433788, 43.1042958050966, -79.2129376437515, 69.6591412648559, 50.0667770393193, 51.4706159941852, 48.2311789412051, -87.6915453933179, 41.4921804331243, 46.0590915754437
+y: -30.0428883638233, 23.8112844526768, -66.162470029667, -58.4669277537614, -13.7554917950183, 40.0350350420922, 80.381247960031, 76.8449954222888, 8.20867097936571, -2.99584232270718, -27.960628317669, -8.26242859475315, -77.6679917704314, 37.3565788380802, -14.3165319226682
+method: s
+rm: TRUE
+result: 0.0255435017969936
+input.z.1: 15.6856134068221, 44.3085910752416, 60.8353640884161, 80.8151323813945, -93.5956147965044, -54.3712676037103, -1.6567571554333, 90.8884244039655, -21.2625379674137, 81.0105908196419, -93.1311052292585, -8.25112308375537, -19.440022809431, 98.4774097334594, -18.0913300719112
+input.z.2: 82.7684669289738, -12.4109126627445, 53.7559506483376, 83.7132328189909, 99.6508095413446, 71.7520699370652, -92.9998741485178, 56.0302780009806, -51.0383900720626, 21.5518812183291, -18.6573163140565, 36.7927459068596, -84.7163817845285, 55.2210496272892, -70.2050358057022
+input.z.3: -98.7551828846335, 19.49746995233, -17.9139976389706, -35.7827616389841, -75.590154202655, 29.1891138069332, -27.3778593633324, -23.2670258264989, -71.2701795622706, -35.3796728886664, -53.1982235610485, -72.0516404602677, -0.0638416036963463, -60.8670709189028, 10.7043496333063
+------------------------------------------------------------
+function_name: pcor.rec
+count: 18
+x: -41.4313202258199, 45.9841891657561, 73.0351263191551, 14.5961822941899, 74.4030376896262, 0.350432144477963, 80.5028904695064, -86.0359017271549, -39.5940739195794, 17.8364073392004, -95.8692795597017, 23.454642156139, 63.9558572787791, 16.6738138534129, -14.6638540551066, -12.6493938267231, -47.084568021819, -49.758878769353
+y: -78.1604333780706, 39.5707542076707, -12.7265444491059, -38.0420819856226, -55.3764114156365, -7.27670988999307, 58.9023143518716, -13.7581620831043, 22.982121957466, -91.5119064040482, -72.0678606536239, 90.5886249616742, -51.7078758683056, 26.0097248945385, -23.915150295943, 68.5918164905161, -81.5348560921848, -15.0977482553571
+method: p
+rm: FALSE
+result: 0.188671955029874
+input.z.1: 80.1465837750584, -10.501228319481, 89.6407624240965, -39.7226133849472, 16.4567670319229, -71.1080288980156, -88.0229809321463, -75.8985460270196, 52.3780675604939, 34.3009188305587, 6.18860609829426, 97.8012350853533, 75.5968149285764, -61.0649057663977, 48.5446393955499, 18.231154140085, 1.47281852550805, -22.2872096579522
+input.z.2: 46.3825967162848, -82.8961354214698, -35.6839893851429, -25.5692901555449, 99.5609007310122, -31.00421926938, -14.7553088143468, -46.3190216105431, -89.3388437107205, -88.630617922172, 4.92621585726738, 89.5269899163395, -18.8370112795383, -40.9037253819406, -33.2164043094963, 74.5714424178004, 88.6978259775788, 61.7720224894583
+input.z.3: 81.4619556535035, -94.0986347850412, 98.9308916497976, 70.2591719571501, 39.478223817423, -88.385613868013, 9.04444772750139, 91.7586042545736, -47.6329161785543, 59.0545888524503, 70.1687247492373, -63.067327439785, -78.9021805860102, -49.9975389800966, 66.2716360297054, -55.5166335310787, -31.9789612665772, 51.4375566504896
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: 10.40073283948, -13.6921347118914, 84.5260130241513, -25.3665409516543, -78.2397591974586, 26.9345681648701, -58.5972013417631, 88.9882248360664, 45.4503744374961, -65.1228747330606, -27.4899946060032, 18.1972809601575, 11.3279470708221, -10.4332664050162, -60.4957120958716, -72.7518951985985
+y: -71.9699081033468, -99.9155370518565, 27.7240531984717, 85.3693515062332, 35.6472678948194, -23.4722698107362, 44.0854747779667, 95.8298934157938, -64.2083233222365, -29.3003208469599, -59.2611992266029, -29.7768235672265, 72.6343247108161, 49.7656984720379, 20.3026765026152, 17.2155754175037
+method: p
+rm: FALSE
+result: 0.0493694878245429
+input.z.1: 35.6308063026518, 4.66748662292957, 30.0429651513696, 76.2124869506806, 41.5056325495243, -30.4092030506581, -40.1510936673731, 91.4136198814958, 54.569678613916, -38.229710329324, 17.4495459534228, 42.4616932403296, -83.6061837617308, -96.9037922099233, 9.05879577621818, -81.1989603098482
+input.z.2: -13.610919052735, -2.48283445835114, 43.406359385699, -1.01326643489301, -71.5403430629522, 42.3702582251281, -57.7236965764314, -98.0018012225628, -2.94910599477589, -99.2285002022982, -30.1409310661256, -15.3791854158044, 63.2841229904443, -59.3148066196591, 89.0598343685269, 50.3705789800733
+input.z.3: 65.1514234952629, -52.134693833068, 37.3474742751569, -34.9965825211257, 29.8068393021822, -37.6201854553074, 28.4822612535208, 58.1028845626861, -71.3396343402565, 6.92787766456604, -81.047579832375, 6.40434417873621, -3.12588470987976, -85.8339602127671, -89.5489359740168, 36.9031661655754
+------------------------------------------------------------
+function_name: pcor.rec
+count: 14
+x: -97.1265674103051, -30.6887221056968, -58.1901613157243, 41.3434299640357, -44.8513293173164, -47.3897785879672, -11.2351455260068, 4.53527974896133, -53.9899244904518, -34.4885903876275, 84.1011397540569, 98.0846612714231, -97.2742294892669, -30.2832910791039
+y: 50.7123678456992, -41.0642932634801, 59.7222890239209, -87.1463846880943, 88.5209604166448, 76.3058924581856, -78.5172951407731, 23.3256267383695, -33.4639381617308, 67.8117078728974, -34.5261936541647, 13.6419337242842, 71.4485326316208, 29.9240712542087
+method: k
+rm: TRUE
+result: -0.414455855539734
+input.z.1: 95.3356681857258, -82.6237799599767, 61.6875410079956, -55.9806656092405, -98.3273911755532, -27.0171985961497, 45.6566241104156, -60.7003193348646, 39.0095799230039, -4.835369810462, -82.758112763986, -63.1046458613127, 22.5925303529948, -27.5266251526773
+input.z.2: 40.2346897870302, -80.8139885775745, 79.8951716627926, -99.673797795549, -11.8247658014297, -4.43669916130602, 21.9069521874189, -96.3469043839723, -12.5659705139697, 5.28370542451739, -2.05569667741656, -46.0224835202098, 37.0902071706951, 13.7604320421815
+input.z.3: -75.4078052937984, 53.1730110291392, 32.1218248456717, -3.36327841505408, -64.6848318167031, 46.9770870171487, 56.2149090692401, 77.8601902537048, -99.6458038687706, 17.093415139243, 30.976364063099, -21.0922583937645, 64.4309076480567, 28.8166706915945
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: -21.7418022919446, -19.7270201519132, -51.0829096194357, 95.4731678124517, 63.3456526324153, 10.2449305355549, -30.8713216334581, 56.4763959497213, 97.5144575815648, -99.8349095229059, -36.944431765005
+y: 41.1633080337197, 71.5601967647672, -32.7024550177157, 95.0067212339491, -41.5371483657509, 76.2717307079583, 64.7539126221091, -59.7191719803959, 38.3289860095829, -5.68816638551652, 46.9167932402343
+method: k
+rm: TRUE
+result: 0.2560174270761
+input.z.1: -13.6582542210817, -54.4519340153784, 60.2084300015122, -22.9066342581064, -1.08100399374962, -39.2812125850469, -59.9119843449444, -89.6116081625223, -93.6755935661495, -30.0237529911101, 63.4646773803979
+input.z.2: 5.04081835970283, -7.67772262915969, 64.7993986494839, 10.6604609638453, 29.0101025719196, -11.9249556213617, -69.8554737027735, -2.71794814616442, 34.5893805380911, 52.1268622484058, -87.2946038842201
+input.z.3: 96.479544788599, 73.5420207027346, -65.0878861546516, -57.7022604178637, 81.0698586516082, -82.7021759469062, 21.458005765453, -53.0339238233864, -43.9016601070762, 60.7445098459721, 50.4766744561493
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: -34.2646942008287, -78.1300825066864, 6.60557821393013, -57.4746059719473, 5.91994277201593, -58.6971938144416, 81.2527935951948, 58.9401760604233, -13.9615070074797, 84.4087808858603
+y: -84.765654662624, 30.2333278115839, -10.119401384145, -17.8130576852709, 14.3761526793242, -21.2025688029826, 59.4600023236126, 22.4814132321626, 43.6779118143022, 10.5381097644567
+z: -67.6395879592746, -63.1648739799857, 25.9779758285731, 68.5387071222067, 95.8367916755378, -11.1885727383196, 89.5199802704155, 29.4853665400296, 40.4386383015662, -79.2295292485505
+method: s
+rm: FALSE
+result: 0.31648230729558
+------------------------------------------------------------
+function_name: pcor.rec
+count: 17
+x: 65.2889241464436, -25.8309810422361, 41.5279346518219, 33.3778714761138, -78.418835811317, -86.3514642696828, -57.550333160907, -88.9864289667457, 83.8500074576586, 86.0779710579664, -72.9724165517837, 62.1391572058201, 35.1193575654179, -83.0525180790573, 27.2962907794863, -75.9986287914217, -59.743734030053
+y: -79.1268857661635, 21.6799827292562, -86.7284807842225, 76.4053526800126, 93.5399503912777, -7.59860742837191, 42.910123243928, -64.9026639293879, -39.5152932032943, 32.3382542468607, 79.3962649535388, 22.9047404136509, -17.6881920080632, 48.4937213361263, 51.0530607774854, 88.3627690374851, 36.3776166923344
+method: s
+rm: TRUE
+result: -0.50973498058253
+input.z.1: -90.2783849742264, 67.8969173692167, 81.9336336571723, 23.094120528549, 45.3741174656898, -61.7810368537903, -40.4937511309981, 65.4344111215323, -88.5476648341864, -64.6377388387918, -44.140517571941, 1.47411120124161, 79.240211751312, -60.1765193045139, 55.3837953601032, 43.3551961556077, -66.288702422753
+input.z.2: -36.9666110258549, -19.9583745095879, 17.8784884046763, 13.4679388720542, 4.24224487505853, 75.965761533007, 77.3604078684002, 14.5181270781904, 96.6304958797991, -90.3991216327995, 23.3897795435041, 87.7320431172848, 44.0418939571828, 98.0463651940227, -0.360229099169374, 33.0039616208524, 31.0656359884888
+input.z.3: -19.3495023064315, -2.21126056276262, 63.4957967326045, -92.3508635722101, 3.20365112274885, 89.5428656134754, -92.3482635524124, -38.769258139655, -49.6236519422382, -46.3103124406189, -85.6290648691356, -92.7534214686602, 7.33050634153187, -3.93257569521666, -19.6759086567909, -99.842318193987, -74.6654002927244
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: -79.5160966925323, -74.9874663539231, -78.7817076314241, -77.2851656656712, -70.8517644088715, -33.5970929358155, -43.6421300284564, -41.397284111008, -92.8962790872902, 70.4068915918469, 47.7719811256975, -92.2868068795651, 28.4771746024489, 79.5827704947442, -28.5637738183141
+y: -37.4145726673305, -0.288628088310361, 47.6206338498741, -88.7128345202655, 30.3396196104586, 25.5081232637167, -72.0780373550951, -73.6024056561291, -57.554987911135, 81.4102350268513, -87.255728431046, 42.0090320520103, -5.66472639329731, -5.92177757062018, -14.2655706964433
+z: -23.3767181169242, 31.2546348199248, 56.052082311362, -27.3735378868878, 3.64539204165339, 64.6297093015164, -93.1361247785389, 99.8736266978085, -36.8254229426384, 86.4495293237269, -95.7299213390797, -50.8483925368637, -78.292038384825, -36.2992297858, -24.5581880677491
+method: k
+rm: FALSE
+result: -0.0134693114610091
+------------------------------------------------------------
+function_name: pcor.rec
+count: 17
+x: -43.5266146436334, 18.0117554031312, 58.6101210676134, -41.2745150737464, 32.3130699340254, 54.0322658605874, 24.1791611537337, 73.3054053038359, 42.0464181806892, -96.5218428522348, 29.9439492635429, -12.5784670002759, -44.0562542993575, -25.4333753138781, 94.4393996614963, 98.0722198262811, 55.4907775018364
+y: -9.93549497798085, -45.8743677474558, -93.3299192227423, 79.5469779986888, 8.02246518433094, -14.3250429537147, 70.3237357083708, -99.5543221011758, -87.8637499641627, -86.2719914410263, -61.0736012924463, 24.7784069273621, -37.3273107688874, -28.9717409294099, 93.1313112843782, -25.6219055503607, -49.4559060782194
+z: -64.1072164289653, 87.7694536466151, -37.9586412105709, -22.3177924286574, 40.3714318294078, -63.5947197675705, -22.0420437864959, 33.9729850180447, 5.00115477479994, 10.3678717743605, 35.4822291061282, -45.7916335668415, -18.1938569061458, 15.615754853934, 19.5150196552277, 23.4867738094181, -95.2608565799892
+method: s
+rm: FALSE
+result: -0.112611956543292
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: -92.1721640042961, -44.6145492140204, 86.8770225439221, -17.2698491252959, -40.4595222324133, -81.152014946565, 76.5948620159179, 14.66314336285, -43.7089977785945, 74.8940746765584, -20.9608427714556, 60.4101787786931, 92.6798572763801, -13.8263172935694, -15.3552802279592, 30.9063795022666
+y: 34.0978310443461, -93.5446070507169, -52.1205889526755, -60.0228164810687, 40.2410709764808, 68.5365847777575, -20.6536095123738, 96.2824455928057, 94.9520392809063, 38.3727887645364, 5.11064333841205, -42.3503454308957, 7.87821393460035, -15.5445182230324, 55.9228281490505, -54.4300060719252
+z: 72.2797598224133, -36.7589842528105, -31.7109297960997, 14.8865082301199, 14.2975315917283, -33.6676219012588, 73.4386292751878, 42.6696452777833, -49.9572122935206, -16.0288103390485, 91.8950178194791, -22.2982299048454, 43.716481141746, -83.7867478840053, -26.7168609891087, -40.8360068220645
+method: k
+rm: TRUE
+result: -0.152451910661407
+------------------------------------------------------------
+function_name: pcor.rec
+count: 13
+x: -73.5700607765466, -27.4823492858559, -18.4957931749523, 75.0972531735897, -84.0701918583363, -73.6900016199797, -80.8014692272991, 1.56031367368996, 53.5824096295983, -15.8273342996836, 27.9865844640881, 71.9814067240804, 16.1229219753295
+y: 61.8587560020387, -54.1709136217833, -85.5680546723306, 11.5867487620562, 8.42031557112932, -19.0553280990571, 53.1157708261162, -6.55828071758151, -57.5449388939887, 60.9522576443851, 14.8441521450877, 21.0842114407569, 98.9267005119473
+z: -77.1422278601676, 71.9358698930591, 30.8435730170459, -37.9183823242784, -2.70509789697826, 11.3845904357731, 98.1391918379813, 59.1201251372695, 16.70933207497, 83.35813540034, -73.9252686966211, -44.1968939267099, 35.4018601123244
+method: s
+rm: TRUE
+result: 0.0029677519984588
+------------------------------------------------------------
+function_name: pcor.rec
+count: 12
+x: 66.390974028036, -16.8352647218853, -53.4644976258278, 75.3752870019525, -57.9270939808339, 54.5454489067197, -96.0464406758547, 33.1332623958588, 86.3947817590088, -18.4396516531706, 35.6390007771552, -6.8594797514379
+y: 66.0928500816226, -76.8080259207636, -82.475224789232, -87.0922611560673, -90.1318115647882, -71.2204404175282, 46.6621011029929, 10.2849024347961, 71.9189416617155, 68.8622513320297, -65.4017291031778, 3.43264965340495
+z: 13.3069343399256, -62.5784140080214, -27.0972901489586, -74.1631664801389, -57.5879731215537, 70.6120911519974, 77.241751877591, -38.2255645468831, -2.94962706975639, -86.2344280350953, 56.0441972222179, -88.6967639438808
+method: p
+rm: TRUE
+result: 0.110920134285541
+------------------------------------------------------------
+function_name: pcor.rec
+count: 11
+x: -8.54161819443107, 28.0718581750989, -32.8153485432267, -41.8009532149881, -83.3797766361386, 93.1131374556571, 80.5043308064342, -62.7610028255731, -15.2504758443683, 48.5718804877251, 17.7535368595272
+y: 42.7155940327793, -65.7041405327618, 69.3401046097279, 41.7508821003139, -67.2856659628451, -72.5374098867178, 6.22773463837802, 29.1457378771156, -41.368066938594, -95.4474326688796, -37.1582591440529
+z: -14.5949687808752, 82.971200812608, -59.7984070889652, -99.9608739744872, 97.1308692358434, -19.0055053215474, 88.3440440520644, 31.6497736144811, -24.3022648151964, -35.1213763467968, 14.9526675231755
+method: p
+rm: TRUE
+result: -0.401692765812538
+------------------------------------------------------------
+function_name: pcor.rec
+count: 14
+x: 80.8533196337521, -18.1722048204392, -75.5538297817111, -67.8516203071922, -22.7996712550521, 57.1183586027473, -69.1113813780248, -62.8999908920377, 22.4695996847004, -0.333229219540954, 48.4565405640751, -92.8434989415109, 29.1625312995166, -83.2451142836362
+y: -38.2450382225215, 67.0644144061953, 38.6723168659955, 24.438568437472, 69.5456247311085, -84.6855477429926, -58.3137557841837, -94.6218158118427, 8.89068827964365, 15.1739988476038, -96.3306906633079, 96.3657117914408, 69.1964435856789, 0.972708594053984
+method: k
+rm: FALSE
+result: -0.243926934409628
+input.z.1: -93.7178533058614, -0.183204282075167, -37.0745961554348, -74.5082440320402, 28.1698084902018, -21.653729910031, 61.0449272207916, -63.0486940033734, -3.97970410995185, -26.7391014844179, 79.7092916909605, -75.7014720700681, -69.53080361709, -82.0775283966213
+input.z.2: -48.5075518488884, 1.95450144819915, -3.33806169219315, -92.2314285300672, 22.3729324061424, -89.7453350014985, -53.7487217225134, -54.0849874261767, 17.1049350406975, -86.7313547525555, 75.2309385687113, -21.8698643147945, 80.9956186451018, 89.605490071699
+input.z.3: -90.0013716425747, 85.5859903153032, -27.047320175916, 46.6997304465622, 21.4192960876971, 77.8831989970058, -8.81227441132069, -6.12898389808834, -87.6430103555322, -61.6656949743629, -82.8727319370955, -7.43764750659466, 69.1672470420599, 87.8232514485717
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: -31.3715231604874, 78.4395510796458, 37.7813975326717, 90.9998905379325, 4.0892272721976, 23.3491680119187, -44.3821705877781, -37.741759326309, -32.6842260081321, -95.3462653793395, 83.2728854846209, 30.0052943173796, 73.2703904621303, 32.3609015904367, 88.8722232542932, 68.1857937481254
+y: 40.6233130022883, -30.0252608954906, -74.1636462509632, -92.0489497948438, 27.8864013496786, -99.424716597423, -20.6159302499145, 25.279173720628, 7.00154760852456, -95.5817312467843, 48.8055042922497, 56.2402768526226, -77.4240196682513, 44.1807419992983, 20.404072990641, -1.18401693180203
+z: 66.9464991427958, 6.30434169434011, -39.6972810849547, -52.4486493319273, -56.4930079970509, 52.421877393499, 55.8516921009868, -4.39011608250439, -74.2396947927773, -25.1450017560273, 42.0996841508895, 16.1958371754736, -22.8619898669422, 90.4492018744349, -74.1765698883682, 39.9869302753359
+method: k
+rm: TRUE
+result: 0.0357828133482257
+------------------------------------------------------------
+function_name: pcor.rec
+count: 14
+x: -94.1282887943089, 0.863795494660735, -54.5142192859203, -14.0683484263718, 10.5734667275101, -55.2807766478509, -71.1918077431619, -88.842673227191, 71.1261768825352, 19.2098991014063, -29.3649735860527, -96.3000339921564, 20.0530176516622, -48.131195968017
+y: 46.0645425599068, -97.9253031779081, 70.4843280371279, 80.5193558335304, 23.0555126443505, -97.9770058766007, 84.8336459603161, -77.9917985666543, 35.5348350480199, -46.9889497384429, 84.9599295295775, 33.0589215271175, 32.9579345881939, 24.89710515365
+z: 42.9362330120057, 42.9295230191201, -64.6692109759897, 38.3608576841652, -17.3026880249381, -25.5683950148523, 90.6109735369682, -16.0139869432896, -38.463629456237, -59.1028479859233, 87.1063947211951, -6.00760709494352, 12.1647471096367, -52.6431480888277
+method: p
+rm: TRUE
+result: 0.0366450176631751
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: -84.5445530954748, 32.1405971888453, -23.0592608451843, -92.6854473073035, 58.4254698362201, -84.7419968340546, -22.7555541787297, 63.9643139205873, 76.1275416240096, -73.178022634238, -3.98154174908996, 26.802809163928, 50.5906715523452, 52.159122005105, 80.1790326368064
+y: -18.9386786427349, -84.6106726676226, 48.5546028707176, -44.6534102782607, 20.7739837002009, 4.48967423290014, -37.7230455633253, -80.9451036620885, 29.9852483905852, 23.2817359268665, -16.882407432422, -53.8926647044718, -97.029253654182, -26.2379488907754, -15.1613433845341
+z: -99.1309873294085, -72.4603479262441, 66.8711055070162, -75.8488883730024, 39.4639032427222, 43.4117903932929, 62.2310574632138, -2.13857642374933, -6.8422191310674, -14.0866828151047, -62.183153629303, -49.4522110093385, -16.3348558358848, 64.6755408030003, -61.5349486470222
+method: p
+rm: FALSE
+result: -0.291819029638886
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: -89.2644015140831, -42.963656084612, 87.6042891759425, -15.7976613845676, -57.8714273869991, 61.3913614768535, 73.5168375074863, -4.00514821521938, 77.7676994912326, -54.8066982533783
+y: 32.5989249162376, 82.6726690400392, 23.7537688110024, -63.3400282356888, 29.2318671010435, -96.3339688256383, 5.10485065169632, -74.1683969274163, 27.5063658133149, -20.300987130031
+method: k
+rm: TRUE
+result: -0.357889493427411
+input.z.1: 53.2483558636159, -62.8594945184886, 69.805056694895, -91.7430310044438, 3.41492984443903, 67.3900785390288, -98.4968071337789, -0.730537809431553, -72.1466899383813, 87.7064510248601
+input.z.2: -89.8748981766403, 15.6837180722505, 14.6945471409708, -73.451646277681, 36.8902978952974, 22.0203426666558, 87.802790151909, -19.431734085083, -43.2061756029725, -2.11614053696394
+input.z.3: -36.9409368839115, 2.75738257914782, 97.5110043305904, 17.5617986824363, -32.737740688026, -28.1387409660965, 58.5559561382979, 41.4380328729749, 63.8094739057124, -65.0269193574786
+------------------------------------------------------------
+function_name: pcor.rec
+count: 13
+x: -42.7785499952734, 87.383286235854, 25.6565656047314, 62.4534173868597, 54.393582046032, -88.4201749227941, -95.5750266090035, 66.1459297407418, -16.2288751453161, -20.9175069350749, -13.3836749475449, 18.3453384786844, 47.9472403414547
+y: -22.8746916633099, -98.0151399970055, -19.1907866857946, -59.1198869049549, -82.8722677659243, 78.9457001723349, 63.5891283862293, 91.796372551471, -77.384944120422, 77.7682485058904, 49.4990679901093, -59.758533583954, 34.0949323493987
+z: 31.6309703979641, 11.225744150579, -23.2299293857068, -64.9821206461638, 44.5281345862895, 29.6854661777616, 26.658301660791, -77.0363720599562, 14.9900930933654, -43.017488764599, -84.5935768913478, -86.2529832404107, 68.9730571582913
+method: k
+rm: FALSE
+result: -0.324337486570401
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: 20.6052641384304, -34.7386178560555, 64.5274777896702, 48.2837058603764, 32.1162473410368, -61.5267707034945, 18.7145279254764, -96.3212412316352, -9.05703571625054, -72.3377135582268, -36.9318156503141, 48.5457048285753, 16.1100664176047, -99.9019818846136, -6.93311747163534, 42.5408709794283
+y: -68.1519189383835, -21.3783976621926, 83.5196397732943, -21.0456018336117, -65.211294637993, -4.57787401974201, -72.63866760768, 21.234114235267, -97.2475761082023, -79.9188132863492, 79.5116892550141, -38.4806913789362, 19.9322822969407, 94.5325861684978, -42.9837487637997, 22.1684457268566
+z: -39.7361300420016, 99.3054033722728, 29.9724598415196, 95.9335449617356, 81.9420096464455, 94.5490169804543, 45.2891474124044, -18.8411912880838, 21.6612101066858, -46.4374198112637, 57.1713132318109, -16.4783576037735, -28.1885820906609, 94.3112654611468, -75.3233570605516, 86.627834988758
+method: p
+rm: TRUE
+result: -0.197035364225789
+------------------------------------------------------------
+function_name: pcor.rec
+count: 19
+x: 68.7338494230062, -90.181301580742, 10.1553022861481, 88.3507196325809, -85.4962442070246, 26.208075415343, -51.701020821929, -30.7254826184362, 10.9224076382816, 96.7410780023783, -39.8431303910911, 65.5343361198902, 41.4392391685396, -88.4308515582234, -52.8691418003291, 66.4409405551851, -55.0576376728714, -38.1625887006521, -48.4449471812695
+y: -86.0378950368613, 46.4772601611912, 68.4132843278348, -11.8289707694203, -30.7506918441504, 36.8791323155165, 91.6302738245577, -46.0631328169256, 10.5568787548691, 60.4254566133022, -35.1412182673812, 92.5516024231911, 41.4456882048398, 10.1779696531594, 76.3081361539662, 81.4410069491714, -23.1231520418078, 11.1144263762981, -66.3827836513519
+method: s
+rm: TRUE
+result: 0.201921490839196
+input.z.1: 66.5893373545259, -94.5090161636472, -32.1443051565439, -26.2381840497255, -67.3655487131327, -45.237745763734, 15.975698409602, 56.1301979236305, -72.355697536841, -1.03531731292605, 51.5078302007169, -34.9794320762157, 7.16000627726316, -69.1763840615749, -29.5579122379422, 77.2579966578633, -2.20924792811275, 22.5620280019939, -25.0138834584504
+input.z.2: 18.2577608153224, -72.2484740428627, 4.15805950760841, 33.5841840598732, -38.4825916495174, -59.1983853839338, -23.3986431267112, -93.8368917442858, -65.0328462012112, 77.1746356505901, 8.98702275007963, -45.9206078201532, -11.1201015301049, -6.38252813369036, -16.0341050941497, 38.0308180116117, 45.4919638112187, -53.2359473407269, 42.4233398400247
+input.z.3: -80.4229929577559, 72.5026939529926, -64.9018800351769, 19.9812149628997, -86.3108912948519, -53.0842928215861, 66.3097468670458, -54.4293747283518, 84.6861940808594, 52.5425457395613, -58.5939683020115, 56.8557804916054, 44.3008310161531, 38.0050702951849, 60.04942744039, 3.64885800518095, -1.5428779181093, -5.60614042915404, -2.5199462659657
+------------------------------------------------------------
+function_name: pcor.rec
+count: 18
+x: -79.1204867418855, -95.156848942861, -58.1009825225919, 1.4517383184284, 5.50476736389101, -62.5133258290589, 38.2517375983298, 96.7142606619745, 47.5910087116063, -65.3327509295195, 76.1547356843948, -0.804628105834126, 75.1669812947512, -96.6471124906093, 59.5920866820961, -17.1567432116717, 84.0993498452008, 77.0434119738638
+y: -7.90872192010283, 69.3680602591485, -10.8002967666835, 72.9388284031302, -59.5035542268306, 32.4369426351041, 27.8420885559171, -8.3828354254365, -34.5960255712271, 94.1054672468454, 90.5859648250043, 54.2748330626637, 77.9608488548547, 26.6538372728974, -84.3118285760283, -61.4382669329643, -36.6503063589334, -97.6180238183588
+z: -41.9485231861472, 16.5158891119063, 94.3834115285426, -48.5038497019559, -72.4178664851934, -12.9061355721205, -45.3039852436632, -22.6247455924749, -81.2429226003587, 21.1907632183284, 60.5692085344344, 45.7070804666728, 49.69632467255, -67.7394894417375, 7.82280783168972, -73.2445613015443, -38.9073747675866, -44.2419451661408
+method: k
+rm: TRUE
+result: -0.226172401437073
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: -18.5641910415143, -20.0593877583742, 25.6991996429861, -19.6434530429542, -49.3258328642696, 74.0071775857359, -14.2312118317932, -98.484157724306, 26.4571780338883, 24.9734192620963
+y: 63.7182058766484, -21.0957065224648, -13.5498566087335, 80.4991848766804, -59.0782665647566, 48.8544872496277, 21.7224644031376, 65.6007543206215, -89.8360439110547, 30.1321961451322
+method: p
+rm: FALSE
+result: -0.208651612863199
+input.z.1: -54.182271566242, -81.6743851173669, -47.1539053600281, 92.6043943036348, -78.3327240496874, 26.2651245109737, -93.9263246953487, -87.8016094211489, -16.633188771084, -78.5125374794006
+input.z.2: 18.6473812907934, -54.5641149859875, -94.9858000036329, -80.5813108570874, 67.0117434114218, -18.388499552384, -90.0589608587325, 79.7222523484379, -29.4443475548178, -2.07264893688262
+input.z.3: -32.8892857767642, 57.8148124739528, -57.9109583515674, 77.5278323795646, -67.0391498599201, -8.65513472817838, 81.3078344333917, 28.577094245702, 39.4989902153611, 74.875748809427
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: -11.7029183078557, 20.6746962387115, -6.4186317846179, -65.7957127317786, -53.4551188349724, -95.6971417646855, 8.08795387856662, -82.9692668747157, 65.0797595269978, -40.0556065142155, 22.845498425886, 1.03095825761557, -14.8108241148293, -78.0993150081486, 30.944905616343
+y: 82.0563825778663, -93.5029713902622, -33.4759468212724, 34.7522557713091, -40.9242569468915, 12.8855560906231, 87.9595287609845, -29.6215635724366, 86.1932807136327, 14.4459169823676, -32.873512012884, -95.2299362048507, -49.8739655595273, 36.8796242401004, -65.0861688889563
+method: p
+rm: FALSE
+result: -0.104743080690118
+input.z.1: 65.66839707084, 92.6697647199035, 38.6834030039608, -1.27137661911547, -28.2877578865737, -84.7902995534241, 27.4061929434538, -27.7048649732023, -63.9012438245118, 28.058318933472, -20.2759954612702, 22.2938399296254, 77.1114971488714, 70.4757141880691, -76.6643046401441
+input.z.2: -39.5549254957587, -19.5246502757072, 18.0171636864543, -57.7165036462247, 95.6821781117469, 33.9750271290541, 71.6323775239289, -66.8427237775177, 10.4952494148165, -29.4743011239916, 71.6373374685645, 40.0875151157379, -42.4196716863662, -1.66454841382802, -60.522589366883
+input.z.3: 98.3820408582687, 25.1781207975, -82.4520411435515, -78.9945350494236, -60.6463038828224, 38.1571523845196, -2.5337272323668, 51.339119952172, 28.5604369360954, -55.1758613903075, -4.05583186075091, -33.9473246596754, 25.7808249443769, -45.2997167594731, -18.1844201404601
+------------------------------------------------------------
+function_name: pcor.rec
+count: 18
+x: -19.9252225458622, -52.1368729881942, 47.0799256581813, 4.0996206458658, -47.799872700125, -30.0670292694122, 99.486964661628, -60.6471673119813, 87.9351426847279, -87.2190349269658, -14.3205997534096, -65.2433201204985, -91.2750414572656, 57.8982046339661, -58.4296739194542, 75.9663732722402, -39.1042973380536, 81.5513394307345
+y: -90.2006414718926, -16.2967856507748, -79.3194455094635, 84.4338634051383, 89.2368617933244, -12.7161718904972, 75.4535779356956, 37.1095749549568, 49.1659552324563, -26.1069383472204, 45.5694596283138, 38.4463460184634, 33.344994019717, -1.42435110174119, 47.1649888902903, -99.7756907250732, 46.394665306434, 15.2081664185971
+method: s
+rm: TRUE
+result: -0.181282481020533
+input.z.1: -50.1517540775239, -67.6142763812095, 48.4815247356892, 8.75700111500919, 31.7483810242265, -90.2583417017013, -67.3944258131087, 9.49530829675496, 90.4742771759629, -84.6624474041164, 91.2189200520515, 97.8029098827392, 68.2472475804389, 37.4118328094482, -83.8537451345474, 69.1915712784976, 19.8050633072853, 33.8238943368196
+input.z.2: 55.8937823399901, -13.7481592129916, -2.85266265273094, -92.6436629146338, -8.95788944326341, 35.6726922094822, -52.2164586465806, 41.2114669103175, -82.6304302550852, 99.3652961216867, 2.97346808947623, -24.6266740374267, 55.9584220405668, 27.8859186451882, -78.0235532671213, 92.6008366048336, -46.0081057623029, 46.4334186166525
+input.z.3: 75.9668093174696, 48.5109059140086, -24.6230148244649, 47.1537347882986, -52.6724417228252, -0.0623919069766998, 60.068893712014, -47.2048899624497, -31.3584079500288, -30.8376907836646, 72.9500978253782, -4.89845988340676, 8.7826278526336, 55.5695308372378, 89.7840007673949, -20.1651885174215, 54.3830844108015, 82.4272679630667
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: -89.2206337768584, -93.6034481041133, -92.6505226641893, -27.2543139755726, -68.1821953039616, -21.7996491119266, 71.5557252522558, 43.2489835191518, -90.4781390912831, 7.11716823279858, -82.050916319713, -26.397502142936, 55.4946079850197, 64.7005498874933, -25.9218308143318, -16.6726984549314
+y: -35.1899597793818, -21.6532570309937, 18.4573667123914, 62.4437351245433, -68.842231342569, -73.8841473590583, -11.0737474635243, -20.1630857773125, -50.4398448392749, 35.7471308205277, -27.5834964122623, -26.5524230897427, 56.0133414808661, -27.9868010431528, -10.7581190299243, -61.9544327724725
+method: k
+rm: TRUE
+result: 0.1802927896232
+input.z.1: -40.1324992999434, 9.90798645652831, -6.51583895087242, -81.11083349213, 84.9643123336136, -87.4527308158576, -60.1582251954824, 77.6400165166706, -42.5469139125198, -82.8197461552918, -48.6188884824514, -13.3140456862748, 88.9097800478339, -57.9036547336727, 65.818764641881, -16.4653040003031
+input.z.2: -84.256647573784, 12.2872774954885, -66.00108044222, 56.7613907624036, 48.1513442005962, 77.6724391616881, -62.4357144348323, -36.4606843795627, -25.3354148473591, -14.6164451725781, -82.1608787402511, 63.0101605318487, -43.4699194505811, 62.6883119344711, 60.930627817288, -4.78333029896021
+input.z.3: 74.4455846492201, 21.936039859429, 57.6761968899518, 89.8042913526297, 63.5838260874152, 38.8069860637188, -54.178605042398, -76.1459093540907, -22.7403795812279, 68.8472212292254, 84.6168057061732, 11.0940378624946, 85.7618093956262, -15.3427021112293, 1.49911385960877, 20.5723023507744
+------------------------------------------------------------
+function_name: pcor.rec
+count: 10
+x: 24.9564551748335, 18.5923957265913, -46.4656071271747, 86.6394772194326, 65.5116721056402, -98.461588146165, 53.3600708469748, -78.3477867487818, 76.5432852786034, 54.6317078173161
+y: -41.7801002506167, 0.232810061424971, 87.8145711030811, 74.0377931389958, 24.6370416134596, 77.2726675961167, 0.525932526215911, 71.0617937613279, 1.96412657387555, -1.88834308646619
+z: -79.2718555312604, -16.1210845690221, 29.8867321573198, 24.5947330724448, -84.9225256126374, 11.1365122720599, -72.2685813438147, 60.749769769609, 8.51291613653302, -13.8399054761976
+method: s
+rm: FALSE
+result: -0.0470490565729547
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: -85.2682391647249, -25.1930296886712, 36.2195362802595, 11.7865398991853, 68.5172120574862, -83.3658806513995, -75.6855964194983, -20.0753760524094, -19.762350525707, 35.1225445978343, 30.2758548408747, 1.45033104345202, -14.6772135049105, 14.2147125676274, 49.1841867566109, -35.2573278360069
+y: -20.5554758664221, -97.0802981872112, -26.0747340507805, 71.6280955821276, -85.3886511176825, -55.2334129810333, 43.0862717330456, 28.4769951831549, 78.5121974069625, -81.3196417409927, 39.5874671638012, -1.8134135287255, 85.9221469610929, -95.360365929082, 19.3586761597544, -66.9956528581679
+method: p
+rm: TRUE
+result: -0.0236982307617225
+input.z.1: 3.02675268612802, 29.488014569506, -90.2211040258408, 18.5702975373715, 81.4835339784622, -81.491480441764, -81.4419069793075, 49.6095394250005, 15.8508184831589, 55.1565334200859, 93.1393330916762, -18.7935738358647, -27.2714839782566, 28.1014911364764, 7.63522856868804, 86.4262473303825
+input.z.2: 15.2697853278369, 21.544589381665, -42.2709172591567, 66.4516931399703, -80.4499278310686, 7.60396728292108, -66.5740209631622, 42.6155330613256, -25.6430941168219, 98.4072601888329, 50.5805794615299, -68.1811819784343, 73.6316103953868, 79.5231841970235, 76.5872830990702, 44.7566782590002
+input.z.3: 6.84692151844501, -56.8186898250133, -52.9168414417654, 38.5583185125142, -1.00095826201141, -6.59536058083177, 55.0686245784163, -76.6531312838197, 56.9502690341324, 5.48669574782252, 98.175480728969, -63.4856688790023, 85.1667809765786, -59.0522172860801, 79.1193772573024, 9.27014825865626
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: -91.3233927916735, -15.5439792200923, 43.0199227761477, 39.7756622638553, -9.58535838872194, -32.0357569493353, -48.6907037906349, 4.63044187054038, -2.5522580370307, 73.4696492087096, 58.3276907913387, 43.7473264522851, -2.46611316688359, -30.3629717323929, -17.4933492671698
+y: -5.91190569102764, -82.0860084611923, -99.643186153844, 16.0177246667445, 19.4741931278259, -7.10836984217167, 47.0438427757472, -83.1305775791407, 78.383247833699, 79.6709012705833, 86.369459098205, 70.2751192264259, -15.8207864966244, -29.9358425661922, 60.3160366881639
+z: 26.2397599872202, -59.9476198200136, 95.269483095035, -0.995413586497307, -45.5644907429814, 24.1255348082632, 54.9571478739381, 6.70850914902985, 83.7543970439583, -42.7414426580071, -30.6731200776994, 86.6206298582256, -21.0456729866564, 20.3609951306134, -51.160212373361
+method: k
+rm: FALSE
+result: 0.160422236979937
+------------------------------------------------------------
+function_name: pcor.rec
+count: 12
+x: -54.2834484484047, -99.5062152389437, 11.2263063900173, 4.25140345469117, -6.57475399784744, -47.9635813273489, 13.5771594475955, -17.8992413450032, 44.7320376522839, 10.5947217904031, -95.9636783692986, 78.552111517638
+y: 25.7135692518204, 65.7770814839751, -47.1805317793041, 86.2048698589206, 84.3483364675194, 52.1802646573633, 38.1061236839741, -24.7705412562937, 70.3330162912607, 70.1622222550213, -19.1713237203658, 66.428263951093
+method: p
+rm: TRUE
+result: 0.329071793149575
+input.z.1: -41.6167279239744, 30.5627764668316, -46.9200180843472, 70.171003555879, 14.7832777816802, 66.5134385228157, 90.0630659423769, 50.129773048684, 99.1226064972579, 20.8656733389944, 93.0510560981929, -58.9669019449502
+input.z.2: -28.3709186594933, 67.1317570377141, -65.2744254097342, 84.8623389843851, 43.1941722985357, -2.67433333210647, 73.5897833947092, 45.3403359744698, -82.2376867290586, -16.9432976283133, 51.7834584228694, 73.2923530042171
+input.z.3: 88.4447504300624, 29.8185252584517, 70.2338655479252, 96.2983122095466, -7.37721398472786, -47.8313674218953, 50.365524366498, 45.9664605092257, -55.9734042268246, 21.4261449407786, 40.0185635779053, 55.8912822511047
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: -57.1398223750293, -23.3540481887758, -22.2071134019643, 96.7134712729603, -57.6335528399795, -49.1604723967612, -78.7016066256911, -84.9242495838553, 65.3399391565472, -31.4437021967024, -9.51485671103001, 70.0565829873085, -71.0057987365872, 91.0863234195858, 72.5100541952997, 58.0725823994726
+y: 18.8888671807945, -22.8483431972563, 24.8971822671592, 4.40226024948061, -48.3475063927472, 50.9493664372712, 92.7150129340589, 63.0087484139949, 43.2604452129453, -33.4913415834308, -35.9951756428927, -87.5060506630689, 15.4649335425347, 88.3686876855791, -25.8083974011242, 0.085412198677659
+z: 81.5011800732464, -99.7660262044519, -93.3500723913312, -79.0094709955156, -71.6781900729984, 1.03125544264913, 11.5347918123007, 86.6896205116063, 34.3875902239233, 7.78482472524047, 85.7462510932237, -45.7913243677467, 22.8047444485128, 4.74429242312908, -16.1633410025388, -13.6797955725342
+method: k
+rm: FALSE
+result: -0.0899565056297501
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: -75.1803813036531, 32.6554085128009, 46.5199385304004, 10.0931627675891, -84.9136417731643, 99.0708300843835, 43.4466718696058, -27.9581206385046, 52.7613752521574, 0.147021608427167, 11.5825299639255, -29.0862209163606, 85.5328780598938, -23.4052004758269, 13.3759755641222
+y: 28.4078094642609, -40.5093076638877, -3.29849710687995, -45.7378671970218, 4.03570998460054, 0.237223505973816, 23.7162163015455, 49.5277442503721, -6.30603078752756, -22.8287412319332, 94.9057441670448, -63.0924633704126, -42.9297237191349, -78.4588639158756, -39.1431424301118
+z: 49.7008972335607, -69.9944775551558, 34.2155236750841, -53.7857625633478, 40.5958297196776, 52.6141790673137, -80.8522994164377, -3.425587201491, -66.6255864314735, 47.9161818511784, -5.30791841447353, -65.1415256317705, -46.0642572958022, 43.2463189586997, 92.9539552424103
+method: s
+rm: FALSE
+result: -0.0445130955220816
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: -51.6405268572271, -71.7918659094721, -73.2296792324632, -31.7894198000431, -20.4344088677317, 6.17863591760397, 67.1885369811207, 26.0930087417364, 77.9443024657667, -59.804061613977, 66.2859657779336, -92.9702171590179, -48.0025853030384, 75.9013353381306, -0.952996592968702, -45.6366574391723
+y: -66.1892560776323, 40.1626775972545, -78.6765556782484, 3.59122948721051, 54.1154608596116, -33.2301977556199, -51.3999274931848, -36.8912567384541, -16.5293656755239, -39.3365318421274, 7.12325950153172, -8.90163774602115, -26.7156166490167, -38.0113017745316, 96.5745037887245, -93.0887303315103
+method: s
+rm: TRUE
+result: 0.00646891417813344
+input.z.1: -71.3289998471737, -89.4274845253676, 80.2009513135999, -96.6635977383703, 1.58105902373791, 44.5951706264168, -22.3852779716253, 97.8820891585201, -66.1968573462218, -6.31989082321525, 23.1592249590904, -83.3515228237957, 57.0112504996359, 31.7412199452519, 68.0809809826314, -37.4492235481739
+input.z.2: -67.5689687952399, 79.3258271180093, 97.4323255009949, -68.1801676284522, 58.8779048528522, -95.3483588527888, -66.6574165225029, -66.7481596115977, -43.544950382784, 13.8981956988573, -96.2374809663743, 30.4743104148656, -20.3307262156159, 58.3140489179641, 83.9318192563951, 18.8910231459886
+input.z.3: 61.8831608444452, -13.0282598547637, -9.60066677071154, 64.577030390501, -36.6879174951464, -47.287135059014, -49.6693975757807, -20.8232561592013, -56.3352135941386, 77.1996547002345, -68.4678519610316, -52.4340079631656, -43.0555366910994, -27.0189959555864, -47.0933285541832, 11.8024677969515
+------------------------------------------------------------
+function_name: pcor.rec
+count: 16
+x: 6.02917508222163, 27.8621552977711, 92.6266786642373, -67.0329743530601, 80.2830060012639, -55.2314624190331, -57.516923872754, -20.3406107611954, -88.6821561027318, -74.7315115761012, 22.0172420144081, -99.7548290062696, 63.5964724700898, -92.0153565239161, 10.2219923399389, 19.8053610976785
+y: 31.9939563982189, -15.3352430090308, -48.4936602413654, 18.2333611883223, -33.8946952484548, 41.1579161882401, -8.68082982487977, 31.8826792296022, -32.7911721542478, -56.1658204998821, -55.476590571925, -76.0229810606688, -28.4876780118793, 46.7708960175514, 26.4549767132849, 21.7337732668966
+z: -61.3926334772259, -8.43798192217946, 49.4600793812424, 12.1881818864495, 4.04470223002136, -0.887329550459981, -14.2089146189392, -69.8127029463649, -23.6053369939327, 37.6661356538534, 28.68687286973, -40.214622952044, -28.2490330282599, -30.1233724225312, 16.7358654085547, -60.9078065026551
+method: s
+rm: TRUE
+result: 0.0109861740383809
+------------------------------------------------------------
+function_name: pcor.rec
+count: 19
+x: -22.6301351562142, -0.401159888133407, -51.0836260858923, 52.9926339164376, -31.112408824265, 7.74280959740281, 57.6454367488623, -58.9728377293795, -55.3409872576594, 93.505600746721, -39.4296121783555, 98.1291733682156, 95.6328963395208, -47.2205543890595, -91.3154749665409, -46.4315792080015, -55.1306743174791, -83.6544279474765, 25.9763963054866
+y: 10.233701299876, -34.3406205065548, -44.1589217633009, 18.0708408355713, -33.9899700134993, -92.1382100787014, -31.3480507116765, 34.7450574394315, -26.1664397548884, -10.6908304151148, -56.8871490191668, 42.0222526416183, -38.5681716259569, -50.3884779289365, 62.0742606930435, 18.8085388857871, -98.4062366187572, -42.258721170947, -78.7414902821183
+method: s
+rm: TRUE
+result: 0.260997031943953
+input.z.1: 93.6964779626578, 97.6941250264645, 84.2403077054769, -21.0036048665643, 30.8375779073685, -66.1338172387332, 5.2408910356462, 61.1676721367985, 60.5456584133208, 0.74210693128407, -37.1678366325796, 29.5855506323278, 27.7806338854134, -5.75614403933287, 67.2522669658065, 76.9101575016975, -26.9960866309702, 77.3400701582432, 27.4017762858421
+input.z.2: 59.9046770483255, 75.6403599400073, 95.9070024080575, -53.2769947312772, 50.6330458912998, 23.7067949026823, 35.1966741029173, 89.4811980891973, 35.9289538580924, 20.3873679041862, 34.1469102073461, 94.6420239284635, 53.1159293837845, -12.1292291209102, 15.0359552353621, 9.68966633081436, 78.1882911454886, 66.8827974237502, 2.47473819181323
+input.z.3: 19.4207503460348, 51.5944085083902, 66.9528753962368, -48.429446760565, -93.2403178419918, -87.8670411650091, -56.8921292200685, -65.7475048676133, 19.9255768209696, 4.57514231093228, -10.249630920589, 69.709189189598, -64.6382919047028, 17.4305737949908, -67.6548017188907, -12.9575524479151, 61.2475155852735, -36.1469886265695, 87.6915104687214
+------------------------------------------------------------
+function_name: pcor.rec
+count: 17
+x: 9.37572391703725, 31.7226287443191, 43.1954346597195, -60.2317395154387, 57.4296472128481, 33.2106852438301, 30.182341625914, 16.8947563041002, 8.45923842862248, 39.1486890614033, -21.3120787870139, 5.00677810050547, 42.3083784524351, 52.4043606128544, 78.8675017654896, 34.8648357205093, 95.3381980303675
+y: 73.7328485585749, -65.1126708835363, -50.9216074366122, -12.8152929246426, -98.8350537605584, -20.3600559849292, 98.9452924579382, 3.61747466959059, 35.8806551899761, 65.8439641352743, -16.7892712634057, 93.2440320961177, -63.617469696328, -95.0687137432396, 37.9251030739397, -75.4912422038615, -6.28811488859355
+method: s
+rm: TRUE
+result: -0.391668812877604
+input.z.1: 84.7690727096051, 35.6805397663265, 2.92688133195043, -2.66396179795265, 59.4639756251127, 63.7523754499853, 18.2699968107045, -82.0927425753325, 15.0487997569144, -88.0888516549021, -27.5004559662193, -25.4689407534897, -42.007040977478, 93.5237852390856, 47.0437038689852, 61.5355266258121, 54.8702186439186
+input.z.2: -87.6829659100622, 47.0985118299723, 12.1185038704425, -46.7640890274197, -69.5790245663375, 5.30735715292394, -4.46678730659187, 93.2893170509487, 50.3495833836496, -34.9353915080428, 18.0263666901737, 58.3935454953462, 87.4742162879556, 30.3390501532704, -73.5950434580445, -74.5545803103596, 38.0712570156902
+input.z.3: -61.2569669261575, -96.3447272777557, -29.3482882902026, -19.3482856731862, 13.6697378009558, 40.6999397091568, 41.9870645273477, 62.1129790320992, 30.4264964070171, 73.9961228799075, -55.8274395298213, -70.7107780966908, 39.5272477529943, 39.4379249308258, 71.6056514065713, -89.4290968310088, -71.2074970826507
+------------------------------------------------------------
+function_name: pcor.rec
+count: 12
+x: 23.9549969322979, -94.3478518631309, 53.8556181825697, -63.9131240081042, -33.5065440740436, -27.5726289022714, -36.9144127704203, 9.75463544018567, 80.6153140030801, -69.4012255873531, 99.9501515645534, 16.0135179758072
+y: -41.6901842225343, 71.2601354811341, 94.5316863711923, -76.7564448993653, 67.3882042057812, 79.135302407667, 85.5548634659499, 98.4304254874587, -25.5130287259817, -22.0055079087615, -95.5722292885184, -19.1982574760914
+z: 31.5045582596213, -61.6609159391373, -53.6041364073753, -54.1261918842793, 55.5201834533364, -70.761605957523, -37.8632005769759, -5.51536502316594, 22.109322855249, -5.48479808494449, 62.8399562090635, 66.7187201790512
+method: k
+rm: TRUE
+result: -0.046547725411756
+------------------------------------------------------------
+function_name: pcor.rec
+count: 19
+x: -86.8803692981601, -36.0070365015417, -70.1002893038094, -86.1806470900774, 66.3614605087787, -94.7579635307193, -49.5362688787282, 39.0053760726005, 28.0300771817565, 65.3048079926521, -78.614980308339, -99.5677480939776, 37.4129545409232, 57.5423365924507, -25.4214689135551, -67.64843207784, -25.7995640393347, -59.050830733031, -49.872957682237
+y: -97.1362472046167, -90.4611896723509, 67.4148492049426, 38.2251622155309, 71.9721779692918, -18.9910460263491, 69.1500102169812, 51.959238294512, -38.5041401255876, -68.6116041615605, 24.4872363749892, -88.0486444570124, 59.0363015886396, 24.4759861845523, -39.4574940670282, 46.4638626202941, 69.4575124420226, 83.6080874316394, -21.5877468697727
+method: p
+rm: TRUE
+result: 0.222856530894645
+input.z.1: 60.3581060189754, 36.6046156268567, -80.6256499607116, 67.3364251852036, 20.8286061882973, 90.5355037655681, 34.4946308527142, 72.2939557861537, 24.818326253444, -73.8570734858513, 60.6789906043559, -78.2595306634903, 31.5215276554227, 88.7460107449442, 47.5978660862893, 37.7674763090909, 14.174500759691, 23.2667552307248, -44.4074565544724
+input.z.2: -71.1571972351521, 67.5592693034559, 32.7134820166975, 50.4700905177742, -5.32517521642148, -9.73571254871786, 62.8018686547875, -33.77331267111, 82.4934613425285, -82.5158701743931, 23.7224648240954, -12.2990741860121, -32.6325906906277, -60.1869959384203, 15.1140324771404, -47.5414104759693, 39.1125004738569, 34.8343822639436, -41.0773036535829
+input.z.3: -83.8173258583993, -41.9550708029419, 94.7827941272408, 44.7238489985466, 7.73765784688294, -76.5092555899173, -70.8226544782519, -20.9283753763884, 30.5160601157695, 8.20419332012534, -23.4743303153664, 1.33969597518444, -45.6315482035279, -20.0630795676261, -55.0699974875897, 76.2154544703662, 90.7609693706036, 49.0804013330489, 24.8603868298233
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: -95.6984742544591, -17.0751072466373, -74.351422348991, 97.9444544762373, -78.9809799753129, -91.6577459778637, 47.7074146270752, -16.9179151300341, -39.3213587347418, 65.5904557090253, 60.0742573849857, 87.3231331352144, -78.467915719375, 28.0999443493783, 89.8317760322243
+y: 38.1394040770829, -79.9139173235744, -11.8167380336672, -27.1410693414509, 0.926599558442831, -76.7347189597785, -78.9869936183095, -44.4243895355612, -84.7858403343707, -42.7895428147167, 95.1523006428033, -37.1474313084036, -20.4304214566946, -45.007686316967, 53.1755958218127
+z: 10.8393523376435, -5.54150752723217, 6.67336750775576, 94.895927561447, 28.04304221645, 8.71308073401451, -63.6728871613741, 25.6648155860603, 94.4418403320014, 65.6681419815868, 14.3071625847369, -18.7641613651067, 47.0834728330374, -34.1443062759936, 41.7607615236193
+method: k
+rm: TRUE
+result: 0.0567462819506484
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: 18.4970577247441, 78.3253606874496, 79.4621794950217, -44.2970278672874, 49.8550353106111, 96.2965226732194, -91.7066268622875, -10.6500246096402, 83.8136198464781, 82.6252206228673, -75.066755246371, 41.5468964725733, 23.8436101470143, -14.4322760403156, 84.5842578914016
+y: -34.6368032041937, -88.1088628899306, 63.0725324619561, -2.26956433616579, 3.40624032542109, 33.9189363643527, -34.2757223173976, -10.0570505019277, -72.027294524014, 89.8351664654911, -98.8331866916269, 73.1307323090732, -50.5687814205885, -23.6362583935261, -91.3148396648467
+z: 79.7483292408288, -81.3085496425629, -7.89254033006728, 11.9726373814046, -15.717267151922, -22.2710655536503, 70.8750586956739, -90.9301116131246, 91.3467094767839, 75.1269446220249, 36.3692390266806, 4.92376713082194, -42.952916584909, 59.6110574901104, 37.576672853902
+method: p
+rm: TRUE
+result: 0.268386356974156
+------------------------------------------------------------
+function_name: pcor.rec
+count: 15
+x: 76.5814383048564, 57.0448996499181, -62.4477106612176, 60.2575681172311, -25.0475298147649, -15.6559887807816, -75.9389230050147, -65.7562242820859, -39.8771365173161, -8.23787515982985, 79.7387945000082, -91.5918366517872, 22.8263909928501, -71.058910060674, 84.923558216542
+y: 28.6601890809834, -36.4405090454966, -5.37604507990181, -37.0503096841276, 65.667122695595, -50.3413951955736, 34.6017302479595, 89.4681378733367, -57.4270334560424, 9.56006632186472, -49.7303061187267, 18.1288056541234, 86.5119753405452, 30.3892049472779, -58.9283072855324
+method: p
+rm: FALSE
+result: -0.581327155629278
+input.z.1: -30.6997185107321, 3.00485193729401, -19.0188682172447, -62.2001667506993, 58.9584777131677, -93.9231510274112, 49.4996389839798, -19.6634422056377, -97.4878797773272, -94.901405647397, 79.1410635225475, -90.6966128386557, -94.0285502001643, 82.7198777813464, -98.452693875879
+input.z.2: -49.3249548599124, 11.3597484305501, 40.297681838274, 56.4172050915658, 41.8464520014822, -4.97913383878767, 69.742794893682, -10.7891221065074, -78.006159607321, -78.0675538815558, -28.415847895667, -91.1122145596892, 74.2001689970493, -99.0127950441092, 5.19012762233615
+input.z.3: -84.0839372947812, 10.4595458135009, 65.0016738567501, -53.3911125268787, -55.4832744412124, 97.5152499508113, 97.4566194228828, 4.70035099424422, -47.3684732802212, 60.6352349743247, -14.0548746567219, 98.1940933503211, -17.8199341520667, -37.4515796545893, 0.333152059465647
+------------------------------------------------------------
+function_name: pcor.rec
+count: 12
+x: -8.38315580040216, 62.577842688188, 49.0786945447326, -23.4214183874428, -50.7951765786856, 63.7958682142198, 18.6142495833337, -65.1562116574496, 9.13515938445926, -13.0318598821759, -14.7402583155781, 43.8437720295042
+y: -95.1547249685973, 65.3086547274143, 64.0893495641649, 41.7833789717406, 79.1582422330976, 77.25128098391, -49.0278182085603, -83.4303252864629, -39.6045518573374, 99.8193635139614, 75.6284608971328, 48.1379889883101
+z: 43.6136350035667, -27.2865650709718, 46.6717171482742, -32.6379572506994, 46.3561374694109, 46.1588426493108, -10.5283190496266, 99.1817278321832, -19.9576248880476, -8.7395085953176, 78.7625784985721, -9.77536281570792
+method: k
+rm: TRUE
+result: 0.1995741655921
+------------------------------------------------------------
+function_name: pcor.rec
+count: 19
+x: 47.2569864243269, -54.1419552639127, 4.58478815853596, -46.2462868075818, 91.8153540231287, 92.8692331537604, -62.5648601911962, 73.8267461303622, 41.3589684758335, -97.9034782387316, 98.4798386693001, -68.1963364593685, 72.0308075658977, 45.4933300614357, -9.36734918504953, -95.2568708453327, 33.6745547596365, -43.6154155991971, -41.3312709424645
+y: -29.2843889445066, -53.1314035411924, -87.0913468301296, 37.3094552196562, -77.3197258356959, 70.0469268020242, -42.8911098279059, 41.4748248644173, 12.3367053456604, 57.5248312205076, -80.0365700386465, 98.4118913300335, 61.524490872398, 65.7054962124676, -65.2169495355338, 14.661518856883, -85.6023627799004, 75.6984632462263, 78.1068930402398
+method: p
+rm: TRUE
+result: -0.135855608847657
+input.z.1: -74.9636400956661, -50.4529112484306, 20.7700976636261, -80.2104050759226, -71.0900575388223, 50.9530781302601, -23.8234671298414, -71.7071319930255, -7.94364735484123, -20.3485743142664, -9.50398133136332, 82.8783791512251, 10.5230217799544, -51.2824773322791, 47.7249845862389, 39.2762039788067, 9.9144400563091, -20.7925260532647, 13.0731736309826
+input.z.2: -94.6578295435756, -64.8527128156275, -58.4413472097367, -85.668760119006, 7.32597187161446, 95.7994839642197, -44.0633145626634, 55.6779716163874, 99.0699136164039, -30.3195034619421, 49.2766278330237, -58.7089132983238, 67.0478899031878, -90.4275255743414, 15.3474381193519, 85.5800486635417, 78.1179318670183, -51.7158948816359, -65.5134835746139
+input.z.3: 45.1672998256981, -82.2150366380811, 60.7568521052599, 59.0756023768336, 6.37573790736496, 85.7110049575567, -48.6619451083243, -57.3790710419416, -43.1352959014475, 90.6157708261162, -64.2348555382341, -62.1769628021866, 99.3770319968462, 37.6210938673466, -57.459226064384, 93.9496335107833, 65.8080945257097, -91.4751033298671, 98.6923529300839
+------------------------------------------------------------
+function_name: pcor.rec
+count: 17
+x: 37.2042017057538, 99.8944859951735, -2.07033073529601, 90.3329219669104, 5.66258640028536, -75.7469927892089, 77.5577671360224, 73.5588663257658, -13.3695781696588, 44.1321019083261, 87.7224891912192, 76.8428465351462, -61.9186359457672, -29.1462487541139, 91.7470158077776, 18.7315174844116, -49.4004189968109
+y: 34.0684679802507, -9.32011008262634, -14.0058151446283, 62.1845297981054, 49.7096230275929, -21.9136434141546, -14.504536613822, -16.5688768029213, -21.3160504121333, -75.6585834547877, -23.5258265398443, 55.5550341960043, 81.8944736849517, -10.6297532562166, -45.3006814233959, -80.5884425528347, -66.3937121629715
+method: k
+rm: FALSE
+result: 0.010709211073504
+input.z.1: -18.9110844396055, -90.7871477305889, -43.4062168933451, 37.5648979563266, 85.6148176360875, 88.7003752402961, 51.7822846770287, -90.8645707648247, 23.4855143819004, 30.8463104069233, -34.2037714086473, -88.5380632244051, -10.789051419124, 48.4769470058382, 97.4002870731056, 25.5868528038263, 77.5939787738025
+input.z.2: -49.3421413935721, -79.5107122976333, -69.2758508492261, 70.2953652944416, -26.0492874309421, -20.896744215861, -75.7518227212131, -0.518101826310158, 46.2639306206256, 70.5356315709651, -40.9173401538283, 92.4795118160546, 55.0997568294406, 16.338200122118, 44.9827799107879, -39.441972784698, 48.6015120055526
+input.z.3: -73.5004779882729, 87.9872216377407, 92.7410830743611, -13.9436025172472, 64.5655245985836, -42.4590483307838, 36.8305039592087, -82.2956138756126, -6.28325091674924, -18.8072303775698, -80.3971918765455, -1.98830938898027, 35.4344930965453, -68.9127727877349, 34.085252834484, 42.8761828225106, -8.14059982076287
+------------------------------------------------------------
+function_name: pcor.rec
+count: 12
+x: 22.8633187245578, 98.9057261962444, 24.6264463290572, -67.5152567680925, -14.0114265028387, -23.4609092120081, -16.0529976245016, -74.1293652914464, -38.613182771951, 21.516504464671, -63.1570098455995, 3.43058109283447
+y: 66.3851822260767, 15.0869043543935, 34.2552722897381, -47.5028248038143, -18.82304972969, 7.55783263593912, 87.5256262719631, -45.0442485976964, 22.7592587005347, 15.5071972869337, 6.64250506088138, -61.0094598028809
+method: k
+rm: FALSE
+result: 0.380642612922639
+input.z.1: -43.5355789028108, 3.15432427451015, 42.3869500402361, -85.9040122944862, -91.3019767962396, -4.38300650566816, -36.0976214520633, 82.1006664074957, -86.6311294957995, -17.1651322394609, 45.6184559967369, 78.0932303052396
+input.z.2: -50.4019991960377, 53.8435474969447, 46.2169490288943, 57.7160312794149, -80.6737503968179, 4.29811356589198, -8.02055508829653, -29.807900544256, -26.4149129390717, 54.7383895143867, -1.05271721258759, 2.92500704526901
+input.z.3: 82.1892600506544, 1.68216228485107, -81.9020131602883, 21.994966128841, -25.5232597701252, 56.1190348584205, -62.1999088674784, -84.2725639231503, -35.7946417294443, -20.4277000855654, -81.0949407052249, 48.0415523983538
+------------------------------------------------------------
diff --git a/tests/unit/computations/test_correlation.py b/tests/unit/computations/test_correlation.py
index 706520a..267ced3 100644
--- a/tests/unit/computations/test_correlation.py
+++ b/tests/unit/computations/test_correlation.py
@@ -1,10 +1,12 @@
"""Module contains the tests for correlation"""
+import math
from unittest import TestCase
from unittest import mock
-import unittest
-
from collections import namedtuple
+import pytest
+from numpy.testing import assert_almost_equal
+
from gn3.computations.correlations import normalize_values
from gn3.computations.correlations import compute_sample_r_correlation
from gn3.computations.correlations import compute_all_sample_correlation
@@ -56,12 +58,12 @@ class DataBase(QueryableMixin):
"""expects the expectede results value to be an array"""
self.password = password
self.db_name = db_name
- self.__query_options = None
+ self.__query_options = None # pylint: disable=[W0238]
self.results_generator(expected_results)
def execute(self, query_options):
"""method to execute an sql query"""
- self.__query_options = query_options
+ self.__query_options = query_options # pylint: disable=[W0238]
return 1
def cursor(self):
@@ -90,53 +92,48 @@ class DataBase(QueryableMixin):
class TestCorrelation(TestCase):
"""Class for testing correlation functions"""
+ @pytest.mark.unit_test
def test_normalize_values(self):
"""Function to test normalizing values """
- results = normalize_values([2.3, None, None, 3.2, 4.1, 5],
- [3.4, 7.2, 1.3, None, 6.2, 4.1])
- expected_results = [(2.3, 4.1, 5), (3.4, 6.2, 4.1)]
+ test_data = [
+ [[2.3, None, None, 3.2, 4.1, 5], [3.4, 7.2, 1.3, None, 6.2, 4.1],
+ [(2.3, 4.1, 5), (3.4, 6.2, 4.1)]],
+ [[2.3, None, 1.3, None], [None, None, None, 1.2], []],
+ [[], [], []]
+ ]
- self.assertEqual(list(zip(*list(results))), expected_results)
+ for a_values, b_values, expected_result in test_data:
+ with self.subTest(a_values=a_values, b_values=b_values):
+ results = normalize_values(a_values, b_values)
+ self.assertEqual(list(zip(*list(results))), expected_result)
- @unittest.skip("reason for skipping")
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.correlations.compute_corr_coeff_p_value")
@mock.patch("gn3.computations.correlations.normalize_values")
def test_compute_sample_r_correlation(self, norm_vals, compute_corr):
"""Test for doing sample correlation gets the cor\
and p value and rho value using pearson correlation
"""
- primary_values = [2.3, 4.1, 5]
- target_values = [3.4, 6.2, 4.1]
+ primary_values = [2.3, 4.1, 5, 4.2, None, None, 4, 1.2, 1.1]
+ target_values = [3.4, 6.2, 4, 1.1, 1.2, None, 8, 1.1, 2.1]
+
- norm_vals.return_value = ([2.3, 4.1, 5, 4.2, 4, 1.2],
- [3.4, 6.2, 4, 1.1, 8, 1.1], 6)
- compute_corr.side_effect = [(0.7, 0.3), (-1.0, 0.9), (1, 0.21)]
+ norm_vals.return_value = iter(
+ [(2.3, 3.4), (4.1, 6.2), (5, 4), (4.2, 1.1), (4, 8), (1.2, 1.1), (1.1, 2.1)])
- pearson_results = compute_sample_r_correlation(trait_name="1412_at",
- corr_method="pearson",
- trait_vals=primary_values,
- target_samples_vals=target_values)
- spearman_results = compute_sample_r_correlation(trait_name="1412_at",
- corr_method="spearman",
- trait_vals=primary_values,
- target_samples_vals=target_values)
+ compute_corr.return_value = (0.8, 0.21)
bicor_results = compute_sample_r_correlation(trait_name="1412_at",
corr_method="bicor",
trait_vals=primary_values,
target_samples_vals=target_values)
- self.assertEqual(bicor_results, ("1412_at", 1, 0.21, 6))
- self.assertEqual(pearson_results, ("1412_at", 0.7, 0.3, 6))
- self.assertEqual(spearman_results, ("1412_at", -1.0, 0.9, 6))
- self.assertIsInstance(
- pearson_results, tuple, "message")
- self.assertIsInstance(
- spearman_results, tuple, "message")
+ self.assertEqual(bicor_results, ("1412_at", 0.8, 0.21, 7))
+ @pytest.mark.unit_test
def test_filter_shared_sample_keys(self):
"""Function to tests shared key between two dicts"""
@@ -164,6 +161,7 @@ class TestCorrelation(TestCase):
self.assertEqual(list(zip(*list(results))), [filtered_this_samplelist,
filtered_target_samplelist])
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.correlations.compute_sample_r_correlation")
@mock.patch("gn3.computations.correlations.filter_shared_sample_keys")
def test_compute_all_sample(self, filter_shared_samples, sample_r_corr):
@@ -206,6 +204,7 @@ class TestCorrelation(TestCase):
corr_method="pearson", trait_vals=('1.23', '6.565', '6.456'),
target_samples_vals=('6.266', '6.565', '6.456'))
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.correlations.compute_corr_coeff_p_value")
def test_tissue_correlation_for_trait(self, mock_compute_corr_coeff):
"""Test given a primary tissue values for a trait and and a list of\
@@ -224,6 +223,7 @@ class TestCorrelation(TestCase):
self.assertEqual(tissue_results, expected_tissue_results)
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.correlations.fetch_lit_correlation_data")
@mock.patch("gn3.computations.correlations.map_to_mouse_gene_id")
def test_lit_correlation_for_trait(self, mock_mouse_gene_id, fetch_lit_data):
@@ -251,6 +251,7 @@ class TestCorrelation(TestCase):
self.assertEqual(lit_results, expected_results)
+ @pytest.mark.unit_test
def test_fetch_lit_correlation_data(self):
"""Test for fetching lit correlation data from\
the database where the input and mouse geneid are none
@@ -264,6 +265,7 @@ class TestCorrelation(TestCase):
self.assertEqual(results, ("1", 0))
+ @pytest.mark.unit_test
def test_fetch_lit_correlation_data_db_query(self):
"""Test for fetching lit corr coefficent givent the input\
input trait mouse gene id and mouse gene id
@@ -281,6 +283,7 @@ class TestCorrelation(TestCase):
self.assertEqual(expected_results, lit_results)
+ @pytest.mark.unit_test
def test_query_lit_correlation_for_db_empty(self):
"""Test that corr coeffient returned is 0 given the\
db value if corr coefficient is empty
@@ -296,6 +299,7 @@ class TestCorrelation(TestCase):
self.assertEqual(lit_results, ("16", 0))
+ @pytest.mark.unit_test
def test_query_formatter(self):
"""Test for formatting a query given the query string and also the\
values
@@ -323,6 +327,7 @@ class TestCorrelation(TestCase):
self.assertEqual(formatted_query, expected_formatted_query)
+ @pytest.mark.unit_test
def test_query_formatter_no_query_values(self):
"""Test for formatting a query where there are no\
string placeholder
@@ -332,6 +337,7 @@ class TestCorrelation(TestCase):
self.assertEqual(formatted_query, query)
+ @pytest.mark.unit_test
def test_map_to_mouse_gene_id(self):
"""Test for converting a gene id to mouse geneid\
given a species which is not mouse
@@ -355,6 +361,7 @@ class TestCorrelation(TestCase):
self.assertEqual(results, expected_results)
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.correlations.lit_correlation_for_trait")
def test_compute_all_lit_correlation(self, mock_lit_corr):
"""Test for compute all lit correlation which acts\
@@ -375,6 +382,7 @@ class TestCorrelation(TestCase):
self.assertEqual(lit_correlation_results, expected_mocked_lit_results)
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.correlations.tissue_correlation_for_trait")
@mock.patch("gn3.computations.correlations.process_trait_symbol_dict")
def test_compute_all_tissue_correlation(self, process_trait_symbol, mock_tissue_corr):
@@ -418,6 +426,7 @@ class TestCorrelation(TestCase):
self.assertEqual(results, expected_results)
+ @pytest.mark.unit_test
def test_map_shared_keys_to_values(self):
"""test helper function needed to integrate with genenenetwork2\
given a a samplelist containing dataset sampelist keys\
@@ -438,6 +447,7 @@ class TestCorrelation(TestCase):
self.assertEqual(results, expected_results)
+ @pytest.mark.unit_test
def test_process_trait_symbol_dict(self):
"""test for processing trait symbol dict\
and fetch tissue values from tissue value dict\
@@ -456,6 +466,7 @@ class TestCorrelation(TestCase):
self.assertEqual(results, [expected_results])
+ @pytest.mark.unit_test
def test_compute_correlation(self):
"""Test that the new correlation function works the same as the original
from genenetwork1."""
@@ -470,10 +481,10 @@ class TestCorrelation(TestCase):
[None, None, None, None, None, None, None, None, None, 0],
(0.0, 1)],
[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- (0, 10)],
+ (math.nan, 10)],
[[9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87],
[9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87],
- (0.9999999999999998, 10)],
+ (math.nan, 10)],
[[9.3, 2.2, 5.4, 7.2, 6.4, 7.6, 3.8, 1.8, 8.4, 0.2],
[0.6, 3.97, 5.82, 8.21, 1.65, 4.55, 6.72, 9.5, 7.33, 2.34],
(-0.12720361919462056, 10)],
@@ -481,5 +492,8 @@ class TestCorrelation(TestCase):
[None, None, None, None, 2, None, None, 3, None, None],
(0.0, 2)]]:
with self.subTest(dbdata=dbdata, userdata=userdata):
- self.assertEqual(compute_correlation(
- dbdata, userdata), expected)
+ actual = compute_correlation(dbdata, userdata)
+ with self.subTest("correlation coefficient"):
+ assert_almost_equal(actual[0], expected[0])
+ with self.subTest("overlap"):
+ self.assertEqual(actual[1], expected[1])
diff --git a/tests/unit/computations/test_diff.py b/tests/unit/computations/test_diff.py
index e4f5dde..128fb60 100644
--- a/tests/unit/computations/test_diff.py
+++ b/tests/unit/computations/test_diff.py
@@ -2,6 +2,8 @@
import unittest
import os
+import pytest
+
from gn3.computations.diff import generate_diff
TESTDIFF = """3,4c3,4
@@ -19,6 +21,7 @@ TESTDIFF = """3,4c3,4
class TestDiff(unittest.TestCase):
"""Test cases for computations.diff"""
+ @pytest.mark.unit_test
def test_generate_diff(self):
"""Test that the correct diff is generated"""
data = os.path.join(os.path.dirname(__file__).split("unit")[0],
diff --git a/tests/unit/computations/test_gemma.py b/tests/unit/computations/test_gemma.py
index 73dd5eb..137c95c 100644
--- a/tests/unit/computations/test_gemma.py
+++ b/tests/unit/computations/test_gemma.py
@@ -1,7 +1,9 @@
"""Test cases for procedures defined in computations.gemma"""
import unittest
-
from unittest import mock
+
+import pytest
+
from gn3.computations.gemma import generate_gemma_cmd
from gn3.computations.gemma import generate_hash_of_string
from gn3.computations.gemma import generate_pheno_txt_file
@@ -9,6 +11,7 @@ from gn3.computations.gemma import generate_pheno_txt_file
class TestGemma(unittest.TestCase):
"""Test cases for computations.gemma module"""
+ @pytest.mark.unit_test
def test_generate_pheno_txt_file(self):
"""Test that the pheno text file is generated correctly"""
open_mock = mock.mock_open()
@@ -19,18 +22,20 @@ class TestGemma(unittest.TestCase):
self.assertEqual(_file, ("/tmp/gn2/phenotype_"
"P7y6QWnwBPedSZdL0+m/GQ.txt"))
open_mock.assert_called_with(("/tmp/gn2/phenotype_"
- "P7y6QWnwBPedSZdL0+m/GQ.txt"), "w")
+ "P7y6QWnwBPedSZdL0+m/GQ.txt"), "w", encoding="utf-8")
open_mock.return_value.write.assert_has_calls([
mock.call("NA\n"),
mock.call("NA\n"),
mock.call("BXD07 438.700\n")
])
+ @pytest.mark.unit_test
def test_generate_hash_of_string(self):
"""Test that a string is hashed correctly"""
self.assertEqual(generate_hash_of_string("I^iQP&TlSR^z"),
"hMVRw8kbEp49rOmoIkhMjA")
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.gemma.get_hash_of_files")
def test_compute_k_values_without_loco(self, mock_get_hash):
"""Test computing k values without loco"""
@@ -52,6 +57,7 @@ class TestGemma(unittest.TestCase):
"-gk > /tmp/my-token/my-hash-output.json")
})
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.gemma.get_hash_of_files")
def test_generate_gemma_cmd_with_loco(self, mock_get_hash):
"""Test computing k values with loco"""
diff --git a/tests/unit/computations/test_parsers.py b/tests/unit/computations/test_parsers.py
index b51b0bf..f05f766 100644
--- a/tests/unit/computations/test_parsers.py
+++ b/tests/unit/computations/test_parsers.py
@@ -2,17 +2,21 @@
import unittest
import os
+import pytest
+
from gn3.computations.parsers import parse_genofile
class TestParsers(unittest.TestCase):
"""Test cases for some various parsers"""
+ @pytest.mark.unit_test
def test_parse_genofile_without_existing_file(self):
"""Assert that an error is raised if the genotype file is absent"""
self.assertRaises(FileNotFoundError, parse_genofile,
"/non-existent-file")
+ @pytest.mark.unit_test
def test_parse_genofile_with_existing_file(self):
"""Test that a genotype file is parsed correctly"""
samples = ["bxd1", "bxd2"]
diff --git a/tests/unit/computations/test_partial_correlations.py b/tests/unit/computations/test_partial_correlations.py
index 83cb9d9..81ddbcc 100644
--- a/tests/unit/computations/test_partial_correlations.py
+++ b/tests/unit/computations/test_partial_correlations.py
@@ -1,16 +1,18 @@
"""Module contains tests for gn3.partial_correlations"""
-import csv
-from unittest import TestCase, skip
+from unittest import TestCase
+
+import pandas
+import pytest
+from numpy.testing import assert_allclose
+
from gn3.computations.partial_correlations import (
fix_samples,
control_samples,
- dictify_by_samples,
+ build_data_frame,
tissue_correlation,
find_identical_traits,
- partial_correlation_matrix,
- good_dataset_samples_indexes,
- partial_correlation_recursive)
+ good_dataset_samples_indexes)
sampleslist = ["B6cC3-1", "BXD1", "BXD12", "BXD16", "BXD19", "BXD2"]
control_traits = (
@@ -93,32 +95,10 @@ dictified_control_samples = (
"BXD1": {"sample_name": "BXD1", "value": 7.77141, "variance": None},
"BXD2": {"sample_name": "BXD2", "value": 7.80944, "variance": None}})
-def parse_test_data_csv(filename):
- """
- Parse test data csv files for R -> Python conversion of some functions.
- """
- def __str__to_tuple(line, field):
- return tuple(float(s.strip()) for s in line[field].split(","))
-
- with open(filename, newline="\n") as csvfile:
- reader = csv.DictReader(csvfile, delimiter=",", quotechar='"')
- lines = tuple(row for row in reader)
-
- methods = {"p": "pearson", "s": "spearman", "k": "kendall"}
- return tuple({
- **line,
- "x": __str__to_tuple(line, "x"),
- "y": __str__to_tuple(line, "y"),
- "z": __str__to_tuple(line, "z"),
- "method": methods[line["method"]],
- "rm": line["rm"] == "TRUE",
- "result": float(line["result"])
- } for line in lines)
-
-
class TestPartialCorrelations(TestCase):
"""Class for testing partial correlations computation functions"""
+ @pytest.mark.unit_test
def test_control_samples(self):
"""Test that the control_samples works as expected."""
self.assertEqual(
@@ -133,36 +113,7 @@ class TestPartialCorrelations(TestCase):
(None, None, None)),
(6, 4, 3)))
- def test_dictify_by_samples(self):
- """
- Test that `dictify_by_samples` generates the appropriate dict
-
- Given:
- a sequence of sequences with sample names, values and variances, as
- in the output of `gn3.partial_correlations.control_samples` or
- the output of `gn3.db.traits.export_informative`
- When:
- the sequence is passed as an argument into the
- `gn3.partial_correlations.dictify_by_sample`
- Then:
- return a sequence of dicts with keys being the values of the sample
- names, and each of who's values being sub-dicts with the keys
- 'sample_name', 'value' and 'variance' whose values correspond to the
- values passed in.
- """
- self.assertEqual(
- dictify_by_samples(
- ((("B6cC3-1", "BXD1", "BXD12", "BXD16", "BXD19", "BXD2"),
- ("BXD12", "BXD16", "BXD19", "BXD2"),
- ("B6cC3-1", "BXD1", "BXD2")),
- ((7.51879, 7.77141, 8.39265, 8.17443, 8.30401, 7.80944),
- (8.39265, 8.17443, 8.30401, 7.80944),
- (7.51879, 7.77141, 7.80944)),
- ((None, None, None, None, None, None), (None, None, None, None),
- (None, None, None)),
- (6, 4, 3))),
- dictified_control_samples)
-
+ @pytest.mark.unit_test
def test_fix_samples(self):
"""
Test that `fix_samples` returns only the common samples
@@ -208,13 +159,14 @@ class TestPartialCorrelations(TestCase):
(None, None, None, None, None, None, None, None, None, None, None,
None, None)))
+ @pytest.mark.unit_test
def test_find_identical_traits(self):
"""
Test `gn3.partial_correlations.find_identical_traits`.
Given:
- the name of a primary trait
- - the value of a primary trait
+ - a sequence of values for the primary trait
- a sequence of names of control traits
- a sequence of values of control traits
When:
@@ -225,12 +177,14 @@ class TestPartialCorrelations(TestCase):
decimal places are considered
"""
for primn, primv, contn, contv, expected in (
- ("pt", 12.98395, ("ct0", "ct1", "ct2"),
- (0.1234, 2.3456, 3.4567), tuple()),
- ("pt", 12.98395, ("ct0", "ct1", "ct2"),
- (12.98354, 2.3456, 3.4567), ("pt", "ct0")),
- ("pt", 12.98395, ("ct0", "ct1", "ct2", "ct3"),
- (0.1234, 2.3456, 0.1233, 4.5678), ("ct0", "ct2"))
+ ("pt", (12.98395,), ("ct0", "ct1", "ct2"),
+ ((0.1234, 2.3456, 3.4567),), tuple()),
+ ("pt", (12.98395, 2.3456, 3.4567), ("ct0", "ct1", "ct2"),
+ ((12.98354, 2.3456, 3.4567), (64.2334, 6.3256, 64.2364),
+ (4.2374, 67.2345, 7.48234)), ("pt", "ct0")),
+ ("pt", (12.98395, 75.52382), ("ct0", "ct1", "ct2", "ct3"),
+ ((0.1234, 2.3456), (0.3621, 6543.572), (0.1234, 2.3456),
+ (0.1233, 4.5678)), ("ct0", "ct2"))
):
with self.subTest(
primary_name=primn, primary_value=primv,
@@ -238,6 +192,7 @@ class TestPartialCorrelations(TestCase):
self.assertEqual(
find_identical_traits(primn, primv, contn, contv), expected)
+ @pytest.mark.unit_test
def test_tissue_correlation_error(self):
"""
Test that `tissue_correlation` raises specific exceptions for particular
@@ -272,7 +227,8 @@ class TestPartialCorrelations(TestCase):
with self.assertRaises(error, msg=error_msg):
tissue_correlation(primary, target, method)
- def test_tissue_correlation(self):
+ @pytest.mark.unit_test
+ def test_tissue_correlation(self): # pylint: disable=R0201
"""
Test that the correct correlation values are computed for the given:
- primary trait
@@ -281,13 +237,14 @@ class TestPartialCorrelations(TestCase):
"""
for primary, target, method, expected in (
((12.34, 18.36, 42.51), (37.25, 46.25, 46.56), "pearson",
- (0.6761779253, 0.5272701134)),
+ (0.6761779252651052, 0.5272701133657985)),
((1, 2, 3, 4, 5), (5, 6, 7, 8, 7), "spearman",
- (0.8207826817, 0.0885870053))):
+ (0.8207826816681233, 0.08858700531354381))):
with self.subTest(primary=primary, target=target, method=method):
- self.assertEqual(
+ assert_allclose(
tissue_correlation(primary, target, method), expected)
+ @pytest.mark.unit_test
def test_good_dataset_samples_indexes(self):
"""
Test that `good_dataset_samples_indexes` returns correct indices.
@@ -298,38 +255,22 @@ class TestPartialCorrelations(TestCase):
("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l")),
(0, 4, 8, 10))
- @skip
- def test_partial_correlation_matrix(self):
+ @pytest.mark.unit_test
+ def test_build_data_frame(self):
"""
- Test that `partial_correlation_matrix` computes the appropriate
- correlation value.
+ Check that the function builds the correct data frame.
"""
- for sample in parse_test_data_csv(
- ("tests/unit/computations/partial_correlations_test_data/"
- "pcor_mat_blackbox_test.csv")):
- with self.subTest(
- xdata=sample["x"], ydata=sample["y"], zdata=sample["z"],
- method=sample["method"], omit_nones=sample["rm"]):
- self.assertEqual(
- partial_correlation_matrix(
- sample["x"], sample["y"], sample["z"],
- method=sample["method"], omit_nones=sample["rm"]),
- sample["result"])
-
- @skip
- def test_partial_correlation_recursive(self):
- """
- Test that `partial_correlation_recursive` computes the appropriate
- correlation value.
- """
- for sample in parse_test_data_csv(
- ("tests/unit/computations/partial_correlations_test_data/"
- "pcor_rec_blackbox_test.csv")):
- with self.subTest(
- xdata=sample["x"], ydata=sample["y"], zdata=sample["z"],
- method=sample["method"], omit_nones=sample["rm"]):
- self.assertEqual(
- partial_correlation_recursive(
- sample["x"], sample["y"], sample["z"],
- method=sample["method"], omit_nones=sample["rm"]),
- sample["result"])
+ for xdata, ydata, zdata, expected in (
+ ((0.1, 1.1, 2.1), (2.1, 3.1, 4.1), (5.1, 6.1, 7.1),
+ pandas.DataFrame({
+ "x": (0.1, 1.1, 2.1), "y": (2.1, 3.1, 4.1),
+ "z": (5.1, 6.1, 7.1)})),
+ ((0.1, 1.1, 2.1), (2.1, 3.1, 4.1),
+ ((5.1, 6.1, 7.1), (5.2, 6.2, 7.2), (5.3, 6.3, 7.3)),
+ pandas.DataFrame({
+ "x": (0.1, 1.1, 2.1), "y": (2.1, 3.1, 4.1),
+ "z0": (5.1, 6.1, 7.1), "z1": (5.2, 6.2, 7.2),
+ "z2": (5.3, 6.3, 7.3)}))):
+ with self.subTest(xdata=xdata, ydata=ydata, zdata=zdata):
+ self.assertTrue(
+ build_data_frame(xdata, ydata, zdata).equals(expected))
diff --git a/tests/unit/computations/test_pca.py b/tests/unit/computations/test_pca.py
new file mode 100644
index 0000000..0189948
--- /dev/null
+++ b/tests/unit/computations/test_pca.py
@@ -0,0 +1,101 @@
+"""module contains unittests for pca"""
+import unittest
+from unittest.mock import patch
+from unittest.mock import Mock
+
+import numpy as np
+import pytest
+
+from gn3.computations.pca import cache_pca_dataset
+from gn3.computations.pca import generate_pca_temp_traits
+from gn3.computations.pca import generate_scree_plot_data
+from gn3.computations.pca import process_factor_loadings_tdata
+
+
+class TestPCA(unittest.TestCase):
+ """pca testcase class"""
+
+ @pytest.mark.unit_test
+ def test_process_factor_loadings(self):
+ """test for processing factor loadings"""
+
+ test_array = np.array([
+ [-0.23511749, -0.61483617, -0.26872797, 0.70319381],
+ [-0.71057342, 0.4623377, -0.52921008, -0.0355803],
+ [-0.60977093, -0.02877103, 0.78874096, 0.07238328],
+ [0.26073856, 0.63827311, 0.16003023, 0.70640864]
+ ])
+
+ expected_results = [[-0.23511749, -0.71057342, -0.60977093],
+ [-0.61483617, 0.4623377, -0.02877103],
+ [-0.26872797, -0.52921008, 0.78874096],
+ [0.70319381, -0.0355803, 0.07238328]]
+
+ self.assertEqual(process_factor_loadings_tdata(
+ test_array, 3), expected_results)
+
+ @pytest.mark.unit_test
+ @patch("gn3.computations.pca.generate_pca_traits_vals")
+ def test_generate_pca_datasets(self, mock_pca_data):
+ """test for generating temp pca dataset"""
+
+ mock_pca_data.return_value = np.array([[21, 10, 17, 15, 13],
+ [21, 11, 18,
+ 9, 1],
+ [22, 16, 0,
+ 0.22667229, -1],
+ [31, 12, 10, 17, 11]])
+
+ shared_samples = ["BXD1", "BXD2", "BXD", "BXD4", "Unkown"]
+
+ dataset_samples = ["BXD1", "BXD5", "BXD4", "BXD"]
+ expected_results = {
+ "PCA1_mouse_G1_now": ["21.0", "x", "10.0", "17.0"],
+ "PCA2_mouse_G1_now": ["21.0", "x", "11.0", "18.0"],
+ "PCA3_mouse_G1_now": ["22.0", "x", "16.0", "0.0"],
+ "PCA4_mouse_G1_now": ["31.0", "x", "12.0", "10.0"]
+ }
+
+ results = generate_pca_temp_traits(species="mouse", group="G1",
+ traits_data=[],
+ dataset_samples=dataset_samples,
+ corr_array=[],
+ shared_samples=shared_samples,
+ create_time="now")
+
+ self.assertEqual(results, expected_results)
+
+ @pytest.mark.unit_test
+ def test_generate_scree_plot(self):
+ """test scree plot data is generated"""
+
+ variance = [0.9271, 0.06232, 0.031]
+
+ self.assertEqual(generate_scree_plot_data(variance),
+ (['PC1', 'PC2', 'PC3'], [92.7, 6.2, 3.1]))
+
+ @pytest.mark.unit_test
+ def test_cache_pca_datasets(self):
+ """test for caching pca datasets"""
+
+ pca_traits = {
+ "PCA_1": ["11.0", "x", "9.0", "7.0"],
+ "PCA_2": ["x", "x", "1.2", "3.1"]
+ }
+
+ self.assertEqual(cache_pca_dataset(redis_conn={}, exp_days=30,
+ pca_trait_dict=pca_traits), False)
+
+ mock_redis = Mock()
+ mock_redis.set.return_value = True
+
+ test_data = [({}, 30, pca_traits, False),
+ (mock_redis, 30, pca_traits, True)]
+
+ for (test_redis, exp_day, test_traits, expected) in test_data:
+
+ with self.subTest(redis_conn=test_redis,
+ exp_days=exp_day, pca_trait_dict=test_traits):
+
+ self.assertEqual(cache_pca_dataset(
+ test_redis, exp_day, test_traits), expected)
diff --git a/tests/unit/computations/test_qtlreaper.py b/tests/unit/computations/test_qtlreaper.py
index 742d106..607f4a6 100644
--- a/tests/unit/computations/test_qtlreaper.py
+++ b/tests/unit/computations/test_qtlreaper.py
@@ -1,5 +1,6 @@
"""Module contains tests for gn3.computations.qtlreaper"""
from unittest import TestCase
+import pytest
from gn3.computations.qtlreaper import (
parse_reaper_main_results,
organise_reaper_main_results,
@@ -9,6 +10,7 @@ from tests.unit.sample_test_data import organised_trait_1
class TestQTLReaper(TestCase):
"""Class for testing qtlreaper interface functions."""
+ @pytest.mark.unit_test
def test_parse_reaper_main_results(self):
"""Test that the main results file is parsed correctly."""
self.assertEqual(
@@ -67,6 +69,7 @@ class TestQTLReaper(TestCase):
}
])
+ @pytest.mark.unit_test
def test_parse_reaper_permutation_results(self):
"""Test that the permutations results file is parsed correctly."""
self.assertEqual(
@@ -77,6 +80,7 @@ class TestQTLReaper(TestCase):
5.63874, 5.71346, 5.71936, 5.74275, 5.76764, 5.79815, 5.81671,
5.82775, 5.89659, 5.92117, 5.93396, 5.93396, 5.94957])
+ @pytest.mark.unit_test
def test_organise_reaper_main_results(self):
"""Check that results are organised correctly."""
self.assertEqual(
diff --git a/tests/unit/computations/test_rqtl.py b/tests/unit/computations/test_rqtl.py
index 955d0ab..51df281 100644
--- a/tests/unit/computations/test_rqtl.py
+++ b/tests/unit/computations/test_rqtl.py
@@ -2,10 +2,12 @@
import unittest
from unittest import mock
+import pytest
from gn3.computations.rqtl import generate_rqtl_cmd
class TestRqtl(unittest.TestCase):
"""Test cases for computations.rqtl module"""
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.rqtl.generate_hash_of_string")
@mock.patch("gn3.computations.rqtl.get_hash_of_files")
def test_generate_rqtl_command(self, mock_get_hash_files, mock_generate_hash_string):
diff --git a/tests/unit/computations/test_slink.py b/tests/unit/computations/test_slink.py
index 995393b..276133a 100644
--- a/tests/unit/computations/test_slink.py
+++ b/tests/unit/computations/test_slink.py
@@ -1,6 +1,8 @@
"""Module contains tests for slink"""
from unittest import TestCase
+import pytest
+
from gn3.computations.slink import slink
from gn3.computations.slink import nearest
from gn3.computations.slink import LengthError
@@ -9,6 +11,7 @@ from gn3.computations.slink import MirrorError
class TestSlink(TestCase):
"""Class for testing slink functions"""
+ @pytest.mark.unit_test
def test_nearest_expects_list_of_lists(self):
"""Test that function only accepts a list of lists."""
# This might be better handled with type-hints and mypy
@@ -18,6 +21,7 @@ class TestSlink(TestCase):
with self.assertRaises(ValueError, msg="Expected list or tuple"):
nearest(item, 1, 1)
+ @pytest.mark.unit_test
def test_nearest_does_not_allow_empty_lists(self):
"""Test that function does not accept an empty list, or any of the child
lists to be empty."""
@@ -29,6 +33,7 @@ class TestSlink(TestCase):
with self.assertRaises(ValueError):
nearest(lst, 1, 1)
+ @pytest.mark.unit_test
def test_nearest_expects_children_are_same_length_as_parent(self):
"""Test that children lists are same length as parent list."""
for lst in [[[0, 1]],
@@ -40,6 +45,7 @@ class TestSlink(TestCase):
with self.assertRaises(LengthError):
nearest(lst, 1, 1)
+ @pytest.mark.unit_test
def test_nearest_expects_member_is_zero_distance_from_itself(self):
"""Test that distance of a member from itself is zero"""
for lst in [[[1]],
@@ -50,6 +56,7 @@ class TestSlink(TestCase):
with self.assertRaises(ValueError):
nearest(lst, 1, 1)
+ @pytest.mark.unit_test
def test_nearest_expects_distance_atob_is_equal_to_distance_btoa(self):
"""Test that the distance from member A to member B is the same as that
from member B to member A."""
@@ -60,6 +67,7 @@ class TestSlink(TestCase):
with self.assertRaises(MirrorError):
nearest(lst, 1, 1)
+ @pytest.mark.unit_test
def test_nearest_expects_zero_or_positive_distances(self):
"""Test that all distances are either zero, or greater than zero."""
# Based on:
@@ -74,6 +82,7 @@ class TestSlink(TestCase):
with self.assertRaises(ValueError, msg="Distances should be positive."):
nearest(lst, 1, 1)
+ @pytest.mark.unit_test
def test_nearest_returns_shortest_distance_given_coordinates_to_both_group_members(self):
"""Test that the shortest distance is returned."""
# This test is named wrong - at least I think it is, from the expected results
@@ -234,6 +243,7 @@ class TestSlink(TestCase):
with self.subTest(lst=lst):
self.assertEqual(nearest(lst, i, j), expected)
+ @pytest.mark.unit_test
def test_nearest_gives_shortest_distance_between_list_of_members_and_member(self):
"""Test that the shortest distance is returned."""
for members_distances, members_list, member_coordinate, expected_distance in [
@@ -260,6 +270,7 @@ class TestSlink(TestCase):
members_distances, member_coordinate, members_list),
expected_distance)
+ @pytest.mark.unit_test
def test_nearest_returns_shortest_distance_given_two_lists_of_members(self):
"""Test that the shortest distance is returned."""
for members_distances, members_list, member_list2, expected_distance in [
@@ -289,12 +300,14 @@ class TestSlink(TestCase):
members_distances, member_list2, members_list),
expected_distance)
+ @pytest.mark.unit_test
def test_slink_wrong_data_returns_empty_list(self):
"""Test that empty list is returned for wrong data."""
for data in [1, "test", [], 2.945, nearest, [0]]:
with self.subTest(data=data):
self.assertEqual(slink(data), [])
+ @pytest.mark.unit_test
def test_slink_with_data(self):
"""Test slink with example data, and expected results for each data
sample."""
diff --git a/tests/unit/computations/test_wgcna.py b/tests/unit/computations/test_wgcna.py
index 5f23a86..a9108b0 100644
--- a/tests/unit/computations/test_wgcna.py
+++ b/tests/unit/computations/test_wgcna.py
@@ -2,6 +2,8 @@
from unittest import TestCase
from unittest import mock
+import pytest
+
from gn3.computations.wgcna import dump_wgcna_data
from gn3.computations.wgcna import compose_wgcna_cmd
from gn3.computations.wgcna import call_wgcna_script
@@ -10,6 +12,7 @@ from gn3.computations.wgcna import call_wgcna_script
class TestWgcna(TestCase):
"""test class for wgcna"""
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.wgcna.process_image")
@mock.patch("gn3.computations.wgcna.run_cmd")
@mock.patch("gn3.computations.wgcna.compose_wgcna_cmd")
@@ -95,6 +98,7 @@ class TestWgcna(TestCase):
self.assertEqual(results, expected_output)
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.wgcna.run_cmd")
@mock.patch("gn3.computations.wgcna.compose_wgcna_cmd")
@mock.patch("gn3.computations.wgcna.dump_wgcna_data")
@@ -117,6 +121,7 @@ class TestWgcna(TestCase):
self.assertEqual(call_wgcna_script(
"input_file.R", ""), expected_error)
+ @pytest.mark.unit_test
def test_compose_wgcna_cmd(self):
"""test for composing wgcna cmd"""
wgcna_cmd = compose_wgcna_cmd(
@@ -124,6 +129,7 @@ class TestWgcna(TestCase):
self.assertEqual(
wgcna_cmd, "Rscript ./scripts/wgcna.r /tmp/wgcna.json")
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.wgcna.TMPDIR", "/tmp")
@mock.patch("gn3.computations.wgcna.uuid.uuid4")
def test_create_json_file(self, file_name_generator):
@@ -160,7 +166,7 @@ class TestWgcna(TestCase):
expected_input)
file_handler.assert_called_once_with(
- "/tmp/facb73ff-7eef-4053-b6ea-e91d3a22a00c.json", 'w')
+ "/tmp/facb73ff-7eef-4053-b6ea-e91d3a22a00c.json", 'w', encoding='utf-8')
self.assertEqual(
results, "/tmp/facb73ff-7eef-4053-b6ea-e91d3a22a00c.json")
diff --git a/tests/unit/db/test_audit.py b/tests/unit/db/test_audit.py
index 7480169..884afc6 100644
--- a/tests/unit/db/test_audit.py
+++ b/tests/unit/db/test_audit.py
@@ -3,6 +3,8 @@ import json
from unittest import TestCase
from unittest import mock
+import pytest
+
from gn3.db import insert
from gn3.db.metadata_audit import MetadataAudit
@@ -10,6 +12,7 @@ from gn3.db.metadata_audit import MetadataAudit
class TestMetadatAudit(TestCase):
"""Test cases for fetching chromosomes"""
+ @pytest.mark.unit_test
def test_insert_into_metadata_audit(self):
"""Test that data is inserted correctly in the audit table
diff --git a/tests/unit/db/test_correlation.py b/tests/unit/db/test_correlation.py
new file mode 100644
index 0000000..5afe55f
--- /dev/null
+++ b/tests/unit/db/test_correlation.py
@@ -0,0 +1,100 @@
+"""
+Tests for the gn3.db.correlations module
+"""
+
+from unittest import TestCase
+
+import pytest
+
+from gn3.db.correlations import (
+ build_query_sgo_lit_corr,
+ build_query_tissue_corr)
+
+class TestCorrelation(TestCase):
+ """Test cases for correlation data fetching functions"""
+ maxDiff = None
+
+ @pytest.mark.unit_test
+ def test_build_query_sgo_lit_corr(self):
+ """
+ Test that the literature correlation query is built correctly.
+ """
+ self.assertEqual(
+ build_query_sgo_lit_corr(
+ "Probeset",
+ "temp_table_xy45i7wd",
+ "T1.value, T2.value, T3.value",
+ (("LEFT JOIN ProbesetData AS T1 "
+ "ON T1.Id = ProbesetXRef.DataId "
+ "AND T1.StrainId=%(T1_sample_id)s"),
+ (
+ "LEFT JOIN ProbesetData AS T2 "
+ "ON T2.Id = ProbesetXRef.DataId "
+ "AND T2.StrainId=%(T2_sample_id)s"),
+ (
+ "LEFT JOIN ProbesetData AS T3 "
+ "ON T3.Id = ProbesetXRef.DataId "
+ "AND T3.StrainId=%(T3_sample_id)s"))),
+ (("SELECT Probeset.Name, temp_table_xy45i7wd.value, "
+ "T1.value, T2.value, T3.value "
+ "FROM (Probeset, ProbesetXRef, ProbesetFreeze) "
+ "LEFT JOIN temp_table_xy45i7wd ON temp_table_xy45i7wd.GeneId2=ProbeSet.GeneId "
+ "LEFT JOIN ProbesetData AS T1 "
+ "ON T1.Id = ProbesetXRef.DataId "
+ "AND T1.StrainId=%(T1_sample_id)s "
+ "LEFT JOIN ProbesetData AS T2 "
+ "ON T2.Id = ProbesetXRef.DataId "
+ "AND T2.StrainId=%(T2_sample_id)s "
+ "LEFT JOIN ProbesetData AS T3 "
+ "ON T3.Id = ProbesetXRef.DataId "
+ "AND T3.StrainId=%(T3_sample_id)s "
+ "WHERE ProbeSet.GeneId IS NOT NULL "
+ "AND temp_table_xy45i7wd.value IS NOT NULL "
+ "AND ProbesetXRef.ProbesetFreezeId = ProbesetFreeze.Id "
+ "AND ProbesetFreeze.Name = %(db_name)s "
+ "AND Probeset.Id = ProbesetXRef.ProbesetId "
+ "ORDER BY Probeset.Id"),
+ 2))
+
+ @pytest.mark.unit_test
+ def test_build_query_tissue_corr(self):
+ """
+ Test that the tissue correlation query is built correctly.
+ """
+ self.assertEqual(
+ build_query_tissue_corr(
+ "Probeset",
+ "temp_table_xy45i7wd",
+ "T1.value, T2.value, T3.value",
+ (("LEFT JOIN ProbesetData AS T1 "
+ "ON T1.Id = ProbesetXRef.DataId "
+ "AND T1.StrainId=%(T1_sample_id)s"),
+ (
+ "LEFT JOIN ProbesetData AS T2 "
+ "ON T2.Id = ProbesetXRef.DataId "
+ "AND T2.StrainId=%(T2_sample_id)s"),
+ (
+ "LEFT JOIN ProbesetData AS T3 "
+ "ON T3.Id = ProbesetXRef.DataId "
+ "AND T3.StrainId=%(T3_sample_id)s"))),
+ (("SELECT Probeset.Name, temp_table_xy45i7wd.Correlation, "
+ "temp_table_xy45i7wd.PValue, "
+ "T1.value, T2.value, T3.value "
+ "FROM (Probeset, ProbesetXRef, ProbesetFreeze) "
+ "LEFT JOIN temp_table_xy45i7wd ON temp_table_xy45i7wd.Symbol=ProbeSet.Symbol "
+ "LEFT JOIN ProbesetData AS T1 "
+ "ON T1.Id = ProbesetXRef.DataId "
+ "AND T1.StrainId=%(T1_sample_id)s "
+ "LEFT JOIN ProbesetData AS T2 "
+ "ON T2.Id = ProbesetXRef.DataId "
+ "AND T2.StrainId=%(T2_sample_id)s "
+ "LEFT JOIN ProbesetData AS T3 "
+ "ON T3.Id = ProbesetXRef.DataId "
+ "AND T3.StrainId=%(T3_sample_id)s "
+ "WHERE ProbeSet.Symbol IS NOT NULL "
+ "AND temp_table_xy45i7wd.Correlation IS NOT NULL "
+ "AND ProbesetXRef.ProbesetFreezeId = ProbesetFreeze.Id "
+ "AND ProbesetFreeze.Name = %(db_name)s "
+ "AND Probeset.Id = ProbesetXRef.ProbesetId "
+ "ORDER BY Probeset.Id"),
+ 3))
diff --git a/tests/unit/db/test_datasets.py b/tests/unit/db/test_datasets.py
index 39f4af9..e4abd2f 100644
--- a/tests/unit/db/test_datasets.py
+++ b/tests/unit/db/test_datasets.py
@@ -1,6 +1,7 @@
"""Tests for gn3/db/datasets.py"""
from unittest import mock, TestCase
+import pytest
from gn3.db.datasets import (
retrieve_dataset_name,
retrieve_group_fields,
@@ -11,35 +12,36 @@ from gn3.db.datasets import (
class TestDatasetsDBFunctions(TestCase):
"""Test cases for datasets functions."""
+ @pytest.mark.unit_test
def test_retrieve_dataset_name(self):
"""Test that the function is called correctly."""
- for trait_type, thresh, trait_name, dataset_name, columns, table in [
- ["ProbeSet", 9, "probesetTraitName", "probesetDatasetName",
- "Id, Name, FullName, ShortName, DataScale", "ProbeSetFreeze"],
- ["Geno", 3, "genoTraitName", "genoDatasetName",
- "Id, Name, FullName, ShortName", "GenoFreeze"],
- ["Publish", 6, "publishTraitName", "publishDatasetName",
- "Id, Name, FullName, ShortName", "PublishFreeze"],
- ["Temp", 4, "tempTraitName", "tempTraitName",
- "Id, Name, FullName, ShortName", "TempFreeze"]]:
+ for trait_type, thresh, dataset_name, columns, table, expected in [
+ ["ProbeSet", 9, "probesetDatasetName",
+ "Id, Name, FullName, ShortName, DataScale", "ProbeSetFreeze",
+ {"dataset_id": None, "dataset_name": "probesetDatasetName",
+ "dataset_fullname": "probesetDatasetName"}],
+ ["Geno", 3, "genoDatasetName",
+ "Id, Name, FullName, ShortName", "GenoFreeze", {}],
+ ["Publish", 6, "publishDatasetName",
+ "Id, Name, FullName, ShortName", "PublishFreeze", {}]]:
db_mock = mock.MagicMock()
with self.subTest(trait_type=trait_type):
with db_mock.cursor() as cursor:
cursor.fetchone.return_value = {}
self.assertEqual(
retrieve_dataset_name(
- trait_type, thresh, trait_name, dataset_name, db_mock),
- {})
+ trait_type, thresh, dataset_name, db_mock),
+ expected)
cursor.execute.assert_called_once_with(
- "SELECT {cols} "
- "FROM {table} "
+ f"SELECT {columns} "
+ f"FROM {table} "
"WHERE public > %(threshold)s AND "
"(Name = %(name)s "
"OR FullName = %(name)s "
- "OR ShortName = %(name)s)".format(
- table=table, cols=columns),
+ "OR ShortName = %(name)s)",
{"threshold": thresh, "name": dataset_name})
+ @pytest.mark.unit_test
def test_retrieve_probeset_group_fields(self):
"""
Test that the `group` and `group_id` fields are retrieved appropriately
@@ -63,6 +65,7 @@ class TestDatasetsDBFunctions(TestCase):
" AND ProbeSetFreeze.Name = %(name)s"),
{"name": trait_name})
+ @pytest.mark.unit_test
def test_retrieve_group_fields(self):
"""
Test that the group fields are set up correctly for the different trait
@@ -88,6 +91,7 @@ class TestDatasetsDBFunctions(TestCase):
trait_type, trait_name, dataset_info, db_mock),
expected)
+ @pytest.mark.unit_test
def test_retrieve_publish_group_fields(self):
"""
Test that the `group` and `group_id` fields are retrieved appropriately
@@ -110,6 +114,7 @@ class TestDatasetsDBFunctions(TestCase):
" AND PublishFreeze.Name = %(name)s"),
{"name": trait_name})
+ @pytest.mark.unit_test
def test_retrieve_geno_group_fields(self):
"""
Test that the `group` and `group_id` fields are retrieved appropriately
diff --git a/tests/unit/db/test_db.py b/tests/unit/db/test_db.py
index e47c9fd..8ac468c 100644
--- a/tests/unit/db/test_db.py
+++ b/tests/unit/db/test_db.py
@@ -2,6 +2,8 @@
from unittest import TestCase
from unittest import mock
+import pytest
+
from gn3.db import fetchall
from gn3.db import fetchone
from gn3.db import update
@@ -14,6 +16,7 @@ from gn3.db.metadata_audit import MetadataAudit
class TestCrudMethods(TestCase):
"""Test cases for CRUD methods"""
+ @pytest.mark.unit_test
def test_update_phenotype_with_no_data(self):
"""Test that a phenotype is updated correctly if an empty Phenotype dataclass
is provided
@@ -24,6 +27,7 @@ class TestCrudMethods(TestCase):
conn=db_mock, table="Phenotype",
data=Phenotype(), where=Phenotype()), None)
+ @pytest.mark.unit_test
def test_update_phenotype_with_data(self):
"""
Test that a phenotype is updated correctly if some
@@ -46,6 +50,7 @@ class TestCrudMethods(TestCase):
"Submitter = %s WHERE id = %s AND Owner = %s",
('Test Pre Pub', 'Test Post Pub', 'Rob', 1, 'Rob'))
+ @pytest.mark.unit_test
def test_fetch_phenotype(self):
"""Test that a single phenotype is fetched properly
@@ -68,6 +73,7 @@ class TestCrudMethods(TestCase):
"SELECT * FROM Phenotype WHERE id = %s AND Owner = %s",
(35, 'Rob'))
+ @pytest.mark.unit_test
def test_fetchall_metadataaudit(self):
"""Test that multiple metadata_audit entries are fetched properly
@@ -96,6 +102,7 @@ class TestCrudMethods(TestCase):
"dataset_id = %s AND editor = %s"),
(35, 'Rob'))
+ @pytest.mark.unit_test
# pylint: disable=R0201
def test_probeset_called_with_right_columns(self):
"""Given a columns argument, test that the correct sql query is
@@ -112,6 +119,7 @@ class TestCrudMethods(TestCase):
"Name = %s",
("1446112_at",))
+ @pytest.mark.unit_test
def test_diff_from_dict(self):
"""Test that a correct diff is generated"""
self.assertEqual(diff_from_dict({"id": 1, "data": "a"},
diff --git a/tests/unit/db/test_genotypes.py b/tests/unit/db/test_genotypes.py
index c125224..28728bf 100644
--- a/tests/unit/db/test_genotypes.py
+++ b/tests/unit/db/test_genotypes.py
@@ -1,5 +1,6 @@
"""Tests gn3.db.genotypes"""
from unittest import TestCase
+import pytest
from gn3.db.genotypes import (
parse_genotype_file,
parse_genotype_labels,
@@ -10,6 +11,7 @@ from gn3.db.genotypes import (
class TestGenotypes(TestCase):
"""Tests for functions in `gn3.db.genotypes`."""
+ @pytest.mark.unit_test
def test_parse_genotype_labels(self):
"""Test that the genotype labels are parsed correctly."""
self.assertEqual(
@@ -22,6 +24,7 @@ class TestGenotypes(TestCase):
("type", "test_type"), ("mat", "test_mat"), ("pat", "test_pat"),
("het", "test_het"), ("unk", "test_unk")))
+ @pytest.mark.unit_test
def test_parse_genotype_header(self):
"""Test that the genotype header is parsed correctly."""
for header, expected in [
@@ -43,6 +46,7 @@ class TestGenotypes(TestCase):
with self.subTest(header=header):
self.assertEqual(parse_genotype_header(header), expected)
+ @pytest.mark.unit_test
def test_parse_genotype_data_line(self):
"""Test parsing of data lines."""
for line, geno_obj, parlist, expected in [
@@ -76,6 +80,7 @@ class TestGenotypes(TestCase):
parse_genotype_marker(line, geno_obj, parlist),
expected)
+ @pytest.mark.unit_test
def test_build_genotype_chromosomes(self):
"""
Given `markers` and `geno_obj`, test that `build_genotype_chromosomes`
@@ -115,6 +120,7 @@ class TestGenotypes(TestCase):
build_genotype_chromosomes(geno_obj, markers),
expected)
+ @pytest.mark.unit_test
def test_parse_genotype_file(self):
"""Test the parsing of genotype files. """
self.assertEqual(
diff --git a/tests/unit/db/test_genotypes2.py b/tests/unit/db/test_genotypes2.py
new file mode 100644
index 0000000..453120b
--- /dev/null
+++ b/tests/unit/db/test_genotypes2.py
@@ -0,0 +1,13 @@
+"""Module to test functions in gn3.db.genotypes"""
+
+import pytest
+
+from gn3.db.genotypes import load_genotype_samples
+
+@pytest.mark.unit_test
+@pytest.mark.parametrize(
+ "genotype_filename,file_type,expected", (
+ ("tests/unit/test_data/genotype.txt", "geno", ("BXD1","BXD2")),))
+def test_load_genotype_samples(genotype_filename, file_type, expected):
+ """Test that the genotype samples are loaded correctly"""
+ assert load_genotype_samples(genotype_filename, file_type) == expected
diff --git a/tests/unit/db/test_sample_data.py b/tests/unit/db/test_sample_data.py
new file mode 100644
index 0000000..2524e07
--- /dev/null
+++ b/tests/unit/db/test_sample_data.py
@@ -0,0 +1,188 @@
+"""Tests for gn3.db.sample_data"""
+import pytest
+import gn3
+
+from gn3.db.sample_data import __extract_actions
+from gn3.db.sample_data import delete_sample_data
+from gn3.db.sample_data import insert_sample_data
+from gn3.db.sample_data import update_sample_data
+
+
+@pytest.mark.unit_test
+def test_insert_sample_data(mocker):
+ """Test that inserts work properly"""
+ mock_conn = mocker.MagicMock()
+ strain_id, data_id, inbredset_id = 1, 17373, 20
+ with mock_conn.cursor() as cursor:
+ cursor.fetchone.side_effect = (
+ 0,
+ [
+ 19,
+ ],
+ 0,
+ )
+ mocker.patch(
+ "gn3.db.sample_data.get_sample_data_ids",
+ return_value=(strain_id, data_id, inbredset_id),
+ )
+ insert_sample_data(
+ conn=mock_conn,
+ trait_name=35,
+ data="BXD1,18,3,0,M",
+ csv_header="Strain Name,Value,SE,Count,Sex",
+ phenotype_id=10007,
+ )
+ calls = [
+ mocker.call(
+ "SELECT Id FROM PublishData where Id = %s " "AND StrainId = %s",
+ (data_id, strain_id),
+ ),
+ mocker.call(
+ "INSERT INTO PublishData " "(StrainId, Id, value) VALUES (%s, %s, %s)",
+ (strain_id, data_id, "18"),
+ ),
+ mocker.call(
+ "INSERT INTO PublishSE "
+ "(StrainId, DataId, error) VALUES (%s, %s, %s)",
+ (strain_id, data_id, "3"),
+ ),
+ mocker.call(
+ "INSERT INTO NStrain " "(StrainId, DataId, count) VALUES (%s, %s, %s)",
+ (strain_id, data_id, "0"),
+ ),
+ mocker.call("SELECT Id FROM CaseAttribute WHERE Name = %s", ("Sex",)),
+ mocker.call(
+ "SELECT StrainId FROM CaseAttributeXRefNew "
+ "WHERE StrainId = %s AND "
+ "CaseAttributeId = %s AND InbredSetId = %s",
+ (strain_id, 19, inbredset_id),
+ ),
+ mocker.call(
+ "INSERT INTO CaseAttributeXRefNew "
+ "(StrainId, CaseAttributeId, Value, "
+ "InbredSetId) VALUES (%s, %s, %s, %s)",
+ (strain_id, 19, "M", inbredset_id),
+ ),
+ ]
+ cursor.execute.assert_has_calls(calls, any_order=False)
+
+
+@pytest.mark.unit_test
+def test_delete_sample_data(mocker):
+ """Test that deletes work properly"""
+ mock_conn = mocker.MagicMock()
+ strain_id, data_id, inbredset_id = 1, 17373, 20
+ with mock_conn.cursor() as cursor:
+ cursor.fetchone.side_effect = (
+ 0,
+ [
+ 19,
+ ],
+ 0,
+ )
+ mocker.patch(
+ "gn3.db.sample_data.get_sample_data_ids",
+ return_value=(strain_id, data_id, inbredset_id),
+ )
+ delete_sample_data(
+ conn=mock_conn,
+ trait_name=35,
+ data="BXD1,18,3,0,M",
+ csv_header="Strain Name,Value,SE,Count,Sex",
+ phenotype_id=10007,
+ )
+ calls = [
+ mocker.call(
+ "DELETE FROM PublishData WHERE " "StrainId = %s AND Id = %s",
+ (strain_id, data_id),
+ ),
+ mocker.call(
+ "DELETE FROM PublishSE WHERE " "StrainId = %s AND DataId = %s",
+ (strain_id, data_id),
+ ),
+ mocker.call(
+ "DELETE FROM NStrain WHERE " "StrainId = %s AND DataId = %s",
+ (strain_id, data_id),
+ ),
+ mocker.call(
+ "DELETE FROM CaseAttributeXRefNew WHERE "
+ "StrainId = %s AND CaseAttributeId = "
+ "(SELECT CaseAttributeId FROM "
+ "CaseAttribute WHERE Name = %s) "
+ "AND InbredSetId = %s",
+ (strain_id, "Sex", inbredset_id),
+ ),
+ ]
+ cursor.execute.assert_has_calls(calls, any_order=False)
+
+
+@pytest.mark.unit_test
+def test_extract_actions():
+ """Test that extracting the correct dict of 'actions' work properly"""
+ assert __extract_actions(
+ original_data="BXD1,18,x,0,x",
+ updated_data="BXD1,x,2,1,F",
+ csv_header="Strain Name,Value,SE,Count,Sex",
+ ) == {
+ "delete": {"data": "BXD1,18", "csv_header": "Strain Name,Value"},
+ "insert": {"data": "BXD1,2,F", "csv_header": "Strain Name,SE,Sex"},
+ "update": {"data": "BXD1,1", "csv_header": "Strain Name,Count"},
+ }
+ assert __extract_actions(
+ original_data="BXD1,18,x,0,x",
+ updated_data="BXD1,19,2,1,F",
+ csv_header="Strain Name,Value,SE,Count,Sex",
+ ) == {
+ "delete": None,
+ "insert": {"data": "BXD1,2,F", "csv_header": "Strain Name,SE,Sex"},
+ "update": {"data": "BXD1,19,1", "csv_header": "Strain Name,Value,Count"},
+ }
+
+
+@pytest.mark.unit_test
+def test_update_sample_data(mocker):
+ """Test that updates work properly"""
+ mock_conn = mocker.MagicMock()
+ strain_id, data_id, inbredset_id = 1, 17373, 20
+ with mock_conn.cursor() as cursor:
+ # cursor.fetchone.side_effect = (0, [19, ], 0)
+ mocker.patch(
+ "gn3.db.sample_data.get_sample_data_ids",
+ return_value=(strain_id, data_id, inbredset_id),
+ )
+ mocker.patch("gn3.db.sample_data.insert_sample_data", return_value=1)
+ mocker.patch("gn3.db.sample_data.delete_sample_data", return_value=1)
+ update_sample_data(
+ conn=mock_conn,
+ trait_name=35,
+ original_data="BXD1,18,x,0,x",
+ updated_data="BXD1,x,2,1,F",
+ csv_header="Strain Name,Value,SE,Count,Sex",
+ phenotype_id=10007,
+ )
+ # pylint: disable=[E1101]
+ gn3.db.sample_data.insert_sample_data.assert_called_once_with(
+ conn=mock_conn,
+ trait_name=35,
+ data="BXD1,2,F",
+ csv_header="Strain Name,SE,Sex",
+ phenotype_id=10007,
+ )
+ # pylint: disable=[E1101]
+ gn3.db.sample_data.delete_sample_data.assert_called_once_with(
+ conn=mock_conn,
+ trait_name=35,
+ data="BXD1,18",
+ csv_header="Strain Name,Value",
+ phenotype_id=10007,
+ )
+ cursor.execute.assert_has_calls(
+ [
+ mocker.call(
+ "UPDATE NStrain SET count = %s "
+ "WHERE StrainId = %s AND DataId = %s",
+ ("1", strain_id, data_id),
+ )
+ ],
+ any_order=False,
+ )
diff --git a/tests/unit/db/test_species.py b/tests/unit/db/test_species.py
index b2c4844..e883b21 100644
--- a/tests/unit/db/test_species.py
+++ b/tests/unit/db/test_species.py
@@ -2,6 +2,8 @@
from unittest import TestCase
from unittest import mock
+import pytest
+
from gn3.db.species import get_chromosome
from gn3.db.species import get_all_species
@@ -9,6 +11,7 @@ from gn3.db.species import get_all_species
class TestChromosomes(TestCase):
"""Test cases for fetching chromosomes"""
+ @pytest.mark.unit_test
def test_get_chromosome_using_species_name(self):
"""Test that the chromosome is fetched using a species name"""
db_mock = mock.MagicMock()
@@ -24,6 +27,7 @@ class TestChromosomes(TestCase):
"Species.Name = 'TestCase' ORDER BY OrderId"
)
+ @pytest.mark.unit_test
def test_get_chromosome_using_group_name(self):
"""Test that the chromosome is fetched using a group name"""
db_mock = mock.MagicMock()
@@ -39,6 +43,7 @@ class TestChromosomes(TestCase):
"InbredSet.Name = 'TestCase' ORDER BY OrderId"
)
+ @pytest.mark.unit_test
def test_get_all_species(self):
"""Test that species are fetched correctly"""
db_mock = mock.MagicMock()
diff --git a/tests/unit/db/test_traits.py b/tests/unit/db/test_traits.py
index 4aa9389..434f758 100644
--- a/tests/unit/db/test_traits.py
+++ b/tests/unit/db/test_traits.py
@@ -1,11 +1,11 @@
"""Tests for gn3/db/traits.py"""
from unittest import mock, TestCase
+import pytest
from gn3.db.traits import (
build_trait_name,
export_trait_data,
export_informative,
set_haveinfo_field,
- update_sample_data,
retrieve_trait_info,
set_confidential_field,
set_homologene_id_field,
@@ -49,6 +49,7 @@ trait_data = {
class TestTraitsDBFunctions(TestCase):
"Test cases for traits functions"
+ @pytest.mark.unit_test
def test_retrieve_publish_trait_info(self):
"""Test retrieval of type `Publish` traits."""
db_mock = mock.MagicMock()
@@ -75,15 +76,15 @@ class TestTraitsDBFunctions(TestCase):
" Publication.Year, PublishXRef.Sequence, Phenotype.Units,"
" PublishXRef.comments"
" FROM"
- " PublishXRef, Publication, Phenotype, PublishFreeze"
+ " PublishXRef, Publication, Phenotype"
" WHERE"
" PublishXRef.Id = %(trait_name)s"
" AND Phenotype.Id = PublishXRef.PhenotypeId"
" AND Publication.Id = PublishXRef.PublicationId"
- " AND PublishXRef.InbredSetId = PublishFreeze.InbredSetId"
- " AND PublishFreeze.Id =%(trait_dataset_id)s"),
+ " AND PublishXRef.InbredSetId = %(trait_dataset_id)s"),
trait_source)
+ @pytest.mark.unit_test
def test_retrieve_probeset_trait_info(self):
"""Test retrieval of type `Probeset` traits."""
db_mock = mock.MagicMock()
@@ -119,6 +120,7 @@ class TestTraitsDBFunctions(TestCase):
"AND ProbeSetFreeze.Name = %(trait_dataset_name)s "
"AND ProbeSet.Name = %(trait_name)s"), trait_source)
+ @pytest.mark.unit_test
def test_retrieve_geno_trait_info(self):
"""Test retrieval of type `Geno` traits."""
db_mock = mock.MagicMock()
@@ -134,14 +136,14 @@ class TestTraitsDBFunctions(TestCase):
"SELECT "
"Geno.name, Geno.chr, Geno.mb, Geno.source2, Geno.sequence "
"FROM "
- "Geno, GenoFreeze, GenoXRef "
+ "Geno INNER JOIN GenoXRef ON GenoXRef.GenoId = Geno.Id "
+ "INNER JOIN GenoFreeze ON GenoFreeze.Id = GenoXRef.GenoFreezeId "
"WHERE "
- "GenoXRef.GenoFreezeId = GenoFreeze.Id "
- "AND GenoXRef.GenoId = Geno.Id "
- "AND GenoFreeze.Name = %(trait_dataset_name)s "
+ "GenoFreeze.Name = %(trait_dataset_name)s "
"AND Geno.Name = %(trait_name)s"),
trait_source)
+ @pytest.mark.unit_test
def test_retrieve_temp_trait_info(self):
"""Test retrieval of type `Temp` traits."""
db_mock = mock.MagicMock()
@@ -154,6 +156,7 @@ class TestTraitsDBFunctions(TestCase):
"SELECT name, description FROM Temp WHERE Name = %(trait_name)s",
trait_source)
+ @pytest.mark.unit_test
def test_build_trait_name_with_good_fullnames(self):
"""
Check that the name is built correctly.
@@ -170,6 +173,7 @@ class TestTraitsDBFunctions(TestCase):
with self.subTest(fullname=fullname):
self.assertEqual(build_trait_name(fullname), expected)
+ @pytest.mark.unit_test
def test_build_trait_name_with_bad_fullnames(self):
"""
Check that an exception is raised if the full name format is wrong.
@@ -179,6 +183,7 @@ class TestTraitsDBFunctions(TestCase):
with self.assertRaises(AssertionError, msg="Name format error"):
build_trait_name(fullname)
+ @pytest.mark.unit_test
def test_retrieve_trait_info(self):
"""Test that information on traits is retrieved as appropriate."""
for threshold, trait_fullname, expected in [
@@ -195,39 +200,7 @@ class TestTraitsDBFunctions(TestCase):
threshold, trait_fullname, db_mock),
expected)
- def test_update_sample_data(self):
- """Test that the SQL queries when calling update_sample_data are called with
- the right calls.
-
- """
- # pylint: disable=C0103
- db_mock = mock.MagicMock()
-
- STRAIN_ID_SQL: str = "UPDATE Strain SET Name = %s WHERE Id = %s"
- PUBLISH_DATA_SQL: str = (
- "UPDATE PublishData SET value = %s "
- "WHERE StrainId = %s AND Id = %s")
- PUBLISH_SE_SQL: str = (
- "UPDATE PublishSE SET error = %s "
- "WHERE StrainId = %s AND DataId = %s")
- N_STRAIN_SQL: str = (
- "UPDATE NStrain SET count = %s "
- "WHERE StrainId = %s AND DataId = %s")
-
- with db_mock.cursor() as cursor:
- type(cursor).rowcount = 1
- self.assertEqual(update_sample_data(
- conn=db_mock, strain_name="BXD11",
- strain_id=10, publish_data_id=8967049,
- value=18.7, error=2.3, count=2),
- (1, 1, 1, 1))
- cursor.execute.assert_has_calls(
- [mock.call(STRAIN_ID_SQL, ('BXD11', 10)),
- mock.call(PUBLISH_DATA_SQL, (18.7, 10, 8967049)),
- mock.call(PUBLISH_SE_SQL, (2.3, 10, 8967049)),
- mock.call(N_STRAIN_SQL, (2, 10, 8967049))]
- )
-
+ @pytest.mark.unit_test
def test_set_haveinfo_field(self):
"""Test that the `haveinfo` field is set up correctly"""
for trait_info, expected in [
@@ -236,6 +209,7 @@ class TestTraitsDBFunctions(TestCase):
with self.subTest(trait_info=trait_info, expected=expected):
self.assertEqual(set_haveinfo_field(trait_info), expected)
+ @pytest.mark.unit_test
def test_set_homologene_id_field(self):
"""Test that the `homologene_id` field is set up correctly"""
for trait_type, trait_info, expected in [
@@ -250,6 +224,7 @@ class TestTraitsDBFunctions(TestCase):
self.assertEqual(
set_homologene_id_field(trait_type, trait_info, db_mock), expected)
+ @pytest.mark.unit_test
def test_set_confidential_field(self):
"""Test that the `confidential` field is set up correctly"""
for trait_type, trait_info, expected in [
@@ -261,6 +236,7 @@ class TestTraitsDBFunctions(TestCase):
self.assertEqual(
set_confidential_field(trait_type, trait_info), expected)
+ @pytest.mark.unit_test
def test_export_trait_data_dtype(self):
"""
Test `export_trait_data` with different values for the `dtype` keyword
@@ -276,6 +252,7 @@ class TestTraitsDBFunctions(TestCase):
export_trait_data(trait_data, samplelist, dtype=dtype),
expected)
+ @pytest.mark.unit_test
def test_export_trait_data_dtype_all_flags(self):
"""
Test `export_trait_data` with different values for the `dtype` keyword
@@ -317,6 +294,7 @@ class TestTraitsDBFunctions(TestCase):
n_exists=nflag),
expected)
+ @pytest.mark.unit_test
def test_export_informative(self):
"""Test that the function exports appropriate data."""
# pylint: disable=W0621
diff --git a/tests/unit/test_authentication.py b/tests/unit/test_authentication.py
index 061b684..59c88ef 100644
--- a/tests/unit/test_authentication.py
+++ b/tests/unit/test_authentication.py
@@ -1,8 +1,10 @@
"""Test cases for authentication.py"""
import json
import unittest
-
from unittest import mock
+
+import pytest
+
from gn3.authentication import AdminRole
from gn3.authentication import DataRole
from gn3.authentication import get_highest_user_access_role
@@ -24,6 +26,7 @@ class TestGetUserMembership(unittest.TestCase):
'"created_timestamp": "Oct 06 2021 06:39PM"}')}
self.conn = conn
+ @pytest.mark.unit_test
def test_user_is_group_member_only(self):
"""Test that a user is only a group member"""
self.assertEqual(
@@ -34,6 +37,7 @@ class TestGetUserMembership(unittest.TestCase):
{"member": True,
"admin": False})
+ @pytest.mark.unit_test
def test_user_is_group_admin_only(self):
"""Test that a user is a group admin only"""
self.assertEqual(
@@ -44,6 +48,7 @@ class TestGetUserMembership(unittest.TestCase):
{"member": False,
"admin": True})
+ @pytest.mark.unit_test
def test_user_is_both_group_member_and_admin(self):
"""Test that a user is both an admin and member of a group"""
self.assertEqual(
@@ -58,6 +63,7 @@ class TestGetUserMembership(unittest.TestCase):
class TestCheckUserAccessRole(unittest.TestCase):
"""Test cases for `get_highest_user_access_role`"""
+ @pytest.mark.unit_test
@mock.patch("gn3.authentication.requests.get")
def test_edit_access(self, requests_mock):
"""Test that the right access roles are set if the user has edit access"""
@@ -79,6 +85,7 @@ class TestCheckUserAccessRole(unittest.TestCase):
"admin": AdminRole.EDIT_ACCESS,
})
+ @pytest.mark.unit_test
@mock.patch("gn3.authentication.requests.get")
def test_no_access(self, requests_mock):
"""Test that the right access roles are set if the user has no access"""
diff --git a/tests/unit/test_commands.py b/tests/unit/test_commands.py
index e644e1a..4dd8735 100644
--- a/tests/unit/test_commands.py
+++ b/tests/unit/test_commands.py
@@ -5,6 +5,7 @@ from dataclasses import dataclass
from datetime import datetime
from typing import Callable
from unittest import mock
+import pytest
from gn3.commands import compose_gemma_cmd
from gn3.commands import compose_rqtl_cmd
from gn3.commands import queue_cmd
@@ -23,6 +24,7 @@ class MockRedis:
class TestCommands(unittest.TestCase):
"""Test cases for commands.py"""
+ @pytest.mark.unit_test
def test_compose_gemma_cmd_no_extra_args(self):
"""Test that the gemma cmd is composed correctly"""
self.assertEqual(
@@ -37,6 +39,7 @@ class TestCommands(unittest.TestCase):
"-p /tmp/gf13Ad0tRX/phenofile.txt"
" -gk"))
+ @pytest.mark.unit_test
def test_compose_gemma_cmd_extra_args(self):
"""Test that the gemma cmd is composed correctly"""
self.assertEqual(
@@ -54,6 +57,7 @@ class TestCommands(unittest.TestCase):
"-p /tmp/gf13Ad0tRX/phenofile.txt"
" -gk"))
+ @pytest.mark.unit_test
def test_compose_rqtl_cmd(self):
"""Test that the R/qtl cmd is composed correctly"""
self.assertEqual(
@@ -78,6 +82,7 @@ class TestCommands(unittest.TestCase):
"--addcovar")
)
+ @pytest.mark.unit_test
def test_queue_cmd_exception_raised_when_redis_is_down(self):
"""Test that the correct error is raised when Redis is unavailable"""
self.assertRaises(RedisConnectionError,
@@ -88,10 +93,10 @@ class TestCommands(unittest.TestCase):
hset=mock.MagicMock(),
rpush=mock.MagicMock()))
+ @pytest.mark.unit_test
@mock.patch("gn3.commands.datetime")
@mock.patch("gn3.commands.uuid4")
- def test_queue_cmd_correct_calls_to_redis(self, mock_uuid4,
- mock_datetime):
+ def test_queue_cmd_correct_calls_to_redis(self, mock_uuid4, mock_datetime):
"""Test that the cmd is queued properly"""
mock_uuid4.return_value = 1234
mock_datetime.now.return_value = datetime.fromisoformat('2021-02-12 '
@@ -106,12 +111,13 @@ class TestCommands(unittest.TestCase):
job_queue="GN2::job-queue"),
actual_unique_id)
mock_redis_conn.hset.assert_has_calls(
- [mock.call(name=actual_unique_id, key="cmd", value="ls"),
+ [mock.call(name=actual_unique_id, key="cmd", value='"ls"'),
mock.call(name=actual_unique_id, key="result", value=""),
mock.call(name=actual_unique_id, key="status", value="queued")])
mock_redis_conn.rpush.assert_has_calls(
[mock.call("GN2::job-queue", actual_unique_id)])
+ @pytest.mark.unit_test
@mock.patch("gn3.commands.datetime")
@mock.patch("gn3.commands.uuid4")
def test_queue_cmd_right_calls_to_redis_with_email(self,
@@ -132,21 +138,23 @@ class TestCommands(unittest.TestCase):
email="me@me.com"),
actual_unique_id)
mock_redis_conn.hset.assert_has_calls(
- [mock.call(name=actual_unique_id, key="cmd", value="ls"),
+ [mock.call(name=actual_unique_id, key="cmd", value='"ls"'),
mock.call(name=actual_unique_id, key="result", value=""),
mock.call(name=actual_unique_id, key="status", value="queued"),
mock.call(name=actual_unique_id, key="email", value="me@me.com")
- ])
+ ], any_order=True)
mock_redis_conn.rpush.assert_has_calls(
[mock.call("GN2::job-queue", actual_unique_id)])
+ @pytest.mark.unit_test
def test_run_cmd_correct_input(self):
"""Test that a correct cmd is processed correctly"""
- self.assertEqual(run_cmd("echo test"),
+ self.assertEqual(run_cmd('"echo test"'),
{"code": 0, "output": "test\n"})
+ @pytest.mark.unit_test
def test_run_cmd_incorrect_input(self):
"""Test that an incorrect cmd is processed correctly"""
- result = run_cmd("echoo test")
+ result = run_cmd('"echoo test"')
self.assertEqual(127, result.get("code"))
self.assertIn("not found", result.get("output"))
diff --git a/tests/unit/test_csvcmp.py b/tests/unit/test_csvcmp.py
new file mode 100644
index 0000000..c2fda6b
--- /dev/null
+++ b/tests/unit/test_csvcmp.py
@@ -0,0 +1,170 @@
+"""Tests for gn3.csvcmp"""
+import pytest
+
+from gn3.csvcmp import clean_csv_text
+from gn3.csvcmp import csv_diff
+from gn3.csvcmp import extract_invalid_csv_headers
+from gn3.csvcmp import extract_strain_name
+from gn3.csvcmp import fill_csv
+from gn3.csvcmp import get_allowable_sampledata_headers
+from gn3.csvcmp import remove_insignificant_edits
+
+
+@pytest.mark.unit_test
+def test_fill_csv():
+ """Test that filling a csv works properly"""
+ test_input = """
+Strain Name,Value,SE,Count,Sex
+BXD1,18,x,0,
+BXD12,16,x,x,
+BXD14,15,x,x,
+BXD15,14,x,x
+"""
+ expected_output = """Strain Name,Value,SE,Count,Sex
+BXD1,18,x,0,x
+BXD12,16,x,x,x
+BXD14,15,x,x,x
+BXD15,14,x,x,x"""
+ assert fill_csv(test_input, width=5, value="x") == expected_output
+
+
+@pytest.mark.unit_test
+def test_remove_insignificant_data():
+ """Test that values outside ε are removed/ ignored"""
+ diff_data = {
+ "Additions": [],
+ "Deletions": [],
+ "Modifications": [
+ {"Current": "1.000001,3", "Original": "1,3"},
+ {"Current": "1,3", "Original": "1.000001,3"},
+ {"Current": "2.000001,3", "Original": "2,2"},
+ {"Current": "1.01,3", "Original": "1,2"},
+ ],
+ }
+ expected_json = {
+ "Additions": [],
+ "Deletions": [],
+ "Modifications": [
+ {"Current": "2,3", "Original": "2,2"},
+ {"Current": "1.01,3", "Original": "1,2"},
+ ],
+ }
+ assert remove_insignificant_edits(diff_data) == expected_json
+
+
+@pytest.mark.unit_test
+def test_csv_diff_same_columns():
+ """Test csv diffing on data with the same number of columns"""
+ assert csv_diff(base_csv="a,b \n1,2\n", delta_csv="a,b\n1,3") == {
+ "Additions": [],
+ "Deletions": [],
+ "Columns": "",
+ "Modifications": [{"Current": "1,3", "Original": "1,2"}],
+ }
+
+
+@pytest.mark.unit_test
+def test_csv_diff_different_columns():
+ """Test csv diffing on data with different columns"""
+ base_csv = """
+Strain Name,Value,SE,Count
+BXD1,18,x,0
+BXD12,16,x,x
+BXD14,15,x,x
+BXD15,14,x,x
+"""
+ delta_csv = """Strain Name,Value,SE,Count,Sex
+BXD1,18,x,0
+BXD12,16,x,x,1
+BXD14,15,x,x
+BXD15,14,x,x"""
+ assert csv_diff(base_csv=base_csv, delta_csv=delta_csv) == {
+ "Additions": [],
+ "Columns": "Strain Name,Value,SE,Count,Sex",
+ "Deletions": [],
+ "Modifications": [{"Current": "BXD12,16,x,x,1", "Original": "BXD12,16,x,x,x"}],
+ }
+
+
+@pytest.mark.unit_test
+def test_csv_diff_only_column_change():
+ """Test csv diffing when only the column header change"""
+ base_csv = """
+Strain Name,Value,SE,Count
+BXD1,18,x,0
+BXD12,16,x,x
+BXD14,15,x,x
+BXD15,14,x,x
+"""
+ delta_csv = """Strain Name,Value,SE,Count,Sex
+BXD1,18,x,0
+BXD12,16,x,x
+BXD14,15,x,x
+BXD15,14,x,x
+"""
+ assert csv_diff(base_csv=base_csv, delta_csv=delta_csv) == {
+ "Additions": [],
+ "Deletions": [],
+ "Modifications": [],
+ }
+
+
+@pytest.mark.unit_test
+def test_extract_strain_name():
+ """Test that the strain's name is extracted given a csv header"""
+ assert (
+ extract_strain_name(csv_header="Strain Name,Value,SE,Count", data="BXD1,18,x,0")
+ == "BXD1"
+ )
+
+
+@pytest.mark.unit_test
+def test_get_allowable_csv_headers(mocker):
+ """Test that all the csv headers are fetched properly"""
+ mock_conn = mocker.MagicMock()
+ expected_values = [
+ "Strain Name", "Value", "SE", "Count",
+ "Condition", "Tissue", "Sex", "Age",
+ "Ethn.", "PMI (hrs)", "pH", "Color",
+ ]
+ with mock_conn.cursor() as cursor:
+ cursor.fetchall.return_value = (
+ ('Condition',), ('Tissue',), ('Sex',),
+ ('Age',), ('Ethn.',), ('PMI (hrs)',), ('pH',), ('Color',))
+ assert get_allowable_sampledata_headers(mock_conn) == expected_values
+ cursor.execute.assert_called_once_with(
+ "SELECT Name from CaseAttribute")
+
+
+@pytest.mark.unit_test
+def test_extract_invalid_csv_headers_with_some_wrong_headers():
+ """Test that invalid column headers are extracted correctly from a csv
+string"""
+ allowed_headers = [
+ "Strain Name", "Value", "SE", "Count",
+ "Condition", "Tissue", "Sex", "Age",
+ "Ethn.", "PMI (hrs)", "pH", "Color",
+ ]
+
+ csv_text = "Strain Name, Value, SE, Colour"
+ assert extract_invalid_csv_headers(allowed_headers, csv_text) == ["Colour"]
+
+
+@pytest.mark.unit_test
+def test_clean_csv():
+ """Test that csv text input is cleaned properly"""
+ csv_text = """
+Strain Name,Value,SE,Count
+BXD1,18,x ,0
+BXD12, 16,x,x
+BXD14,15 ,x,x
+BXD15,14,x,
+"""
+ expected_csv = """Strain Name,Value,SE,Count
+BXD1,18,x,0
+BXD12,16,x,x
+BXD14,15,x,x
+BXD15,14,x,"""
+
+ assert clean_csv_text(csv_text) == expected_csv
+ assert clean_csv_text("a,b \n1,2\n") == "a,b\n1,2"
diff --git a/tests/unit/test_data_helpers.py b/tests/unit/test_data_helpers.py
index 39aea45..e7c3ae9 100644
--- a/tests/unit/test_data_helpers.py
+++ b/tests/unit/test_data_helpers.py
@@ -4,13 +4,16 @@ Test functions in gn3.data_helpers
from unittest import TestCase
-from gn3.data_helpers import partition_all, parse_csv_line
+import pytest
+
+from gn3.data_helpers import partition_by, partition_all, parse_csv_line
class TestDataHelpers(TestCase):
"""
Test functions in gn3.data_helpers
"""
+ @pytest.mark.unit_test
def test_partition_all(self):
"""
Test that `gn3.data_helpers.partition_all` partitions sequences as expected.
@@ -34,8 +37,9 @@ class TestDataHelpers(TestCase):
(13, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
((0, 1, 2, 3, 4, 5, 6, 7, 8, 9), ))):
with self.subTest(n=count, items=items):
- self.assertEqual(partition_all(count, items), expected)
+ self.assertEqual(tuple(partition_all(count, items)), expected)
+ @pytest.mark.unit_test
def test_parse_csv_line(self):
"""
Test parsing a single line from a CSV file
@@ -59,3 +63,32 @@ class TestDataHelpers(TestCase):
parse_csv_line(
line=line, delimiter=delimiter, quoting=quoting),
expected)
+
+ @pytest.mark.unit_test
+ def test_partition_by(self):
+ """
+ Test that `partition_by` groups the data using the given predicate
+
+ Given:
+ - `part_fn`: a predicate funtion that return boolean True/False
+ - `items`: a sequence of items
+ When:
+ - the partitioning predicate function and the sequence of items are
+ passed to the `partition_by` function
+ Then:
+ - the result is a tuple, with sub-tuples containing the data in the
+ original sequence. Each sub-tuple is a partition, ending as soon as
+ the next value in the sequence, when passed to `part_fn`, returns
+ boolean `True`.
+ """
+ for part_fn, items, expected in (
+ (lambda s: s.startswith("----"),
+ ("------", "a", "b", "-----", "c", "----", "d", "e", "---",
+ "f"),
+ (("------", "a", "b"), ("-----", "c"),
+ ("----", "d", "e", "---", "f"))),
+ (lambda x: (x % 2) == 0,
+ (0, 1, 3, 2, 4, 5, 7, 6, 9, 1),
+ ((0, 1, 3), (2,), (4, 5, 7), (6, 9, 1))),):
+ with self.subTest(items=items):
+ self.assertEqual(partition_by(part_fn, items), expected)
diff --git a/tests/unit/test_db_utils.py b/tests/unit/test_db_utils.py
index 0f2de9e..7dc66c0 100644
--- a/tests/unit/test_db_utils.py
+++ b/tests/unit/test_db_utils.py
@@ -2,9 +2,10 @@
from unittest import TestCase
from unittest import mock
-
from types import SimpleNamespace
+import pytest
+
from gn3.db_utils import database_connector
from gn3.db_utils import parse_db_url
@@ -12,6 +13,7 @@ from gn3.db_utils import parse_db_url
class TestDatabase(TestCase):
"""class contains testd for db connection functions"""
+ @pytest.mark.unit_test
@mock.patch("gn3.db_utils.mdb")
@mock.patch("gn3.db_utils.parse_db_url")
def test_database_connector(self, mock_db_parser, mock_sql):
@@ -26,8 +28,9 @@ class TestDatabase(TestCase):
mock_sql.connect.assert_called_with(
"localhost", "guest", "4321", "users")
self.assertIsInstance(
- results, tuple, "database not created successfully")
+ results, SimpleNamespace, "database not created successfully")
+ @pytest.mark.unit_test
@mock.patch("gn3.db_utils.SQL_URI",
"mysql://username:4321@localhost/test")
def test_parse_db_url(self):
diff --git a/tests/unit/test_file_utils.py b/tests/unit/test_file_utils.py
index 75be4f6..2c6f0b6 100644
--- a/tests/unit/test_file_utils.py
+++ b/tests/unit/test_file_utils.py
@@ -5,6 +5,7 @@ import unittest
from dataclasses import dataclass
from typing import Callable
from unittest import mock
+import pytest
from gn3.fs_helpers import extract_uploaded_file
from gn3.fs_helpers import get_dir_hash
from gn3.fs_helpers import jsonfile_to_dict
@@ -21,17 +22,20 @@ class MockFile:
class TestFileUtils(unittest.TestCase):
"""Test cases for procedures defined in fs_helpers.py"""
+ @pytest.mark.unit_test
def test_get_dir_hash(self):
"""Test that a directory is hashed correctly"""
test_dir = os.path.join(os.path.dirname(__file__), "test_data")
self.assertEqual("3aeafab7d53b4f76d223366ae7ee9738",
get_dir_hash(test_dir))
+ @pytest.mark.unit_test
def test_get_dir_hash_non_existent_dir(self):
"""Test thata an error is raised when the dir does not exist"""
self.assertRaises(FileNotFoundError, get_dir_hash,
"/non-existent-file")
+ @pytest.mark.unit_test
def test_jsonfile_to_dict(self):
"""Test that a json file is parsed correctly""" ""
json_file = os.path.join(os.path.dirname(__file__), "test_data",
@@ -39,12 +43,14 @@ class TestFileUtils(unittest.TestCase):
self.assertEqual("Longer description",
jsonfile_to_dict(json_file).get("description"))
+ @pytest.mark.unit_test
def test_jsonfile_to_dict_nonexistent_file(self):
"""Test that a ValueError is raised when the json file is
non-existent"""
self.assertRaises(FileNotFoundError, jsonfile_to_dict,
"/non-existent-dir")
+ @pytest.mark.unit_test
@mock.patch("gn3.fs_helpers.tarfile")
@mock.patch("gn3.fs_helpers.secure_filename")
def test_extract_uploaded_file(self, mock_file, mock_tarfile):
@@ -60,11 +66,12 @@ non-existent"""
"upload-data.tar.gz")
mock_tarfile.open.assert_called_once_with("/tmp/abcdef-abcdef/"
"upload-data.tar.gz")
- mock_tarfile.open.return_value.extractall.assert_called_once_with(
+ mock_tarfile.open.return_value.__enter__.return_value.extractall.assert_called_once_with(
path='/tmp/abcdef-abcdef')
mock_file.assert_called_once_with("upload-data.tar.gz")
self.assertEqual(result, {"status": 0, "token": "abcdef-abcdef"})
+ @pytest.mark.unit_test
@mock.patch("gn3.fs_helpers.secure_filename")
def test_extract_uploaded_file_non_existent_gzip(self, mock_file):
"""Test that the right error message is returned when there is a problem
@@ -78,13 +85,15 @@ extracting the file"""
"error": "gzip failed to unpack file"
})
+ @pytest.mark.unit_test
def test_cache_ipfs_file_cache_hit(self):
"""Test that the correct file location is returned if there's a cache hit"""
# Create empty file
test_dir = "/tmp/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc-test"
if not os.path.exists(test_dir):
os.mkdir(test_dir)
- open(f"{test_dir}/genotype.txt", "a").close()
+ with open(f"{test_dir}/genotype.txt", "a", encoding="utf8"):
+ pass
file_loc = cache_ipfs_file(
ipfs_file=("/ipfs/"
"QmQPeNsJPyVWPFDVHb"
@@ -96,6 +105,7 @@ extracting the file"""
os.rmdir(test_dir)
self.assertEqual(file_loc, f"{test_dir}/genotype.txt")
+ @pytest.mark.unit_test
@mock.patch("gn3.fs_helpers.ipfshttpclient")
def test_cache_ipfs_file_cache_miss(self,
mock_ipfs):
diff --git a/tests/unit/test_heatmaps.py b/tests/unit/test_heatmaps.py
index 03fd4a6..8781d6f 100644
--- a/tests/unit/test_heatmaps.py
+++ b/tests/unit/test_heatmaps.py
@@ -1,5 +1,9 @@
"""Module contains tests for gn3.heatmaps.heatmaps"""
from unittest import TestCase
+
+import pytest
+from numpy.testing import assert_allclose
+
from gn3.heatmaps import (
cluster_traits,
get_loci_names,
@@ -24,7 +28,8 @@ slinked = (
class TestHeatmap(TestCase):
"""Class for testing heatmap computation functions"""
- def test_cluster_traits(self):
+ @pytest.mark.unit_test
+ def test_cluster_traits(self): # pylint: disable=R0201
"""
Test that the clustering is working as expected.
"""
@@ -39,7 +44,7 @@ class TestHeatmap(TestCase):
(6.84118, 7.08432, 7.59844, 7.08229, 7.26774, 7.24991),
(9.45215, 10.6943, 8.64719, 10.1592, 7.75044, 8.78615),
(7.04737, 6.87185, 7.58586, 6.92456, 6.84243, 7.36913)]
- self.assertEqual(
+ assert_allclose(
cluster_traits(traits_data_list),
((0.0, 0.20337048635536847, 0.16381088984330505, 1.7388553629398245,
1.5025235756329178, 0.6952839500255574, 1.271661230252733,
@@ -73,11 +78,13 @@ class TestHeatmap(TestCase):
1.7413442197913358, 0.33370067057028485, 1.3256191648260216,
0.0)))
+ @pytest.mark.unit_test
def test_compute_heatmap_order(self):
"""Test the orders."""
self.assertEqual(
compute_traits_order(slinked), (0, 2, 1, 7, 5, 9, 3, 6, 8, 4))
+ @pytest.mark.unit_test
def test_retrieve_samples_and_values(self):
"""Test retrieval of samples and values."""
for orders, slist, tdata, expected in [
@@ -103,6 +110,7 @@ class TestHeatmap(TestCase):
self.assertEqual(
retrieve_samples_and_values(orders, slist, tdata), expected)
+ @pytest.mark.unit_test
def test_get_lrs_from_chr(self):
"""Check that function gets correct LRS values"""
for trait, chromosome, expected in [
@@ -117,6 +125,7 @@ class TestHeatmap(TestCase):
with self.subTest(trait=trait, chromosome=chromosome):
self.assertEqual(get_lrs_from_chr(trait, chromosome), expected)
+ @pytest.mark.unit_test
def test_process_traits_data_for_heatmap(self):
"""Check for correct processing of data for heatmap generation."""
self.assertEqual(
@@ -129,6 +138,7 @@ class TestHeatmap(TestCase):
[[0.5, 0.579, 0.5],
[0.5, 0.5, 0.5]]])
+ @pytest.mark.unit_test
def test_get_loci_names(self):
"""Check that loci names are retrieved correctly."""
for organised, expected in (