Skip to content

Commit

Permalink
Revert "allow for specification of gene identifier"
Browse files Browse the repository at this point in the history
This reverts commit f44ac0f.
  • Loading branch information
yaseminbridges committed Nov 13, 2024
1 parent 4d22b88 commit bada320
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
10 changes: 2 additions & 8 deletions src/phenotype2phenopacket/add/add_genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,19 @@ def add_genes(
)


def add_genes_to_directory(
phenopacket_dir: Path,
genes_to_disease: pl.DataFrame,
gene_identifier: str,
output_dir: Path,
):
def add_genes_to_directory(phenopacket_dir: Path, genes_to_disease: pl.DataFrame, output_dir: Path):
"""
Add known gene-to-phenotype relationships to the interpretations of a directory of phenopackets.
Args:
phenopacket_dir (Path): Directory containing the phenopacket files.
genes_to_disease (pl.DataFrame): DataFrame containing genes_to_disease.txt entries.
gene_identifier (str): Gene identifier for the phenopacket.
output_dir (Path): Directory to store the updated phenopackets.
"""
hgnc_dict = create_hgnc_dict()
identifier_map = create_gene_identifier_map()
gene_identifier_updater = GeneIdentifierUpdater(
gene_identifier=gene_identifier, hgnc_data=hgnc_dict, identifier_map=identifier_map
gene_identifier="ensembl_id", hgnc_data=hgnc_dict, identifier_map=identifier_map
)
for phenopacket_path in all_files(phenopacket_dir):
add_genes(phenopacket_path, genes_to_disease, gene_identifier_updater, output_dir)
10 changes: 0 additions & 10 deletions src/phenotype2phenopacket/cli_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,9 @@
help="Path to output directory.",
type=Path,
)
@click.option(
"--gene-identifier",
"-g",
required=False,
help="Gene identifier to update in phenopacket",
type=click.Choice(["ensembl_id", "entrez_id", "hgnc_id"]),
)
def add_genes_command(
phenopacket_dir: Path,
genes_to_disease: Path,
gene_identifier: str,
output_dir: Path,
):
"""
Expand All @@ -47,14 +39,12 @@ def add_genes_command(
Args:
phenopacket_dir (Path): Directory containing the phenopacket files.
genes_to_disease (Path): Path to the genes_to_disease.txt file.
gene_identifier (str): Gene identifier to add in phenopacket
output_dir (Path): Directory to store the updated phenopackets.
"""
output_dir.mkdir(exist_ok=True)
genes_to_disease_df = read_genes_to_disease(genes_to_disease)
add_genes_to_directory(
phenopacket_dir,
genes_to_disease_df,
gene_identifier,
output_dir,
)

0 comments on commit bada320

Please sign in to comment.