@click.command('<STR_LIT>', short_help='<STR_LIT>')<EOL>@click.argument('<STR_LIT>', required=False)<EOL>@click.option('<STR_LIT>', '<STR_LIT>',<EOL>help="<STR_LIT>",<EOL>)<EOL>@click.option('<STR_LIT>', '<STR_LIT>',<EOL>help="<STR_LIT>",<EOL>)<EOL>@click.option('<STR_LIT>', '<STR_LIT:-c>',<EOL>help="<STR_LIT>",<EOL>)<EOL>@click.option('<STR_LIT>', type=click.Path(exists=True),<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', type=click.Path(exists=True),<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', type=click.Path(exists=True),<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', type=click.Path(exists=True),<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', type=click.Path(exists=True),<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', type=click.Path(exists=True),<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', type=click.Path(exists=True),<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', is_flag=True,<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>@click.option('<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>@click.pass_context<EOL>def case(context, case_id, case_name, institute, collaborator, vcf, vcf_sv,<EOL>vcf_cancer, vcf_research, vcf_sv_research, vcf_cancer_research, peddy_ped,<EOL>reupload_sv, rankscore_treshold, rankmodel_version):
adapter = context.obj['<STR_LIT>']<EOL>if not case_id:<EOL><INDENT>if not (case_name and institute):<EOL><INDENT>LOG.info("<STR_LIT>")<EOL>context.abort<EOL><DEDENT>case_id = "<STR_LIT>".format(institute, case_name)<EOL><DEDENT>case_obj = adapter.case(case_id)<EOL>if not case_obj:<EOL><INDENT>LOG.warning("<STR_LIT>", case_id)<EOL>context.abort()<EOL><DEDENT>case_changed = False<EOL>if collaborator:<EOL><INDENT>if not adapter.institute(collaborator):<EOL><INDENT>LOG.warning("<STR_LIT>", collaborator)<EOL>context.abort()<EOL><DEDENT>if not collaborator in case_obj['<STR_LIT>']:<EOL><INDENT>case_changed = True<EOL>case_obj['<STR_LIT>'].append(collaborator)<EOL>LOG.info("<STR_LIT>", collaborator)<EOL><DEDENT><DEDENT>if vcf:<EOL><INDENT>LOG.info("<STR_LIT>", vcf)<EOL>case_obj['<STR_LIT>']['<STR_LIT>'] = vcf<EOL>case_changed = True<EOL><DEDENT>if vcf_sv:<EOL><INDENT>LOG.info("<STR_LIT>", vcf_sv)<EOL>case_obj['<STR_LIT>']['<STR_LIT>'] = vcf_sv<EOL>case_changed = True<EOL><DEDENT>if vcf_cancer:<EOL><INDENT>LOG.info("<STR_LIT>", vcf_cancer)<EOL>case_obj['<STR_LIT>']['<STR_LIT>'] = vcf_cancer<EOL>case_changed = True<EOL><DEDENT>if vcf_research:<EOL><INDENT>LOG.info("<STR_LIT>", vcf_research)<EOL>case_obj['<STR_LIT>']['<STR_LIT>'] = vcf_research<EOL>case_changed = True<EOL><DEDENT>if vcf_sv_research:<EOL><INDENT>LOG.info("<STR_LIT>", vcf_sv_research)<EOL>case_obj['<STR_LIT>']['<STR_LIT>'] = vcf_sv_research<EOL>case_changed = True<EOL><DEDENT>if vcf_cancer_research:<EOL><INDENT>LOG.info("<STR_LIT>", vcf_cancer_research)<EOL>case_obj['<STR_LIT>']['<STR_LIT>'] = vcf_cancer_research<EOL>case_changed = True<EOL><DEDENT>if case_changed:<EOL><INDENT>adapter.update_case(case_obj)<EOL><DEDENT>if reupload_sv:<EOL><INDENT>LOG.info("<STR_LIT>", case_id)<EOL>updates = {'<STR_LIT>': True}<EOL>if rankscore_treshold:<EOL><INDENT>updates['<STR_LIT>'] = rankmodel_version<EOL><DEDENT>if vcf_sv:<EOL><INDENT>updates['<STR_LIT>'] = vcf_sv<EOL><DEDENT>if vcf_sv:<EOL><INDENT>updates['<STR_LIT>'] = vcf_sv_research<EOL><DEDENT>updated_case = adapter.case_collection.find_one_and_update(<EOL>{'<STR_LIT>':case_id}, <EOL>{'<STR_LIT>': updates<EOL>},<EOL>return_document=pymongo.ReturnDocument.AFTER<EOL>)<EOL>rankscore_treshold = rankscore_treshold or updated_case.get("<STR_LIT>", <NUM_LIT:5>)<EOL>if updated_case['<STR_LIT>'].get('<STR_LIT>'):<EOL><INDENT>adapter.delete_variants(case_id, variant_type='<STR_LIT>', category='<STR_LIT>')<EOL>adapter.load_variants(updated_case, variant_type='<STR_LIT>', <EOL>category='<STR_LIT>', rank_threshold=rankscore_treshold)<EOL><DEDENT>if updated_case['<STR_LIT>'].get('<STR_LIT>'):<EOL><INDENT>adapter.delete_variants(case_id, variant_type='<STR_LIT>', category='<STR_LIT>')<EOL>if updated_case.get('<STR_LIT>'):<EOL><INDENT>adapter.load_variants(updated_case, variant_type='<STR_LIT>', <EOL>category='<STR_LIT>', rank_threshold=rankscore_treshold)<EOL><DEDENT><DEDENT><DEDENT>
Update a case in the database