You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not clear to me how to extract all gene embeddings from one of the models. I tried this code but can only extract from one specific tissue and I am not sure my code is right and do what I want. Any help will be super appreciated. My code:
emb_names= ["scgpt"]
census_version="2023-12-15"withcellxgene_census.open_soma(census_version=census_version) ascensus:
adata=cellxgene_census.get_anndata(
census,
organism="homo_sapiens",
measurement_name="RNA",
obs_value_filter="tissue == 'tongue'",
obs_embeddings=emb_names,
)
# Get gene namesgene_names=adata.var.feature_name.tolist() # List of gene names# Convert sparse matrix to dense formatgene_embeddings_dense=adata.X.toarray()
# Map genes to their embeddingsgene_to_embedding_dict= {
gene: gene_embeddings_dense[:, idx].tolist() # Extract all embeddings for the geneforidx, geneinenumerate(gene_names)
}
The text was updated successfully, but these errors were encountered:
Hi,
It is not clear to me how to extract all gene embeddings from one of the models. I tried this code but can only extract from one specific tissue and I am not sure my code is right and do what I want. Any help will be super appreciated. My code:
The text was updated successfully, but these errors were encountered: