scgpt package
Modules
- scgpt.model package
- Submodules
- scgpt.model.dsbn module
- scgpt.model.generation_model module
- scgpt.model.grad_reverse module
- scgpt.model.model module
- Module contents
- scgpt.scbank package
- Submodules
- scgpt.scbank.data module
- scgpt.scbank.databank module
DataBankDataBank.append_study()DataBank.batch_from_anndata()DataBank.custom_filter()DataBank.data_tablesDataBank.delete_study()DataBank.filter()DataBank.from_anndata()DataBank.from_path()DataBank.gene_vocabDataBank.link()DataBank.load()DataBank.load_all()DataBank.load_anndata()DataBank.load_table()DataBank.main_dataDataBank.main_table_keyDataBank.meta_infoDataBank.save()DataBank.settingsDataBank.sync()DataBank.track()DataBank.update_datatables()
- scgpt.scbank.monitor module
- scgpt.scbank.setting module
- Module contents
- scgpt.tasks package
- Submodules
- scgpt.tasks.cell_emb module
- scgpt.tasks.grn module
GeneEmbeddingGeneEmbedding.average_vector_results()GeneEmbedding.cluster_definitions_as_df()GeneEmbedding.compute_similarities()GeneEmbedding.generate_network()GeneEmbedding.generate_vector()GeneEmbedding.generate_weighted_vector()GeneEmbedding.get_adata()GeneEmbedding.get_metagenes()GeneEmbedding.get_similar_genes()GeneEmbedding.plot_metagene()GeneEmbedding.plot_metagenes_scores()GeneEmbedding.plot_similarities()GeneEmbedding.read_embedding()GeneEmbedding.read_vector()GeneEmbedding.score_metagenes()
- Module contents
- scgpt.tokenizer package
- scgpt.utils package
scgpt.data_collator
scgpt.data_sampler
- class scgpt.data_sampler.SubsetSequentialSampler(indices: Sequence[int])[source]
Bases:
SamplerSamples elements sequentially from a given list of indices, without replacement.
- Parameters:
indices (sequence) – a sequence of indices
- class scgpt.data_sampler.SubsetsBatchSampler(subsets: List[Sequence[int]], batch_size: int, intra_subset_shuffle: bool = True, inter_subset_shuffle: bool = True, drop_last: bool = False)[source]
Bases:
Sampler[List[int]]Samples batches of indices from a list of subsets of indices. Each subset of indices represents a data subset and is sampled without replacement randomly or sequentially. Specially, each batch only contains indices from a single subset. This sampler is for the scenario where samples need to be drawn from multiple subsets separately.
- Parameters:
subsets (List[Sequence[int]]) – A list of subsets of indices.
batch_size (int) – Size of mini-batch.
intra_subset_shuffle (bool) – If
True, the sampler will shuffle the indices within each subset.inter_subset_shuffle (bool) – If
True, the sampler will shuffle the order of subsets.drop_last (bool) – If
True, the sampler will drop the last batch if its size would be less thanbatch_size.
scgpt.loss
- scgpt.loss.criterion_neg_log_bernoulli(input: Tensor, target: Tensor, mask: Tensor) Tensor[source]
Compute the negative log-likelihood of Bernoulli distribution
scgpt.preprocess
- class scgpt.preprocess.Preprocessor(use_key: Optional[str] = None, filter_gene_by_counts: Union[int, bool] = False, filter_cell_by_counts: Union[int, bool] = False, normalize_total: Union[float, bool] = 10000.0, result_normed_key: Optional[str] = 'X_normed', log1p: bool = False, result_log1p_key: str = 'X_log1p', subset_hvg: Union[int, bool] = False, hvg_use_key: Optional[str] = None, hvg_flavor: str = 'seurat_v3', binning: Optional[int] = None, result_binned_key: str = 'X_binned')[source]
Bases:
objectPrepare data into training, valid and test split. Normalize raw expression values, binning or using other transform into the preset model input format.
- check_logged(adata: AnnData, obs_key: Optional[str] = None) bool[source]
Check if the data is already log1p transformed.
Args:
- adata (
AnnData): The
AnnDataobject to preprocess.- obs_key (
str, optional): The key of
AnnData.obsto use for batch information. This arg is used in the highly variable gene selection step.
- adata (