scout/parse/clinvar.py
def clinvar_submission_lines(submission_objs, submission_header):
    """Create the lines to include in a Clinvar submission csv file from a list of submission objects and a custom document header

        Args:
            submission_objs(list): a list of objects (variants or casedata) to include in a csv file
            submission_header(dict) : as in constants CLINVAR_HEADER and CASEDATA_HEADER, but with required fields only

        Returns:
            submission_lines(list) a list of strings, each string represents a line of the clinvar csv file to be doenloaded
    """
    submission_lines = []
    for submission_obj in submission_objs: # Loop over the submission objects. Each of these is a line
        csv_line = []
        for header_key, header_value in submission_header.items(): # header_keys are the same keys as in submission_objs
            if header_key in submission_obj: # The field is filled in for this variant/casedata object
                csv_line.append('"'+submission_obj.get(header_key)+'"')
            else: # Empty field for this this variant/casedata object
                csv_line.append('""')

        submission_lines.append(','.join(csv_line))

    return submission_lines
def clinvar_submission_lines(submission_objs, submission_header):
    submission_lines = []
    for submission_obj in submission_objs: # Loop over the submission objects. Each of these is a line
        csv_line = []
        for header_key, header_value in submission_header.items(): # header_keys are the same keys as in submission_objs
            if header_key in submission_obj: # The field is filled in for this variant/casedata object
                csv_line.append('"'+submission_obj.get(header_key)+'"')
            else: # Empty field for this this variant/casedata object
                csv_line.append('""')

        submission_lines.append(','.join(csv_line))

    return submission_lines
def clinvar_submission_lines ( submission_objs , submission_header ) : submission_lines = [ ] for submission_obj in submission_objs : # Loop over the submission objects. Each of these is a line csv_line = [ ] for header_key , header_value in submission_header . items ( ) : # header_keys are the same keys as in submission_objs if header_key in submission_obj : # The field is filled in for this variant/casedata object csv_line . append ( '"' + submission_obj . get ( header_key ) + '"' ) else : # Empty field for this this variant/casedata object csv_line . append ( '""' ) submission_lines . append ( ',' . join ( csv_line ) ) return submission_lines
Create the lines to include in a Clinvar submission csv file from a list of submission objects and a custom document header

        Args:
            submission_objs(list): a list of objects (variants or casedata) to include in a csv file
            submission_header(dict) : as in constants CLINVAR_HEADER and CASEDATA_HEADER, but with required fields only

        Returns:
            submission_lines(list) a list of strings, each string represents a line of the clinvar csv file to be doenloaded
Create the lines to include in a Clinvar submission csv file from a list of submission objects and a custom document header