Exemplo n.º 1
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
    def parameters(cls):
        cls._file_param = ParameterFactory.file("Experiment results file.")
        cls._sid_param = ParameterFactory.lc_string(SAMPLE_ID,
                                                    "Genomic DNA Sample ID.")
        cls._rid_param = ParameterFactory.lc_string(RUN_ID, "Run ID.")
        cls._date_param = ParameterFactory.date()

        parameters = [
            cls._file_param,
            cls._sid_param,
            cls._rid_param,
            cls._date_param,
        ]
        return parameters
Exemplo n.º 3
0
    def parameters(cls):
        cls.pa_data_src_param = ParameterFactory.pa_data_source()
        cls.dyes_param = ParameterFactory.dyes()
        cls.device_param = ParameterFactory.device()
        cls.major_param    = ParameterFactory.integer(MAJOR, "Major dye " \
                                                      "profile version",
                                                      minimum=0)
        cls.minor_param    = ParameterFactory.integer(MINOR, "Minor dye " \
                                                      "profile version",
                                                      minimum=0)
        cls.job_name_param = ParameterFactory.lc_string(JOB_NAME, "Unique "\
                                                        "name to give this "
                                                        "job.")
        cls.offset         = ParameterFactory.integer(OFFSETS, "Offset used " \
            "to infer a dye model. The inference will offset the dye profiles " \
            "in a range of (-<offset>,<offset>] to determine the optimal " \
            "offset.", default=abs(DEFAULT_OFFSETS[0]), minimum=1)
        cls.use_iid_param  = ParameterFactory.boolean(USE_IID, "Use IID Peak " \
                                                      "Detection.",
                                                      default_value=False)

        parameters = [
            cls.pa_data_src_param,
            cls.dyes_param,
            cls.device_param,
            cls.major_param,
            cls.minor_param,
            cls.job_name_param,
            cls.offset,
            cls.use_iid_param,
        ]
        return parameters
 def parameters(cls):
     cls._file_param = ParameterFactory.file("Probe metadata file.")
     cls._app_param = ParameterFactory.lc_string(
         APPLICATION, "Case-insensitive application (e.g. Oncopanel).")
     parameters = [
         cls._file_param,
         cls._app_param,
     ]
     return parameters
Exemplo n.º 5
0
    def parameters(cls):
        cls.archives_param = ParameterFactory.archive()
        cls.job_name_param = ParameterFactory.lc_string(JOB_NAME, "Unique "\
                                                        "name to give this "
                                                        "job.")


        parameters = [
                      cls.archives_param,
                      cls.job_name_param,
                     ]
        return parameters
 def parameters(cls):
     pid_enum = cls._DB_CONNECTOR.distinct(PROBE_METADATA_COLLECTION,
                                           PROBE_ID)
     cls._pid_param = ParameterFactory.lc_string(PROBE_ID,
                                                 "Probe ID(s).",
                                                 required=True,
                                                 allow_multiple=True,
                                                 enum=pid_enum)
     parameters = [
         cls._pid_param,
     ]
     return parameters
Exemplo n.º 7
0
 def parameters(cls):
     rid_enum = cls._DB_CONNECTOR.distinct(PROBE_EXPERIMENTS_COLLECTION,
                                           RUN_ID)
     cls._rid_param = ParameterFactory.lc_string(RUN_ID,
                                                 "Run ID.",
                                                 required=True,
                                                 allow_multiple=True,
                                                 enum=rid_enum)
     parameters = [
         cls._rid_param,
     ]
     return parameters
Exemplo n.º 8
0
 def parameters(cls):
     parameters = [
         ParameterFactory.file_uuid(PROBES, PROBES_COLLECTION),
         ParameterFactory.file_uuid(TARGETS, TARGETS_COLLECTION),
         ParameterFactory.boolean("absorb", "Check for absorbed probes."),
         ParameterFactory.integer("num",
                                  "Minimum number of probes for a target.",
                                  default=3,
                                  minimum=1),
         ParameterFactory.lc_string(JOB_NAME,
                                    "Unique name to give this job.")
     ]
     return parameters
