简体   繁体   English

为整数线性规划设计目标函数

[英]Devising objective function for integer linear programming

I am working to devise a objective function for a integer linear programming model. 我正在努力为整数线性规划模型设计目标函数。 The goal is to determine the copy number of two genes as well as if a gene conversion event has happened (where one copy is overwritten by the other, which looks like one was deleted but the net copy number has not changed). 目的是确定两个基因的拷贝数以及是否发生了基因转换事件(其中一个拷贝被另一个拷贝覆盖,看起来一个拷贝已被删除,但净拷贝数未更改)。

The problem involves two data vectors, P_A and P_B . 问题涉及两个数据向量P_AP_B The vectors contain continuous values larger than zero that correspond to a measure of copy number made at each position. 这些向量包含大于零的连续值,这些连续值对应于在每个位置进行的拷贝数测量。 P_{A,i} is not necessarily the same spot across the gene as P_{B,i} is, because the positions are unique to each copy (and can be mapped to an absolute position in the genome). P_{A,i}在基因上不一定与P_{B,i} ,因为每个副本的位置都是唯一的(并且可以映射到基因组中的绝对位置)。

Given this, my plan was to try and minimize the difference between my decision variables and the measured data across different genome windows, giving me different slices of the two data vectors that correspond to the same region. 鉴于此,我的计划是尝试使决策变量与跨不同基因组窗口的测量数据之间的差异最小化,从而为我提供对应于同一区域的两个数据向量的不同片段。

Decision variables: 决策变量:

A_w = copy number of A in window in {0,1,2,3,4}
B_w = copy number of B in window in {0,1,2,3,4}
C_w = gene conversion in {-2,-1,0,1,2}

The goal then would be to minimize the difference between the left and right sides of the below equations: 然后的目标是使以下等式的左侧和右侧之间的差异最小化:

A_w - C_w ~= mean(P_{A,W})
B_w + C_w ~= mean(P_{B,W})

Subject to a handful of constraints such as 2 <- A_w + B_w <= 4 受少数约束,例如2 <- A_w + B_w <= 4

But I am unsure how to formulate this into a function to minimize. 但是我不确定如何将其表述为最小化的函数。 I have two equations that are not really a function, and the decision variables have no coefficients. 我有两个方程并不是真正的函数,决策变量没有系数。

I am also unsure of how to handle the negative values of C_w . 我也不确定如何处理C_w

I also am unsure of how to bring the results back together; 我也不确定如何将结果重新组合在一起。 after I solve the LP in each window, I still need to merge it into one gene-wide call (and ideally identify which window(s) had non-zero values of C_w . 在每个窗口中求解完LP之后,我仍然需要将其合并为一个全基因调用(并理想地确定哪个窗口的C_wC_w

Create the LpProblem instance: 创建LpProblem实例:

problem = LpProblem("Another LpProblem", LpMinimize)

Objective (per what you've vaguely described above): 目标(根据您上面含糊的描述):

problem += (mean(P_{A,W}) - (A_w - C_w)) + (mean(P_{B,W}) - (B_w + C_w))

This is all I could tell from your really rather vague question. 从您这个非常模糊的问题中我可以说出这一切。 You'll need to be much more specific with what you mean by terms like "bring the results back together", or "handle the negative values in C_w". 您需要更明确地说明“将结果重新组合”或“处理C_w中的负值”之类的术语。 Add in your current code snippets and the errors you're getting for more details. 添加您当前的代码段和您所得到的错误以获取更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM