Skip to content

Commit

Permalink
list the available experiment types
Browse files Browse the repository at this point in the history
  • Loading branch information
psmyth94 committed Oct 13, 2024
1 parent 4636d2f commit df2ad97
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ information from the loaded data to handle batch effects and confounding factors
metadata, and labels.

🧬 **Integration with datasets library**: BioSets builds on the `datasets` library's
functionality. Note that if `path` is not a value found in `biosets.list_experiments()`,
it acts like Huggingface's `datasets` library.
functionality. Note that if `path` is not a value found in
`biosets.list_experiment_types()`, it acts like Huggingface's `datasets` library.

## Getting Started

Expand Down
1 change: 1 addition & 0 deletions src/biosets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
decode,
)
from .load import load_dataset, concatenate_datasets, load_from_disk
from .packaged_modules import list_experiment_types
12 changes: 12 additions & 0 deletions src/biosets/packaged_modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,15 @@
"rna": "rna-seq",
"asv": "otu", # we are not treating ASV as a separate dataset type currently
}


def list_experiment_types(experiment_type=None):
if experiment_type is not None:
if experiment_type in DATASET_NAME_TO_OMIC_TYPE:
return list(DATASET_NAME_TO_OMIC_TYPE[experiment_type])
else:
raise ValueError(
f"Invalid experiment type: {experiment_type}. "
f"Valid experiment types are: {list(DATASET_NAME_TO_OMIC_TYPE.keys())}"
)
return sorted(list(DATASET_NAME_TO_OMIC_TYPE.keys()))

0 comments on commit df2ad97

Please sign in to comment.