hiyata commited on
Commit
2897f12
·
verified ·
1 Parent(s): d2177a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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']}: importance={kmer['importance']:.4f}, frequency={kmer['frequency']:.4f} ({kmer['frequency']*100:.2f}%), scaled={kmer['scaled']:.4f}"
 
 
 
 
 
 
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: