sequence.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:Master-Thesis 作者: AntoinePassemiers 项目源码 文件源码
def __init__(self, data, comments = list()):
        """
        Data structure for storing a sequence of amino acids. 
        The latter is represented by a contiguous array of integers.
        The mapping between the amino acids and their numeric value
        is done by using the ascii table.

        Attributes
        ----------
        comments [list] : list of informations about the sequence parsed from the FASTA file
                          The list is constructed by splitting the comments using the ' ' delimiter
        N [int] : length of the sequence
        data [np.ndarray] : contiguous array containing the ascii values of the amino acids
        """
        self.comments = comments
        self.N = len(data)
        if isinstance(data, np.ndarray):
            self.data = data
        else:
            # If a string is passed, the latter is converted to a numpy array
            self.data = np.empty(self.N, dtype = np.int16)
            for i in range(self.N):
                self.data[i] = Sequence.charToInt(data[i])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号