基因驱动 CovEx 代码阅读(一)

CovEx

源代码 https://sourceforge.net/projects/cancer-pathway/

首先重点阅读 README1.txt 一步一步执行

安装 Gurobi Optimizer 注意:
这里需要校园网环境 官网上下载到gurobi8.0.1_linux64.tar.gz 安装产生gurobi.lic 具体步骤参考:
https://blog.csdn.net/seaskying/article/details/52761823
当显示如下时,说明安装完成(为了顺利执行CovEx 的第194行:time gurobi.sh ./GAOBO_$MyDate/Tingge.py)

~/CovEx$ gurobi.sh
Python 2.7.13 (default, Sep  4 2017, 15:40:17) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Academic license - for non-commercial use only

Gurobi Interactive Shell (linux64), Version 8.0.1
Copyright (c) 2018, Gurobi Optimization, LLC
Type "help()" for help

gurobi> 

CovEx

CovEx 是一个shell脚本 可以通过 一个.cc源码一个.cc源码的执行
我通过 GUN 调试了 WriteBLP.cc

~/CovEx$ gdb ./src/Write_BLP
 GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./src/Write_BLP...done.
(gdb) set args ./sample_test/LAML ./data/PPR_hi.m ./data/hi_index_file.txt 1 15 300 2 5 ./GAOBO_$MyDate/ ./sample_test/analyzed_genes  // 传递10个参数
(gdb) 
#include<fstream>
#include<vector>
#include<string>
#include<iostream>
#include<stdlib.h>
#include<algorithm>
#include<map>
using namespace std;
#define LAMDA atof(argv[4])
#define D atof(argv[5]) 
#define NUM atof(argv[6])
#define MIN_T atoi(argv[7])
#define MAX_T atoi(argv[8])

//./Write_BLP  mutation_data.txt  PPI_matrix.txt  PPI_index_file.txt  1(lamda)  15(delta)  300(local_network_size)  2(min_size) 5(max_size) Out_Dir genes_considered
    
inline static void split(std::string src, std::string token, vector<std::string>& vect)
{ 
    int nend=0;
    int nbegin=0;
    while(nend != -1)
    {
        nend = src.find_first_of(token, nbegin);
        if(nend == -1)
            vect.push_back(src.substr(nbegin, src.length()-nbegin));
        else
            vect.push_back(src.substr(nbegin, nend-nbegin));
        nbegin = nend + 1;
    }
}
/*
inline 是内联函数,split 函数是分割作用
int main (int argc, char *argv[])

{
    int N,edge_num,num=2,ch,ch1=0;
    int i=0,j=0,k=0,i1,j1,i2,j2,k1,k2,k3,p,q;   
    int size=0,size1,size2,s,M_size,SIZE,SIZE1,SIZE2,SIZE3;
    float DELTA;

    vector<vector<int> > C,Matrix01,RawILP_genes,snvs,snvs1;
    vector< int > int_line,Genes,isolate_genes,indictor,Gene_network,k3_neighbour;
    vector< float > line,InfluenceMatrix,Inf;
    vector<string> Line; 

    map<string,int> map1,map2;
    map<int,int> map3;
    map<int,string> map5;
        string temp,sto=",",sto1=" ";                    
    int_line.clear();
    line.clear();
    Line.clear();
    char  szFileName1[100];
    char  szFileName2[100];
    char  szFileName3[100];
    ifstream ifs,ifs1,ifs2,ifs3;        
    ofstream ofs1,ofs2,ofs3;

        ifs.open(argv[10]);
    ch=ifs.get(); 
        if ( ch!=EOF )  
        {
        ch1=1;
        ifs3.open(argv[10]);
        while(getline(ifs3, temp))
        {
            map1[temp]=1;
        }
        ifs3.close();
    }
        ifs.close();
/*
(gdb) p map1
$1 = std::map with 100 elements = {["ABCF1"] = 1, ["ABL1"] = 1, ["ABTB1"] = 1, 
  ["ACVR2B"] = 1, ["ADAM19"] = 1, ["ADAMTS1"] = 1, ["ADCY3"] = 1, ["ADNP"] = 1, 
  ["ADRBK1"] = 1, ["AFF4"] = 1, ["AKAP12"] = 1, ["AKAP13"] = 1, ["AKAP5"] = 1, 
  ["AKD1"] = 1, ["ALG13"] = 1, ["AMOT"] = 1, ["ANG"] = 1, ["ANKRD13A"] = 1, 
  ["ANKRD24"] = 1, ["AP1G2"] = 1, ["AP1M1"] = 1, ["ARHGAP18"] = 1, ["ARHGAP5"] = 1, 
  ["ARHGEF1"] = 1, ["ARHGEF10L"] = 1, ["ARHGEF11"] = 1, ["ARHGEF5"] = 1, 
  ["ARHGEF6"] = 1, ["ARID1A"] = 1, ["ARID2"] = 1, ["ARID4B"] = 1, ["ARL3"] = 1, 
  ["ASTE1"] = 1, ["ASUN"] = 1, ["ASXL1"] = 1, ["ASXL2"] = 1, ["ATF7IP"] = 1, 
  ["ATG14"] = 1, ["ATG16L1"] = 1, ["ATP2A2"] = 1, ["ATP6AP2"] = 1, ["ATXN7L1"] = 1, 
  ["AURKB"] = 1, ["BABAM1"] = 1, ["BAIAP2L1"] = 1, ["BCLAF1"] = 1, ["BCOR"] = 1, 
  ["BECN1"] = 1, ["BICD1"] = 1, ["BLZF1"] = 1, ["BMP6"] = 1, ["BPTF"] = 1, 
  ["BRCC3"] = 1, ["BRMS1"] = 1, ["BRPF1"] = 1, ["BUB1"] = 1, ["BUB3"] = 1, 
  ["C2"] = 1, ["C3"] = 1, ["C5"] = 1, ["CAD"] = 1, ["CALR"] = 1, ["CAMKK1"] = 1, 
  ["CAND1"] = 1, ["CAPRIN2"] = 1, ["CASC5"] = 1, ["CASP10"] = 1, ["CBFB"] = 1, 
  ["CBL"] = 1, ["CBX5"] = 1, ["CBX7"] = 1, ["CCDC136"] = 1, ["CCDC150"] = 1, 
  ["CCDC24"] = 1, ["CCDC57"] = 1, ["CCNG2"] = 1, ["CD74"] = 1, ["CDC42"] = 1, 
  ["CDH24"] = 1, ["CDK11B"] = 1, ["CDK13"] = 1, ["CDON"] = 1, ["CEBPA"] = 1, 
  ["CELSR1"] = 1, ["CELSR3"] = 1, ["CENPB"] = 1, ["CENPF"] = 1, ["CENPN"] = 1, 
  ["CEP170"] = 1, ["CEP290"] = 1, ["CHD4"] = 1, ["CHIC2"] = 1, ["CIC"] = 1, 
  ["CKAP4"] = 1, ["CNOT3"] = 1, ["CNOT6"] = 1, ["CNOT6L"] = 1, ["COPS2"] = 1, 
  ["CPNE3"] = 1, ["CR1"] = 1...}
*/


    ifs.open(argv[3]);
    i=0;
    while(getline(ifs, temp))
    {
        i++;
        split(temp, sto1,  Line);
        k=atoi(Line[0].c_str());
        map2[Line[1]]=k;
        map5[k]=Line[1];
        Line.clear();
    }
    N=i;
    ifs.close();
