在做单细胞的时候,有很多基因属于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 | 特征选择的更多相关文章

  1. 选择屏幕(Selection Screen)

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  2. ISLR系列:(4.1)模型选择 Subset Selection

    Linear Model Selection and Regularization 此博文是 An Introduction to Statistical Learning with Applicat ...

  3. 选择排序 Selection Sort

    选择排序 Selection Sort 1)在数组中找最小的数与第一个位置上的数交换: 2)找第二小的数与第二个位置上的数交换: 3)以此类推 template<typename T> / ...

  4. 排序算法 - 选择排序(selection sort)

    选择排序(Selection sort)跟插入排序一样,也是O(n^2)的复杂度,这个排序方式也可以用我们的扑克牌来解释. 概念 桌面上有一堆牌,也是杂乱无章的,现在我们想将牌由小到大排序,如果使用选 ...

  5. 简单选择排序 Selection Sort 和树形选择排序 Tree Selection Sort

    选择排序 Selection Sort 选择排序的基本思想是:每一趟在剩余未排序的若干记录中选取关键字最小的(也可以是最大的,本文中均考虑排升序)记录作为有序序列中下一个记录. 如第i趟选择排序就是在 ...

  6. 排序算法--选择排序(Selection Sort)_C#程序实现

    排序算法--选择排序(Selection Sort)_C#程序实现 排序(Sort)是计算机程序设计中的一种重要操作,也是日常生活中经常遇到的问题.例如,字典中的单词是以字母的顺序排列,否则,使用起来 ...

  7. 跳跃空间(链表)排序 选择排序(selection sort),插入排序(insertion sort)

    跳跃空间(链表)排序 选择排序(selection sort),插入排序(insertion sort) 选择排序(selection sort) 算法原理:有一筐苹果,先挑出最大的一个放在最后,然后 ...

  8. 【ABAP系列】SAP ABAP选择屏幕(SELECTION SCREEN)事件解析

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP选择屏幕(SEL ...

  9. android 开发高仿QQ表情选择、输入框

    首先大家看效果: 用到的文件有(源码文件有,只包含表情.输入框等有关文件,工程项目是公司项目,恕不公开啦): res: drawable/face_del_icon.xml drawable/iv_f ...

随机推荐

  1. 关于VS2013下制作和使用静态库和动态库

    关于VS2013下制作和使用静态库和动态库 引言 什么是库:库是写好的现有的,成熟的,可以复用的代码. 所谓静态.动态是指链接.将一个程序编译成可执行程序的步骤: 静态库在链接阶段,会将汇编生成的目标 ...

  2. OO课程第四次总结

    终于来到了最后一次的OO作业,以博客作业的形式来终结也是极好的,回顾一下过去十六周自己的经历,感慨颇深. 测试和正确性论证 简单来说,测试的目的是将程序的代码做到全覆盖,从而确保每个分支都运行一遍,进 ...

  3. memory cache 和 disk cache

    memory cache简介:MemoryCache顾名思义,就是将资源缓存到内存中,等待下次访问时不需要重新下载资源,而直接从内存中获取.Webkit早已支持memoryCache. 目前Webki ...

  4. Codeforces Round #425 (Div. 2) Problem C Strange Radiation (Codeforces 832C) - 二分答案 - 数论

    n people are standing on a coordinate axis in points with positive integer coordinates strictly less ...

  5. 值类型之间的相互转化,运算符,if条件判断,循环,函数

    值类型之间的相互转化 number | string | boolean 一.转换为boolean=>Boolean(a); var num = 10; var s = '123'; var b ...

  6. Nikto

    https://cirt.net/nikto2 Fire Up Kali & Open Nikto Let's fire up Kali and get started with nikto. ...

  7. sqlserver无法在数据库上放置锁

    由于无法在数据库 ' ' 上放置锁,ALTER DATABASE 失败.请稍后再试.消息5069,级别16,状态1,第一行ALTER DATABASE 语句失败. 解决方法: 新建查询,通过下面SQL ...

  8. tp框架中的一些疑点知识-1

    tp默认的编码是utf-8 Runtime中的Cache和Logs都是分模块的,因为在应用app下可以有多个模块,但是 公共模块和Runtime模块只有一个, 所以, Runtime要包含各个模块的内 ...

  9. Markdown语法参考

    参考博客: https://www.jianshu.com/p/f3147a804368 https://www.jianshu.com/p/191d1e21f7ed https://www.jian ...

  10. (转) 机器学习很有趣Part6:怎样使用深度学习进行语音识别

    本文转自:http://www.jiqizhixin.com/article/2321 机器学习很有趣Part6:怎样使用深度学习进行语音识别 2017-02-19 13:20:47    机器学习  ...