4f3a3ea6c3d02b1bd0f4ec5e688666f125e32be8,src/biotite/structure/dotbracket.py,,base_pairs_from_dot_bracket,#,128

Before Change


       Bioinformatics, 34(8), 1304-1312 (2018).
    
    basepairs = []
    opened_brackets = {}

    // Iterate through input string and extract base pairs
    for pos, symbol in enumerate(dot_bracket_notation):

        if symbol in _OPENING_BRACKETS:
            // Add opening residues to list (separate list for each
            // bracket type)
            index = _OPENING_BRACKETS.index(symbol)
            if index not in opened_brackets:
                opened_brackets[index] = []
            opened_brackets[index].append(pos)

        elif symbol in _CLOSING_BRACKETS:
            // For each closing bracket, the the basepair consists out of
            // the current index and the last index added to the list in
            // `opened_brackets` corresponding to the same bracket type.
            index = _CLOSING_BRACKETS.index(symbol)
            basepairs.append((opened_brackets[index].pop(), pos))

        else:
            if symbol != ".":
                raise ValueError(
                    f""{symbol}" is an invalid character for DBL-notation."
                )

    for _, not_closed in opened_brackets.items():
        if not_closed != []:
            raise ValueError(
                "Invalid DBL-notation! Not all opening brackets have a "

After Change


       Bioinformatics, 34(8), 1304-1312 (2018).
    
    basepairs = []
    opened_brackets = [[] for _ in range(len(_OPENING_BRACKETS))]

    // Iterate through input string and extract base pairs
    for pos, symbol in enumerate(dot_bracket_notation):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: biotite-dev/biotite
Commit Name: 4f3a3ea6c3d02b1bd0f4ec5e688666f125e32be8
Time: 2020-11-27
Author: tom.mueller@beachouse.de
File Name: src/biotite/structure/dotbracket.py
Class Name:
Method Name: base_pairs_from_dot_bracket


Project Name: rasbt/mlxtend
Commit Name: c9e82bb1ab323d4a79793e47dbdd9204302e36af
Time: 2015-04-06
Author: se.raschka@me.com
File Name: mlxtend/file_io/find.py
Class Name:
Method Name: find_filegroups


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: b5034279b48ae96ffdd4714f96e0f62b0f4807fc
Time: 2018-10-26
Author: jcastaldo08@gmail.com
File Name: category_encoders/ordinal.py
Class Name: OrdinalEncoder
Method Name: ordinal_encoding