/*
N = 9859
(gdb) p map2
$2 = std::map with 9859 elements = {["A1BG"] = 1, ["A1CF"] = 2, ["A2BP1"] = 3, 
  ["A2LD1"] = 4, ["A2M"] = 5, ["AACS"] = 6, ["AAGAB"] = 7, ["AAMP"] = 8, 
  ["AANAT"] = 9, ["AARS2"] = 10, ["AASDHPPT"] = 11, ["AATF"] = 12, ["ABAT"] = 13, 
  ["ABCA1"] = 14, ["ABCA2"] = 15, ["ABCB1"] = 16, ["ABCB6"] = 17, ["ABCB8"] = 18, 
  ["ABCC2"] = 19, ["ABCC8"] = 20, ["ABCC9"] = 21, ["ABCD1"] = 22, ["ABCD2"] = 23, 
  ["ABCD3"] = 24, ["ABCD4"] = 25, ["ABCF1"] = 26, ["ABCF3"] = 27, ["ABCG5"] = 28, 
  ["ABCG8"] = 29, ["ABHD1"] = 30, ["ABHD16A"] = 31, ["ABHD4"] = 32, ["ABI1"] = 33, 
  ["ABI2"] = 34, ["ABI3"] = 35, ["ABI3BP"] = 36, ["ABL1"] = 37, ["ABL2"] = 38, 
  ["ABLIM1"] = 39, ["ABLIM2"] = 40, ["ABLIM3"] = 41, ["ABO"] = 42, ["ABP1"] = 43, 
  ["ABR"] = 44, ["ABT1"] = 45, ["ABTB1"] = 46, ["ABTB2"] = 47, ["ACACA"] = 48, 
  ["ACACB"] = 49, ["ACAD8"] = 50, ["ACADM"] = 51, ["ACAN"] = 52, ["ACAP1"] = 53, 
  ["ACAP3"] = 54, ["ACAT2"] = 55, ["ACBD3"] = 56, ["ACCS"] = 57, ["ACD"] = 58, 
  ["ACE2"] = 59, ["ACHE"] = 60, ["ACIN1"] = 61, ["ACMSD"] = 62, ["ACO1"] = 63, 
  ["ACO2"] = 64, ["ACOT13"] = 65, ["ACOT7"] = 66, ["ACOT8"] = 67, ["ACOX3"] = 68, 
  ["ACP1"] = 69, ["ACP5"] = 70, ["ACP6"] = 71, ["ACPP"] = 72, ["ACSBG1"] = 73, 
  ["ACSF2"] = 74, ["ACSL5"] = 75, ["ACSM2B"] = 76, ["ACSS1"] = 77, ["ACSS2"] = 78, 
  ["ACTA1"] = 79, ["ACTB"] = 80, ["ACTC1"] = 81, ["ACTG1"] = 82, ["ACTL6A"] = 83, 
  ["ACTL6B"] = 84, ["ACTL7A"] = 85, ["ACTL8"] = 86, ["ACTN1"] = 87, ["ACTN2"] = 88, 
  ["ACTN3"] = 89, ["ACTN4"] = 90, ["ACTR10"] = 91, ["ACTR1A"] = 92, 
  ["ACTR1B"] = 93, ["ACTR2"] = 94, ["ACTR3"] = 95, ["ACTR3B"] = 96, ["ACTR5"] = 97, 
  ["ACTR6"] = 98, ["ACTR8"] = 99, ["ACVR1"] = 100...}
(gdb) p map5
$3 = std::map with 9859 elements = {[1] = "A1BG", [2] = "A1CF", [3] = "A2BP1", 
  [4] = "A2LD1", [5] = "A2M", [6] = "AACS", [7] = "AAGAB", [8] = "AAMP", 
  [9] = "AANAT", [10] = "AARS2", [11] = "AASDHPPT", [12] = "AATF", [13] = "ABAT", 
  [14] = "ABCA1", [15] = "ABCA2", [16] = "ABCB1", [17] = "ABCB6", [18] = "ABCB8", 
  [19] = "ABCC2", [20] = "ABCC8", [21] = "ABCC9", [22] = "ABCD1", [23] = "ABCD2", 
  [24] = "ABCD3", [25] = "ABCD4", [26] = "ABCF1", [27] = "ABCF3", [28] = "ABCG5", 
  [29] = "ABCG8", [30] = "ABHD1", [31] = "ABHD16A", [32] = "ABHD4", [33] = "ABI1", 
  [34] = "ABI2", [35] = "ABI3", [36] = "ABI3BP", [37] = "ABL1", [38] = "ABL2", 
  [39] = "ABLIM1", [40] = "ABLIM2", [41] = "ABLIM3", [42] = "ABO", [43] = "ABP1", 
  [44] = "ABR", [45] = "ABT1", [46] = "ABTB1", [47] = "ABTB2", [48] = "ACACA", 
  [49] = "ACACB", [50] = "ACAD8", [51] = "ACADM", [52] = "ACAN", [53] = "ACAP1", 
  [54] = "ACAP3", [55] = "ACAT2", [56] = "ACBD3", [57] = "ACCS", [58] = "ACD", 
  [59] = "ACE2", [60] = "ACHE", [61] = "ACIN1", [62] = "ACMSD", [63] = "ACO1", 
  [64] = "ACO2", [65] = "ACOT13", [66] = "ACOT7", [67] = "ACOT8", [68] = "ACOX3", 
  [69] = "ACP1", [70] = "ACP5", [71] = "ACP6", [72] = "ACPP", [73] = "ACSBG1", 
  [74] = "ACSF2", [75] = "ACSL5", [76] = "ACSM2B", [77] = "ACSS1", [78] = "ACSS2", 
  [79] = "ACTA1", [80] = "ACTB", [81] = "ACTC1", [82] = "ACTG1", [83] = "ACTL6A", 
  [84] = "ACTL6B", [85] = "ACTL7A", [86] = "ACTL8", [87] = "ACTN1", [88] = "ACTN2", 
  [89] = "ACTN3", [90] = "ACTN4", [91] = "ACTR10", [92] = "ACTR1A", 
  [93] = "ACTR1B", [94] = "ACTR2", [95] = "ACTR3", [96] = "ACTR3B", [97] = "ACTR5", 
  [98] = "ACTR6", [99] = "ACTR8", [100] = "ACVR1"...}

*/
    ifs.open(argv[1]);
    if(ch1==1)
    {
        while(getline(ifs, temp))
        {
            split(temp, sto1,  Line);
/*(gdb) p temp
$6 = "TCGA-AB-2970 BCLAF1 BCOR FLT3 PLEKHH1 RUNX1 WT1"
*/
            SIZE=Line.size();
            for(i=1;i<SIZE;i++)
            {
                k=map2[Line[i]];
                if(map1[Line[i]] && k)
                {
                    int_line.push_back(k);
                }
            }
/*
(gdb) p int_line
$9 = std::vector of length 2, capacity 2 = {734, 735}
    734 BCLAF1
    735 BCOR
*/
            snvs.push_back(int_line);
            Line.clear();
            int_line.clear();
        }
    }
