Detect copy number variations from tumor/normal samples using Battenberg.

def run(items, background=None):
    """Detect copy number variations from tumor/normal samples using Battenberg.
    """
    paired = vcfutils.get_paired_bams([x["align_bam"] for x in items], items)
    if not paired or not paired.normal_bam:
        logger.warn("Battenberg only works on paired tumor/normal inputs, skipping %s"
                    % dd.get_sample_name(items[0]))
        batout = None
    elif not tz.get_in(["genome_resources", "aliases", "human"], paired.tumor_data):
        logger.warn("Battenberg only works on human data, skipping %s"
                    % dd.get_sample_name(items[0]))
        batout = None
    else:
        batout = _do_run(paired)
        batout["variantcaller"] = "battenberg"
    out = []
    for data in items:
        if batout and dd.get_sample_name(data) == paired.tumor_name:
            if "sv" not in data:
                data["sv"] = []
            data["sv"].append(batout)
        out.append(data)
    return out