Exemplo n.º 9
0
    def process_request(cls, params_dict):
        probes_file_uuid = params_dict[ParameterFactory.file_uuid(
            "probes", PROBES_COLLECTION)][0]
        targets_file_uuid = params_dict[ParameterFactory.file_uuid(
            "targets", TARGETS_COLLECTION)][0]
        absorb = params_dict[ParameterFactory.boolean(
            "absorb", "Check for absorbed probes.")][0]
        num = params_dict[ParameterFactory.integer(
            "num",
            "Minimum number of probes for a target.",
            default=3,
            minimum=1)][0]
        job_name = params_dict[ParameterFactory.lc_string(
            JOB_NAME, "Unique name to give this job.")][0]

        json_response = {
            PROBES: probes_file_uuid,
            TARGETS: targets_file_uuid,
            ABSORB: absorb,
            NUM: num,
            UUID: str(uuid4()),
            STATUS: JOB_STATUS.submitted,  # @UndefinedVariable
            JOB_NAME: job_name,
            DATESTAMP: datetime.today(),
        }
        http_status_code = 200

        if job_name in cls._DB_CONNECTOR.distinct(VALIDATION_COLLECTION,
                                                  JOB_NAME):
            http_status_code = 403
        else:
            try:
                probes_path = cls._DB_CONNECTOR.find_one(
                    PROBES_COLLECTION, UUID, probes_file_uuid)[FILEPATH]
                targets_path = cls._DB_CONNECTOR.find_one(
                    TARGETS_COLLECTION, UUID, targets_file_uuid)[FILEPATH]

                #ADD VALIDATOR JOB TO QUEUE

                cls._DB_CONNECTOR.insert(VALIDATION_COLLECTION,
                                         [json_response])
                del json_response[ID]
            except:
                APP_LOGGER.exception(traceback.format_exc())
                json_response[ERROR] = str(sys.exc_info()[1])
                http_status_code = 500

        return make_clean_response(json_response, http_status_code)
Exemplo n.º 10
0
    def parameters(cls):
        cls.job_uuid_param  = ParameterFactory.job_uuid(SA_ASSAY_CALLER_COLLECTION)
        cls.job_name_param  = ParameterFactory.lc_string(JOB_NAME, JOB_NAME_DESC)
        cls.exp_defs_param  = ParameterFactory.experiment_definition()
        cls.req_drops_param = ParameterFactory.integer(REQUIRED_DROPS,
                                                       REQ_DROPS_DESCRIPTION,
                                                       required=True, default=0,
                                                       minimum=0)

        parameters = [
                      cls.job_uuid_param,
                      cls.job_name_param,
                      cls.exp_defs_param,
                      cls.req_drops_param,
                      ]
        return parameters