/*
(gdb) p snvs
$11 = std::vector of length 0, capacity 0

*/
    else
    {
        while(getline(ifs, temp))
        {
            split(temp, sto1,  Line);
            SIZE=Line.size();
            for(i=1;i<SIZE;i++)
            {
                k=map2[Line[i]];
                if(k)
                {
                    int_line.push_back(k);
                }
            }
            snvs.push_back(int_line);
            Line.clear();
            int_line.clear();
        }
    }
/*(gdb) p snvs
$24 = std::vector of length 192, capacity 256 = {
  std::vector of length 2, capacity 2 = {734, 735}, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 1, capacity 1 = {103}, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 1, capacity 1 = {308}, 
  std::vector of length 0, capacity 0, std::vector of length 1, capacity 1 = {607}, 
  std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 0, capacity 0, std::vector of length 3, capacity 3 = {134, 
    777, 1640}, std::vector of length 0, capacity 0, 
  std::vector of length 4, capacity 4 = {224, 561, 1269, 1379}, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 1, capacity 1 = {740}, std::vector of length 0, capacity 0, 
  std::vector of length 1, capacity 1 = {352}, std::vector of length 0, capacity 0, 
  std::vector of length 1, capacity 1 = {450}, 
  std::vector of length 3, capacity 3 = {735, 805, 1467}, 
  std::vector of length 0, capacity 0, std::vector of length 1, capacity 1 = {114}, 
  std::vector of length 0, capacity 0, std::vector of length 1, capacity 1 = {
    1325}, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 1, capacity 1 = {
    1665}, std::vector of length 1, capacity 1 = {1260}, 
  std::vector of length 2, capacity 2 = {1303, 1387}, 
  std::vector of length 0, capacity 0, std::vector of length 1, capacity 1 = {
    1651}, std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 2, capacity 2 = {466, 1924}, 
  std::vector of length 2, capacity 2 = {46, 592}, 
  std::vector of length 1, capacity 1 = {560}, 
  std::vector of length 1, capacity 1 = {1860}, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 2, capacity 2 = {561, 575}, 
  std::vector of length 0, capacity 0, std::vector of length 1, capacity 1 = {637}, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 1, capacity 1 = {1738}, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 0, capacity 0, std::vector of length 1, capacity 1 = {46}, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
---Type <return> to continue, or q <return> to quit---
*/
    ifs.close();
    map1.clear();
    SIZE=snvs.size(); // SIZE=192
    for(i=0;i<SIZE;i++)
    {
        if(!snvs[i].empty())    
        {
            snvs1.push_back(snvs[i]);
            SIZE1=snvs[i].size();
            for(j=0;j<SIZE1;j++)
            {
                if(!map3[snvs[i][j]])
                {
                    Genes.push_back(snvs[i][j]);
                    map3[snvs[i][j]]=1;
                }
            }
        }
    }
