lundi 28 octobre 2019

Replace line in strings

the main i idea i'm work in motif sequences by gibbs sampling the last of algorithm after save the position for current sequence i need replaced this sequence by original and iteration for other each iteration take 3 sequence and reject one.

i have a two string  this 
seq={1- ACCATGACAG
2- GAGTATACCT
3- CATGCTTACT
4- CGGAATGCAT} i cut 2-4 seq by random on 7 elements and save in string name random and i take the reset character in other string the second string save the rest of character in string name reminder and except the last one 
(like first seq cut as =GTATACC so the reset is GAT)
how can i do iteration for this problem to take the another three (3,4,1)and except second seq and so on ?

c++ code:

cout << "This is the random selection after distrubtion of result (position=";
    srand(unsigned(time(NULL)));
    int nor = rand() % newdistrbution.size();
    cout << newdistrbution[nor] << " -> " << seq[0].substr(newdistrbution[nor], cut) << ")" << endl;
    random[0].swap(seq[0].substr(newdistrbution[nor], cut));//depend of big for loop to change random 0 to i
    random[1].replace(0, cut, random[2]);
    random[2].replace(0, cut, random[3]);
    random[3].clear();

Aucun commentaire:

Enregistrer un commentaire