def find_largest_domain(ptg_list):
    """
    Return the 'largest' domain in the list of PTGraph2 objects (each one
    representing one domain). 'Largest' is defined as the one with the
    largest sheet (as defined by PTGraph2.largest_sheet()). If there is
    no PTGraph2 with a sheet, use the one with the largest helix.

    There are some alternative definitions of 'largest' that also make
    sense, such as the one with the most SSEs, or with the most residues,
    but we choose this one as on the diagram (and in 3D), the largest sheet is
    what we tend to see as 'central' and orient everything around, which
    is what we want here. Note if we choose 'most SSEs' as 'largest', may
    end up with a domain with many small helices as largets, which would
    probably not be desirable, and 'most residues' may give a domain with
    large helices as largest, while we probably would prefer a sheet
    to be the 'largest' element, so that's why it is this way.

    Parameters:
       ptg_list - list of PTGraph2 objects

    Return value:
       The PTGraph2 object that is largest according to above definition.
    """
    max_sheet_size = 0
    largest_ptg = None
    for ptg in ptg_list:
        largest_sheet_id = ptg.largest_sheet()
        if largest_sheet_id != None:
            sheet_size = ptg.sheet_size(largest_sheet_id)
            if sheet_size > max_sheet_size:
                max_sheet_size = sheet_size
                largest_ptg = ptg
    if largest_ptg == None: # no largest sheet, use helices instead
        max_helix_size = 0
        for ptg in ptg_list:
            largest_helix = ptg.largest_helix()
            if largest_helix.get_span() > max_helix_size:
                max_helix_size = largest_helix.get_span()
                largest_ptg = ptg
    return largest_ptg