Exemplo n.º 11
0
    def parameters(cls):
        cls.job_uuid_param = ParameterFactory.job_uuid(SA_IDENTITY_COLLECTION)
        cls.job_name_param  = ParameterFactory.lc_string(JOB_NAME, 'Unique '\
                                                         'name to give this '
                                                         'job.')
        cls.exp_defs_param = ParameterFactory.experiment_definition()
        cls.training_param = ParameterFactory.integer(
            TRAINING_FACTOR,
            TRAINING_FACTOR_DESCRIPTION,
            default=AC_TRAINING_FACTOR,
            minimum=1,
            required=True)
        cls.ctrl_thresh = ParameterFactory.float(CTRL_THRESH,
                                                 CTRL_THRESH_DESCRIPTION,
                                                 default=AC_CTRL_THRESHOLD,
                                                 minimum=0.0,
                                                 maximum=100.0)
        cls.ctrl_filter = ParameterFactory.boolean(CTRL_FILTER,
                                                   CTRL_FILTER_DESCRIPTION,
                                                   default_value=False,
                                                   required=True)
        cls.ac_method = ParameterFactory.ac_method(AC_METHOD,
                                                   AC_METHOD_DESCRIPTION)
        cls.ac_model = ParameterFactory.cs_string(
            AC_MODEL,
            AC_MODEL_DESCRIPTION,
            required=False,
            enum=[
                m for model_dict in MODEL_FILES.values() for m in model_dict
            ])

        parameters = [
            cls.job_uuid_param,
            cls.job_name_param,
            cls.exp_defs_param,
            cls.training_param,
            cls.ctrl_thresh,
            cls.ctrl_filter,
            cls.ac_method,
            cls.ac_model,
        ]
        return parameters
    def parameters(cls):
        cls._users_param    = ParameterFactory.lc_string(USERS, 
            "Username(s) of individual(s) that performed the run (e.g. ddicara)", 
            allow_multiple=True)
        cls._date_param     = ParameterFactory.date()
        cls._archive_param = ParameterFactory.archive()
        cls._beta_param     = ParameterFactory.integer(BETA, 
            "Beta (e.g. 17)", required=True, minimum=1, maximum=100)
        cls._device_param   = ParameterFactory.cs_string(DEVICE, 
            "Device description (e.g. PDMS bonded on COP)") 
        cls._dye_profile_metrics_param = ParameterFactory.dye_profile_metrics()
        cls._surfactant_param = ParameterFactory.cs_string(SURFACTANT,
            "Surfactant (e.g. RAN 002-105).")

        parameters = [
                      cls._users_param,
                      cls._date_param,
                      cls._archive_param,
                      cls._beta_param,
                      cls._device_param,
                      cls._dye_profile_metrics_param,
                      cls._surfactant_param,
                     ]
        return parameters
Exemplo n.º 13
0
    def parameters(cls):
        cls.job_uuid_param  = ParameterFactory.job_uuid(PA_PROCESS_COLLECTION)
        cls.job_name_param  = ParameterFactory.lc_string(JOB_NAME, "Unique "\
                                                         "name to give this "
                                                         "job.")
        cls.pico1_dye_param      = ParameterFactory.dye(PICO1_DYE,
                                                      "Picoinjection 1 dye.")
        cls.pico2_dye_param      = ParameterFactory.dye(PICO2_DYE,
                                                      "Picoinjection 2 dye.")
        cls.assay_dye_param    = ParameterFactory.dye(ASSAY_DYE, "Assay dye.")
        cls.n_probes_param     = ParameterFactory.integer(NUM_PROBES,
                                                        NUM_PROBES_DESCRIPTION,
                                                        default=0, minimum=0)
        cls.training_param     = ParameterFactory.integer(TRAINING_FACTOR,
                                                   TRAINING_FACTOR_DESCRIPTION,
                                                   default=DEFAULT_ID_TRAINING_FACTOR,
                                                   minimum=1)
        cls.dye_levels_param   = ParameterFactory.dye_levels()
        cls.ignored_dyes_param = ParameterFactory.dyes(name=IGNORED_DYES,
                                                       required=False)
        cls.filtered_dyes_param = ParameterFactory.dyes(name=FILTERED_DYES,
                                                        required=False)
        cls.ui_threshold_param = ParameterFactory.float(UI_THRESHOLD,
                                                      UI_THRESHOLD_DESCRIPTION,
                                                      default=UNINJECTED_THRESHOLD,
                                                      minimum=0.0)
        cls.continuous_phase_param   = ParameterFactory.boolean(CONTINUOUS_PHASE,
                                                          CONTINUOUS_PHASE_DESCRIPTION,
                                                          default_value=False,
                                                          required=False)
        cls.dev_mode_param   = ParameterFactory.boolean(DEV_MODE,
                                                        'Use development mode (more forgiving of mistakes).',
                                                        default_value=DEFAULT_DEV_MODE,
                                                        required=False)
        cls.drift_compensate_param   = ParameterFactory.boolean(DRIFT_COMPENSATE,
                                                        'Compensate for data drift.',
                                                        default_value=DEFAULT_DRIFT_COMPENSATE,
                                                        required=False)
        cls.max_ui_ratio_param = ParameterFactory.float(MAX_UNINJECTED_RATIO,
                                                        MAX_UI_RATIO_DESCRIPTION,
                                                        default=UNINJECTED_RATIO,
                                                        minimum=0.0)
        cls.ignore_lowest_barcode = ParameterFactory.boolean(IGNORE_LOWEST_BARCODE,
                                                             IGNORE_LOWEST_BARCODE_DESCRIPTION,
                                                             default_value=DEFAULT_IGNORE_LOWEST_BARCODE,
                                                             required=False)

        parameters = [
                      cls.job_uuid_param,
                      cls.job_name_param,
                      cls.pico1_dye_param,
                      cls.pico2_dye_param,
                      cls.assay_dye_param,
                      cls.n_probes_param,
                      cls.training_param,
                      cls.dye_levels_param,
                      cls.ignored_dyes_param,
                      cls.filtered_dyes_param,
                      cls.ui_threshold_param,
                      cls.continuous_phase_param,
                      cls.max_ui_ratio_param,
                      cls.ignore_lowest_barcode,
                      cls.dev_mode_param,
                      cls.drift_compensate_param,
                     ]
        return parameters
