8bb827838c60d008d1cd5124b050021a3b7734dc,cnvlib/diagram.py,,create_diagram,#,29

Before Change


    // Label genes where copy ratio value exceeds threshold
    cnarr = cnarr.shift_xx(male_reference)
    if cnarr_is_seg:
        gainloss = []
    elif segarr:
        segarr = segarr.shift_xx(male_reference)
        gainloss = reports.gainloss_by_segment(cnarr, segarr, threshold)
    else:

After Change


    // NB: If multiple segments cover the same gene (gene contains breakpoints),
    // all those segments are marked as "hits".  We"ll uniquify them.
    // TODO - use different logic to only label the gene"s signficant segment(s)
    seen_genes = set()

    // Consolidate genes & coverage values as chromosome features
    features = collections.defaultdict(list)
    strand = 1 if do_both else None  // Draw on the chr. right half or full width
    chrom_sizes = plots.chromosome_sizes(cnarr)
    if not cnarr_is_seg:
        cnarr = cnarr.squash_genes()
    for row in cnarr:
        if row.start - 1 >= 0 and row.end <= chrom_sizes[row.chromosome]:  // Sanity check
            if row.gene in gene_labels and row.gene not in seen_genes:
                seen_genes.add(row.gene)
                feat_name = row.gene
                if "," in feat_name:
                    // TODO - line-wrap multi-gene labels (reportlab won"t do \n)
                    feat_name = feat_name.replace(",", ", ")
            else:
                feat_name = None
            features[row.chromosome].append(
                (row.start - 1, row.end, strand, feat_name,
                 colors.Color(*plots.cvg2rgb(row.log2, not cnarr_is_seg))))
    if do_both:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: etal/cnvkit
Commit Name: 8bb827838c60d008d1cd5124b050021a3b7734dc
Time: 2016-04-06
Author: eric.talevich@gmail.com
File Name: cnvlib/diagram.py
Class Name:
Method Name: create_diagram


Project Name: rtqichen/torchdiffeq
Commit Name: 625784c31f592f3b760b53faa0c2f31b57be238a
Time: 2020-07-30
Author: 33688385+patrick-kidger@users.noreply.github.com
File Name: torchdiffeq/_impl/misc.py
Class Name:
Method Name: _check_inputs


Project Name: daniellerch/aletheia
Commit Name: e7eefe879b9e5b7a279d80588af59d08f21365a1
Time: 2020-11-01
Author: kevin.clark@gmail.com
File Name: aletheialib/attacks.py
Class Name:
Method Name: difference


Project Name: CNuge/kaggle-code
Commit Name: b7990885d8b26b9404fd9ce952b0b2f005019594
Time: 2018-01-12
Author: nugentc@uoguelph.ca
File Name: california_housing/feature_engineering.py
Class Name:
Method Name: