05399c5856736751995ed5514db68ef24b034aba,src/biotite/sequence/align/alignment.py,Alignment,__getitem__,#Alignment#Any#,131

Before Change


    
    def __getitem__(self, index):
        if isinstance(index, tuple):
            return Alignment(self.sequences[index[1]], self.trace[index],
                             self.score)
        elif isinstance(index, slice):
            return Alignment(self.sequences[:], self.trace[index], self.score)
        else:
            raise IndexError("Invalid alignment index")

After Change


        if isinstance(index, tuple):
            new_trace = self.trace[index]
            if isinstance(index[1], (list, tuple, np.ndarray)):
                new_sequences = [self.sequences[i] for i in index[1]]
            else:
                new_sequences = self.sequences[index[1]]
            return Alignment(new_sequences, new_trace, self.score)
        elif isinstance(index, slice):
            return Alignment(self.sequences[:], self.trace[index], self.score)
        else:
            raise IndexError("Invalid alignment index")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: biotite-dev/biotite
Commit Name: 05399c5856736751995ed5514db68ef24b034aba
Time: 2018-05-17
Author: patrick.kunzm@gmail.com
File Name: src/biotite/sequence/align/alignment.py
Class Name: Alignment
Method Name: __getitem__


Project Name: biotite-dev/biotite
Commit Name: fd3153a8805bbc0160d5bf9751bf8896b153b06d
Time: 2019-09-26
Author: patrick.kunzm@gmail.com
File Name: src/biotite/sequence/align/alignment.py
Class Name: Alignment
Method Name: __getitem__


Project Name: biocore/scikit-bio
Commit Name: 2cd1091f0efdeab3c63bff064d31a44f23e0d307
Time: 2014-06-24
Author: gregcaporaso@gmail.com
File Name: skbio/core/alignment/pairwise.py
Class Name:
Method Name: local_pairwise_align