-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from PGScatalog/stream_combine
Refactor combine_scorefiles
- Loading branch information
Showing
27 changed files
with
4,146 additions
and
703 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.1.3 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- id: ruff-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,25 @@ | ||
from enum import Enum, auto | ||
from enum import Enum | ||
|
||
|
||
class GenomeBuild(Enum): | ||
GRCh37 = auto() | ||
GRCh38 = auto() | ||
GRCh37 = "GRCh37" | ||
GRCh38 = "GRCh38" | ||
# just included to handle older files, incompatible unless harmonised: | ||
NCBI36 = "NCBI36" # ew | ||
|
||
def __str__(self): | ||
return str(self.value) | ||
|
||
@classmethod | ||
def from_string(cls, build): | ||
match build: | ||
case "GRCh37" | "hg19": | ||
return cls(GenomeBuild.GRCh37) | ||
case "GRCh38" | "hg38": | ||
return cls(GenomeBuild.GRCh38) | ||
case "NR": | ||
return None | ||
case "NCBI36" | "hg18": | ||
return cls(GenomeBuild.NCBI36) | ||
case _: | ||
raise Exception(f"Can't match {build=}") |
Oops, something went wrong.