scout/parse/clinvar.py
def get_submission_variants(form_fields):
    """Extracts a list of variant ids from the clinvar submission form in blueprints/variants/clinvar.html (creation of a new clinvar submission).

        Args:
             form_fields(dict): it's the submission form dictionary. Keys have the same names as CLINVAR_HEADER and CASEDATA_HEADER

        Returns:
             clinvars: A list of variant IDs
    """

    clinvars = []

    # if the html checkbox named 'all_vars' is checked in the html form, then all pinned variants from a case should be included in the clinvar submission file,
    # otherwise just the selected one.
    if 'all_vars' in form_fields:
        for field, value in form_fields.items():
            if field.startswith('local_id'):
                clinvars.append(form_fields[field].replace('local_id@',''))
    else:
        clinvars = [form_fields['main_var']] #also a list, but has one element

    return clinvars
def get_submission_variants(form_fields):
    """Extracts a list of variant ids from the clinvar submission form in blueprints/variants/clinvar.html (creation of a new clinvar submission).

        Args:
             form_fields(dict): it's the submission form dictionary. Keys have the same names as CLINVAR_HEADER and CASEDATA_HEADER

        Returns:
             clinvars: A list of variant IDs
    """

    clinvars = []

    # if the html checkbox named 'all_vars' is checked in the html form, then all pinned variants from a case should be included in the clinvar submission file,
    # otherwise just the selected one.
    if 'all_vars' in form_fields:
        for field, value in form_fields.items():
            if field.startswith('local_id'):
                clinvars.append(form_fields[field].replace('local_id@',''))
    else:
        clinvars = [form_fields['main_var']] #also a list, but has one element

    return clinvars
Extracts a list of variant ids from the clinvar submission form in blueprints/variants/clinvar.html (creation of a new clinvar submission).

        Args:
             form_fields(dict): it's the submission form dictionary. Keys have the same names as CLINVAR_HEADER and CASEDATA_HEADER

        Returns:
             clinvars: A list of variant IDs