def filter_based_on_query_coverage(query_length, query_start_index, query_stop_index,
                                   query_coverage_threshold):
    """
    Determine if read should be filtered based on query coverage threshold
    """

    if query_length > 1:
        query_coverage = ((abs(query_stop_index - query_start_index) + 1) / float(query_length)) * 100.0
    else:
        # if the query length is not provided, default coverage to greater than threshold
        query_coverage = query_coverage_threshold + 1.0

    filter = False
    if query_coverage < query_coverage_threshold:
        filter = True

    return filter