def score_nwalign(nwalign_out: list):
    align1 = nwalign_out[0]
    align2 = nwalign_out[1]
    # scoring the alignment #
    nwscore = nw.score_alignment(
        align1,
        align2,
        gap_open=10,
        gap_extend=5,
        matrix=
        '/home/saveliy/nwalign3-master/nwalign3-master/nwalign3/matrices/BLOSUM62'
    )
    return (nwscore)
Esempio n. 2
0
File: ga.py Progetto: Nicolik/msa-ga
    def evaluation_func(lines):
        for i in range(len(lines)):
            sum_score = 0

            # Compute the pairwise scores
            for j in range(len(lines)):
                if i != j:
                    scr = nw.score_alignment(lines[i],
                                             lines[j],
                                             gap_open=-1,
                                             gap_extend=-0.5,
                                             matrix='matrix/BLOSUM62')
                    sum_score += scr

            return sum_score
Esempio n. 3
0
 def _score_alignment(self):
     if all(
         [self._score_match is not None, self._score_mismatch is not None]):
         matrix = self._get_matrix_file(match=self._score_match,
                                        mismatch=self._score_mismatch)
     elif self._matrix is not None:
         matrix = self._get_matrix_file(matrix=self._matrix)
     else:
         matrix = self._get_matrix_file(match=self._match,
                                        mismatch=self._mismatch)
     gap_open = self._score_gap_open if self._score_gap_open is not None else self._gap_open
     gap_extend = self._score_gap_extend if self._score_gap_extend is not None else self._gap_extend
     aln = nw.score_alignment(self.aligned_query,
                              self.aligned_target,
                              gap_open=gap_open,
                              gap_extend=gap_extend,
                              matrix=matrix)
     return aln