summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTa180m2021-06-02 21:33:01 +0000
committerTa180m2021-06-02 21:33:01 +0000
commit2c39f5fe3f1126d6781888b99fef687e877e6c3d (patch)
treeba6cc18b484eeba2cdc54ee378768517ab54bf40
parent06134062ba77b09caf5696907a2fda957482280f (diff)
Add latest files
-rw-r--r--.gitignore2
-rw-r--r--mainbin42120 -> 0 bytes
-rw-r--r--main.cpp32
3 files changed, 21 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..59be43b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*
+!*.*
diff --git a/main b/main
deleted file mode 100644
index 21bb4e4..0000000
--- a/main
+++ /dev/null
Binary files differ
diff --git a/main.cpp b/main.cpp
index c651f76..397ff3b 100644
--- a/main.cpp
+++ b/main.cpp
@@ -5,7 +5,7 @@ using ll = long long;
string P[3];
double score[3][7];
-vector<string> variant[7];
+vector<string> vrt[7];
ll levenshtein(string &s, string &t){
int n = s.size(), m = t.size();
@@ -44,31 +44,37 @@ bitset<k> test(string & probe) {
bitset<k> bs;
double avg[7];
for (int i = 0; i < 7; ++i) {
- avg[i] = 0;
- for (int j = 0; j < 20; ++j)
- avg[i] += sequenceCmp(probe, variant[i][j]);
- avg[i] /= 20;
+ for (int j = 0; j < 2; ++j) {
+ int r = rand()%20;
+ avg[i] += sequenceCmp(probe, vrt[i][r]);
+ }
+ avg[i] /= 2;
}
int cnt = 0;
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;
- return cnt;
+ {
+ if (abs(avg[i]-avg[j]) > 10) bs[cnt] = 1;
+ cnt++;
+ }
+ return bs;
}
vector<string> dp[4][1 << k];
void analyze_spike_sequences(){
freopen("spike_sequences.txt", "r", stdin);
- for (int i = 0; i < 7; ++i) { // 7 variants
+ for (int i = 0; i < 7; ++i) { // 7 vrts
for (int j = 0; j < 20; ++j) {
string s, t; cin >> s >> t;
- variant[i].push_back(t);
+ vrt[i].push_back(t);
}
}
+ int cnt = 0;
for (int i = 0; i < 7; ++i) {
- for (int j = 0; j <= variant[i][0].size()-150; ++j) {
- string probe(begin(variant[i][0]), begin(variant[i][0])+150);
+ 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;
int bsint = 0; //change to int
for(int i = 0; i < k; i++) bsint |= bs[i] << i;
@@ -111,7 +117,7 @@ void mkscores() {
for (int j = 0; j < 7; ++j) {
score[i][j] = 0;
for (int k = 0; k < 20; ++k)
- score[i][j] += sequenceCmp(P[i], variant[j][k]);
+ score[i][j] += sequenceCmp(P[i], vrt[j][k]);
score[i][j] /= 20;
cout << score[i][j];
if (j < 6) cout << ",";
@@ -137,7 +143,7 @@ string types[7] = {"original",
"B.1.427",
"P.1",
"B.1.351",
-"other_variant",
+"other_vrt",
"not_sars_cov2"};
void answer(){