我正在学习JBoss Drools我正在使用来自 hapmap 项目的遗传学数据:(http://hapmap.ncbi.nlm.nih.gov/genotypes/latest/forward/non-redundant/)。该目录中的每个文件都是一个表格,顶部是个体,左侧是基因组上的位置,以及观察到的突变每个人/职位。
在这里,我想使用 Drools 找到文件中的一些潜在错误(例如, child 没有来自 parent 的任何突变)。
1) 我想将这些数据加载到 Drools 中。这可能是大量数据(例如,genotypes_chr2_YRI_r27_nr.b36_fwd.txt.gz 经过 20Mo gzip 压缩)这些数据会存储在内存中吗?还是 Drools 将其存储在某个地方?或者我应该使用持久性系统?
2)关于模型:
我正在考虑将以下类放入 StatefulKnowledgeSession 中:
class Individual
{
private String name;
//constructor, getters, setters etc...
}
class Position
{
private String name;
private String chromosome;
private int position;
//constructor, getters, setters etc...
}
class ObservedMutation
{
private String individualName;
private String positionName;
private String observed;
//constructor, getters, setters etc...
}
或者 ObservedMutation 应该是:
class ObservedMutation
{
private Individual individual;
private Position position;
private String observed;
//constructor, getters, setters etc...
}
感谢您的建议
皮埃尔
更新:我的第一次测试:http://plindenbaum.blogspot.com/2010/07/rules-engine-for-bioinformatics-playing.html
最佳答案
是的,当您插入大量数据时,Drools会将它们存储在内存中。 20 Mb 可能不是问题 - 试试吧。
为您建议的模型类编写规则应该很简单 - 第一个测试中的 hapmap.drl 示例中的规则看起来很合理。两个 ObservedMutation 类之间的选择与其他任何事情一样都是品味问题,因为它们将导致不同的 DRL 规则语法。我将从第二个版本开始,看看你如何进行:如果你有对象属性(如 ObservedMutation 的第二个版本),也许不明显的事情是你可能需要使用 this
来引用绑定(bind)对象,例如$p
位于:
when
ObservedMutation($p : position)
Position(this == $p)
关于java - 学习JBoss流口水: what should be my model,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3313153/