From 5bbf11ad5a9f2921d13cd95bcc36594e9f78c4e4 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Wed, 2 Jun 2021 16:46:12 -0500 Subject: Add latest changes --- main.cpp | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) 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; -- cgit v1.2.3-70-g09d2