def average_replicate_timepoints(rowdata):
    """
    function FN to be fed to CombiFiles().output_to_rQTL with replicate_fn kwarg,
    e.g. CombiFiles().output_to_rQTL(replicate_fn=average_replicate_timepoints)
    each row should be a dict with headers "phenotyperow","strain","genotyperow","record"
    but strain and genotyperow should be the same for all rows
    """
    strain=rowdata[0]["strain"]
    genotypes=rowdata[0]["genotyperow"]
    phenotyperows=[row["phenotyperow"] for row in rowdata]
    phenotyperow=[sum(col)/float(len(phenotyperows))
                  for col in zip(*phenotyperows)]
    return {"phenotyperow":phenotyperow,
            "strain":strain,
            "n_replicates":len(rowdata),
            "genotyperow":genotypes}