Esempio n. 1
0
    def __init__(self):
        """Create a dictionary of samples where the value is set to Geno,
Publish or ProbeSet. E.g.

        {'AD-cases-controls-MyersGeno': 'Geno',
         'AD-cases-controls-MyersPublish': 'Publish',
         'AKXDGeno': 'Geno',
         'AXBXAGeno': 'Geno',
         'AXBXAPublish': 'Publish',
         'Aging-Brain-UCIPublish': 'Publish',
         'All Phenotypes': 'Publish',
         'B139_K_1206_M': 'ProbeSet',
         'B139_K_1206_R': 'ProbeSet' ...

        """
        self.datasets = {}
        if USE_GN_SERVER:
            data = menu_main()
        else:
            file_name = "wqflask/static/new/javascript/dataset_menu_structure.json"
            with open(file_name, 'r') as fh:
                data = json.load(fh)

        for species in data['datasets']:
            for group in data['datasets'][species]:
                for dataset_type in data['datasets'][species][group]:
                    for dataset in data['datasets'][species][group][
                            dataset_type]:
                        short_dataset_name = dataset[1]
                        if dataset_type == "Phenotypes":
                            new_type = "Publish"
                        elif dataset_type == "Genotypes":
                            new_type = "Geno"
                        else:
                            new_type = "ProbeSet"
                        self.datasets[short_dataset_name] = new_type
        # Set LOG_LEVEL_DEBUG=5 to see the following:
        logger.debugf(5, "datasets", self.datasets)
Esempio n. 2
0
    def __init__(self):
        """Create a dictionary of samples where the value is set to Geno,
Publish or ProbeSet. E.g.

        {'AD-cases-controls-MyersGeno': 'Geno',
         'AD-cases-controls-MyersPublish': 'Publish',
         'AKXDGeno': 'Geno',
         'AXBXAGeno': 'Geno',
         'AXBXAPublish': 'Publish',
         'Aging-Brain-UCIPublish': 'Publish',
         'All Phenotypes': 'Publish',
         'B139_K_1206_M': 'ProbeSet',
         'B139_K_1206_R': 'ProbeSet' ...

        """
        self.datasets = {}
        if USE_GN_SERVER:
            data = menu_main()
        else:
            file_name = "wqflask/static/new/javascript/dataset_menu_structure.json"
            with open(file_name, 'r') as fh:
                data = json.load(fh)

        for species in data['datasets']:
            for group in data['datasets'][species]:
                for dataset_type in data['datasets'][species][group]:
                    for dataset in data['datasets'][species][group][dataset_type]:
                        short_dataset_name = dataset[1]
                        if dataset_type == "Phenotypes":
                            new_type = "Publish"
                        elif dataset_type == "Genotypes":
                            new_type = "Geno"
                        else:
                            new_type = "ProbeSet"
                        self.datasets[short_dataset_name] = new_type
        # Set LOG_LEVEL_DEBUG=5 to see the following:
        logger.debugf(5,"datasets",self.datasets)