Skip to content

Commit

Permalink
feat: add annotations for bicodon CAI
Browse files Browse the repository at this point in the history
  • Loading branch information
Cauch-BS committed Nov 11, 2024
1 parent 27334a1 commit 41946cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions vaxpress/scoring/aup.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,6 @@ def annotate_sequence(self, seq, folding):

def evaluate_local(self, seq, folding):
xi_array = 1 - folding["pi_array"]
# moving average of xi_array
baseindex = list(range(len(seq)))
return {"aup": (baseindex, xi_array)}
7 changes: 7 additions & 0 deletions vaxpress/scoring/bicodon.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,10 @@ def score(self, seqs):
bcai_score = bcai * self.weight

return {"bicodon": bcai_score}, {"bicodon": bcai}

def evaluate_local(self, seq):
scores = self.bicodon_scores
seq = Sequence(seq).cdsseq
bcai = np.array([scores[seq[i : i + 6]] for i in range(0, len(seq) - 3, 3)])
centers = np.arange(0, len(seq) - 3, 3)
return {"bcai": (centers, bcai)}

0 comments on commit 41946cd

Please sign in to comment.