/*
(gdb) p snvs1
$30 = std::vector of length 89, capacity 128 = {
  std::vector of length 2, capacity 2 = {734, 735}, 
  std::vector of length 1, capacity 1 = {103}, 
  std::vector of length 1, capacity 1 = {308}, 
  std::vector of length 1, capacity 1 = {607}, 
  std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 3, capacity 3 = {134, 777, 1640}, 
  std::vector of length 4, capacity 4 = {224, 561, 1269, 1379}, 
  std::vector of length 1, capacity 1 = {740}, 
  std::vector of length 1, capacity 1 = {352}, 
  std::vector of length 1, capacity 1 = {450}, 
  std::vector of length 3, capacity 3 = {735, 805, 1467}, 
  std::vector of length 1, capacity 1 = {114}, 
  std::vector of length 1, capacity 1 = {1325}, 
  std::vector of length 1, capacity 1 = {1665}, 
  std::vector of length 1, capacity 1 = {1260}, 
  std::vector of length 2, capacity 2 = {1303, 1387}, 
  std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 2, capacity 2 = {466, 1924}, 
  std::vector of length 2, capacity 2 = {46, 592}, 
  std::vector of length 1, capacity 1 = {560}, 
  std::vector of length 1, capacity 1 = {1860}, 
  std::vector of length 2, capacity 2 = {561, 575}, 
  std::vector of length 1, capacity 1 = {637}, 
  std::vector of length 1, capacity 1 = {1738}, 
  std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 1, capacity 1 = {46}, 
  std::vector of length 1, capacity 1 = {1325}, 
  std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 1, capacity 1 = {457}, 
  std::vector of length 2, capacity 2 = {351, 829}, 
  std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 1, capacity 1 = {1651}, 
  std::vector of length 1, capacity 1 = {1538}, 
  std::vector of length 2, capacity 2 = {1287, 1651}, 
  std::vector of length 1, capacity 1 = {1672}, 
  std::vector of length 1, capacity 1 = {1306}, 
  std::vector of length 1, capacity 1 = {850}, 
  std::vector of length 1, capacity 1 = {852}, 
  
(gdb) p map3
$44 = std::map with 13 elements = {[103] = 1, [134] = 1, [224] = 1, [308] = 1, 
  [561] = 1, [607] = 1, [734] = 1, [735] = 1, [777] = 1, [1269] = 1, [1379] = 1, 
  [1640] = 1, [1651] = 1} ....

  */
    map3.clear();
    sort(Genes.begin(),Genes.end());
/*
(gdb) p Genes
$46 = std::vector of length 100, capacity 128 = {26, 37, 46, 103, 114, 118, 134, 
  146, 157, 169, 224, 225, 230, 236, 259, 282, 294, 308, 314, 351, 352, 439, 450, 
  455, 456, 457, 465, 466, 469, 471, 475, 486, 559, 560, 561, 562, 571, 574, 575, 
  592, 607, 637, 643, 664, 679, 734, 735, 740, 757, 777, 784, 805, 810, 825, 829, 
  850, 852, 1058, 1112, 1140, 1244, 1260, 1269, 1276, 1287, 1303, 1306, 1325, 1326, 
  1340, 1342, 1373, 1379, 1387, 1400, 1467, 1538, 1569, 1598, 1606, 1608, 1640, 
  1651, 1663, 1665, 1668, 1672, 1677, 1684, 1690, 1738, 1747, 1783, 1793, 1858, 
  1860, 1861, 1924, 1965, 1977}
*/
    SIZE=Genes.size(); 
/*
(gdb) p SIZE
$48 = 100
*/
    for(i=0;i<SIZE;i++)
    {
        k=Genes[i];
        map3[k]=i+1;
    }
    k1=snvs1.size();
    k2=Genes.size();
/*
(gdb) p k1
$49 = 89
(gdb) p k2
$50 = 100
(gdb) p map3
$51 = std::map with 100 elements = {[26] = 1, [37] = 2, [46] = 3, [103] = 4, 
  [114] = 5, [118] = 6, [134] = 7, [146] = 8, [157] = 9, [169] = 10, [224] = 11, 
  [225] = 12, [230] = 13, [236] = 14, [259] = 15, [282] = 16, [294] = 17, 
  [308] = 18, [314] = 19, [351] = 20, [352] = 21, [439] = 22, [450] = 23, 
  [455] = 24, [456] = 25, [457] = 26, [465] = 27, [466] = 28, [469] = 29, 
  [471] = 30, [475] = 31, [486] = 32, [559] = 33, [560] = 34, [561] = 35, 
  [562] = 36, [571] = 37, [574] = 38, [575] = 39, [592] = 40, [607] = 41, 
  [637] = 42, [643] = 43, [664] = 44, [679] = 45, [734] = 46, [735] = 47, 
  [740] = 48, [757] = 49, [777] = 50, [784] = 51, [805] = 52, [810] = 53, 
  [825] = 54, [829] = 55, [850] = 56, [852] = 57, [1058] = 58, [1112] = 59, 
  [1140] = 60, [1244] = 61, [1260] = 62, [1269] = 63, [1276] = 64, [1287] = 65, 
  [1303] = 66, [1306] = 67, [1325] = 68, [1326] = 69, [1340] = 70, [1342] = 71, 
  [1373] = 72, [1379] = 73, [1387] = 74, [1400] = 75, [1467] = 76, [1538] = 77, 
  [1569] = 78, [1598] = 79, [1606] = 80, [1608] = 81, [1640] = 82, [1651] = 83, 
  [1663] = 84, [1665] = 85, [1668] = 86, [1672] = 87, [1677] = 88, [1684] = 89, 
  [1690] = 90, [1738] = 91, [1747] = 92, [1783] = 93, [1793] = 94, [1858] = 95, 
  [1860] = 96, [1861] = 97, [1924] = 98, [1965] = 99, [1977] = 100...}
*/
    sprintf(szFileName3,"%sWrite_BLP.log",argv[9]);   
    ofs3.open(szFileName3);
    ofs3<<"Number of all patients: "<<snvs.size()<<endl;
    ofs3<<"Number of covered patients "<<k1<<endl;
    ofs3<<"Number of considered genes: "<<k2<<endl;
/*
(gdb) p k2
$62 = 100
(gdb) p snvs.size()
$63 = 192
(gdb) p k1
$64 = 89
*/
    sprintf(szFileName1,"%sGene_num.txt",argv[9]);   
    ofs1.open(szFileName1);
    ofs1<<k2;
    ofs1.close();

    for(k=0;k<=k2;k++)
    {
        int_line.push_back(0);    //one more zero
    }
