def process_coverage_summary_file(coverage_summary_fh, log_fh, verbose=False):
    """get the number of bases covered for all samples and return as a dict
    """
    if verbose:
        log_fh.write("Parsing coverage summary file\n")
    header = coverage_summary_fh.next().strip().split(",")
    sample_idx = header.index("Sample")
    coverage_idx = header.index("Total_Covered_Base")
    coverage_by_sample = {}
    for line in coverage_summary_fh:
        fields = line.strip().split(",")
        coverage_by_sample[fields[sample_idx]] = int(fields[coverage_idx])
    coverage_summary_fh.close()
    if verbose:
        log_fh.write("Done with coverage summary file; found {} entries\n\n".
                     format(len(coverage_by_sample)))
    return coverage_by_sample