def update_sample(self, lims_id: str, sex=None, target_reads: int = None, name: str = None, **kwargs): """Update information about a sample.""" lims_sample = Sample(self, id=lims_id) if sex: lims_gender = REV_SEX_MAP.get(sex) if lims_gender: lims_sample.udf[PROP2UDF["sex"]] = lims_gender if name: lims_sample.name = name if isinstance(target_reads, int): lims_sample.udf[PROP2UDF["target_reads"]] = target_reads for key, value in kwargs.items(): if not PROP2UDF.get(key): raise LimsDataError( f"Unknown how to set {key} in LIMS since it is not defined in {PROP2UDF}" ) lims_sample.udf[PROP2UDF[key]] = value lims_sample.put()
def update_sample(self, lims_id: str, sex=None, application: str = None, target_reads: int = None): """Update information about a sample.""" lims_sample = Sample(self, id=lims_id) if sex: lims_gender = REV_SEX_MAP.get(sex) if lims_gender: lims_sample.udf[PROP2UDF['sex']] = lims_gender if application: lims_sample.udf[PROP2UDF['application']] = application if isinstance(target_reads, int): lims_sample.udf[PROP2UDF['target_reads']] = target_reads lims_sample.put()