Exemple #1
0
 def parameters(cls):
     cls.uuids_param = ParameterFactory.uuid(required=False)
     parameters = [
         cls.uuids_param,
         ParameterFactory.format(),
     ]
     return parameters
Exemple #2
0
    def parameters(cls):
        sid_enum  = cls._DB_CONNECTOR.distinct(PROBE_EXPERIMENTS_COLLECTION,
                                               SAMPLE_ID)
        rid_enum  = cls._DB_CONNECTOR.distinct(PROBE_EXPERIMENTS_COLLECTION,
                                               RUN_ID)
        pid_enum  = cls._DB_CONNECTOR.distinct(PROBE_EXPERIMENTS_COLLECTION,
                                               PROBE_ID)
        date_enum = cls._DB_CONNECTOR.distinct(PROBE_EXPERIMENTS_COLLECTION,
                                               DATE)
        date_enum = map(lambda x: x.strftime("%Y_%m_%d"), date_enum)

        parameters = [
                      ParameterFactory.format(),
                      ParameterFactory.lc_string(SAMPLE_ID, 
                                                 "Genomic DNA Sample ID(s).",
                                                 required=False,
                                                 allow_multiple=True,
                                                 enum=sid_enum),
                      ParameterFactory.lc_string(RUN_ID, "Run ID(s).",
                                                 required=False,
                                                 allow_multiple=True,
                                                 enum=rid_enum),
                      ParameterFactory.lc_string(PROBE_ID, "Probe ID(s).",
                                                 required=False,
                                                 allow_multiple=True,
                                                 enum=pid_enum),
                      ParameterFactory.date(required=False, enum=date_enum)
                     ]
        return parameters
Exemple #3
0
 def parameters(cls):
     parameters = [
         ParameterFactory.format(),
         ParameterFactory.sequence_names(required=True),
         ParameterFactory.sequences(required=True),
     ]
     return parameters
Exemple #4
0
    def _parse_query_params(cls, query_params):
        '''
        Valid query_params are defined by parameters(). However, a user can 
        supply parameters not contained in this list. Therefore, invalid 
        parameters are discarded and a params_dict is populated only with those 
        parameters that are valid. Since format is a special required input 
        parameter for every API function, it is parsed and returned separately.
        
        Note that each parameter parses its own arguments. This allows it to
        set a default when the parameter isn't included in the API call, as well
        as format the input appropriately (string, float, int, date, etc.).  
        '''
        params_dict = dict()

        _format = FORMATS.json  # @UndefinedVariable

        parameters = cls.parameters()

        for parameter in parameters:
            # Path parameters are parsed in _handle_path_fields()
            if not parameter.is_path():
                # query_params is a default_dict(list), so it returns an empty
                # list if this parameter was not provided - parse_args must
                # be called on every parameter to set its default value if one
                # exists.
                args = parameter.parse_args(
                    query_params[parameter.alias.lower()])
                if args:
                    if parameter == ParameterFactory.format():
                        _format = args[0]
                    else:
                        params_dict[parameter] = args

        return (params_dict, _format)
 def parameters(cls):
     cls.refresh_parameter = ParameterFactory.boolean("refresh",
                                                      "Refresh available " \
                                                      "run reports.",
                                                      default_value=False)
     cls.cart_sn_parameter = ParameterFactory.cartridge_sn()
     cls.start_date = DateParameter("start",
                                    "Start date of the form YYYY_MM_DD.",
                                    allow_multiple=False,
                                    required=False)
     cls.end_date = DateParameter("end",
                                  "End date of the form YYYY_MM_DD.",
                                  allow_multiple=False,
                                  required=False)
     cls.uuid_parameter = ParameterFactory.uuid(required=False,
                                                allow_multiple=False)
     parameters = [
         cls.cart_sn_parameter,
         cls.refresh_parameter,
         cls.start_date,
         cls.end_date,
         cls.uuid_parameter,
         ParameterFactory.format(),
     ]
     return parameters
Exemple #6
0
 def parameters(cls):
     cls.ac_method = ParameterFactory.ac_method(AC_METHOD,
                                                AC_METHOD_DESCRIPTION)
     parameters = [
         cls.ac_method,
         ParameterFactory.format(),
     ]
     return parameters
Exemple #7
0
 def parameters(cls):
     cls.refresh_parameter = ParameterFactory.boolean("refresh", 
                                                      "Refresh available dyes.",
                                                      default_value=False)
     parameters = [
                   cls.refresh_parameter,
                   ParameterFactory.format(),
                  ]
     return parameters
Exemple #8
0
 def parameters(cls):
     parameters = [
         ParameterFactory.format(),
         ParameterFactory.snpsearch_name(required=True),
         ParameterFactory.chromosome_num(required=True),
         ParameterFactory.chromosome_start(required=True),
         ParameterFactory.chromosome_stop(required=True),
     ]
     return parameters
Exemple #9
0
    def parameters(cls):
        cls.tags_parameter = ParameterFactory.tags("Run report tags.")
        cls.report_uuid_parameter = ParameterFactory.uuid(allow_multiple=False)

        parameters = [
            cls.tags_parameter,
            cls.report_uuid_parameter,
            ParameterFactory.format(),
        ]
        return parameters
Exemple #10
0
    def parameters(cls):
        cls.dataset_parameter = ParameterFactory.pa_data_source()
        cls.report_uuid_parameter = ParameterFactory.uuid(allow_multiple=False)

        parameters = [
            cls.dataset_parameter,
            cls.report_uuid_parameter,
            ParameterFactory.format(),
        ]
        return parameters
    def parameters(cls):
        cls.filenames_parameter = ParameterFactory.filenames()
        cls.report_uuid_parameter = ParameterFactory.uuid(allow_multiple=False)

        parameters = [
            cls.filenames_parameter,
            cls.report_uuid_parameter,
            ParameterFactory.format(),
        ]
        return parameters
    def parameters(cls):
        pid_enum = cls._DB_CONNECTOR.distinct(PROBE_METADATA_COLLECTION,
                                              PROBE_ID)

        parameters = [
            ParameterFactory.format(),
            ParameterFactory.lc_string(PROBE_ID,
                                       "Probe ID(s).",
                                       required=False,
                                       allow_multiple=True,
                                       enum=pid_enum),
        ]
        return parameters
Exemple #13
0
 def parameters(cls):
     parameters = [
         ParameterFactory.format(),
     ]
     return parameters