3f5563740b444d0f8eb86f87eb30edc3d0ff9189,workers/data_refinery_workers/processors/qn_reference.py,,_update_experiment_caches,#Any#,213

Before Change


def _update_experiment_caches(job_context: Dict) -> Dict:
     Experiments have a cached value with the number of samples that have QN targets
        generated, this value should be updated after generating new QN targets. 
    unique_experiments = []
    all_samples = job_context["samples"]["ALL"]
    for sample in all_samples:
        if sample.experiments.all().count() > 0:
            unique_experiments = list(set(unique_experiments + sample.experiments.all()[::1]))

    for experiment in unique_experiments:
        experiment.update_num_samples()

After Change


        generated, this value should be updated after generating new QN targets. 
    organism_id = job_context["samples"]["ALL"][0].organism_id
    organism_name = Organism.get_name_for_id(organism_id)
    unique_experiments = Experiments.objects.all().filter(organism_names__contains=organism_name)
    
    for experiment in unique_experiments:
        experiment.update_num_samples()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: AlexsLemonade/refinebio
Commit Name: 3f5563740b444d0f8eb86f87eb30edc3d0ff9189
Time: 2019-06-19
Author: arielsvn@gmail.com
File Name: workers/data_refinery_workers/processors/qn_reference.py
Class Name:
Method Name: _update_experiment_caches


Project Name: AlexsLemonade/refinebio
Commit Name: 99d2d1aced54a9673b9e25b6c1f992acd20535e1
Time: 2019-08-16
Author: arielsvn@gmail.com
File Name: common/data_refinery_common/rna_seq.py
Class Name:
Method Name: should_run_tximport


Project Name: pantsbuild/pants
Commit Name: a5be64f57a268a23db5267cd7526d67c13a6bc66
Time: 2013-11-20
Author: jsirois@twitter.com
File Name: src/python/twitter/pants/tasks/cache_manager.py
Class Name: CacheManager
Method Name: _order_target_list