diff --git a/main.cpp b/main.cpp index e80b645..6fbe40a 100644 --- a/main.cpp +++ b/main.cpp @@ -2,8 +2,13 @@ using namespace std; using ll = long long; -string P[3]; -double score[3][7]; +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} }; vector vrt[7]; @@ -54,7 +59,7 @@ bitset test(string & probe) { 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; + if (abs(avg[i]-avg[j]) > 5) bs[cnt] = 1; cnt++; } return bs; @@ -62,13 +67,6 @@ bitset test(string & probe) { vector dp[4][1 << k]; void analyze_spike_sequences(){ - freopen("spike_sequences.txt", "r", stdin); - for (int i = 0; i < 7; ++i) { // 7 vrts - for (int j = 0; j < 20; ++j) { - string s, t; cin >> s >> t; - vrt[i].push_back(t); - } - } int cnt = 0; for (int i = 0; i < 7; ++i) { for (int j = 0; j <= vrt[i][0].size()-150; j += rand()%100) { @@ -112,6 +110,7 @@ void analyze_spike_sequences(){ } void mkscores() { + cout << '{'; for (int i = 0; i < 3; ++i) { cout << "{"; for (int j = 0; j < 7; ++j) { @@ -122,8 +121,11 @@ void mkscores() { cout << score[i][j]; if (j < 6) cout << ","; } - cout <<"}\n"; + cout <<"}"; + if (i < 2) cout << ","; + cout << '\n'; } + cout << '}'; } // classify a string @@ -162,6 +164,13 @@ int main(){ ios::sync_with_stdio(0); cin.tie(0); if (fopen("spike_sequences.txt", "r")) { + freopen("spike_sequences.txt", "r", stdin); + for (int i = 0; i < 7; ++i) { // 7 vrts + for (int j = 0; j < 20; ++j) { + string s, t; cin >> s >> t; + vrt[i].push_back(t); + } + } if (P[0] != "") mkscores(); else analyze_spike_sequences(); return 0;