怎样做购物网站客户管理系统哪个好用
- 作者: 五速梦信息网
- 时间: 2026年03月21日 06:45
当前位置: 首页 > news >正文
怎样做购物网站,客户管理系统哪个好用,ai绘图网页版免费,wordpress 接收询盘文章目录 1.前言2.CellNet2.1CellNet简介2.2CellNet结果 3.PACNet3.1安装R包与加载R包3.2加载数据3.3开始训练和分类3.4可视化分类过程3.5可视化分类结果 4.细胞命运分类和免疫浸润比较 1.前言 今天冲浪看到一个细胞分类性能评估的R包——PACNet#xff0c;它与转录组分析方法… 文章目录 1.前言2.CellNet2.1CellNet简介2.2CellNet结果 3.PACNet3.1安装R包与加载R包3.2加载数据3.3开始训练和分类3.4可视化分类过程3.5可视化分类结果 4.细胞命运分类和免疫浸润比较 1.前言 今天冲浪看到一个细胞分类性能评估的R包——PACNet它与转录组分析方法、计算预处理方法和预处理方法产生的基因可用性无关因此可以对细胞命运工程方案的性能进行交叉研究比较这个是新包。 其次还有孪生子弟旧R包已经停止更新了CellNet 先讲一下CellNet因为新包的参考数据集也是共用的但使用的话我们还是用PACNet哈 2.CellNet 2.1CellNet简介 CellNet是一个基于网络生物学的计算平台用于评估细胞工程的保真度并生成用于改进细胞衍生的假设。CellNet基于细胞类型特异性基因调控网络GRN的重建有16种小鼠和16种人类细胞和组织类型的公开RNA-Seq数据进行重建。 简单过一下CellNet目前有两种方法可以运行CellNet获取RNA-Seq数据。作者提供了云平台和本地运行两种方式因为亚马逊云要氪金本着白嫖的意思就本地跑一跑了 CutadaptSalmonGNU Parallel CellNet的核心是随机森林分类器。这是对细胞命运实验结果进行分类的算法。要使用 CellNet 分析自己的表达数据需要一个经过训练的 CellNet 分类器对象我们将其称为 cnProcCellNet 处理器。 第一步需要先构建cnProc对象可以自己去构建相关代码构建cnProc优势就是可以增加自己需要研究细胞类型或者研究人鼠外其他物种。 可以使用作者整理好了的rdata在github中下载即可 第二第三步就是RNA数据要SRA文件和索引了 作者也提供了 2.2CellNet结果 分类热图在训练数据行中显示每个样本列对每个细胞和组织类型的分类分数 pdf(filehmclass_example.pdf, width7, height5) cn_HmClass(cnRes) dev.off()这里可以看到iPSC在胚胎干细胞中分数更高其次是Day0的几个在成纤维细胞中分数更高。 Gene Regulatory Network 状态栏图一种更灵敏的测量用于测量特定细胞类型的 GRN 在实验数据中建立的程度 fname-grnstats_esc_example.pdf bOrder-c(fibroblast_train, unique(as.vector(stQuery\(description1)), esc_train) cn_barplot_grnSing(cnRes,cnProc,esc, c(fibroblast,esc), bOrder, sidColsra_id) ggplot2::ggsave(fname, width5.5, height5) dev.off()这里关于基因调控网络状态的如果说热图是一个计算分数绝对值的匹配那这里就是对调控网络状态一个动态的匹配 Network Influence Score Box and Whisker Plot可以更好地调节的转录因子的建议按其潜在影响进行排序 rownames(stQuery)-as.vector(stQuery\)sra_id) tfScores-cn_nis_all(cnRes, cnProc, esc) fname-nis_esc_example_Day0.pdf plot_nis(tfScores, esc, stQuery, Day0, dLeveldescription1, limitTo0) ggplot2::ggsave(fname, width4, height12) dev.off()这个就调控影响分数的排序 3.PACNet 流程和输入文件是与CellNet一样的直接跳过开始demo 3.1安装R包与加载R包 install.packages(devtools) library(devtools) install_github(pcahan1/CellNet, refmaster) install_github(pcahan1/cancerCellNetv0.1.1, refmaster) source(pacnet_utils.R)library(CellNet) library(cancerCellNet) library(plyr) library(ggplot2) library(RColorBrewer) library(pheatmap) library(plotly) library(igraph)3.2加载数据 这里就需要表达矩阵和元数据列表。 表达矩阵应将基因符号作为行名将样本名称作为列名。示例元数据表应将示例名称作为行名将示例要素作为列名。表达式矩阵的列名必须与元数据表的行名匹配。为了使分类器训练可靠每种训练类型至少应有 60 个独立rep。 元数据列表的title格式 加载数据 expTrain - utils_loadObject(Hs_expTrain_Jun-20-2017.rda) stTrain - utils_loadObject(Hs_stTrain_Jun-20-2017.rda)加载工程参考数据和查询数据 liverRefExpDat - utils_loadObject(liver_engineeredRef_normalized_expDat_all.rda) liverRefSampTab - utils_loadObject(liver_engineeredRef_sampTab_all.rda) queryExpDat - read.csv(example_data/example_counts_matrix.csv, row.names1) querySampTab - read.csv(example_data/example_sample_metadata_table.csv) rownames(querySampTab) - querySampTab$sample_name study_name - liver_example识别交叉基因 iGenes - intersect(rownames(expTrain), rownames(liverRefExpDat)) iGenes - intersect(iGenes, rownames(queryExpDat))
Subset training expression matrix based on iGenes
expTrain - expTrain[iGenes,]3.3开始训练和分类 将数据拆分为训练集和验证集 set.seed(99) # Setting a seed for the random number generator allows us to reproduce the same split in the future stList - splitCommon_proportion(sampTab stTrain, proportion 0.66, dLevel description1) # Use 2⁄3 of training data for training and 1⁄3 for validation stTrainSubset - stList\(trainingSet expTrainSubset - expTrain[,rownames(stTrainSubset)]#See number of samples of each unique type in description1 in training subset table(stTrainSubset\)description1)stValSubset - stList\(validationSet expValSubset - expTrain[,rownames(stValSubset)] #See number of samples of each unique type in description1 in validation subset table(stValSubset\)description1)训练随机森林分类器需要 3-10 分钟具体取决于内存可用性 system.time(my_classifier - broadClass_train(stTrain stTrainSubset, expTrain expTrainSubset, colName_cat description1, colName_samp sra_id, nRand 70, nTopGenes 100, nTopGenePairs 100, nTrees 2000, stratifyTRUE, sampsize25, # Must be less than the smallest number in table(stTrainSubset\(description1)quickPairsTRUE)) # Increasing the number of top genes and top gene pairs increases the resolution of the classifier but increases the computing time save(my_classifier, fileexample_outputs/cellnet_classifier_100topGenes_100genePairs.rda)3.4可视化分类过程 分类热图 stValSubsetOrdered - stValSubset[order(stValSubset\)description1), ] #order samples by classification name expValSubset - expValSubset[,rownames(stValSubsetOrdered)] cnProc - my_classifier\(cnProc #select the cnProc from the earlier class trainingclassMatrix - broadClass_predict(cnProc, expValSubset, nrand 60) stValRand - addRandToSampTab(classMatrix, stValSubsetOrdered, descdescription1, idsra_id)grps - as.vector(stValRand\)description1) names(grps)-rownames(stValRand)# Create validation heatmap png(fileclassification_validation_hm.png, height6, width10, unitsin, res300) ccn_hmClass(classMatrix, grpsgrps, fontsize_row10) dev.off()验证精度-召回率曲线 assessmentDat - ccn_classAssess(classMatrix, stValRand, classLevelsdescription1, dLevelSIDsra_id) png(fileexample_outputs/classifier_assessment_PR.png, height8, width10, unitsin, res300) plot_class_PRs(assessmentDat) dev.off()基因对验证 genePairs - cnProc$xpairs
Get gene to gene comparison of each gene pair in the expression table
expTransform - query_transform(expTrainSubset, genePairs)
avgGenePair_train - avgGeneCat(expDat expTransform, sampTab stTrainSubset, dLevel description1, sampID sra_id)genePairs_val - query_transform(expValSubset, genePairs)
geneCompareMatrix - makeGeneCompareTab(queryExpTab genePairs_val,avgGeneTab avgGenePair_train, geneSamples genePairs)
val_grps - stValSubset[,description1]
val_grps - c(val_grps, colnames(avgGenePair_train))
names(val_grps) - c(rownames(stValSubset), colnames(avgGenePair_train))png(fileexample_outputs/validation_gene-pair_comparison.png, width10, height80, unitsin, res300)
plotGeneComparison(geneCompareMatrix, grps val_grps, fontsize_row 6)
dev.off()该图较大主要就是基因对的分数热图这个就是xpairs图
创建并保存xpairs_list对象用于 grn 重建和训练规范化参数
xpairs_list - vector(list, 14)
for (pair in rownames(avgGenePair_train)) {for (j in 1:ncol(avgGenePair_train)) {if (avgGenePair_train[pair,j] 0.5) {if (is.null(xpairs_list[[j]])) {xpairs_list[[j]] - c(pair)} else { xpairs_list[[j]] - c(xpairs_list[[j]], pair)}} }
}
xpair_names - colnames(avgGenePair_train)
xpair_names - sub(pattern_Avg, replacement, xxpair_names)
names(xpairs_list) - xpair_namesfor (type in names(xpairs_list)) {names(xpairs_list[[type]]) - xpairs_list[[type]]
}
save(xpairs_list, fileexample_outputs/Hs_xpairs_list.rda)3.5可视化分类结果
对训练集样本进行分类
classMatrixLiverRef - broadClass_predict(cnProc cnProc, expDat liverRefExpDat, nrand 10)
grp_names1 - c(as.character(liverRefSampTab\(description1), rep(random, 10))
names(grp_names1) - c(as.character(rownames(liverRefSampTab)), paste0(rand_, c(1:10)))# Re-order classMatrixQuery to match order of rows in querySampTab
classMatrixLiverRef - classMatrixLiverRef[,names(grp_names1)]png(fileexample_outputs/heatmapLiverRef.png, height12, width9, unitsin, res300)
heatmapRef(classMatrixLiverRef, liverRefSampTab) # This function can be found in pacnet_utils.R
dev.off()# Alternatively, for an interactive plotly version:
heatmapPlotlyRef(classMatrixLiverRef, liverRefSampTab)对测试集进行分类
queryExpDat - log(1queryExpDat)
classMatrixQuery - broadClass_predict(cnProc cnProc, expDat queryExpDat, nrand 3)
grp_names - c(as.character(querySampTab\)description1), rep(random, 3))
names(grpnames) - c(as.character(rownames(querySampTab)), paste0(rand, c(1:3)))# Re-order classMatrixQuery to match order of rows in querySampTab
classMatrixQuery - classMatrixQuery[,names(grp_names)]save(classMatrixQuery, fileexample_outputs/example_classificationMatrix.rda)png(fileexample_outputs/query_classification_heatmap.png, height4, width8, unitsin, res300)
This function can be found in pacnet_utils.R
acn_queryClassHm(classMatrixQuery, main paste0(Classification Heatmap, , study_name), grps grp_names, fontsize_row10, fontsize_col 10, isBig FALSE) dev.off()计算调控因子得分
准备用于网络影响得分计算的 GRN 和表达式数据
基于交叉基因的子集和对象grnAlltrainNormParam
grnAll - utils_loadObject(liver_grnAll.rda)
trainNormParam - utils_loadObject(liver_trainNormParam.rda)# These two functions can be found in pacnet_utils.R
grnAll - subsetGRNall(grnAll, iGenes)
trainNormParam - subsetTrainNormParam(trainNormParam, grnAll, iGenes)queryExpDat_ranked - logRank(queryExpDat, base 0)
queryExpDat_ranked - as.data.frame(queryExpDat_ranked)## 计算转录调节因子的计算网络影响评分 NIS
network_cell_type - liver
target_cell_type - liver
system.time(TF_scores - pacnet_nis(expDat queryExpDat_ranked, stQueryquerySampTab, iGenesiGenes,grnAll grnAll, trainNorm trainNormParam,subnet network_cell_type, ctttarget_cell_type,colname_sidsample_name, relaWeight0))save(TF_scores, fileexample_outputs/my_study_TF_scores.rda)## 选择得分最高的 25 个 TF 进行绘图
TFsums - rowSums(abs(TF_scores))
ordered_TFsums - TFsums[order(TFsums, decreasing TRUE)]
if(length(TFsums) 25) {top_display_TFs - names(ordered_TFsums)[1:25]
} else {top_display_TFs - names(ordered_TFsums)
}
TF_scores - TF_scores[top_display_TFs,]## 绘制 TF 分数
sample_names - rownames(querySampTab)pdf(fileexample_outputs/my_study_TF_scores_my_cell_type.pdf, height6, width8)
for(sample in sample_names) {descript - querySampTab$description1[which(rownames(querySampTab) sample)]plot_df - data.frame(TFs rownames(TF_scores),Scores as.vector(TF_scores[,sample]))sample_TFplot - ggplot(plot_df, aes(x reorder(TFs,Scores,mean) , y Scores)) geom_bar(statidentity) #aes(fill medVal)) theme_bw() ggtitle(paste0(sample, , , descript, , , target_cell_type, transcription factor scores)) ylab(Network influence score) xlab(Transcriptional regulator) theme(legend.position none, axis.text element_text(size 8)) theme(text element_text(size10), legend.positionnone,axis.text.x element_text(angle 45, vjust0.5))print(sample_TFplot)
}
dev.off()阴性 TF 评分表明给定的 TF 应该上调以获得与靶细胞类型更相似的身份。正 TF 评分表明给定的 TF 应下调以获得与靶细胞类型更相似的身份。 4.细胞命运分类和免疫浸润比较
免疫浸润评估主要是指在特定组织如肿瘤组织中不同类型的免疫细胞的存在与活性的分析。这涉及到分析如何及在什么程度上各种免疫细胞例如T细胞、B细胞、巨噬细胞等参与到组织的免疫应答中。免疫浸润的水平可以作为疾病预后的一个重要指标特别是在癌症研究中高水平的免疫浸润通常与较好的预后相关。拿常见的CIBERSORT来看这是用于从复杂的组织表达数据中通过特征矩阵例如LM22估计细胞组成的相对丰度的免疫浸润方法。PACNet是用于分析特别是在癌症研究中常见的多组分样本如肿瘤微环境中的细胞。它提供了一种网络方法通过整合表达数据和先验分子网络信息来预测样本中细胞类型的丰度。各有侧重CIBERSORT 更专注于从复杂组织样本中准确估计免疫细胞的丰度而 PACNet 则提供了一种网络分析方法不仅可以估计细胞丰度还可以探究细胞之间的相互作用和网络结构。
对于做分化、做干细胞、做肿瘤分型等来说这真是一大利器埋下伏笔下期更新单细胞的
- 上一篇: 怎样做公司官方网站专业性行业网站有哪些
- 下一篇: 怎样做关于自己的网站网站开发后端语言
相关文章
-
怎样做公司官方网站专业性行业网站有哪些
怎样做公司官方网站专业性行业网站有哪些
- 技术栈
- 2026年03月21日
-
怎样做公司官方网站营销网站建设hanyous
怎样做公司官方网站营销网站建设hanyous
- 技术栈
- 2026年03月21日
-
怎样做返利网站北京网站开发不限年龄
怎样做返利网站北京网站开发不限年龄
- 技术栈
- 2026年03月21日
-
怎样做关于自己的网站网站开发后端语言
怎样做关于自己的网站网站开发后端语言
- 技术栈
- 2026年03月21日
-
怎样做好外贸网站推广企业网站怎么做优化
怎样做好外贸网站推广企业网站怎么做优化
- 技术栈
- 2026年03月21日
-
怎样做集装箱网站酒店网站案例
怎样做集装箱网站酒店网站案例
- 技术栈
- 2026年03月21日
