~ # print cell type proportions for svr model on ABIS_S0 reference profile decon$proportions$svr_ABIS_S0 ~ # plot cell type proportions for svr model on ABIS_S0 reference profile plot_proportions(deconvoluted # plot cell type proportions plot_deconvolute(deconvoluted = decon, scale = TRUE, labels = FALSE) 反卷积方法的 Benchmarking # benchmark methods by correlating estimated to measured cell type proportions bench <- # plot pearson correlation between predictions and true proportions plot_benchmark(benchmarked = bench
Stratified k-fold is nice because its scheme is specifically designed to maintain the class proportions For larger samples. it probably won't be as big of a deal.We'll then plot the class proportions at each step to illustrate how the class proportions are maintained: 我们将生成一个小的数据集,在这个数据集,我们使用k-fold分层估计,我们想让它小到我们可以看到方差 range(n_folds), kfold_y_props, label="Stratified",color='k', ls='--') ax.set_title("Comparing class proportions 315 396] As we can see, we got roughly the sample sizes of each class for our training and testing proportions
hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions , extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs 毁容、总体比例、畸形的四肢、缺失的手臂、缺失的腿、额外的手臂、多余的腿、融合的手指、太多的手指、长脖子 出图测试: Negative prompt常用到的单词2 bad anatomy, bad proportions mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, ugly, blurry, bad anatomy, bad proportions , extra limbs, cloned face, disfigured, out of frame, ugly, extra limbs, bad anatomy, gross proportions
# print measured cell type proportions (percentages) groundTruth_ABIS[1:5, 1:5] 2.反卷积分析流程 granulator for svr model on ABIS_S0 reference profile decon$proportions$svr_ABIS_S0[1:5, 1:5] dim(decon$proportions $svr_ABIS_S0) decon$proportions$svr_ABIS_S0 rowSums(decon$proportions$svr_ABIS_S0) 该函数返回估算的细胞类型系数和比例 可以使用plot_proportions()函数绘制估算的细胞类型比例。 请注意,细胞类型比例的总和不能超过100%: # plot cell type proportions for svr model on ABIS_S0 reference profile plot_proportions
dist } } }colnames(dist_mat) <- rownames(pos)rownames(dist_mat) <- rownames(pos)计算距离,以三种细胞类型为例proportions , distance_wide$PTC_myCAF_mean, paired = TRUE)需要source的脚本distance_comparison <- function(distances, proportions , topic1, topic2, t1_thresh, t2_thresh){ # Filter the desired topics for barcode proportions greater than threshold and only keep barcode and topic column filtered_props_1 <- proportions[proportions[, greater than threshold and only keep barcode and topic column filtered_props_2 <- proportions[proportions
mutated hands,poorly drawn hands,poorly drawn face,mutation,deformed,blurry,dehydrated,bad anatomy,bad proportions ,extra limbs,cloned face,disfigured,gross proportions,malformed limbs,missing arms,missing legs,extra mutated hands,poorly drawn hands,poorly drawn face,mutation,deformed,blurry,dehydrated,bad anatomy,bad proportions ,extra limbs,cloned face,disfigured,gross proportions,malformed limbs,missing arms,missing legs,extra ,extra limbs,cloned face,disfigured,gross proportions,malformed limbs,missing arms,missing legs,extra
一、sampling variability & CLT for proportions ? 四、estimating the difference between two proportions ? ? 五、hypothesis tests for comparing two proportions ? ? ? ? 六、small sample proportion ?
adata, s_genes, g2m_genes) # 可视化细胞周期得分 sc.pl.scatter(adata, x='score_S', y='score_G2M') # 计算每个簇的细胞比例 proportions = adata.obs['leiden'].value_counts(normalize=True) print(proportions) 7. adata, 'leiden', method='t-test') sc.pl.rank_genes_groups(adata, n_genes=25, sharey=False) # 细胞组成分析 proportions = adata.obs['leiden'].value_counts(normalize=True) print("细胞簇比例:\n", proportions) # 可视化细胞组成 proportions.plot (kind='bar') plt.ylabel('Proportion') plt.title('Cell Cluster Proportions') plt.show() 总结: 掌握Python在单细胞转录组分析中的应用
mutilated:1.21), (tranny:1.331), mutated hands, (poorly drawn hands:1.5), blurry, (bad anatomy:1.21), (bad proportions mutilated:1.21), (tranny:1.331), mutated hands, (poorly drawn hands:1.5), blurry, (bad anatomy:1.21), (bad proportions mutilated:1.21), (tranny:1.331), mutated hands, (poorly drawn hands:1.5), blurry, (bad anatomy:1.21), (bad proportions mutilated:1.21), (tranny:1.331), mutated hands, (poorly drawn hands:1.5), blurry, (bad anatomy:1.21), (bad proportions
, gross proportions, skin spots, acnes, skin blemishes, DeepNegative,(fat:1.2),facing away, looking away ,gross proportions,text,error,missing fingers,missing arms,missing legs,extra digit, 正面关键词: (masterpiece , gross proportions, skin spots, acnes, skin blemishes, DeepNegative,(fat:1.2),facing away, looking away , gross proportions, skin spots, acnes, skin blemishes, DeepNegative,(fat:1.2),facing away, looking away , gross proportions, skin spots, acnes, skin blemishes, DeepNegative,(fat:1.2),facing away, looking away
<- table(seurat_obj$MP_assignment, seurat_obj$orig.ident) sample_mp_proportions <- prop.table(sample_mp_proportions , margin = 2) # 计算MP间的相关性 mp_correlations <- cor(t(sample_mp_proportions), method = "spearman") = sample_mp_proportions, mp_correlations = mp_correlations ))}# 使用示例# Seurat对象名为 seurat_obj# results y = "Meta-Programs", fill = "Correlation")}# 可视化MP在样本中的分布plot_mp_distribution <- function(sample_mp_proportions ) { dist_melt <- reshape2::melt(sample_mp_proportions) ggplot(dist_melt, aes(x = Var2, y = value, fill
hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions , extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs
绘制一个展示男女乘客比例的扇形图 males = (titanic['Sex'] == 'male').sum() females = (titanic['Sex'] == 'female').sum() proportions = [males, females] plt.pie( proportions, labels = ['Males','Females'], shadow = False,
alternative making a decision ‣ results from the simulations look likethe data → the difference between the proportions are independent) ‣ results from the simulations do not looklike the data → the difference between the proportions
如何计算:比例检验可以用Python的proportions_ztest函数,t检验可以用Python的ttest_ind函数。 如果包括0的话意味着两组指标有可能相同,如果不包括0则说明两组指标不同 如何计算:比例检验可以用Python的confint_proportions_2indep函数,t检验可以用Python的tconfint_diff 总结 日常A/B最常见的就是分析概率类指标和均值类指标,经验上,概率类指标采用双尾双样本比例检验(z),可用proportions_ztest函数计算p值,confint_proportions_2indep
hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions , extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs
mutated hands,poorly drawn hands,poorly drawn face,mutation,deformed,blurry,dehydrated,bad anatomy,bad proportions ,extra limbs,cloned face,disfigured,gross proportions,malformed limbs,missing arms,missing legs,extra
letsum = 0; for(var i= 0; i < predictions.length; i++)sum+=predictions[i] //cumpute proportions let proportions= [] for(var i= 0; i < predictions.length; i++){ let prop = (predictions[i]* 100)/sum proportions.push(prop) } return { EOSINOPHIL : proportions[0], LYMPHOCYTE : proportions[1], MONOCYTE : proportions [2], NEUTROPHIL : proportions[3] } } } 总结 这个项目对我来说真的很棒,我学会了如何使用谷歌colab在云上训练ML
# Bulk expression matrix bulk.mtx = exprs(GSE50244.bulk.eset) # Estimate cell type proportions Est.prop.GSE50244 # Jitter plot of estimated cell type proportions jitter.fig = Jitter_Est(list(data.matrix(Est.prop.GSE50244 Est.prop.allgene)), method.name = c('MuSiC', 'NNLS'), title = 'Jitter plot of Est Proportions # Create dataframe for beta cell proportions and HbA1c levels m.prop.ana = data.frame(pData(GSE50244. XinT2D.construct.full$num.real, by.col = FALSE) head(XinT2D.construct.full$prop.real) # Estimate cell type proportions
( '0', proportions(training_counts.column('0')), '1', proportions(training_counts.column('1')) (counts.column(1)), 'Not Cancer', proportions(counts.column(2)) ) dists.barh(0) 与“非癌症”类别的分布相比,“ (1)), 'Not Cancer', proportions(shuffled_counts.column(2)) ) shuffled_dists.barh(0) 这与原始条形图看起来有点不同 (shuffled_counts.column(1)), proportions(shuffled_counts.column(2))) tvds = np.append(tvds, new_tvd (counts.column(1)), proportions(counts.column(2))) # Assuming the null is true, randomly permute