/*
(gdb) p int_line
$52 = std::vector of length 101, capacity 128 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0}
*/
    for(i=0;i<k1;i++)
    {
        Matrix01.push_back(int_line);       
            size=snvs1[i].size();
        for(k=0;k<size;k++)
        {
            j=snvs1[i][k];
            j1=map3[j];
            Matrix01[i][j1]=1;
        }   
    }
/*
Breakpoint 22, main (argc=<optimized out>, argv=0x7fffffffdd38) at Write_BLP.cc:180
180     ifs.close();
(gdb) p Matrix01
$55 = std::vector of length 89, capacity 128 = {
  std::vector of length 101, capacity 101 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, std::vector of length 101, capacity 101 = {0, 0, 
    0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 
  std::vector of length 101, capacity 101 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, std::vector of length 101, capacity 101 = {0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 
  std::vector of length 101, capacity 101 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, std::vector of length 101, capacity 101 = {0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 
  std::vector of length 101, capacity 101 = {0, 0, 0, 0, 0, 0, 0, 1, 
---Type <return> to continue, or q <return> to quit---
*/
    int_line.clear();  
    ifs.close();
    M_size=k1;
/*
(gdb) p k1
$56 = 89
(gdb) p M_size
$57 = 89
*/
    ifs.open(argv[2]);
        while(getline(ifs, temp))               
    {   
            split(temp, sto,  Line) ; 
        size=Line.size(); 
        for(j=0;j<size;j++)
        {
            InfluenceMatrix.push_back(atof(Line[j].c_str()));
        }
                Line.clear();
    }
/*
(gdb) p InfluenceMatrix   //PPI_matrix
$58 = std::vector of length 75262322, capacity 134217728 = {0.402909994, 
  4.31299986e-06, 3.79390008e-06, 1.30160004e-06, 0.000127759995, 2.53429994e-06, 
  1.57569993e-05, 0.000134410002, 5.09900019e-06, 3.38569998e-06, 1.26699997e-05, 
  1.19030001e-05, 5.9207e-06, 5.72679983e-06, 9.47280023e-06, 2.46239997e-05, 
  2.12480008e-05, 2.02009996e-05, 1.96089991e-06, 4.91070011e-07, 6.63850005e-06, 
  9.69560006e-07, 9.69560006e-07, 9.69560006e-07, 1.07229998e-05, 2.11650004e-05, 
  1.04749997e-05, 4.47630009e-06, 2.68579993e-06, 2.24399992e-06, 2.56959993e-06, 
  0.000579439977, 4.11510018e-06, 5.56089981e-06, 5.76830007e-06, 5.59779983e-06, 
  1.1608e-05, 1.81220003e-05, 5.70880002e-06, 3.95010011e-06, 7.45629995e-06, 
  2.12269993e-06, 1.05740003e-06, 6.96449979e-06, 4.3015998e-06, 7.72559997e-06, 
  1.26880004e-05, 2.42139995e-05, 3.43290003e-06, 6.53530014e-06, 9.37970015e-07, 
  5.70979978e-07, 5.76010007e-06, 1.26530003e-05, 8.28649991e-06, 2.8211e-06, 
  7.55690007e-06, 4.18540003e-06, 4.37049994e-06, 5.02930016e-06, 6.19230013e-06, 
  4.20800006e-06, 2.46239997e-05, 2.61300011e-06, 4.72360007e-05, 3.27030011e-06, 
  4.14819988e-06, 2.8211e-06, 6.27569989e-06, 2.30130008e-05, 4.11580004e-05, 
  5.02080002e-05, 2.99490002e-05, 4.1843e-06, 1.58850003e-06, 5.99399982e-06, 
  6.55209988e-06, 3.29199997e-06, 2.16469998e-05, 0.000161560005, 4.39620017e-05, 
  2.62770009e-05, 5.56509985e-06, 0.000724039972, 2.53119993e-06, 3.7376999e-06, 
  1.44149999e-05, 5.94899984e-06, 2.7946e-05, 7.10230006e-06, 2.54120005e-05, 
  9.0880003e-06, 0.000294089987, 8.1549997e-06, 6.62430011e-06, 2.52890004e-05, 
  9.02830016e-06, 4.63380002e-06, 4.61140007e-06, 3.96909991e-06, 8.55120015e-06, 
  7.25590007e-06, 1.14739996e-05, 2.90980006e-06, 1.42839997e-06, 4.70229998e-06, 
  3.60700005e-06, 7.2109998e-07, 2.72319994e-06, 1.31059996e-05, 7.11409984e-06, 
  9.16740009e-06, 2.64219989e-06, 6.27740019e-06, 3.79249991e-06, 2.86840009e-06, 
  5.19530022e-06, 5.89389992e-06, 0.000825299998, 5.01869999e-06, 5.94399989e-06, 
  1.0883e-05, 3.42589999e-07, 2.81839993e-06, 3.86649981e-06, 2.29200009e-06, 
  2.06099994e-05, 1.19349997e-05, 5.92310016e-06, 1.17769996e-05, 4.86600002e-05, 
  6.13680004e-06, 2.36460005e-06, 2.80280005e-06, 1.16130004e-05, 1.0668e-05, 
  5.21799984e-06, 1.23509999e-05, 9.15730016e-06, 5.49439983e-06, 0.000190609993, 
  5.21430002e-06, 1.0879e-05, 2.23960001e-06, 3.1341001e-06, 1.10569999e-05, 
  9.27600013e-06, 1.52279995e-06, 1.41290002e-06, 3.34659999e-05, 3.72430009e-06, 
---Type <return> to continue, or q <return> to quit---

*/
    ifs.close();
    cout<<"size of PPI matrix: "<<size<<endl<<"Writing BLP programming..."<<endl;

    for(i=0;i<k2-1;i++)
    {
        for(j=i+1;j<k2;j++)
        {
            i1=Genes[i]-1;
            j1=Genes[j]-1;
            i2=i1*N+j1;
            j2=j1*N+i1;
            if(InfluenceMatrix[i2]>=InfluenceMatrix[j2])
/*
(gdb) p InfluenceMatrix[i2]
Python Exception <class 'gdb.error'> value has been optimized out: 
Error while executing Python code.
*/
            {
                Inf.push_back(InfluenceMatrix[j2]);
            }
            else
            {
                Inf.push_back(InfluenceMatrix[i2]);
            }
        }
    }
    sort(Inf.rbegin(),Inf.rend());
