Skip to content

Commit

Permalink
tox lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yaseminbridges committed Jun 10, 2024
1 parent 4bd8ce0 commit 54cdf50
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/pheval_ai_marrvel/post_process/post_process_results_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ def read_raw_result(raw_result_path: Path) -> pl.DataFrame:
raw_result = pl.read_csv(raw_result_path)
raw_result = raw_result.rename({"Unnamed: 0": "variant"})
raw_result = raw_result.select(pl.col(["variant", "predict", "geneSymbol", "ranking"]))
grouped_gene_symbols = raw_result.group_by("variant", maintain_order=True).agg(
pl.col("geneSymbol").unique(maintain_order=True)).select(pl.col("geneSymbol")).rename(
{"geneSymbol": "groupedGeneSymbol"})
grouped_gene_symbols = (
raw_result.group_by("variant", maintain_order=True)
.agg(pl.col("geneSymbol").unique(maintain_order=True))
.select(pl.col("geneSymbol"))
.rename({"geneSymbol": "groupedGeneSymbol"})
)
raw_result = raw_result.unique(subset=["variant"], maintain_order=True)
raw_result = raw_result.hstack(grouped_gene_symbols)
return raw_result
Expand Down Expand Up @@ -84,7 +87,10 @@ def obtain_gene_identifier(self, result_entry: dict) -> List[str]:
str: The gene identifier.
"""
gene_symbols = self._obtain_gene_symbol(result_entry)
return [self.gene_identifier_updater.find_identifier(gene_symbol) for gene_symbol in gene_symbols]
return [
self.gene_identifier_updater.find_identifier(gene_symbol)
for gene_symbol in gene_symbols
]

@staticmethod
def obtain_chrom(variant_str: str) -> str:
Expand Down

0 comments on commit 54cdf50

Please sign in to comment.