grelu.resources#
grelu.resources contains additional data files that can be used by gReLU functions. It also contains functions to load these files as well as files stored externally, such as model checkpoints and datasets in the model zoo on huggingface.
For legacy wandb access, use grelu.resources.wandb.
Submodules#
Exceptions#
Raised when deprecated API is used. |
Functions#
|
Return the path to a MEME file. |
|
Return the path to a blacklist file |
|
List all model repo IDs in the gReLU model zoo collection. |
|
List all dataset repo IDs in the gReLU model zoo collection. |
|
Download a model checkpoint file from HuggingFace. |
|
Download a dataset file from HuggingFace. |
|
Download and load a model from HuggingFace. |
|
Get full model card metadata from HuggingFace. |
|
Get full dataset card metadata from HuggingFace. |
|
Get datasets linked to a model (from 'datasets' field in model card). |
|
Get base models this model was fine-tuned from (from 'base_model' field). |
|
Get models trained on a dataset (searches collection models). |
Package Contents#
- grelu.resources.get_meme_file_path(meme_motif_db: str) str[source]#
Return the path to a MEME file.
- Parameters:
meme_motif_db – Path to a MEME file or the name of a MEME file included with gReLU. Current name options are “hocomoco_v12”, “hocomoco_v13”, and “consensus”.
- Returns:
Path to the specified MEME file.
- grelu.resources.get_blacklist_file(genome: str) str[source]#
Return the path to a blacklist file
- Parameters:
genome – Name of a genome whose blacklist file is included with gReLU. Current name options are “hg19”, “hg38” and “mm10”.
- Returns:
Path to the specified blacklist file.
- exception grelu.resources.DeprecationError[source]#
Bases:
ExceptionRaised when deprecated API is used.
- grelu.resources.list_models() List[str][source]#
List all model repo IDs in the gReLU model zoo collection.
- Returns:
List of model repository IDs (e.g., [“Genentech/human-atac-catlas-model”, …])
- grelu.resources.list_datasets() List[str][source]#
List all dataset repo IDs in the gReLU model zoo collection.
- Returns:
List of dataset repository IDs (e.g., [“Genentech/human-atac-catlas-data”, …])
- grelu.resources.download_model(repo_id: str, filename: str = 'model.ckpt', **kwargs) str[source]#
Download a model checkpoint file from HuggingFace.
- Parameters:
repo_id – HuggingFace repository ID (e.g., “Genentech/human-atac-catlas-model”)
filename – Name of the checkpoint file to download (default: “model.ckpt”)
**kwargs – Additional arguments to pass to hf_hub_download
- Returns:
Local path to the downloaded file
- grelu.resources.download_dataset(repo_id: str, filename: str = 'data.h5ad', **kwargs) str[source]#
Download a dataset file from HuggingFace.
- Parameters:
repo_id – HuggingFace repository ID (e.g., “Genentech/human-atac-catlas-data”)
filename – Name of the dataset file to download (default: “data.h5ad”)
**kwargs – Additional arguments to pass to hf_hub_download
- Returns:
Local path to the downloaded file
- grelu.resources.load_model(repo_id: str | None = None, filename: str = 'model.ckpt', device: str | int = 'cpu', project: str | None = None, model_name: str | None = None) grelu.lightning.LightningModel[source]#
Download and load a model from HuggingFace.
- Parameters:
repo_id – HuggingFace repository ID (e.g., “Genentech/human-atac-catlas-model”)
filename – Name of the checkpoint file (default: “model.ckpt”)
device – Device to load the model on (default: “cpu”)
- Returns:
A LightningModel object
- grelu.resources.get_model_info(repo_id: str) Dict[str, Any][source]#
Get full model card metadata from HuggingFace.
- Parameters:
repo_id – HuggingFace repository ID
- Returns:
Dictionary containing model metadata including list of files
- grelu.resources.get_dataset_info(repo_id: str) Dict[str, Any][source]#
Get full dataset card metadata from HuggingFace.
- Parameters:
repo_id – HuggingFace repository ID
- Returns:
Dictionary containing dataset metadata including list of files
- grelu.resources.get_datasets_by_model(repo_id: str) List[str][source]#
Get datasets linked to a model (from ‘datasets’ field in model card).
- Parameters:
repo_id – HuggingFace model repository ID
- Returns:
List of dataset repository IDs linked to this model