summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2021-06-02 16:46:12 -0500
committerAnthony Wang2021-06-02 16:46:12 -0500
commit5bbf11ad5a9f2921d13cd95bcc36594e9f78c4e4 (patch)
tree13a99756d71befc8ff041bcbc910435ab427e11d
parent206bdf3d781f1c9bc9cba180cf23e54e2b0a73b7 (diff)
Add latest changes
-rw-r--r--main.cpp31
1 files 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<string> vrt[7];
@@ -54,7 +59,7 @@ bitset<k> 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<k> test(string & probe) {
vector<string> 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;