# #——消息= FALSE ------------------------------------------------------------ 库(data.table)库(MOFA2 ) ## ----------------------------------------------------------------------------- 数据< - make_example_data (n_views = 2, n_samples = 200, n_features = 1000,n_factors = 10)[[1]]拉普兰人(数据、暗)# #——消息= FALSE ------------------------------------------------------------ MOFAobject < - create_mofa(数据 ) ## ----------------------------------------------------------------------------- plot_data_overview (MOFAobject) # #——消息= FALSE ------------------------------------------------------------ N = ncol(数据[[1]])组= c(代表(“A”,N / 2),代表(“B”,N / 2) MOFAobject < create_mofa(数据,组=组 ) ## ----------------------------------------------------------------------------- plot_data_overview (MOFAobject ) ## ----------------------------------------------------------------------------- filepath < -系统。文件(“extdata”、“test_data。RData”,包= " MOFA2 (filepath)头(dt)负载 ) ## ----------------------------------------------------------------------------- MOFAobject < - create_mofa (dt) (MOFAobject) # #——打印出来。宽度= " 80 %"-------------------------------------------------------- plot_data_overview (MOFAobject ) ## ----------------------------------------------------------------------------- data_opts < - get_default_data_options (MOFAobject)头(data_opts ) ## ----------------------------------------------------------------------------- model_opts < - get_default_model_options (MOFAobject) model_opts num_factors < - 10头(model_opts) # #----------------------------------------------------------------------------- train_opts < - get_default_training_options (MOFAobject)头(train_opts) # #——消息= FALSE ------------------------------------------------------------ MOFAobject < - prepare_mofa(对象= MOFAobject data_options = data_opts model_options = model_opts,training_options = train_opts ) ## ----------------------------------------------------------------------------- 输出文件= file.path (tempdir(),“model.hdf5”)MOFAobject。训练有素的< - run_mofa (MOFAobject输出文件 ) ## ----------------------------------------------------------------------------- sessionInfo ()