/*
(gdb) p Inf
$65 = std::vector of length 4950, capacity 8192 = {9.83259964, 9.48359966, 
  9.18470001, 9.11600018, 9.06849957, 9.05130005, 8.90789986, 8.8114996, 
  8.62479973, 8.60750008, 8.4921999, 8.47099972, 8.44460011, 8.26990032, 
  8.25469971, 8.2258997, 8.01449966, 7.98759985, 7.82410002, 7.82280016, 
  7.80490017, 7.69259977, 7.61280012, 7.52199984, 7.45800018, 7.4064002, 7.3755002, 
  7.37139988, 7.34649992, 7.29850006, 7.29850006, 7.25820017, 7.20699978, 
  7.16610003, 7.16610003, 7.15299988, 7.12599993, 7.09240007, 6.92210007, 
  6.91179991, 6.8973999, 6.89489985, 6.87989998, 6.87319994, 6.80429983, 
  6.79650021, 6.78649998, 6.77600002, 6.7743001, 6.7420001, 6.73339987, 6.7256999, 
  6.7052002, 6.70319986, 6.62109995, 6.58400011, 6.47139978, 6.40600014, 
  6.38539982, 6.3281002, 6.32189989, 6.30849981, 6.30849981, 6.29559994, 
  6.25979996, 6.25699997, 6.20569992, 6.10839987, 6.06220007, 6.06010008, 
  6.05770016, 6.05369997, 6.03639984, 6.02190018, 6.01450014, 6, 5.99380016, 
  5.97989988, 5.94820023, 5.89760017, 5.88079977, 5.86429977, 5.84509993, 
  5.84280014, 5.8355999, 5.77759981, 5.76410007, 5.65880013, 5.63369989, 
  5.60459995, 5.60020018, 5.57730007, 5.54409981, 5.46019983, 5.4538002, 5.4538002, 
  5.44700003, 5.44420004, 5.42579985, 5.41590023, 5.38520002, 5.37330008, 
  5.36929989, 5.36929989, 5.26569986, 5.26240015, 5.2507, 5.24609995, 5.23699999, 
  5.23169994, 5.23169994, 5.18610001, 5.1097002, 5.10680008, 5.06780005, 
  5.04759979, 5.01879978, 5.00169992, 4.99760008, 4.99319983, 4.97539997, 
  4.96869993, 4.95599985, 4.93240023, 4.91909981, 4.91890001, 4.90670013, 
  4.90460014, 4.8980999, 4.87909985, 4.87220001, 4.84439993, 4.82000017, 
  4.81869984, 4.78660011, 4.78459978, 4.77930021, 4.73579979, 4.72440004, 
  4.70849991, 4.69789982, 4.69659996, 4.6855998, 4.68050003, 4.67579985, 
  4.65829992, 4.64989996, 4.64620018, 4.62890005, 4.61910009, 4.61810017, 
  4.60160017, 4.58650017, 4.56110001, 4.55480003, 4.52580023, 4.50229979, 
  4.49900007, 4.49749994, 4.4843998, 4.4843998, 4.46869993, 4.45970011, 4.41660023, 
  4.39370012, 4.38630009, 4.38329983, 4.37839985, 4.33760023, 4.33519983, 
  4.32019997, 4.30530024, 4.3052001, 4.25689983, 4.2421999, 4.22790003, 4.21680021, 
  4.21479988, 4.20730019, 4.20459986, 4.20100021, 4.19740009, 4.18389988, 
  4.17980003, 4.17640018, 4.16139984, 4.14690018, 4.12839985, 4.12090015, 
---Type <return> to continue, or q <return> to quit---
*/
    j=int(D*k2/2-1);
    DELTA=Inf[j];
/*
(gdb) p j
$1 = 749
(gdb) p DELTA
$2 = 1.12282347e-38
*/
        ofs3<<"delta: "<<DELTA<<endl;
    for (i=0;i<=k2;i++)             
        {
               C.push_back(int_line);
        }
/*
(gdb) p C
$3 = std::vector of length 101, capacity 128 = {
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
---Type <return> to continue, or q <return> to quit---
*/
    edge_num=0;
    for (i=0;i<k2-1;i++)              
    {
        for (j=i+1;j<k2;j++)
                {
            i1=Genes[i]-1;
            j1=Genes[j]-1;
            i2=i1*N+j1;
            j2=j1*N+i1;
            if (InfluenceMatrix[i2]>=DELTA && InfluenceMatrix[j2]>=DELTA)
            {
                C[i+1].push_back(j+1);
                C[j+1].push_back(i+1);
                edge_num++;
            }
                }
        }
