diff options
-rw-r--r-- | main.cpp | 48 |
1 files changed, 28 insertions, 20 deletions
@@ -4,11 +4,12 @@ using ll = long long; string P[3] = { "ATGTTTGTTTTTCTTGTTTTATTGCCACTAGTCTCTAGTCAGTGTGTTAATCTTACAACCAGAACTCAATTACCCCCTGCATACACTAATTCTTTCACACGTGGTGTTTATTACCCTGACAAAGTTTTCAGATCCTCAGTTTTACATTCA", - "CCACTAGTCTCTAGTCAGTGTGTTAATCTTACAACCAGAACTCAATTACCCCCTGCATACACTAATTCTTTCACACGTGGTGTTTATTACCCTGACAAAGTTTTCAGATCCTCAGTTTTACATTCAACTCAGGACTTGTTCTTACCTTTC", - "TTTCGGCTTTAGAACCATTGGTAGATTTGCCAATAGGTATTAACATCACTAGGTTTCAAACTTTACTTGCTTTACATAGAAGTTATTTGACTCCTGGTGATTCTTCTTCAGGTTGGACAGCTGGTGCTGCAGCTTATTATGTGGGTTATC" }; -double score[3][7] = { {449.7,449.7,449.7,449.7,437.7,161,147.35}, -{449.7,449.7,449.4,449.7,437.7,158,149}, -{449.7,449.4,404.4,450,449.7,172,146.85} }; + "TTCGAAGACCCAGTCCCTACTTATTGTTAATAACGCTACTAATGTTGTTATTAAAGTCTGTGAATTTCAATTTTGTAATGATCCATTTTTGGGTGTTTATTACCACAAAAACAACAAAAGTTGGATGGAAAGTGAGTTCAGAGTTTATTC", + "TCTAAGCACACGCCTATTAATTTAGTGCGTGATCTCCCTCAGGGTTTTTCGGCTTTAGAACCATTGGTAGATTTGCCAATAGGTATTAACATCACTAGGTTTCAAACTTTACTTGCTTTACATAGAAGTTATTTGACTCCTGGTGATTCT" }; +double score[3][7] = {{449.7,449.7,449.7,449.7,437.7,161,147.35}, +{450,435,450,449.7,444,180,139.8}, +{449.4,449.1,404.7,450,449.7,147,148} +}; vector<string> vrt[7]; @@ -49,19 +50,23 @@ bitset<k> test(string & probe) { bitset<k> bs; double avg[7]; for (int i = 0; i < 7; ++i) { - for (int j = 0; j < 10; ++j) { - int r = rand()%20; - avg[i] += sequenceCmp(probe, vrt[i][r]); + avg[i] = 0; + for (int j = 0; j < 20; ++j) { + avg[i] += sequenceCmp(probe, vrt[i][j]); } - avg[i] /= 2; + avg[i] /= 20; + cout << avg[i] << ' '; } + cout << '\n'; int cnt = 0; - for (int i = 0; i < 7; ++i) - for (int j = i+1; j < 7; ++j) - { - if (abs(avg[i]-avg[j]) > 5) bs[cnt] = 1; - cnt++; - } + for (int i = 0; i < 7; ++i) { + for (int j = i+1; j < 7; ++j) { + if (abs(avg[i]-avg[j]) > 10) bs[cnt] = 1; + cnt++; + cout << avg[i] << ' ' << avg[j] << ' ' << bs[cnt-1] << '\n'; + } + } + cout << bs << '\n'; return bs; } @@ -69,7 +74,7 @@ vector<string> dp[4][1 << k]; void analyze_spike_sequences(){ int cnt = 0; for (int i = 0; i < 7; ++i) { - for (int j = 0; j <= vrt[i][0].size()-150; j += rand()%100) { + for (int j = 0; j <= vrt[i][0].size()-150; ++j) { string probe(begin(vrt[i][0])+j, begin(vrt[i][0])+j+150); bitset<k> bs = test(probe); cout << probe << ' ' << cnt++ << endl; @@ -161,11 +166,12 @@ void answer(){ int main(){ ios::sync_with_stdio(0); cin.tie(0); - if (fopen("input.txt", "r")) { + srand(time(0)); + /*if (fopen("input.txt", "r")) { freopen("input.txt", "r", stdin); answer(); return 0; - } + }*/ if (fopen("spikesequences.txt", "r")) { freopen("spikesequences.txt", "r", stdin); for (int i = 0; i < 7; ++i) { // 7 vrts @@ -174,10 +180,12 @@ int main(){ vrt[i].push_back(t); } } - if (P[0] != "") mkscores(); - else analyze_spike_sequences(); +// if (P[0] != "") mkscores(); +// else + analyze_spike_sequences(); return 0; } + answer(); return 0; } |