Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -161,10 +161,16 @@ Confidence: {float(max(probs[0])):0.4f}
|
|
161 |
Human probability: {float(probs[0][1]):0.4f}
|
162 |
Non-human probability: {float(probs[0][0]):0.4f}
|
163 |
|
164 |
-
Most influential k-mers:"""
|
165 |
|
166 |
for kmer in important_kmers:
|
167 |
-
result += f"\n {kmer['kmer']}:
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
|
169 |
results.append(result)
|
170 |
except Exception as e:
|
|
|
161 |
Human probability: {float(probs[0][1]):0.4f}
|
162 |
Non-human probability: {float(probs[0][0]):0.4f}
|
163 |
|
164 |
+
Most influential k-mers (ranked by importance):"""
|
165 |
|
166 |
for kmer in important_kmers:
|
167 |
+
result += f"\n {kmer['kmer']}: "
|
168 |
+
result += f"impact={kmer['importance']:.4f}, "
|
169 |
+
result += f"occurrence={kmer['frequency']*100:.2f}% of sequence "
|
170 |
+
if kmer['scaled'] > 0:
|
171 |
+
result += f"(appears {abs(kmer['scaled']):.2f}σ more than average)"
|
172 |
+
else:
|
173 |
+
result += f"(appears {abs(kmer['scaled']):.2f}σ less than average)"
|
174 |
|
175 |
results.append(result)
|
176 |
except Exception as e:
|