6372bff538de67595fda0183964a8df4b9b105fb,cnvlib/antitarget.py,,get_background,#Any#Any#Any#Any#,13

Before Change


                                target_bed,
                                tuple(sorted(target_chroms.keys())[:3])))
        // But filter out untargeted alternative contigs and mitochondria
        untgt_chroms = set(access_chroms) - set(target_chroms)
        // Autosomes typically have numeric names, allosomes are X and Y
        is_canonical = re.compile(r"(chr)?(\d+|[XYxy])$")
        if any(is_canonical.match(c) for c in target_chroms):
            chroms_to_skip = [c for c in untgt_chroms
                              if not is_canonical.match(c)]
        else:
            // Alternative contigs have long names -- skip them
            max_tgt_chr_name_len = max(map(len, target_chroms))
            chroms_to_skip = [c for c in untgt_chroms
                              if len(c) > max_tgt_chr_name_len]
        for untgt_chr in chroms_to_skip:
            logging.info("Skipping untargeted chromosome %s", untgt_chr)
            del access_chroms[untgt_chr]
    else:
        // Chromosome accessible sequence regions not known -- use heuristics
        // (chromosome length is endpoint of last probe; skip initial
        // <magic number> of bases that are probably telomeric)

After Change


    if access_bed:
        // Chromosomes" accessible sequence regions are given -- use them
        accessible = tabio.read_auto(access_bed)
        access_chroms = set(accessible.chromosome.unique())
        if access_chroms and access_chroms.isdisjoint(target_chroms):
            raise ValueError("Chromosome names in the accessible regions file "
                             "%s %r do not match those in targets %s %r"
                             % (access_bed, tuple(sorted(access_chroms)[:3]),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: etal/cnvkit
Commit Name: 6372bff538de67595fda0183964a8df4b9b105fb
Time: 2016-12-08
Author: eric.talevich@gmail.com
File Name: cnvlib/antitarget.py
Class Name:
Method Name: get_background


Project Name: scikit-image/scikit-image
Commit Name: ea40a555956467d98c7d321633a73cf408d9a805
Time: 2016-11-08
Author: yue@berkeley.edu
File Name: skimage/color/colorlabel.py
Class Name:
Method Name: _match_label_with_color


Project Name: pfnet/optuna
Commit Name: 4acb2e669d287af76b2936b42d801b7d1c818c4d
Time: 2019-12-01
Author: t.ohmae.nx01@gmail.com
File Name: examples/skimage_lbp_simple.py
Class Name:
Method Name: load_data