/*
(gdb) p C
$5 = std::vector of length 101, capacity 128 = {
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 0, capacity 0, 
  std::vector of length 0, capacity 0, std::vector of length 40, capacity 64 = {52, 
    53, 54, 56, 58, 59, 60, 61, 62, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 77, 79, 
    80, 81, 83, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100}, 
  std::vector of length 31, capacity 32 = {51, 53, 54, 55, 56, 58, 59, 60, 61, 62, 
    63, 64, 67, 70, 71, 72, 74, 79, 81, 83, 84, 85, 86, 88, 89, 91, 92, 93, 94, 98, 
---Type <return> to continue, or q <return> to quit---
    61, 62, 63, 64, 67, 70, 71, 72, 74, 79, 81, 83, 84, 85, 86, 88, 89, 91, 
    92, 93, 94, 98, 99}, std::vector of length 28, capacity 32 = {51, 52, 
    56, 60, 62, 63, 64, 68, 70, 71, 72, 73, 74, 78, 79, 80, 81, 82, 83, 84, 
    86, 87, 88, 94, 95, 96, 99, 100}, 
  std::vector of length 28, capacity 32 = {51, 52, 55, 56, 59, 60, 61, 67, 
    68, 69, 70, 71, 73, 74, 75, 76, 77, 82, 83, 84, 85, 86, 89
    , 91, 92, 95, 
    97, 98}, std::vector of length 28, capacity 32 = {52, 54, 58, 59, 61, 
    63, 66, 67, 68, 69, 72, 73, 75, 76, 77, 82, 85, 86, 88, 89, 90, 91, 92, 
    95, 97, 98, 99, 100}, std::vector of length 30, capacity 32 = {51, 52, 
    53, 54, 57, 58, 59, 60, 63, 65, 66, 68, 72, 73, 74, 77, 78, 83, 84, 85, 
    86, 87, 88, 89, 90, 94, 96, 97, 99, 100}, 
  std::vector of length 20, capacity 32 = {56, 59, 60, 62, 63, 65, 67, 69, 
    72, 77, 78, 79, 80, 88, 93, 94, 95, 96, 98, 99}, 
  std::vector of length 33, capacity 64 = {51, 52, 55, 56, 59, 61, 63, 65, 
    66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 78, 79, 81, 82, 83, 84, 85, 86, 
    87, 88, 92, 93, 96, 97, 98}, std::vector of length 29, capacity 32 = {
    51, 52, 54, 55, 56, 57, 58, 61, 64, 65, 67, 68, 72, 73, 75, 77, 79, 80, 
    81, 82, 85, 86, 87, 91, 92, 94, 96, 98, 100}, 
  std::vector of length 27, capacity 32 = {51, 52, 53, 54, 56, 57, 62, 66, 
    68, 69, 72, 74, 75, 76, 78, 79, 81, 82, 84, 87, 88, 92, 96, 97, 98, 99, 
    100}, std::vector of length 28, capacity 32 = {51, 52, 54, 55, 58, 59, 
    62, 63, 64, 65, 66, 67, 68, 75, 76, 77, 78, 80, 82, 86, 87, 88, 89, 90, 
    91, 92, 95, 96}, std::vector of length 34, capacity 64 = {51, 52, 53, 
    57, 60, 61, 63, 64, 65, 67, 68, 69, 73, 74, 75, 76, 78, 79, 80, 81, 82, 
    84, 86, 87, 88, 89, 90, 92, 93, 95, 96, 97, 99, 100}, 
  std::vector of length 28, capacity 32 = {52, 53, 55, 56, 57, 58, 61, 62, 
    64, 66, 67, 68, 69, 73, 75, 80, 81, 82, 83, 86, 88, 89, 91, 92, 93, 96, 
    97, 99}, std::vector of length 30, capacity 32 = {52, 53, 59, 61, 62, 
    63, 66, 67, 68, 70, 71, 74, 75, 76, 79, 80, 81, 83, 84, 85, 87, 88, 91, 
    93, 95, 96, 97, 98, 99, 100}, std::vector of length 29, capacity 32 = {
    51, 56, 57, 58, 59, 61, 62, 66, 70, 71, 72, 74, 76, 79, 80, 81, 82, 84, 
---Type <return> to continue, or q <return> to quit---85Quit

(gdb) p edge_num
$6 = <optimized out>

10: edge_num = 749
(gdb) 
Continuing.

Breakpoint 11, main (argc=<optimized out>, argv=0x7fffffffdd38)
    at Write_BLP.cc:242
242     ofs3<<"edge number: "<<edge_num<<endl;
10: edge_num = <optimized out>

*/
    InfluenceMatrix.clear();
    ofs3<<"edge number: "<<edge_num<<endl; //

    k=0;N=k2;
    //sprintf(szFileName2,"%sTingge_lamda%g_delta%g.py",argv[7],LAMDA,D);   
    sprintf(szFileName2,"%sTingge.py",argv[9]);
    ofs2.open(szFileName2);
    ofs2<<"import sys"<<endl<<"from gurobipy import *"<<endl<<endl;
    
    for (s=1;s<=N;s++) 
    {
        if(C[s].empty()) 
        {
            isolate_genes.push_back(s);
        }
        /* 第一次运行完 if  此时s = 51
        (gdb) p isolate_genes
        $11 = std::vector of length 50, capacity 64 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 
          12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 
          32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50}
        */
        else  // s=51                                                   
        {
            Gene_network.clear();
            indictor.clear();
            RawILP_genes.clear();
            k3_neighbour.clear();
            Gene_network.push_back(s);
            Gene_network.insert(Gene_network.end(),C[s].begin(),C[s].end());
/*
Gene_network = std::vector of length 1, capacity 1 = {51}
*/
            ofs3<<"Search radius information of gene "<<s<<":"<<endl;
                indictor.push_back(1);
            SIZE=C[s].size();
/*
(gdb) p C[s].size()
$34 = 40
*/
            if(SIZE+1>NUM)  //此处执行 else
            {
                indictor.push_back(SIZE+1);
                ofs3<<"1,"<<SIZE+1<<endl;
            }
            else
            {
                size=1;
                size1=Gene_network.size();
                while(size<size1 && size1<=NUM)
                {
                    indictor.push_back(size1);
                    for(k=size;k<size1;k++)
                    {
                        size2=Gene_network.size();
                        p=Gene_network[k];
                        SIZE1=C[p].size();
                        for(q=0;q<SIZE1;q++)
                        {
                            for(k1=0;k1<size2;k1++)
                            {
                                if(C[p][q]==Gene_network[k1])
                                {
                                    break;
                                }
                            }
                            if(k1==size2)
                            {
                                Gene_network.push_back(C[p][q]);
                            }                       
                        }
                    }
                    size=size1;
                    size1=Gene_network.size();
                }
                SIZE2=indictor.size();
                for(i=0;i<SIZE2;i++)
                {
                    ofs3<<indictor[i]<<",";
                }
                ofs3<<size1<<endl;
            }

            if(size>=MAX_T)
            {
                num=MAX_T;
            }
            else if(size>=MIN_T)
            {
                num=size;
            }
            
            if(size>=MIN_T)
            {
                for(i=MIN_T;i<=num;i++)
                {
                    sprintf(szFileName1,"%sS%d_t%d.lp",argv[9],s,i);   
                    ofs1.open(szFileName1);

                    ofs2<<"m=read('"<<argv[9]<<"S"<<s<<"_t"<<i<<".lp')"<<endl;
                    ofs2<<"m.optimize()"<<endl;
                    ofs2<<"m.write('"<<argv[9]<<"S"<<s<<"_t"<<i<<".sol')"<<endl<<endl;
/*
ofs2 Tingge.py Python的调用 
*/
                    SIZE3=indictor.size();
                    if(SIZE3>=i)
                    {
                        k3=indictor[i-1]-1;
                    }
                    else
                    {
                        k3=indictor.back()-1;
                    }
                    size1=M_size;
                    RawILP_genes.clear();
                    for(j=0;j<size1;j++)
                    {
                        for(k=0;k<=k3;k++)
                        {
                            k2=Gene_network[k];
                            if(Matrix01[j][k2]==1)
                            {
                                int_line.push_back(k2);
                            }
                        }
                        if(!int_line.empty())
                        {
                            RawILP_genes.push_back(int_line);            
                            int_line.clear();
                        }   
                    }
                        
                    //objective function
                    size1=RawILP_genes.size();
                    ofs1<<"Max"<<endl;
                    ofs1<<1+LAMDA<<" x0 ";
                    if(size1>1)
                    {
                        for(j=1;j<size1;j++)
                        {
                            ofs1<<" + "<<1+LAMDA<<" x"<<j;
                        }
                    }

                    size1=M_size;
                    for(k=0;k<=k3;k++)
                    {
                        k1=0;
                        k2=Gene_network[k];
                        for(j=0;j<size1;j++)
                        {
                            if(Matrix01[j][k2]==1)
                            {
                                k1++;
                            }
                        }
                        ofs1<<" - "<<LAMDA*k1<<" y"<<k2;
                    }
                    ofs1<<endl;
                    ofs1<<"Subject To"<<endl;

                    // constraints of patients(x) and mutated genes(y) 
                    size1=RawILP_genes.size();
                    for(j=0;j<size1;j++)
                    {
                        size2=RawILP_genes[j].size();
                        if(size2==1)
                        {
                            ofs1<<"y"<<RawILP_genes[j][0]<<" - x"<<j<<" >= 0"<<endl;
                        }
                        else
                        {   
                            for (k=0;k<size2-1;k++)
                            {
                                ofs1<<"y"<<RawILP_genes[j][k]<<" + ";
                            }
                            ofs1<<"y"<<RawILP_genes[j][k]<<" - x"<<j<<" >= 0"<<endl;
                        }
                    }

                    //ys==1
                    ofs1<<"y"<<s<<" = 1"<<endl;

                    //constraints of s
                    if(k3>1)
                    {           
                        for (j=1;j<=k3-1;j++)
                        {
                            ofs1<<"y"<<Gene_network[j]<<" + ";
                        }
                        ofs1<<"y"<<Gene_network[j]<<" <= "<<i-1<<endl;
                    }
                    else
                    {
                        ofs1<<"y"<<Gene_network[1]<<" = 1"<<endl;
                    }
                    
                    ofs1<<"Binaries"<<endl;
                    size1=RawILP_genes.size();
                    for (j=0;j<size1;j++)
                    {
                        ofs1<<"x"<<j<<endl;
                    }
                    for (j=1;j<=k3;j++)
                    {
                        ofs1<<"y"<<Gene_network[j]<<endl;
                    }
                    ofs1<<"End"<<endl;  
                    ofs1.close();
                }
            }
        }
    }
    ofs3.close();
