Exemplo n.º 1
0
    def __init__(self, inarg, Stype=FS.SIMILARITY, new=True):
        self.thisown = 0
        if isinstance(inarg, FS_Smatrix):
            if new:
                self.this = FS.Smatrix_copy(inarg)
                self.thisown = 1
            else:
                self.this = inarg
                self.thisown = 1
        elif isinstance(inarg, list):
            # List - Biopython PSSM
            self.this = FS.Smatrix_pssm(inarg)
            self.thisown = 1
        elif isinstance(inarg, ProfileMatrix):
            # Instance of ProfileMatrix
            self.this = FS.Smatrix_copy(inarg.this)
            self.thisown = 1
        else:
            raise TypeError, "Constructor only accepts"\
                  " a Biopython PSSM"\
                  " and an instance of ProfileMatrix."

        self.mean = self._calc_mean()
        self.alphabet = FS.Smatrix_alphabet_get(self)
        self._len = FS.Smatrix_len_get(self)
        self.qseq = FS.Smatrix_qseq_get(self)