def get_chipseq_atacseq_qc_summary(quality_metric, qc_type):
    """
        Chipseq and Atacseq QCs both have common QC Summary metrics. This method
        calculates the metrics within quality_metric_summary calculated property
    """

    def round2(numVal):
        return round(numVal * 100) / 100

    qc_summary = []

    if 'overlap_reproducibility_qc' in quality_metric:
        if 'idr_reproducibility_qc' in quality_metric:
            qc_method = 'idr'
        else:
            qc_method = 'overlap'

        opt_set = quality_metric.get(
            qc_method + "_reproducibility_qc")["opt_set"]
        qc_summary.append({"title": "Optimal Peaks",
                           "value": str(quality_metric.get(qc_method + "_reproducibility_qc")["N_opt"]),
                           "numberType": "integer"})
        qc_summary.append({"title": "Rescue Ratio",
                           "tooltip": "Ratio of number of peaks (Nt) relative to peak calling based" +
                           " on psuedoreplicates (Np) [max(Np,Nt) / min (Np,Nt)]",
                           "value": str(round2(quality_metric.get(qc_method + "_reproducibility_qc")["rescue_ratio"])),
                           "numberType": "float"})
        qc_summary.append({"title": "Self Consistency Ratio",
                           "tooltip": "Ratio of number of peaks in two replicates [max(N1,N2) / min (N1,N2)]",
                           "value": str(round2(quality_metric.get(qc_method + "_reproducibility_qc")["self_consistency_ratio"])),
                           "numberType": "float"})
        qc_summary.append({"title": "Fraction of Reads in Peaks",
                           "value": str(round2(quality_metric.get(qc_method + "_frip_qc")[opt_set]["FRiP"])),
                           "numberType": "float"})
    elif 'flagstat_qc' in quality_metric or 'ctl_flagstat_qc' in quality_metric:
        pref = ''
        if 'ctl_flagstat_qc' in quality_metric:
            pref = 'ctl_'

        # mitochondrial rate (only for ATAC-seq)
        if qc_type == 'QualityMetricAtacseq':
            total = quality_metric.get(
                pref + "dup_qc")[0]["paired_reads"] + quality_metric.get(pref + "dup_qc")[0]["unpaired_reads"]
            nonmito = quality_metric.get(
                pref + "pbc_qc")[0]["total_read_pairs"]
            mito_rate = round2((1 - (float(nonmito) / float(total))) * 100)
            qc_summary.append({"title": "Percent mitochondrial reads",
                               "value": str(mito_rate),
                               "numberType": "percent"})
        qc_summary.append({"title": "Nonredundant Read Fraction (NRF)",
                           "value": str(round2(quality_metric.get(pref + "pbc_qc")[0]["NRF"])),
                           "tooltip": "distinct non-mito read pairs / total non-mito read pairs",
                           "numberType": "float"})
        qc_summary.append({"title": "PCR Bottleneck Coefficient (PBC)",
                           "value": str(round2(quality_metric.get(pref + "pbc_qc")[0]["PBC1"])),
                           "tooltip": "one-read non-mito read pairs / distinct non-mito read pairs",
                           "numberType": "float"})
        final_reads = quality_metric.get(
            pref + "nodup_flagstat_qc")[0]["read1"]  # PE
        if not final_reads:
            final_reads = quality_metric.get(
                pref + "nodup_flagstat_qc")[0]["total"]  # SE
        qc_summary.append({"title": "Filtered & Deduped Reads",
                           "value": str(final_reads),
                           "numberType": "integer"})

    return qc_summary if qc_summary else None