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
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
def parameters(cls): cls._file_param = ParameterFactory.file("Image stack tgz file.") cls._exp_defs_param = ParameterFactory.experiment_definition() cls._name_param = ParameterFactory.cs_string( NAME, "Unique name to give this image stack.") cls._short_desc_param = ParameterFactory.cs_string( DESCRIPTION, "Short description of image stack.") parameters = [ cls._file_param, cls._exp_defs_param, cls._name_param, cls._short_desc_param, ] return parameters
def parameters(cls): cls._file_param = ParameterFactory.file('Image stack tgz file.') cls._stack_type_param = ParameterFactory.mon_camera_type( STACK_TYPE, 'Monitor Camera Number') cls._name_param = ParameterFactory.cs_string( NAME, 'Unique name to give this image stack.') cls._short_desc_param = ParameterFactory.cs_string( DESCRIPTION, 'Short description of image stack.') parameters = [ cls._file_param, cls._stack_type_param, cls._name_param, cls._short_desc_param, ] return parameters
def parameters(cls): parameters = [ ParameterFactory.file("Raw plate reader data file."), ParameterFactory.cs_string("probe_sequence", "Probe sequence."), ParameterFactory.cs_string("probe_tm", "Probe melting temperature."), ParameterFactory.cs_string("probe_length", "Probe melting temperature."), ParameterFactory.cs_string("target_sequence", "Target sequence."), ParameterFactory.cs_string("variant_location", "Variant location."), ParameterFactory.cs_string("variant_allele", "Variant allele."), ParameterFactory.cs_string("reference_allele", "Reference allele."), ParameterFactory.cs_string( "incubation_temp", "Incubation temperature (degrees celsius)."), ParameterFactory.cs_string("incubation_time", "Incubation time (minutes)."), ] return parameters
def process_request(cls, params_dict): targets_file = params_dict[ParameterFactory.file( "Targets FASTA file.")][0] json_response = {FILENAME: targets_file.filename} http_status_code = 200 file_uuid = str(uuid4()) path = os.path.join(TARGETS_UPLOAD_PATH, file_uuid) existing_filenames = cls._DB_CONNECTOR.distinct( TARGETS_COLLECTION, FILENAME) if os.path.exists(path) or targets_file.filename in existing_filenames: http_status_code = 403 elif validate_fasta(targets_file) == False: http_status_code = 415 else: try: targets_file.save(path) targets_file.close() json_response[URL] = "http://%s/uploads/%s/targets/%s" % ( HOSTNAME, PORT, file_uuid) json_response[FILEPATH] = path json_response[UUID] = file_uuid json_response[DATESTAMP] = datetime.today() json_response[TYPE] = "targets" if "." in targets_file.filename: json_response[FORMAT] = targets_file.filename.split( ".")[-1] else: json_response[FORMAT] = "Unknown" cls._DB_CONNECTOR.insert(TARGETS_COLLECTION, [json_response]) except: APP_LOGGER.exception(traceback.format_exc()) json_response[ERROR] = str(sys.exc_info()[1]) http_status_code = 500 finally: if ID in json_response: del json_response[ID] return make_clean_response(json_response, http_status_code)
def parameters(cls): parameters = [ParameterFactory.file("Probes file.")] return parameters
def process_request(cls, params_dict): plate_file = params_dict[ParameterFactory.file( "Raw plate reader data file.")][0] probe_sequence = params_dict[ParameterFactory.cs_string( "probe_sequence", "Probe sequence.")][0] probe_tm = params_dict[ParameterFactory.float( "probe_tm", "Probe melting temperature (degrees celsius).")][0] probe_length = params_dict[ParameterFactory.integer( "probe_length", "Probe length.")][0] target_sequence = params_dict[ParameterFactory.cs_string( "target_sequence", "Target sequence.")][0] variant_location = params_dict[ParameterFactory.cs_string( "variant_location", "Variant location.")][0] variant_allele = params_dict[ParameterFactory.cs_string( "variant_allele", "Variant allele.")][0] reference_allele = params_dict[ParameterFactory.cs_string( "reference_allele", "Reference allele.")][0] incubation_temp = params_dict[ParameterFactory.float( "incubation_temp", "Incubation temperature (degrees celsius).")][0] incubation_time = params_dict[ParameterFactory.float( "incubation_time", "Incubation time (minutes).")][0] json_response = { FILENAME: plate_file.filename, "probe_sequence": probe_sequence, "probe_tm": probe_tm, "probe_length": probe_length, "target_sequence": target_sequence, "variant_location": variant_location, "variant_allele": variant_allele, "reference_allele": reference_allele, "incubation_temp": incubation_temp, "incubation_time": incubation_time, } http_status_code = 200 file_uuid = str(uuid4()) path = os.path.join(PLATES_UPLOAD_PATH, file_uuid) existing_filenames = cls._DB_CONNECTOR.distinct( PLATES_COLLECTION, FILENAME) if os.path.exists(path) or plate_file.filename in existing_filenames: http_status_code = 403 else: try: plate_file.save(path) plate_file.close() json_response[URL] = "http://%s/uploads/%s/plates/%s" % ( HOSTNAME, PORT, file_uuid) json_response[FILEPATH] = path json_response[UUID] = file_uuid json_response[DATESTAMP] = datetime.today() json_response[TYPE] = "plate" cls._DB_CONNECTOR.insert(PLATES_COLLECTION, [json_response]) except: APP_LOGGER.exception(traceback.format_exc()) json_response[ERROR] = str(sys.exc_info()[1]) http_status_code = 500 finally: if ID in json_response: del json_response[ID] silently_remove_file(path) return make_clean_response(json_response, http_status_code)
def parameters(cls): parameters = [ParameterFactory.file("Targets FASTA file.")] return parameters