# #——发射wpm eval = FALSE ------------------------------------------------- # 图书馆每分钟(wpm) #个字 () ## ---- 回声= FALSE -------------------------------------------------------------- knitr:: kable (data.frame(“Sample”= c (s1, s2、s3”、“s4 "))) ## ---- 回声= FALSE -------------------------------------------------------------- knitr: kable (data.frame(“样本”= c (s1, s2, s3、s4),“类型”= c(“A”、“A”、“B”,“c”),“治疗”= c(“trt1”、“tr1”,“控制”,“Ctrl ")) ) ## ---- 将CSV文件,eval = FALSE ------------------------------------------- # 每分钟imported_csv < -个字:convertCSV(“path-to-CSV-file ") ## ---- 创建一个MSnSet对象 -------------------------------------------------- sample_names < - c (s1, s2、s3、s4, s5) M < -矩阵(NA nrow = 4, ncol = 5) colnames (M) < - sample_names rownames (M) < - paste0(“id”,信件[1:4])pd < data.frame(环境= rep_len(字母[1:3],5),类别= rep_len (1:2, 5),row.names = sample_names) rownames (pd) < - colnames (M) my_MSnSet_object < - MSnbase:: MSnSet (exprs = M, pData = pd) # #——ESet转换/ MSnSet对象 ----------------------------------------------- df < - wpm:: convertESet (my_MSnSet_object”环境 ") ## ---- 转换SummarizedExperiment对象 -------------------------------------- nrows < - 200 ncols < - 6数< -矩阵(runif (e4 nrows * ncols 1 1), nrows) colData < data.frame(治疗=代表(c(“芯片”,“输入”),3),row.names=LETTERS[1:6]) se <- summarize实验::summarize实验(assays=list(counts=counts), colData=colData) df <- wpm::convertSE(se, "Treatment") ## ----用CSV文件运行wpm, eval=FALSE-------------------------------------- # wpm_result <- wpm::wrapperWPM(user_df = imported_csv$df_wpm, # plate_dims =list(8,12), # nb_plates = 1, # forbidden_wells = "A1,A2,A3", # fixed_wells = "B1,B2",# spatial_constraint = " NS ") ## ---- 每分钟跑个字 ------------------------------------------------------------------ 每分钟wpm_result < -个字::wrapperWPM (user_df = df, plate_dims =(8、12)列表,nb_plates = 1, forbidden_wells = " A1, A2, A3, fixed_wells =“B1、B2”,spatial_constraint = " NS ") ## ---- 可视化板图 ------------------------------------------------------ 每分钟drawned_map < -个字::drawMap (df = wpm_result sample_gps =长度(水平(as.factor (colData治疗)美元)),gp_levels = gp_lvl < -水平(as.factor (colData治疗)美元),plate_lines = 8, plate_cols = 12, project_title = "我的项目标题 ") ## ---- 看到地图 -------------------------------------------------------------- drawned_map # #——保存地图绘制,eval = FALSE ------------------------------------------------ # ggplot2:: ggsave(#文件名=“我的文件名”,#情节= drawned_map #宽度= 10,#身高= 7,#单位= " " # ) ## ---- eval = FALSE ------------------------------------------------------------ # numberOfThePlate < - 1 # drawned_map < - wpm:: drawMap (df = wpm_result [[numberOfThePlate]], # sample_gps =长度(水平(as.factor (pd环境)美元)),# gp_levels = gp_lvl <——水平(as.factor (pd环境)美元),# plate_lines = 8 # plate_cols = 12 # project_title = "我的项目标题 ") ## ---- SessionInfo -------------------------------------------------------------- sessionInfo ()