-
Notifications
You must be signed in to change notification settings - Fork 7
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 #108 from helicalAI/main
Change workflow to exectute tests and notebooks sequentially
- Loading branch information
Showing
10 changed files
with
68 additions
and
57 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 was deleted.
Oops, something went wrong.
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
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
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,24 +1,27 @@ | ||
from helical import Geneformer,GeneformerConfig | ||
from helical.utils import get_anndata_from_hf_dataset | ||
import hydra | ||
from omegaconf import DictConfig | ||
import anndata as ad | ||
from datasets import load_dataset | ||
from helical.utils import get_anndata_from_hf_dataset | ||
|
||
|
||
@hydra.main(version_base=None, config_path="configs", config_name="geneformer_config") | ||
def run(cfg: DictConfig): | ||
geneformer_config = GeneformerConfig(**cfg) | ||
geneformer = Geneformer(configurer = geneformer_config) | ||
|
||
hf_dataset = load_dataset("helical-ai/yolksac_human",split="train[:5%]", trust_remote_code=True, download_mode="reuse_cache_if_exists") | ||
ann_data = get_anndata_from_hf_dataset(hf_dataset) | ||
# either load via huggingface | ||
# hf_dataset = load_dataset("helical-ai/yolksac_human",split="train[:5%]", trust_remote_code=True, download_mode="reuse_cache_if_exists") | ||
# ann_data = get_anndata_from_hf_dataset(hf_dataset) | ||
|
||
# or load directly | ||
ann_data = ad.read_h5ad("./yolksac_human.h5ad") | ||
|
||
dataset = geneformer.process_data(ann_data[:10]) | ||
embeddings = geneformer.get_embeddings(dataset) | ||
|
||
print(embeddings.shape) | ||
|
||
|
||
|
||
if __name__ == "__main__": | ||
run() |
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
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