def create(cls, experiment, sample, file, analysisId=None, study=None, analysisState="UNPUBLISHED", info=None): check_type(experiment, VariantCall) check_state( sample is not None and isinstance(sample, list) and len(sample) > 0, "Atleast one sample must be defined") check_state( file is not None and isinstance(file, list) and len(file) > 0, "Atleast one file must be defined") for s in sample: check_type(s, CompositeEntity) for f in file: check_type(f, File) s = VariantCallAnalysis() s.experiment = experiment s.analysisId = analysisId s.study = study s.analysisState = analysisState s.sample = sample s.file = file s.info = default_value(info, {}) return s
def create(cls, donorSubmitterId, studyId, donorGender, donorId=None, info=None): d = Donor() d.donorId = donorId d.info = default_value(info, {}) d.studyId = studyId d.donorSubmitterId = donorSubmitterId d.donorGender = donorGender return d
def create(cls, specimenId, sampleSubmitterId, sampleType, sampleId=None, info=None): s = Sample() s.info = default_value(info, {}) s.specimenId = specimenId s.sampleType = sampleType s.sampleSubmitterId = sampleSubmitterId s.sampleId = sampleId return s
def create(cls, donorId, specimenSubmitterId, specimenClass, specimenType, specimenId=None, info=None): s = Specimen() s.info = default_value(info, {}) s.specimenId = specimenId s.donorId = donorId s.specimenType = specimenType s.specimenClass = specimenClass s.specimenSubmitterId = specimenSubmitterId return s
def create(cls, fileName, fileSize, fileType, fileMd5sum, fileAccess, studyId=None, analysisId=None, objectId=None, info=None): f = File() f.objectId = objectId f.analysisId = analysisId f.studyId = studyId f.fileType = fileType f.fileSize = fileSize f.info = default_value(info, {}) f.fileMd5sum = fileMd5sum f.fileAccess = fileAccess f.fileName = fileName return f
def non_null(exclude=None): exclude = default_value(exclude, []) def wrap(func): inspected_args = OrderedDict.fromkeys( inspect.signature(func).parameters.keys(), True) is_self = False if "self" in inspected_args.keys(): is_self = True inspected_args.pop("self") def new_func(*args, **kwargs): count = 1 if is_self else 0 for a in inspected_args.keys(): if a not in exclude: check_state(args[count] is not None, "The argument '{}' must be non-null", a) count += 1 return func(*args, **kwargs) return new_func return wrap
def __init__(self, analysis_id, manifest_entries=None): self.analysis_id = analysis_id self.entries = default_value(manifest_entries, [])