highly variable gene | 高变异基因的选择 | feature selection | 特征选择
在做单细胞的时候,有很多基因属于noise,就是变化没有规律,或者无显著变化的基因。在后续分析之前,我们需要把它们去掉。
以下是一种找出highly variable gene的方法:
The feature selection procedure is based on the largest difference between the observed coefficient of variation (CV) and the predicted CV (estimated by a non-linear noise model learned from the data) See Figure S1C. In particular, Support Vector Regression (SVR, Smola and Vapnik, 1997) was used for this purpose (scikit-learn python implementation, default parameters with gamma = 0.06; Pedregosa et al., 2011).
#Pre-filtering
df_f = df_merge.copy()
df_f = df_f.ix[sum(df_f>=1, 1)>=5,:] # is at least 1 in X cells
df_f = df_f.ix[sum(df_f>=2, 1)>=2,:] # is at least 2 in X cells
df_f = df_f.ix[sum(df_f>=3, 1)>=1,:] # is at least 2 in X cells #Fitting
mu = df_f.mean(1).values
sigma = df_f.std(1, ddof=1).values
cv = sigma/mu
score, mu_linspace, cv_fit , params = fit_CV(mu,cv, 'SVR', svr_gamma=0.005) #Plotting
def plot_cvmean():
figure()
scatter(log2(mu),log2(cv), marker='o', edgecolor ='none',alpha=0.1, s=5)
mu_sorted = mu[argsort(score)[::-1]]
cv_sorted = cv[argsort(score)[::-1]]
scatter(log2(mu_sorted[:thrs]),log2(cv_sorted[:thrs]), marker='o', edgecolor ='none',alpha=0.15, s=8, c='r')
plot(mu_linspace, cv_fit,'-k', linewidth=1, label='$Fit$')
plot(linspace(-9,7), -0.5*linspace(-9,7), '-r', label='$Poisson$')
ylabel('log2 CV')
xlabel('log2 mean')
grid(alpha=0.3)
xlim(-8.6,6.5)
ylim(-2,6.5)
legend(loc=1, fontsize='small')
gca().set_aspect(1.2) plot_cvmean() #Adjusting plot
对每一个基因在不同细胞中的表达量的mean和CV散点图,通过SVR拟合出noise的曲线。
通过the largest difference between the observed coefficient of variation (CV) and the predicted CV (estimated by a non-linear noise model learned from the data)就能找出highly variable gene了。
highly variable gene | 高变异基因的选择 | feature selection | 特征选择的更多相关文章
- 选择屏幕(Selection Screen)
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- ISLR系列:(4.1)模型选择 Subset Selection
Linear Model Selection and Regularization 此博文是 An Introduction to Statistical Learning with Applicat ...
- 选择排序 Selection Sort
选择排序 Selection Sort 1)在数组中找最小的数与第一个位置上的数交换: 2)找第二小的数与第二个位置上的数交换: 3)以此类推 template<typename T> / ...
- 排序算法 - 选择排序(selection sort)
选择排序(Selection sort)跟插入排序一样,也是O(n^2)的复杂度,这个排序方式也可以用我们的扑克牌来解释. 概念 桌面上有一堆牌,也是杂乱无章的,现在我们想将牌由小到大排序,如果使用选 ...
- 简单选择排序 Selection Sort 和树形选择排序 Tree Selection Sort
选择排序 Selection Sort 选择排序的基本思想是:每一趟在剩余未排序的若干记录中选取关键字最小的(也可以是最大的,本文中均考虑排升序)记录作为有序序列中下一个记录. 如第i趟选择排序就是在 ...
- 排序算法--选择排序(Selection Sort)_C#程序实现
排序算法--选择排序(Selection Sort)_C#程序实现 排序(Sort)是计算机程序设计中的一种重要操作,也是日常生活中经常遇到的问题.例如,字典中的单词是以字母的顺序排列,否则,使用起来 ...
- 跳跃空间(链表)排序 选择排序(selection sort),插入排序(insertion sort)
跳跃空间(链表)排序 选择排序(selection sort),插入排序(insertion sort) 选择排序(selection sort) 算法原理:有一筐苹果,先挑出最大的一个放在最后,然后 ...
- 【ABAP系列】SAP ABAP选择屏幕(SELECTION SCREEN)事件解析
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP选择屏幕(SEL ...
- android 开发高仿QQ表情选择、输入框
首先大家看效果: 用到的文件有(源码文件有,只包含表情.输入框等有关文件,工程项目是公司项目,恕不公开啦): res: drawable/face_del_icon.xml drawable/iv_f ...
随机推荐
- 【Python30--文件系统】
一.模块 定义:模块是一个包含所有定义的函数和变量的文件,后缀名是.py.模块可以被别的程序引用,以使用该模块中的函数等功能 >>> secret = random.randint( ...
- DOM元素加载之前执行的jQuery代码
<script type="text/javascript"> (function() { alert("DOM还没加载哦!"); })(jQuer ...
- Bootstrap3基础 navbar 导航条 简单示例
内容 参数 OS Windows 10 x64 browser Firefox 65.0.2 framework Bootstrap 3.3.7 editor ...
- Python3 tkinter基础 Button command 单击按钮 在console中打印文本
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Ping 不通的原因分析
背景 简介 ping是常用的网络管理命令,ping也属于一个通信协议,是TCP/IP协议的一部分,适用于windows和linux以及unix 根据reply用来检查网络是否通畅&网络连接的速 ...
- grub基本应用
一.基本概念 GRUB(boot loader): GRand Unified Bootloader 两个版本: grub .x: grup legacy grub .x: grub2 grub ...
- Custom Quality Profiles in SonarQube
https://medium.com/ltunes/custom-quality-profiles-in-sonarqube-part-1-8754348b9369 Creating Custom Q ...
- reshape2
require(reshape2)x = data.frame(subject = c("John", "Mary"), tim ...
- 物体检测算法 SSD 的训练和测试
物体检测算法 SSD 的训练和测试 GitHub:https://github.com/stoneyang/caffe_ssd Paper: https://arxiv.org/abs/1512.02 ...
- c# 后台post,包含file文件
http request 相关 private bool Upload(KeyValuePair<string, string>[] paramString,Stream paramFil ...