Exemplo n.º 14
0
    def parameters(cls):
        # required parameters
        cls.job_name_param = ParameterFactory.lc_string(
            JOB_NAME, 'Unique name for this job.', required=True)
        cls.exp_def_param = ParameterFactory.experiment_definition()
        cls.mask_param = ParameterFactory.cs_string(
            VARIANT_MASK, 'Mask code for variant selection.', required=False)

        # primary analysis parameters
        cls.pa_data_src_param = ParameterFactory.cs_string(
            PA_DATA_SOURCE,
            "Primary analysis data source (HDF5 or image stack).",
            required=True)
        cls.dyes_param = ParameterFactory.dyes(required=False)
        cls.device_param = ParameterFactory.device(required=False,
                                                   default='katahdin')
        cls.major_param = ParameterFactory.integer(MAJOR,
                                                   'Major dye version',
                                                   minimum=0,
                                                   required=False,
                                                   default=1)
        cls.minor_param = ParameterFactory.integer(MINOR,
                                                   'Minor dye version',
                                                   minimum=0,
                                                   required=False,
                                                   default=0)
        cls.offset = ParameterFactory.integer(
            OFFSETS,
            'Offset used to infer a dye model.',
            default=abs(DEFAULT_OFFSETS[0]),
            minimum=1,
            required=False)
        cls.use_iid_param = ParameterFactory.boolean(USE_IID,
                                                     'Use IID Peak Detection.',
                                                     default_value=False,
                                                     required=False)

        # identity parameters
        cls.dye_levels_param = ParameterFactory.dye_levels(required=False)
        cls.ignored_dyes_param = ParameterFactory.dyes(name=IGNORED_DYES,
                                                       required=False)
        cls.filtered_dyes_param = ParameterFactory.dyes(name=FILTERED_DYES,
                                                        required=False)
        cls.pico1_dye_param = ParameterFactory.dye(PICO1_DYE,
                                                   'picoinjection 1 dye.',
                                                   required=False,
                                                   default=None)
        cls.pico2_dye_param = ParameterFactory.dye(PICO2_DYE,
                                                   'picoinjection 2 dye.',
                                                   required=False,
                                                   default=DEFAULT_PICO2_DYE)
        cls.assay_dye_param = ParameterFactory.dye(ASSAY_DYE,
                                                   'Assay dye.',
                                                   required=False,
                                                   default=DEFAULT_ASSAY_DYE)
        cls.n_probes_param = ParameterFactory.integer(NUM_PROBES,
                                                      NUM_PROBES_DESCRIPTION,
                                                      minimum=4,
                                                      required=False)
        cls.id_training_param = ParameterFactory.integer(
            ID_TRAINING_FACTOR,
            TRAINING_FACTOR_DESCRIPTION,
            minimum=1,
            required=False,
            default=DEFAULT_ID_TRAINING_FACTOR,
        )
        cls.ui_threshold_param = ParameterFactory.float(
            UI_THRESHOLD,
            UI_THRESHOLD_DESCRIPTION,
            minimum=0.0,
            required=False,
            default=DEFAULT_UNINJECTED_THRESHOLD)
        cls.continuous_phase_param = ParameterFactory.boolean(
            CONTINUOUS_PHASE,
            CONTINUOUS_PHASE_DESCRIPTION,
            default_value=False,
            required=False)
        cls.max_ui_ratio_param = ParameterFactory.float(
            MAX_UNINJECTED_RATIO,
            MAX_UI_RATIO_DESCRIPTION,
            default=DEFAULT_UNINJECTED_RATIO,
            minimum=0.0)
        cls.ignore_lowest_barcode = ParameterFactory.boolean(
            IGNORE_LOWEST_BARCODE,
            IGNORE_LOWEST_BARCODE_DESCRIPTION,
            default_value=True,
            required=False)
        cls.use_pico1_filter = ParameterFactory.boolean(
            USE_PICO1_FILTER,
            USE_PICO1_FILTER_DESCRIPTION,
            default_value=True,
            required=False)
        cls.use_pico2_filter = ParameterFactory.boolean(
            USE_PICO2_FILTER,
            USE_PICO2_FILTER_DESCRIPTION,
            default_value=True,
            required=False)
        cls.dev_mode_param = ParameterFactory.boolean(
            DEV_MODE,
            'Use development mode (more forgiving of mistakes).',
            default_value=DEFAULT_DEV_MODE,
            required=False)
        cls.drift_compensate_param = ParameterFactory.boolean(
            DRIFT_COMPENSATE,
            'Compensate for data drift.',
            default_value=DEFAULT_DRIFT_COMPENSATE,
            required=False)

        # assay caller params
        cls.ac_training_param = ParameterFactory.integer(
            AC_TRAINING_FACTOR,
            TRAINING_FACTOR_DESCRIPTION,
            minimum=1,
            required=False,
            default=DEFAULT_AC_TRAINING_FACTOR)

        cls.ctrl_thresh = ParameterFactory.float(
            CTRL_THRESH,
            CTRL_THRESH_DESCRIPTION,
            default=DEFAULT_AC_CTRL_THRESHOLD,
            minimum=0.0,
            maximum=100.0)

        cls.ctrl_filter = ParameterFactory.boolean(CTRL_FILTER,
                                                   CTRL_FILTER_DESCRIPTION,
                                                   default_value=False,
                                                   required=True)
        cls.ac_method = ParameterFactory.ac_method(AC_METHOD,
                                                   AC_METHOD_DESCRIPTION)
        cls.ac_model = ParameterFactory.cs_string(
            AC_MODEL,
            AC_MODEL_DESCRIPTION,
            required=False,
            enum=[
                m for model_dict in MODEL_FILES.values() for m in model_dict
            ])

        # genotyper params
        cls.req_drops_param = ParameterFactory.integer(REQUIRED_DROPS,
                                                       REQ_DROPS_DESCRIPTION,
                                                       required=False,
                                                       minimum=0,
                                                       default=0)

        parameters = [
            cls.pa_data_src_param,
            cls.dyes_param,
            cls.device_param,
            cls.major_param,
            cls.minor_param,
            cls.job_name_param,
            cls.offset,
            cls.use_iid_param,
            cls.pico1_dye_param,
            cls.pico2_dye_param,
            cls.assay_dye_param,
            cls.n_probes_param,
            cls.id_training_param,
            cls.dye_levels_param,
            cls.ignored_dyes_param,
            cls.dev_mode_param,
            cls.drift_compensate_param,
            cls.use_pico1_filter,
            cls.use_pico2_filter,
            cls.filtered_dyes_param,
            cls.ui_threshold_param,
            cls.continuous_phase_param,
            cls.max_ui_ratio_param,
            cls.ignore_lowest_barcode,
            cls.ac_training_param,
            cls.ctrl_thresh,
            cls.ctrl_filter,
            cls.ac_method,
            cls.ac_model,
            cls.req_drops_param,
            cls.exp_def_param,
            cls.mask_param,
        ]
        return parameters