######################################################
#
# Make a copy of this file and edit it to your liking
#
######################################################

# Which population to plot
species_names = ['Bacteroides_vulgatus_57955']
# Alternative: can access entire list using function:
#species_names = parse_midas_data.parse_good_species_list()

# Output filename (alter as needed)
filename = parse_midas_data.analysis_directory+'example_timecourse.png'

####################################################################
#
#  Function controlling which mutations are colored
#
#      Returns: true for colored
#               false for not colored
#
####################################################################
def color_condition(population_idx, chromosome, location, gene_name, variant_type, times, freqs, depths):

    # don't use interpolated freqs yet.    
    
    # First two conditions require mutation to start at low frequency
    # i.e., to focus on "de novo" mutations
    condition = freqs[0]<0.5
    condition = condition and (freqs[1]<0.05)
    # Next condition requires a large frequency change
    condition = condition and ((freqs.max()-freqs.min()) > 0.5)
    
    return condition
