sidechainnet/utils/load.py
def filter_dictionary_by_missing_residues(raw_data):
    """Return new SidechainNet dictionary that omits training data with missing residues.

    Args:
        raw_data (dict): SidechainNet dictionary.

    Returns:
        Filtered dictionary.
    """
    new_data = {
        "seq": [],
        "ang": [],
        "ids": [],
        "evo": [],
        "msk": [],
        "crd": [],
        "sec": [],
        "res": [],
        "ums": [],
        "mod": []
    }
    train = raw_data["train"]
    n_filtered_entries = 0
    total_entires = 0.
    for seq, ang, crd, msk, evo, _id, res, sec, ums, mod in zip(
            train['seq'], train['ang'], train['crd'], train['msk'], train['evo'],
            train['ids'], train['res'], train['sec'], train['ums'], train['mod']):
        total_entires += 1
        if "-" in msk:
            n_filtered_entries += 1
            continue
        else:
            new_data["seq"].append(seq)
            new_data["ang"].append(ang)
            new_data["ids"].append(_id)
            new_data["evo"].append(evo)
            new_data["msk"].append(msk)
            new_data["crd"].append(crd)
            new_data["sec"].append(sec)
            new_data["res"].append(res)
            new_data["ums"].append(ums)
            new_data["mod"].append(mod)

    if n_filtered_entries:
        print(f"{n_filtered_entries} ({n_filtered_entries/total_entires:.1%})"
              " training set entries were excluded based on missing residues.")
    raw_data["train"] = new_data
    return raw_data
Return new SidechainNet dictionary that omits training data with missing residues.

    Args:
        raw_data (dict): SidechainNet dictionary.

    Returns:
        Filtered dictionary.
    
Return new SidechainNet dictionary that omits training data with missing residues.
Return new SidechainNet dictionary that omits training data with missing residues .
def filter_dictionary_by_missing_residues(raw_data):
    new_data = {
        "seq": [],
        "ang": [],
        "ids": [],
        "evo": [],
        "msk": [],
        "crd": [],
        "sec": [],
        "res": [],
        "ums": [],
        "mod": []
    }
    train = raw_data["train"]
    n_filtered_entries = 0
    total_entires = 0.
    for seq, ang, crd, msk, evo, _id, res, sec, ums, mod in zip(
            train['seq'], train['ang'], train['crd'], train['msk'], train['evo'],
            train['ids'], train['res'], train['sec'], train['ums'], train['mod']):
        total_entires += 1
        if "-" in msk:
            n_filtered_entries += 1
            continue
        else:
            new_data["seq"].append(seq)
            new_data["ang"].append(ang)
            new_data["ids"].append(_id)
            new_data["evo"].append(evo)
            new_data["msk"].append(msk)
            new_data["crd"].append(crd)
            new_data["sec"].append(sec)
            new_data["res"].append(res)
            new_data["ums"].append(ums)
            new_data["mod"].append(mod)
    if n_filtered_entries:
        print(f"{n_filtered_entries} ({n_filtered_entries/total_entires:.1%})"
              " training set entries were excluded based on missing residues.")
    raw_data["train"] = new_data
    return raw_data
def filter_dictionary_by_missing_residues ( raw_data ) : new_data = { "seq" : [ ] , "ang" : [ ] , "ids" : [ ] , "evo" : [ ] , "msk" : [ ] , "crd" : [ ] , "sec" : [ ] , "res" : [ ] , "ums" : [ ] , "mod" : [ ] } train = raw_data [ "train" ] n_filtered_entries = 0 total_entires = 0. for seq , ang , crd , msk , evo , _id , res , sec , ums , mod in zip ( train [ 'seq' ] , train [ 'ang' ] , train [ 'crd' ] , train [ 'msk' ] , train [ 'evo' ] , train [ 'ids' ] , train [ 'res' ] , train [ 'sec' ] , train [ 'ums' ] , train [ 'mod' ] ) : total_entires += 1 if "-" in msk : n_filtered_entries += 1 continue else : new_data [ "seq" ] . append ( seq ) new_data [ "ang" ] . append ( ang ) new_data [ "ids" ] . append ( _id ) new_data [ "evo" ] . append ( evo ) new_data [ "msk" ] . append ( msk ) new_data [ "crd" ] . append ( crd ) new_data [ "sec" ] . append ( sec ) new_data [ "res" ] . append ( res ) new_data [ "ums" ] . append ( ums ) new_data [ "mod" ] . append ( mod ) if n_filtered_entries : print ( f"{n_filtered_entries} ({n_filtered_entries/total_entires:.1%})" " training set entries were excluded based on missing residues." ) raw_data [ "train" ] = new_data return raw_data
Return new SidechainNet dictionary that omits training data with missing residues.
Return new SidechainNet dictionary that omits training data with missing residues .
"""Return new SidechainNet dictionary that omits training data with missing residues.

    Args:
        raw_data (dict): SidechainNet dictionary.

    Returns:
        Filtered dictionary.
    """
None
raw_data
None