我有两个由蛋白质 pdb id 制成的载体,例如 1A3BA、3B5RE、1WYX5。我想比较这些两个向量中的蛋白质列表是否相同。有什么不同?我尝试在C++中使用stl算法,但是一直有段错误!有没有人可以告诉我怎么了..?我也不太确定排序算法,但无论如何..无论我是否进行排序,代码都有问题......
vector<string> pdb_b_list;
vector<string> pdb_a_list;
vector<string> intset;
vector<string>::iterator im;
sort(pdb_a_list.begin(),pdb_a_list.end());
sort(pdb_b_list.begin(),pdb_a_list.end());
if (includes(pdb_a_list.begin(), pdb_a_list.end(), pdb_b_list.begin(), pdb_b_list.end())){
cout << "a includes b"<<endl;
cnt_s++;
}
else if (includes(pdb_b_list.begin(), pdb_b_list.end(), pdb_a_list.begin(), pdb_a_list.end()) ){
cout <<"b includes a" <<endl;
cnt_s++;
}
else {
cout << "different proteins in the sets" <<endl;
cnt_d++;
//sort(pdb_a_list.begin(),pdb_a_list.end());
// sort(pdb_b_list.begin(),pdb_a_list.end());
im = set_intersection(pdb_a_list.begin(),pdb_a_list.end(),pdb_b_list.begin(),pdb_a_list.end(), intset.begin());
cout <<" the intersetion has \t" <<int(im- intset.begin())<<"elements" <<endl;
}