Skip to content

Commit b79d0a6

Browse files
committed
fix test
1 parent f7a75df commit b79d0a6

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

pgscatalog.calclib/src/pgscatalog/calclib/polygenicscore.py

+21-22
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import logging
22
import pathlib
3-
from collections import namedtuple
43

54
import pandas as pd
65

7-
from .ancestry.tools import choose_pval_threshold, compare_ancestry
86
from .principalcomponents import PopulationType
97
from .ancestry import read
108

@@ -67,6 +65,7 @@ def _check_overlap(self, ref_pc, target_pc):
6765
def adjust(self, *, ref_pc, target_pc, **kwargs):
6866
"""
6967
>>> from ._config import Config
68+
>>> from .principalcomponents import PrincipalComponents
7069
>>> ref_pc = PrincipalComponents(pcs_path=[Config.ROOT_DIR / "tests" / "ref.pcs"], dataset="reference", psam_path=Config.ROOT_DIR / "tests" / "ref.psam", pop_type=PopulationType.REFERENCE)
7170
>>> target_pcs = PrincipalComponents(pcs_path=Config.ROOT_DIR / "tests" / "target.pcs", dataset="target", pop_type=PopulationType.TARGET)
7271
>>> score_path = Config.ROOT_DIR / "tests" / "aggregated_scores.txt.gz"
@@ -81,28 +80,28 @@ def adjust(self, *, ref_pc, target_pc, **kwargs):
8180
self._check_overlap(ref_pc=ref_pc, target_pc=target_pc)
8281

8382
# join pgs + pca data
84-
target_df = target_pc.df.join(self.df.loc[self.target_name], on="IID")
85-
reference_df = ref_pc.df.join(self.df.loc["reference"], on="IID")
86-
87-
# set up
88-
ancestry_args = namedtuple("ancestry_args", ["method_compare", "pThreshold"])
89-
args = ancestry_args(
90-
kwargs.get("method_compare", "RandomForest"), kwargs.get("pThreshold", None)
91-
)
92-
assignment_threshold_p = choose_pval_threshold(args)
83+
# target_df = target_pc.df.join(self.df.loc[self.target_name], on="IID")
84+
# reference_df = ref_pc.df.join(self.df.loc["reference"], on="IID")
85+
#
86+
# # set up
87+
# ancestry_args = namedtuple("ancestry_args", ["method_compare", "pThreshold"])
88+
# args = ancestry_args(
89+
# kwargs.get("method_compare", "RandomForest"), kwargs.get("pThreshold", None)
90+
# )
91+
# assignment_threshold_p = choose_pval_threshold(args)
9392

9493
# TODO: bork
95-
ancestry_ref, ancestry_target, compare_info = compare_ancestry(
96-
ref_df=reference_df,
97-
ref_pop_col=ref_pc.poplabel,
98-
ref_train_col="Unrelated",
99-
target_df=target_df,
100-
n_pcs=ref_pc.npcs_popcomp,
101-
method=args.method_compare,
102-
p_threshold=assignment_threshold_p,
103-
)
104-
105-
pass
94+
# ancestry_ref, ancestry_target, compare_info = compare_ancestry(
95+
# ref_df=reference_df,
96+
# ref_pop_col=ref_pc.poplabel,
97+
# ref_train_col="Unrelated",
98+
# target_df=target_df,
99+
# n_pcs=ref_pc.npcs_popcomp,
100+
# method=args.method_compare,
101+
# p_threshold=assignment_threshold_p,
102+
# )
103+
104+
raise NotImplementedError
106105

107106

108107
class PolygenicScore:

0 commit comments

Comments
 (0)