我正在尝试在R中为二进制数据矩阵(11 x~1500)绘制热图.
heatmap(y, col = hmcols);
Run Code Online (Sandbox Code Playgroud)
矩阵'y'看起来像这样
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0 0 0 1 1 1 1 1 1 1 1 1
[2,] 0 0 1 0 0 1 0 0 0 0 0 0 1
[3,] 0 0 0 0 0 1 1 1 1 0 0 1 1 ...etc...
Run Code Online (Sandbox Code Playgroud)
我正在使用默认距离和聚类功能,但由于某种原因,我的热图显示了渐变色.我也试过使用二进制距离函数,尽管发生了类似的渐变.由于每个样本之间的距离,样本是否缺乏相似性?这是热图的图像:
https://www.dropbox.com/s/jz1r41lhnrkisvz/Rplots.pdf
我觉得这是因为我对默认距离和聚类功能如何重新排序数据缺乏了解.我该如何解释这些结果?
恐怕我不太了解pandas的合并功能,尽管目前我更喜欢python而不是R。
在R中,我始终能够非常轻松地合并数据帧,如下所示:
> merge(test,e2s, all.x=T)
Gene Mutation Chromosome Entrez
1 AGRN p.R451H chr1 375790
2 C1orf170 p.V663A/V683A chr1 84808
3 HES4 p.R44S chr1 57801
4 ISG15 p.S83N chr1 9636
5 PLEKHN1 p.S476P/S511P/S563P/S76P chr1 84069
Run Code Online (Sandbox Code Playgroud)
但是,我无法通过merge(how =“ left,right,inner,outer”)在熊猫中重建它。例如:
Outer yields a union, which makes sense:
x = test.merge(e2s, how="outer")
In [133]: x.shape
Out[133]: (46271, 4)
Run Code Online (Sandbox Code Playgroud)
但是即使Entrez_Gene_Id
合并成功,内部也会产生一个空的数据框:
In [143]: x = test.merge(e2s, how="inner")
In [144]: x
Out[144]:
Empty DataFrame
Columns: [Gene, Mutation, Chromosome, Entrez_Gene_Id]
Index: []
[0 rows x 4 …
Run Code Online (Sandbox Code Playgroud) 感谢Alex Spellers关于服务器端验证的教程,我为RestAdapter 实现了DS.Errors。
但是,在我的应用程序的这一部分中,我想做一个简单的客户端检查,以查看表单是否完整。(为什么没有DS.Errors处理所有错误?)
process: function(upload) {
var form = upload.get('form');
if (!isComplete(form)) {
upload.get('errors').add('field', 'field isempty');
return;
}
// else "Processing..."
Run Code Online (Sandbox Code Playgroud)
这里的逻辑有些简化,但是errors.add()应该无效,并向模型添加错误。但是我收到以下错误:
Uncaught Error: Attempted to handle event `becameInvalid` on <@model:upload:54a1f298ef912a2ace760b0f> while in state root.loaded.saved.
Run Code Online (Sandbox Code Playgroud)
我已经阅读了有关状态管理器的信息,但是不确定在向模型中添加错误之前应该如何以及将状态转换为什么状态。
提前致谢!
Ember : 1.8.1
Ember Data : 1.0.0-beta.11
Handlebars : 1.3.0
jQuery : 1.11.2
Run Code Online (Sandbox Code Playgroud)