Skip to content

Commit

Permalink
refactor: remove gene_index step (#946)
Browse files Browse the repository at this point in the history
* refactor: rename all gene_index related files to target_index

* refactor: rename gene_index to target_index in various files

* refactor: rename gene_index to target_index in tests

* refactor: rename fields to be compatible with new target_index

* refactor: replace examples that use gene_index

* refactor: delete gene_index step files

* refactor: remove gene_index step from config

* feat: replace the gene_index schema with the target_index schema

* refactor: modify mock_target_index

* fix: remove mock_target_index from test_validate_schema_missing_field

* refactor: delete target.md

* fix: fix study index validation tests

* fix: fix l2g feature tests

* chore: pre-commit auto fixes [...]

* revert: revert column name after merging from dev

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Daniel Suveges <daniel.suveges@protonmail.com>
  • Loading branch information
3 people authored Jan 22, 2025
1 parent 111d902 commit c847921
Show file tree
Hide file tree
Showing 40 changed files with 1,306 additions and 467 deletions.
9 changes: 4 additions & 5 deletions docs/howto/command_line/run_step_in_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Available options:
eqtl_catalogue
finngen_studies
finngen_sumstat_preprocess
gene_index
gwas_catalog_ingestion
gwas_catalog_sumstat_preprocess
ld_index
Expand All @@ -28,16 +27,16 @@ Available options:
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
```

As indicated, you can run a step by specifying the step's name with the `step` argument. For example, to run the `gene_index` step, you can run:
As indicated, you can run a step by specifying the step's name with the `step` argument. For example, to run the `gwas_catalog_sumstat_preprocess` step, you can run:

```bash
gentropy step=gene_index
gentropy step=gwas_catalog_sumstat_preprocess
```

In most occassions, some mandatory values will be required to run the step. For example, the `gene_index` step requires the `step.target_path` and `step.gene_index_path` argument to be specified. You can complete the necessary arguments by adding them to the command line:
In most occassions, some mandatory values will be required to run the step. For example, the `gwas_catalog_sumstat_preprocess` step requires the `step.raw_sumstats_path` and `step.out_sumstats_path` argument to be specified. You can complete the necessary arguments by adding them to the command line:

```bash
gentropy step=gene_index step.target_path=/path/to/target step.gene_index_path=/path/to/gene_index
gentropy step=gwas_catalog_sumstat_preprocess step.raw_sumstats_path=/path/to/raw_sumstats step.out_sumstats_path=/path/to/out_sumstats
```

You can find more about the available steps in the [documentation](../../python_api/steps/_steps.md).
18 changes: 9 additions & 9 deletions docs/howto/command_line/run_step_using_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ To run a step using a configuration file, you need to create a configuration fil
```{ .sh .no-copy }
config/
├─ step/
│ └─ my_gene_index.md
│ └─ my_gwas_catalog_sumstat_preprocess.md
└─ my_config.yml
```

The configuration file should contain the parameters you want to use to run the step. For example, to run the `gene_index` step, you need to specify the `step.target_path` and `step.gene_index_path` parameters. The configuration file should look like this:
The configuration file should contain the parameters you want to use to run the step. For example, to run the `gwas_catalog_sumstat_preprocess` step, you need to specify the `step.raw_sumstats_path` and `step.out_sumstats_path` parameters. The configuration file should look like this:

=== "my_config.yaml"

Expand All @@ -31,20 +31,20 @@ The configuration file should contain the parameters you want to use to run the

This config file will specify that your configuration file will inherit the default configuration (`config`) and everything provided (`_self_`) will overwrite the default configuration.

=== "step/my_gene_index.md"
=== "step/my_gwas_catalog_sumstat_preprocess.md"

``` yaml
defaults:
- gene_index
- gwas_catalog_sumstat_preprocess

target_path: /path/to/target
gene_index_path: /path/to/gene_index
raw_sumstats_path: /path/to/raw_sumstats
out_sumstats_path: /path/to/out_sumstats
```

This config file will inherit the default configuration for the `gene_index` step and overwrite the `target_path` and `gene_index_path` parameters.
This config file will inherit the default configuration for the `gwas_catalog_sumstat_preprocess` step and overwrite the `raw_sumstats_path` and `out_sumstats_path` parameters.

Once you have created the configuration file, you can run your own new `my_gene_index`:
Once you have created the configuration file, you can run your own new `my_gwas_catalog_sumstat_preprocess`:

```bash
gentropy step=my_gene_index --config-dir=config --config-name=my_config
gentropy step=my_gwas_catalog_sumstat_preprocess --config-dir=config --config-name=my_config
```
9 changes: 0 additions & 9 deletions docs/python_api/datasets/gene_index.md

This file was deleted.

9 changes: 9 additions & 0 deletions docs/python_api/datasets/target_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Target Index
---

::: gentropy.dataset.target_index.TargetIndex

## Schema

--8<-- "assets/schemas/target_index.md"
5 changes: 0 additions & 5 deletions docs/python_api/datasources/open_targets/target.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/python_api/steps/gene_index.md

This file was deleted.

69 changes: 0 additions & 69 deletions src/gentropy/assets/schemas/gene_index.json

This file was deleted.

Loading

0 comments on commit c847921

Please sign in to comment.