/*

*/

    sprintf(szFileName1,"%sC",argv[9]);   
    ofs1.open(szFileName1);
    SIZE=C.size();
    for(i=0;i<SIZE;i++)
    {
        SIZE1=C[i].size();
        if(SIZE1==0)
            ofs1<<endl;
        else
        {
            if(SIZE1==1)
                ofs1<<C[i][0]<<endl;
            else
            {
                for(j=0;j<SIZE1-1;j++)
                {
                    ofs1<<C[i][j]<<",";
                }
                ofs1<<C[i][j]<<endl;
            }
        }
    }
    ofs1.close();
    sprintf(szFileName1,"%sMatrix01",argv[9]);   
    ofs1.open(szFileName1);
    for(i=0;i<M_size;i++)
    {
        SIZE=Matrix01[i].size();
        if(SIZE==0)
            ofs1<<endl;
        else
        {
            if(SIZE==1)
                ofs1<<Matrix01[i][0]<<endl;
            else
            {
                for(j=0;j<SIZE-1;j++)
                {
                    ofs1<<Matrix01[i][j]<<",";
                }
                ofs1<<Matrix01[i][j]<<endl;
            }
        }
    }
    ofs1.close();
    sprintf(szFileName1,"%sConsidered_genes",argv[9]);   
    ofs1.open(szFileName1);
    size=Genes.size();
    for(i=0;i<size;i++)
    {
        k=Genes[i];
        ofs1<<map5[k]<<" "<<i+1<<endl;
    }
    ofs1.close();

    sprintf(szFileName1,"%sIsolate_genes",argv[9]);   
    ofs1.open(szFileName1);
    size=isolate_genes.size();
    for(i=0;i<size;i++)
    {
        j=isolate_genes[i];
        k=Genes[j-1];
        ofs1<<map5[k]<<endl;
    }
    ofs1.close();
    return 0;
}


这是我第一次Linux环境下读大型C++项目,学过C但是一点不熟悉C++和Linux,繁琐了还望大佬见谅
我读了前265行

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值