[docs]classGenerativeModel:""" Generative models are algorithms which can be trained to learn patterns in existing datasets, and then be used to generate new synthetic datasets. These methods can be used in the :ref:`TrainGenModel` instruction, and previously trained models can be used to generate data using the :ref:`ApplyGenModel` instruction. """DOCS_TITLE="Generative models"OUTPUT_COLUMNS=[]def__init__(self,locus:Chain,name:str=None,region_type:RegionType=None,seed=None):self.locus=Chain.get_chain(locus)iflocusisnotNoneelseNoneself.name=nameself.region_type=region_typeself.seed=seed
[docs]defset_locus(self,dataset:Dataset):dataset_locus=dataset.get_locus()iflen(dataset_locus)>0:logging.info(f"GenerativeModel: input dataset has multiple loci, choosing: {dataset_locus}")ifself.locusisnotNoneanddataset_locus[0]!=self.locus.value:logging.info(f"GenerativeModel: Overwriting default locus {self.locus.value} with dataset locus {dataset_locus[0]}")self.locus=Chain.get_chain(dataset_locus[0])