From fd39b8ce0ad86c85636a09ca3ac15975fabf776a Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 25 Mar 2022 16:13:00 +0300 Subject: Create a fixture for pcorrs data --- tests/integration/conftest.py | 24 + tests/integration/test_data/pcorrs_data.json | 1039 ++++++++++++++++++++++++ tests/integration/test_partial_correlations.py | 5 +- 3 files changed, 1066 insertions(+), 2 deletions(-) create mode 100644 tests/integration/test_data/pcorrs_data.json (limited to 'tests/integration') diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 4274233..90cf985 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -78,3 +78,27 @@ def db_conn(): # # b.) Delete the test database db_cursor.execute(f"DROP DATABASE IF EXISTS {test_db_name}") + +@pytest.fixture(scope="function") +def db_conn_with_pcorrs_data(db_conn): + """Fixture with data for partial correlations tests""" + with open( + "tests/integration/test_data/pcorrs_data.json", + encoding="utf8") as data_file: + data = json.loads(data_file.read()) + with db_conn.cursor() as cursor: + for item in data: + row_keys = item["rows"][0].keys() + query = ( + f"INSERT INTO {item['dbtable']}({', '.join(row_keys)}) " + f"VALUES ({', '.join(['%s' for key in row_keys])})") + cursor.executemany( + query, + tuple( + tuple(row[key] for key in row_keys) + for row in item["rows"])) + + yield db_conn + + for item in data: + cursor.execute(f"DELETE FROM {item['dbtable']}") diff --git a/tests/integration/test_data/pcorrs_data.json b/tests/integration/test_data/pcorrs_data.json new file mode 100644 index 0000000..8f748fc --- /dev/null +++ b/tests/integration/test_data/pcorrs_data.json @@ -0,0 +1,1039 @@ +[ + { + "dbtable": "Phenotype", + "rows": [ + { + "Id": 16472, + "Pre_publication_description": "Central nervous system, be ...", + "Post_publication_description": "Central nervous system, ...", + "Original_description": "Original post publication descrip ...", + "Units": "Unknown", + "Pre_publication_abbreviation": "Learning3", + "Post_publication_abbreviation": "Touches_N", + "Lab_code": null, + "Submitter": "synomehbp", + "Owner": null, + "Authorized_Users": "synomehbp" + }, + { + "Id": 16475, + "Pre_publication_description": "Central nervous system, be ...", + "Post_publication_description": "Central nervous system, b ...", + "Original_description": "Original post publication descrip ...", + "Units": "Unknown", + "Pre_publication_abbreviation": "Learning6", + "Post_publication_abbreviation": "Final_Pretrain_Blank_Latency_S", + "Lab_code": null, + "Submitter": "synomehbp", + "Owner": null, + "Authorized_Users": "synomehbp" + }] + }, + { + "dbtable": "InbredSet", + "rows": [ + { + "Id": 1, + "InbredSetId": 1, + "InbredSetName": "BXD", + "Name": "BXD", + "SpeciesId": 1, + "FullName": "BXD Family", + "public": 2, + "MappingMethodId": 1, + "GeneticType": "riset", + "Family": "Reference Populations", + "FamilyOrder": 1, + "MenuOrderId": 0, + "InbredSetCode": "BXD" + }] + }, + { + "dbtable": "PublishXRef", + "rows": [ + { + "Id": 17937, + "InbredSetId": 1, + "PhenotypeId": 16472, + "PublicationId": 13554, + "DataId": 41005366, + "mean": 229.93754196166992, + "Locus": "16p_no_data", + "LRS": 23.7705104960664, + "additive": -46.0108582181818, + "Sequence": 1, + "comments": "a publish trait" + }, + { + "Id": 17940, + "InbredSetId": 1, + "PhenotypeId": 16475, + "PublicationId": 13557, + "DataId": 41005369, + "mean": 8.97237495581309, + "Locus": "rs30305830", + "LRS": 18.3037843139756, + "additive": -1.79666089108911, + "Sequence": 1, + "comments": "a publish trait" + }] + }, + { + "dbtable": "Publication", + "rows": [ + { + "Id": 13554, + "PubMed_ID": null, + "Abstract": "SYNOME (Partner 97). Since April 2014, when ...", + "Authors": "Horner A, Kopanitsa M, McLaren R, Human Brain Project Task 1.1.7", + "Title": "HBP MAPGENCO BXD study", + "Journal": null, + "Volume": null, + "Pages": null, + "Month": null, + "Year": 2015 + }, + { + "Id": 13557, + "PubMed_ID": null, + "Abstract": "SYNOME (Partner 97). Since April 2014, when ...", + "Authors": "Horner A, Kopanitsa M, McLaren R, Human Brain Project Task 1.1.7", + "Title": "HBP MAPGENCO BXD study", + "Journal": null, + "Volume": null, + "Pages": null, + "Month": null, + "Year": 2015 + }] + }, + { + "dbtable": "PublishFreeze", + "rows": [ + { + "Id": 1, + "Name": "BXDPublish", + "FullName": "BXD Published Phenotypes", + "ShortName": "BXDPublish", + "CreateTime": "2004-07-17", + "public": 2, + "InbredSetId": 1, + "confidentiality": 0, + "AuthorisedUsers": null + } + ] + }, + { + "dbtable": "ProbeSet", + "rows": [ + { + "Id": 162363, + "ChipId":7, + "Name": "ILM105290026", + "TargetId": "GI_38090455-S", + "Symbol": "Gm1151", + "description": "gene model 1151, (NCBI)", + "Chr": 10, + "Mb":36.833229, + "Chr_2016": 10, + "Mb_2016": 36.553035, + "alias": "", + "GeneId": 382362, + "GenbankId": null, + "SNP": null, + "BlatSeq": "GATGGTGACCGTCTTATCACAGAACCTCTGCCGGAACTACAGCTGGTGGA", + "TargetSeq": "", + "UniGeneId": null, + "Strand_Probe": "+", + "Strand_Gene": null, + "OMIM": "", + "comments": "", + "Probe_set_target_region": null, + "Probe_set_specificity": 5, + "Probe_set_BLAT_score": 50, + "Probe_set_Blat_Mb_start": 36.833229, + "Probe_set_Blat_Mb_end": 36.833279, + "Probe_set_Blat_Mb_start_2016": 36.553035, + "Probe_set_Blat_Mb_end_2016": 36.553085, + "Probe_set_strand": "+", + "Probe_set_Note_by_RW": null, + "flag": 0, + "Symbol_H": null, + "description_H": null, + "chromosome_H": null, + "MB_H": null, + "alias_H": null, + "GeneId_H": null, + "chr_num": 10, + "name_num": 4294967290, + "Probe_Target_Description": "exon 5", + "RefSeq_TranscriptId": "XM_356462", + "ENSEMBLGeneId": null, + "Chr_mm8": 10, + "Mb_mm8": 36.522645, + "Probe_set_Blat_Mb_start_mm8": 36.522645, + "Probe_set_Blat_Mb_end_mm8": 36.522695, + "HomoloGeneID": null, + "Biotype_ENS": null, + "ProteinID": null, + "ProteinName": null, + "UniProtID": null, + "Flybase_Id": null, + "RGD_ID": null, + "HMDB_ID": null, + "Confidence": null, + "ChEBI_ID": null, + "ChEMBL_ID": null, + "CAS_number": null, + "PubChem_ID": null, + "ChemSpider_ID": null, + "UNII_ID": null, + "EC_number": null, + "KEGG_ID": null, + "Molecular_Weight": null, + "Nugowiki_ID": null, + "Type": null, + "Tissue": null, + "PrimaryName": null, + "SecondaryNames": null, + "PeptideSequence": null + }, + { + "Id": "162364", + "ChipId": "7", + "Name": "ILM610369", + "TargetId": "scl0011717.2_283-S", + "Symbol": "Ampd3", + "description": "AMP deaminase 3", + "Chr": "7", + "Mb": "110.80792", + "Chr_2016": "7", + "Mb_2016": "117.951434", + "alias": "", + "GeneId": "11717", + "GenbankId": "D88994|D85596|BC056380|BC040366|BC007183|AK133465|", + "SNP": null, + "BlatSeq": "ACCGATGACCCCATGCAGTTTCACTACACAAAGAAGCGCTCATGGAGGAG", + "TargetSeq": "TACATGTCTCTCTCTCTACCGATGACCCCATGCAGTTTCACTACACAAAGAAGCGCTCATGGAGGAGTAC", + "UniGeneId": "Mm.3238", + "Strand_Probe": "+", + "Strand_Gene": "+", + "OMIM": "102772", + "comments": "", + "Probe_set_target_region": null, + "Probe_set_specificity": "5", + "Probe_set_BLAT_score": "33", + "Probe_set_Blat_Mb_start": "110.80792", + "Probe_set_Blat_Mb_end": "110.807953", + "Probe_set_Blat_Mb_start_2016": "117.951434", + "Probe_set_Blat_Mb_end_2016": "117.951467", + "Probe_set_strand": "+", + "Probe_set_Note_by_RW": null, + "flag": "0", + "Symbol_H": null, + "description_H": null, + "chromosome_H": null, + "MB_H": null, + "alias_H": null, + "GeneId_H": null, + "chr_num": "7", + "name_num": "4294967290", + "Probe_Target_Description": "exon 14", + "RefSeq_TranscriptId": "NM_009667", + "ENSEMBLGeneId": null, + "Chr_mm8": "7", + "Mb_mm8": "110.599097", + "Probe_set_Blat_Mb_start_mm8": "110.599097", + "Probe_set_Blat_Mb_end_mm8": "110.59913", + "HomoloGeneID": "408", + "Biotype_ENS": null, + "ProteinID": null, + "ProteinName": null, + "UniProtID": null, + "Flybase_Id": null, + "RGD_ID": null, + "HMDB_ID": null, + "Confidence": null, + "ChEBI_ID": null, + "ChEMBL_ID": null, + "CAS_number": null, + "PubChem_ID": null, + "ChemSpider_ID": null, + "UNII_ID": null, + "EC_number": null, + "KEGG_ID": null, + "Molecular_Weight": null, + "Nugowiki_ID": null, + "Type": null, + "Tissue": null, + "PrimaryName": null, + "SecondaryNames": null, + "PeptideSequence": null + }, + { + "Id": "162365", + "ChipId": "7", + "Name": "ILM1450014", + "TargetId": "scl52892.1.1_103-S", + "Symbol": "D830016O14Rik", + "description": "RIKEN cDNA D830016O14 gene", + "Chr": "19", + "Mb": "7.325407", + "Chr_2016": "19", + "Mb_2016": "7.399897", + "alias": "", + "GeneId": "319413", + "GenbankId": null, + "SNP": null, + "BlatSeq": "GGTGTCTTTAACAAATCCCTCCAAAGTGAGCTTAATTTGACAAACATGGA", + "TargetSeq": "AAAAGACTTTGGTGTCTTTAACAAATCCCTCCAAAGTGAGCTTAATTTGACAAACATGGAAATAAAAGCT", + "UniGeneId": null, + "Strand_Probe": "-", + "Strand_Gene": null, + "OMIM": "", + "comments": "", + "Probe_set_target_region": null, + "Probe_set_specificity": "5", + "Probe_set_BLAT_score": "50", + "Probe_set_Blat_Mb_start": "7.325407", + "Probe_set_Blat_Mb_end": "7.325457", + "Probe_set_Blat_Mb_start_2016": "7.399897", + "Probe_set_Blat_Mb_end_2016": "7.399947", + "Probe_set_strand": "-", + "Probe_set_Note_by_RW": null, + "flag": "0", + "Symbol_H": null, + "description_H": null, + "chromosome_H": null, + "MB_H": null, + "alias_H": null, + "GeneId_H": null, + "chr_num": "19", + "name_num": "4294967290", + "Probe_Target_Description": "intron 2", + "RefSeq_TranscriptId": "NM_176907", + "ENSEMBLGeneId": null, + "Chr_mm8": "19", + "Mb_mm8": "7.392451", + "Probe_set_Blat_Mb_start_mm8": "7.392451", + "Probe_set_Blat_Mb_end_mm8": "7.392501", + "HomoloGeneID": null, + "Biotype_ENS": null, + "ProteinID": null, + "ProteinName": null, + "UniProtID": null, + "Flybase_Id": null, + "RGD_ID": null, + "HMDB_ID": null, + "Confidence": null, + "ChEBI_ID": null, + "ChEMBL_ID": null, + "CAS_number": null, + "PubChem_ID": null, + "ChemSpider_ID": null, + "UNII_ID": null, + "EC_number": null, + "KEGG_ID": null, + "Molecular_Weight": null, + "Nugowiki_ID": null, + "Type": null, + "Tissue": null, + "PrimaryName": null, + "SecondaryNames": null, + "PeptideSequence": null + }, + { + "Id": "162366", + "ChipId": "7", + "Name": "ILM380019", + "TargetId": "scl0012946.2_3-S", + "Symbol": "Crry", + "description": "complement receptor related protein", + "Chr": "1", + "Mb": "195.131336", + "Chr_2016": "1", + "Mb_2016": "196.95753", + "alias": "MGC102484; Mcp; mCRY", + "GeneId": "12946", + "GenbankId": null, + "SNP": null, + "BlatSeq": "CGGAACCCAGCGCCATTTCTGGGTGGGACTGCTTTCTACACCATTTGCCG", + "TargetSeq": "AGAGGAAGTTTTATTCCGGAACCCAGCGCCATTTCTGGGTGGGACTGCTTTCTACACCATTTGCCGTAAA", + "UniGeneId": "Mm.301652", + "Strand_Probe": "-", + "Strand_Gene": "-", + "OMIM": "", + "comments": "", + "Probe_set_target_region": null, + "Probe_set_specificity": "5", + "Probe_set_BLAT_score": "50", + "Probe_set_Blat_Mb_start": "195.131336", + "Probe_set_Blat_Mb_end": "195.131386", + "Probe_set_Blat_Mb_start_2016": "196.95753", + "Probe_set_Blat_Mb_end_2016": "196.95758", + "Probe_set_strand": "-", + "Probe_set_Note_by_RW": null, + "flag": "0", + "Symbol_H": null, + "description_H": null, + "chromosome_H": null, + "MB_H": null, + "alias_H": null, + "GeneId_H": null, + "chr_num": "1", + "name_num": "4294967290", + "Probe_Target_Description": "5' UTR", + "RefSeq_TranscriptId": "NM_013499", + "ENSEMBLGeneId": null, + "Chr_mm8": "1", + "Mb_mm8": "196.83206", + "Probe_set_Blat_Mb_start_mm8": "196.83206", + "Probe_set_Blat_Mb_end_mm8": "196.83211", + "HomoloGeneID": null, + "Biotype_ENS": null, + "ProteinID": null, + "ProteinName": null, + "UniProtID": null, + "Flybase_Id": null, + "RGD_ID": null, + "HMDB_ID": null, + "Confidence": null, + "ChEBI_ID": null, + "ChEMBL_ID": null, + "CAS_number": null, + "PubChem_ID": null, + "ChemSpider_ID": null, + "UNII_ID": null, + "EC_number": null, + "KEGG_ID": null, + "Molecular_Weight": null, + "Nugowiki_ID": null, + "Type": null, + "Tissue": null, + "PrimaryName": null, + "SecondaryNames": null, + "PeptideSequence": null + }, + { + "Id": "162367", + "ChipId": "7", + "Name": "ILM100430441", + "TargetId": "scl18939.11_88-S", + "Symbol": "Ehf", + "description": "ets homologous factor", + "Chr": "2", + "Mb": "103.263355", + "Chr_2016": "2", + "Mb_2016": "103.103512", + "alias": "9030625L19Rik; AU019492; ESE3; ESEJ", + "GeneId": "13661", + "GenbankId": "BC008249|BC006789|BC005520|AF035527|", + "SNP": null, + "BlatSeq": "CCACCCTACAGACTAAATGTTGTAACAGAACATGGACAGCTTTGGTATCT", + "TargetSeq": "CCTTCCTTGGGATAATCCACCCTACAGACTAAATGTTGTAACAGAACATGGACAGCTTTGGTATCTGCTT", + "UniGeneId": "Mm.10724", + "Strand_Probe": "-", + "Strand_Gene": "-", + "OMIM": "605439", + "comments": "", + "Probe_set_target_region": null, + "Probe_set_specificity": "5", + "Probe_set_BLAT_score": "50", + "Probe_set_Blat_Mb_start": "103.263355", + "Probe_set_Blat_Mb_end": "103.263405", + "Probe_set_Blat_Mb_start_2016": "103.103512", + "Probe_set_Blat_Mb_end_2016": "103.103562", + "Probe_set_strand": "-", + "Probe_set_Note_by_RW": null, + "flag": "0", + "Symbol_H": null, + "description_H": null, + "chromosome_H": null, + "MB_H": null, + "alias_H": null, + "GeneId_H": null, + "chr_num": "2", + "name_num": "4294967290", + "Probe_Target_Description": "putative intergenic", + "RefSeq_TranscriptId": "NM_007914", + "ENSEMBLGeneId": null, + "Chr_mm8": "2", + "Mb_mm8": "103.064194", + "Probe_set_Blat_Mb_start_mm8": "103.064194", + "Probe_set_Blat_Mb_end_mm8": "103.064244", + "HomoloGeneID": "3265", + "Biotype_ENS": null, + "ProteinID": null, + "ProteinName": null, + "UniProtID": null, + "Flybase_Id": null, + "RGD_ID": null, + "HMDB_ID": null, + "Confidence": null, + "ChEBI_ID": null, + "ChEMBL_ID": null, + "CAS_number": null, + "PubChem_ID": null, + "ChemSpider_ID": null, + "UNII_ID": null, + "EC_number": null, + "KEGG_ID": null, + "Molecular_Weight": null, + "Nugowiki_ID": null, + "Type": null, + "Tissue": null, + "PrimaryName": null, + "SecondaryNames": null, + "PeptideSequence": null + }, + { + "Id": "162368", + "ChipId": "7", + "Name": "ILM610088", + "TargetId": "scl45217.22.1_37-S", + "Symbol": "Dis3", + "description": "DIS3 mitotic control homolog (S. cerevisiae)", + "Chr": "14", + "Mb": "99.077306", + "Chr_2016": "14", + "Mb_2016": "99.476525", + "alias": "2810028N01Rik; DKFZp667L1817; FLJ10484; KIAA1008; MGC33035; RP11-342J4.3; RRP44; bA555G22.1; dis3p", + "GeneId": "72662", + "GenbankId": "BC027357|AK012840|", + "SNP": null, + "BlatSeq": "CTCAACAGCAACAAAATGGAGAGCATACTTACAGACTCCTGTGCGATAGC", + "TargetSeq": "CAGAACATCCAAAGACTCAACAGCAACAAAATGGAGAGCATACTTACAGACTCCTGTGCGATAGCTACTT", + "UniGeneId": "Mm.163339", + "Strand_Probe": "-", + "Strand_Gene": "-", + "OMIM": "607533", + "comments": "", + "Probe_set_target_region": null, + "Probe_set_specificity": "5", + "Probe_set_BLAT_score": "50", + "Probe_set_Blat_Mb_start": "99.077306", + "Probe_set_Blat_Mb_end": "99.077356", + "Probe_set_Blat_Mb_start_2016": "99.476525", + "Probe_set_Blat_Mb_end_2016": "99.476575", + "Probe_set_strand": "-", + "Probe_set_Note_by_RW": null, + "flag": "0", + "Symbol_H": null, + "description_H": null, + "chromosome_H": null, + "MB_H": null, + "alias_H": null, + "GeneId_H": null, + "chr_num": "14", + "name_num": "4294967290", + "Probe_Target_Description": "3' UTR", + "RefSeq_TranscriptId": "NM_028315", + "ENSEMBLGeneId": null, + "Chr_mm8": "14", + "Mb_mm8": "97.96044", + "Probe_set_Blat_Mb_start_mm8": "97.96044", + "Probe_set_Blat_Mb_end_mm8": "97.96049", + "HomoloGeneID": "6910", + "Biotype_ENS": null, + "ProteinID": null, + "ProteinName": null, + "UniProtID": null, + "Flybase_Id": null, + "RGD_ID": null, + "HMDB_ID": null, + "Confidence": null, + "ChEBI_ID": null, + "ChEMBL_ID": null, + "CAS_number": null, + "PubChem_ID": null, + "ChemSpider_ID": null, + "UNII_ID": null, + "EC_number": null, + "KEGG_ID": null, + "Molecular_Weight": null, + "Nugowiki_ID": null, + "Type": null, + "Tissue": null, + "PrimaryName": null, + "SecondaryNames": null, + "PeptideSequence": null + }, + { + "Id": "162369", + "ChipId": "7", + "Name": "ILM870181", + "TargetId": "scl056379.2_58-S", + "Symbol": "Kcnj1", + "description": "potassium inwardly-rectifying channel, subfamily J, member 1", + "Chr": "9", + "Mb": "32.398853", + "Chr_2016": "9", + "Mb_2016": "32.206438", + "alias": "KIR1.1; Kir1.1; ROMK; ROMK-2; ROMK1; Romk2", + "GeneId": "56379", + "GenbankId": "BC020525|AF012834|", + "SNP": null, + "BlatSeq": "CCTGGAGTGTGTATGATGCTAACACCGAATGGTTCTTGTGTTTCTCTGCC", + "TargetSeq": "CAGCCTGGAGTGTGTATGATGCTAACACCGAATGGTTCTTGTGTTTCTCTGCCTAGTGGTTGAACTGCAA", + "UniGeneId": "Mm.390168", + "Strand_Probe": "+", + "Strand_Gene": "+", + "OMIM": "600359", + "comments": "", + "Probe_set_target_region": null, + "Probe_set_specificity": "5", + "Probe_set_BLAT_score": "50", + "Probe_set_Blat_Mb_start": "32.398853", + "Probe_set_Blat_Mb_end": "32.398903", + "Probe_set_Blat_Mb_start_2016": "32.206438", + "Probe_set_Blat_Mb_end_2016": "32.206488", + "Probe_set_strand": "+", + "Probe_set_Note_by_RW": null, + "flag": "0", + "Symbol_H": null, + "description_H": null, + "chromosome_H": null, + "MB_H": null, + "alias_H": null, + "GeneId_H": null, + "chr_num": "9", + "name_num": "4294967290", + "Probe_Target_Description": "3' UTR", + "RefSeq_TranscriptId": "NM_019659", + "ENSEMBLGeneId": null, + "Chr_mm8": "9", + "Mb_mm8": "32.148418", + "Probe_set_Blat_Mb_start_mm8": "32.148418", + "Probe_set_Blat_Mb_end_mm8": "32.148468", + "HomoloGeneID": "56764", + "Biotype_ENS": null, + "ProteinID": null, + "ProteinName": null, + "UniProtID": null, + "Flybase_Id": null, + "RGD_ID": null, + "HMDB_ID": null, + "Confidence": null, + "ChEBI_ID": null, + "ChEMBL_ID": null, + "CAS_number": null, + "PubChem_ID": null, + "ChemSpider_ID": null, + "UNII_ID": null, + "EC_number": null, + "KEGG_ID": null, + "Molecular_Weight": null, + "Nugowiki_ID": null, + "Type": null, + "Tissue": null, + "PrimaryName": null, + "SecondaryNames": null, + "PeptideSequence": null + }, + { + "Id": "162370", + "ChipId": "7", + "Name": "ILM103060390", + "TargetId": "ri|D130099D04|PX00187M10|AK051805|1507-S", + "Symbol": "Scn3b", + "description": "sodium channel, voltage-gated, type III, beta", + "Chr": "9", + "Mb": "40.277854", + "Chr_2016": "9", + "Mb_2016": "40.085439", + "alias": "1110001K16Rik; 4833414B02Rik; HSA243396; SCNB3; Scnb3", + "GeneId": "235281", + "GenbankId": null, + "SNP": null, + "BlatSeq": "GCTCAGGGCCAGGGTCAGGGTCAGAGTGAGGGTCAATTTCGGTTCTGGTT", + "TargetSeq": "", + "UniGeneId": "Mm.290083", + "Strand_Probe": "+", + "Strand_Gene": null, + "OMIM": "608214", + "comments": "", + "Probe_set_target_region": null, + "Probe_set_specificity": "5", + "Probe_set_BLAT_score": "50", + "Probe_set_Blat_Mb_start": "40.277854", + "Probe_set_Blat_Mb_end": "40.277904", + "Probe_set_Blat_Mb_start_2016": "40.085439", + "Probe_set_Blat_Mb_end_2016": "40.085489", + "Probe_set_strand": "+", + "Probe_set_Note_by_RW": null, + "flag": "0", + "Symbol_H": null, + "description_H": null, + "chromosome_H": null, + "MB_H": null, + "alias_H": null, + "GeneId_H": null, + "chr_num": "9", + "name_num": "4294967290", + "Probe_Target_Description": "intron 4", + "RefSeq_TranscriptId": "NM_001083917", + "ENSEMBLGeneId": null, + "Chr_mm8": "9", + "Mb_mm8": "40.028425", + "Probe_set_Blat_Mb_start_mm8": "40.028425", + "Probe_set_Blat_Mb_end_mm8": "40.028475", + "HomoloGeneID": "10176", + "Biotype_ENS": null, + "ProteinID": null, + "ProteinName": null, + "UniProtID": null, + "Flybase_Id": null, + "RGD_ID": null, + "HMDB_ID": null, + "Confidence": null, + "ChEBI_ID": null, + "ChEMBL_ID": null, + "CAS_number": null, + "PubChem_ID": null, + "ChemSpider_ID": null, + "UNII_ID": null, + "EC_number": null, + "KEGG_ID": null, + "Molecular_Weight": null, + "Nugowiki_ID": null, + "Type": null, + "Tissue": null, + "PrimaryName": null, + "SecondaryNames": null, + "PeptideSequence": null + }, + { + "Id": "162371", + "ChipId": "7", + "Name": "ILM4480390", + "TargetId": "scl0018933.1_65-S", + "Symbol": "Prrx1", + "description": "paired related homeobox 1", + "Chr": "1", + "Mb": "163.257817", + "Chr_2016": "1", + "Mb_2016": "165.187948", + "alias": "A230024N07Rik; AA755424; AI385634; AI843499; K-2; PHOX1; PMX1; PRX1; Pmx1; Prx1; mHox", + "GeneId": "18933", + "GenbankId": "X59725|U03873|L06502|", + "SNP": null, + "BlatSeq": "CTCAAGTCCTACTCAGGAGACGTGACTGCTGTGGAGCAACCCATCGTACC", + "TargetSeq": "CAATAAAAACGCTTCTCTCCTCAAGTCCTACTCAGGAGACGTGACTGCTGTGGAGCAACCCATCGTACCT", + "UniGeneId": "Mm.288642", + "Strand_Probe": "-", + "Strand_Gene": "-", + "OMIM": "167420", + "comments": "", + "Probe_set_target_region": null, + "Probe_set_specificity": "5", + "Probe_set_BLAT_score": "50", + "Probe_set_Blat_Mb_start": "163.257817", + "Probe_set_Blat_Mb_end": "163.257867", + "Probe_set_Blat_Mb_start_2016": "165.187948", + "Probe_set_Blat_Mb_end_2016": "165.187998", + "Probe_set_strand": "-", + "Probe_set_Note_by_RW": null, + "flag": "0", + "Symbol_H": null, + "description_H": null, + "chromosome_H": null, + "MB_H": null, + "alias_H": null, + "GeneId_H": null, + "chr_num": "1", + "name_num": "4294967290", + "Probe_Target_Description": "exon 3", + "RefSeq_TranscriptId": "NM_001025570", + "ENSEMBLGeneId": null, + "Chr_mm8": "1", + "Mb_mm8": "165.094492", + "Probe_set_Blat_Mb_start_mm8": "165.094492", + "Probe_set_Blat_Mb_end_mm8": "165.094542", + "HomoloGeneID": "7896", + "Biotype_ENS": null, + "ProteinID": null, + "ProteinName": null, + "UniProtID": null, + "Flybase_Id": null, + "RGD_ID": null, + "HMDB_ID": null, + "Confidence": null, + "ChEBI_ID": null, + "ChEMBL_ID": null, + "CAS_number": null, + "PubChem_ID": null, + "ChemSpider_ID": null, + "UNII_ID": null, + "EC_number": null, + "KEGG_ID": null, + "Molecular_Weight": null, + "Nugowiki_ID": null, + "Type": null, + "Tissue": null, + "PrimaryName": null, + "SecondaryNames": null, + "PeptideSequence": null + }, + { + "Id": "162372", + "ChipId": "7", + "Name": "ILM101940014", + "TargetId": "ri|A430065A10|PX00137F11|AK040115|1649-S", + "Symbol": "Cd4", + "description": "CD4 antigen", + "Chr": "6", + "Mb": "124.867492", + "Chr_2016": "6", + "Mb_2016": "124.81751", + "alias": "CD4mut; L3T4; Ly-4", + "GeneId": "12504", + "GenbankId": "X04836|M36851|M36850|M17080|M17079|M17078|M17077|M17076|M13816|BC039137|AK161775|AK153966|AF045882|AC002397|", + "SNP": null, + "BlatSeq": "ACAGAGGTTGGAGATAGAAGTGAGGAGAGAGAGGGGTCCTGGGCTCTAGG", + "TargetSeq": "", + "UniGeneId": "Mm.2209", + "Strand_Probe": "-", + "Strand_Gene": "-", + "OMIM": "186940", + "comments": "", + "Probe_set_target_region": null, + "Probe_set_specificity": "5", + "Probe_set_BLAT_score": "50", + "Probe_set_Blat_Mb_start": "124.867492", + "Probe_set_Blat_Mb_end": "124.867542", + "Probe_set_Blat_Mb_start_2016": "124.81751", + "Probe_set_Blat_Mb_end_2016": "124.81756", + "Probe_set_strand": "-", + "Probe_set_Note_by_RW": null, + "flag": "0", + "Symbol_H": null, + "description_H": null, + "chromosome_H": null, + "MB_H": null, + "alias_H": null, + "GeneId_H": null, + "chr_num": "6", + "name_num": "4294967290", + "Probe_Target_Description": "intron 8", + "RefSeq_TranscriptId": "NM_013488", + "ENSEMBLGeneId": null, + "Chr_mm8": "6", + "Mb_mm8": "124.833111", + "Probe_set_Blat_Mb_start_mm8": "124.833111", + "Probe_set_Blat_Mb_end_mm8": "124.833161", + "HomoloGeneID": "513", + "Biotype_ENS": null, + "ProteinID": null, + "ProteinName": null, + "UniProtID": null, + "Flybase_Id": null, + "RGD_ID": null, + "HMDB_ID": null, + "Confidence": null, + "ChEBI_ID": null, + "ChEMBL_ID": null, + "CAS_number": null, + "PubChem_ID": null, + "ChemSpider_ID": null, + "UNII_ID": null, + "EC_number": null, + "KEGG_ID": null, + "Molecular_Weight": null, + "Nugowiki_ID": null, + "Type": null, + "Tissue": null, + "PrimaryName": null, + "SecondaryNames": null, + "PeptideSequence": null + } + ] + }, + { + "dbtable": "ProbeFreeze", + "rows": [ + { + "Id": 70, + "ProbeFreezeId": 70, + "ChipId": 7, + "TissueId": 22, + "Name": "UCLA BXD and BXH Cartilage v2", + "FullName": "", + "ShortName": "", + "CreateTime": "2008-09-19", + "InbredSetId": 1 + }] + }, + { + "dbtable": "ProbeSetFreeze", + "rows": [ + { + "Id": 208, + "ProbeFreezeId": 70, + "AvgID": 8, + "Name": "UCLA_BXDBXH_CARTILAGE_V2", + "Name2": "UCLA_BXDBXH_CARTILAGE_V2", + "FullName": "UCLA BXD and BXH Cartilage v2", + "ShortName": "UCLA BXD and BXH Cartilage v2", + "CreateTime": "2008-09-19", + "OrderList": 1, + "public": 1, + "confidentiality": 0, + "AuthorisedUsers": "", + "DataScale": "log2" + }] + }, + { + "dbtable": "ProbeSetXRef", + "rows": [ + { + "ProbeSetFreezeId": 208, + "ProbeSetId": 162363, + "DataId": 36682455, + "Locus_old": null, + "LRS_old": null, + "pValue_old": null, + "mean": 6.456752523814815, + "se": null, + "Locus": "rs13481111", + "LRS": 9.14055192058577, + "pValue": 0.766, + "additive": 0.317877142857143, + "h2": null + }, + { + "ProbeSetFreezeId": 208, + "ProbeSetId": 162364, + "DataId": 36694754, + "Locus_old": null, + "LRS_old": null, + "pValue_old": null, + "mean": 6.770600282740741, + "se": null, + "Locus": "rs45702177", + "LRS": 9.93858530031785, + "pValue": 0.807, + "additive": -0.269377750000001, + "h2": null + }, + { + "ProbeSetFreezeId": 208, + "ProbeSetId": 162365, + "DataId": 36722457, + "Locus_old": null, + "LRS_old": null, + "pValue_old": null, + "mean": 5.662663275518519, + "se": null, + "Locus": "rs13476571", + "LRS": 9.48847562635838, + "pValue": 0.819, + "additive": 0.455515666666667, + "h2": null + }, + { + "ProbeSetFreezeId": 208, + "ProbeSetId": 162366, + "DataId": 36694938, + "Locus_old": null, + "LRS_old": null, + "pValue_old": null, + "mean": 9.016869263111111, + "se": null, + "Locus": "D17Mit49", + "LRS": 15.4322471324916, + "pValue": 0.256, + "additive": 0.694807555555555, + "h2": null + }, + { + "ProbeSetFreezeId": 208, + "ProbeSetId": 162367, + "DataId": 36708108, + "Locus_old": null, + "LRS_old": null, + "pValue_old": null, + "mean": 6.718528922370371, + "se": null, + "Locus": "rs30410261", + "LRS": 12.0753156129002, + "pValue": 0.471, + "additive": 0.178058453038674, + "h2": null + }, + { + "ProbeSetFreezeId": 208, + "ProbeSetId": 162368, + "DataId": 36719235, + "Locus_old": null, + "LRS_old": null, + "pValue_old": null, + "mean": 7.002730319481482, + "se": null, + "Locus": "rs13481905", + "LRS": 10.9885585995265, + "pValue": 0.692, + "additive": 0.43507425, + "h2": null + }, + { + "ProbeSetFreezeId": 208, + "ProbeSetId": 162369, + "DataId": 36703967, + "Locus_old": null, + "LRS_old": null, + "pValue_old": null, + "mean": 6.218555236666667, + "se": null, + "Locus": "rs30180803", + "LRS": 10.9500077249538, + "pValue": 0.535, + "additive": 0.448662250000001, + "h2": null + }, + { + "ProbeSetFreezeId": 208, + "ProbeSetId": 162370, + "DataId": 36689110, + "Locus_old": null, + "LRS_old": null, + "pValue_old": null, + "mean": 7.600573964407409, + "se": null, + "Locus": "rs33169019", + "LRS": 11.9566520135225, + "pValue": 0.578, + "additive": -0.598675833333333, + "h2": null + }, + { + "ProbeSetFreezeId": 208, + "ProbeSetId": 162371, + "DataId": 36695702, + "Locus_old": null, + "LRS_old": null, + "pValue_old": null, + "mean": 8.625563461407406, + "se": null, + "Locus": "rs33154273", + "LRS": 16.4292522865817, + "pValue": 0.751, + "additive": 0.671029166666667, + "h2": null + }, + { + "ProbeSetFreezeId": 208, + "ProbeSetId": 162372, + "DataId": 36687105, + "Locus_old": null, + "LRS_old": null, + "pValue_old": null, + "mean": 7.485297168111107, + "se": null, + "Locus": "rs31238188", + "LRS": 14.6979417011059, + "pValue": 0.365, + "additive": 0.217527857142857, + "h2": null + } + ] + } +] diff --git a/tests/integration/test_partial_correlations.py b/tests/integration/test_partial_correlations.py index d249b42..e047e3d 100644 --- a/tests/integration/test_partial_correlations.py +++ b/tests/integration/test_partial_correlations.py @@ -213,7 +213,7 @@ def test_partial_correlation_api_with_non_existent_control_traits(client, post_d # 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): + db_conn_with_pcorrs_data, primary, controls, method, target): """ Check that calling the function with a mix of existing and missing control traits raises an warning. @@ -221,4 +221,5 @@ def test_part_corr_api_with_mix_of_existing_and_non_existing_control_traits( criteria = 10 with pytest.warns(UserWarning): partial_correlations_entry( - db_conn, primary, controls, method, criteria, target) + db_conn_with_pcorrs_data, primary, controls, method, criteria, + target) -- cgit v1.2.3