<commit_before>import re
import os
from app.readers import tsv as tsvreader


def create_proteinquant_lookup(fns, pqdb, poolnames, protacc_colnr,
                               ms1_qcolpattern=None, isobqcolpattern=None,
                               psmnrpattern=None, probcolpattern=None,
                               fdrcolpattern=None, pepcolpattern=None):
    poolmap = {name: pid for (name, pid) in pqdb.get_all_poolnames()}
    pqdb.store_protein_tables([(poolmap[pool], os.path.basename(fn))
                               for fn, pool in zip(fns, poolnames)])
    prottable_map = pqdb.get_protein_table_map()
    protein_acc_map = pqdb.get_protein_acc_map()
    iso_quantcols, psmnrcolmap = {}, {}
    precur_quantcols, probcol, fdrcol, pepcol = {}, {}, {}, {}
    for fn in fns:
        header = tsvreader.get_tsv_header(fn)
        basefn = os.path.basename(fn)
        for colmap, pattern in zip([iso_quantcols, psmnrcolmap],
                                   [isobqcolpattern, psmnrpattern]):
            cols = get_cols_in_file(colmap, pattern, header)
            if cols:
                colmap[basefn] = cols
        for colmap, pattern in zip([precur_quantcols, probcol, fdrcol, pepcol],
                                   [ms1_qcolpattern, probcolpattern,
                                    fdrcolpattern, pepcolpattern]):
            cols = get_cols_in_file(colmap, pattern, header, single_col=True)
            if cols:
                colmap[basefn] = cols
    if iso_quantcols and psmnrcolmap:
        create_isobaric_proteinquant_lookup(fns, prottable_map,
                                            protein_acc_map, pqdb,
                                            protacc_colnr,
                                            iso_quantcols, psmnrcolmap)
    if precur_quantcols:<commit_msg>Oops forgot to remove an argument<commit_after>import re
import os
from app.readers import tsv as tsvreader


def create_proteinquant_lookup(fns, pqdb, poolnames, protacc_colnr,
                               ms1_qcolpattern=None, isobqcolpattern=None,
                               psmnrpattern=None, probcolpattern=None,
                               fdrcolpattern=None, pepcolpattern=None):
    poolmap = {name: pid for (name, pid) in pqdb.get_all_poolnames()}
    pqdb.store_protein_tables([(poolmap[pool], os.path.basename(fn))
                               for fn, pool in zip(fns, poolnames)])
    prottable_map = pqdb.get_protein_table_map()
    protein_acc_map = pqdb.get_protein_acc_map()
    iso_quantcols, psmnrcolmap = {}, {}
    precur_quantcols, probcol, fdrcol, pepcol = {}, {}, {}, {}
    for fn in fns:
        header = tsvreader.get_tsv_header(fn)
        basefn = os.path.basename(fn)
        for colmap, pattern in zip([iso_quantcols, psmnrcolmap],
                                   [isobqcolpattern, psmnrpattern]):
            cols = get_cols_in_file(pattern, header)
            if cols:
                colmap[basefn] = cols
        for colmap, pattern in zip([precur_quantcols, probcol, fdrcol, pepcol],
                                   [ms1_qcolpattern, probcolpattern,
                                    fdrcolpattern, pepcolpattern]):
            cols = get_cols_in_file(pattern, header, single_col=True)
            if cols:
                colmap[basefn] = cols
    if iso_quantcols and psmnrcolmap:
        create_isobaric_proteinquant_lookup(fns, prottable_map,
                                            protein_acc_map, pqdb,
                                            protacc_colnr,
                                            iso_quantcols, psmnrcolmap)
    if precur_quantcols:
{'fraction_non_alphanumeric': 0.07958287596048298, 'fraction_numerical': 0.0010976948408342481, 'mean_word_length': 1.7909647779479325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '956757', 'n_tokens_mistral': 1113, 'n_tokens_neox': 1074, 'n_words': 212}