_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
75
19.8k
language
stringclasses
1 value
meta_information
dict
q273400
build_clnsig
test
def build_clnsig(clnsig_info): """docstring for build_clnsig""" clnsig_obj = dict( value = clnsig_info['value'], accession = clnsig_info.get('accession'), revstat = clnsig_info.get('revstat') ) return clnsig_obj
python
{ "resource": "" }
q273401
GeneHandler.load_hgnc_bulk
test
def load_hgnc_bulk(self, gene_objs): """Load a bulk of hgnc gene objects Raises IntegrityError if there are any write concerns Args: gene_objs(iterable(scout.models.hgnc_gene)) Returns: result (pymongo.results.InsertManyResult) """ LOG....
python
{ "resource": "" }
q273402
GeneHandler.load_transcript_bulk
test
def load_transcript_bulk(self, transcript_objs): """Load a bulk of transcript objects to the database Arguments: transcript_objs(iterable(scout.models.hgnc_transcript)) """ LOG.info("Loading transcript bulk") try: result = self.transcript_collection.inse...
python
{ "resource": "" }
q273403
GeneHandler.load_exon_bulk
test
def load_exon_bulk(self, exon_objs): """Load a bulk of exon objects to the database Arguments: exon_objs(iterable(scout.models.hgnc_exon)) """ try: result = self.exon_collection.insert_many(transcript_objs) except (DuplicateKeyError, BulkWriteError) as e...
python
{ "resource": "" }
q273404
GeneHandler.hgnc_gene
test
def hgnc_gene(self, hgnc_identifier, build='37'): """Fetch a hgnc gene Args: hgnc_identifier(int) Returns: gene_obj(HgncGene) """ if not build in ['37', '38']: build = '37' query = {} try: # If the ...
python
{ "resource": "" }
q273405
GeneHandler.hgnc_id
test
def hgnc_id(self, hgnc_symbol, build='37'): """Query the genes with a hgnc symbol and return the hgnc id Args: hgnc_symbol(str) build(str) Returns: hgnc_id(int) """ #LOG.debug("Fetching gene %s", hgnc_symbol) query = {'hgnc_symbol':hg...
python
{ "resource": "" }
q273406
GeneHandler.hgnc_genes
test
def hgnc_genes(self, hgnc_symbol, build='37', search=False): """Fetch all hgnc genes that match a hgnc symbol Check both hgnc_symbol and aliases Args: hgnc_symbol(str) build(str): The build in which to search search(bool): if partial sear...
python
{ "resource": "" }
q273407
GeneHandler.all_genes
test
def all_genes(self, build='37'): """Fetch all hgnc genes Returns: result() """ LOG.info("Fetching all genes") return self.hgnc_collection.find({'build': build}).sort('chromosome', 1)
python
{ "resource": "" }
q273408
GeneHandler.nr_genes
test
def nr_genes(self, build=None): """Return the number of hgnc genes in collection If build is used, return the number of genes of a certain build Returns: result() """ if build: LOG.info("Fetching all genes from build %s", build) else: ...
python
{ "resource": "" }
q273409
GeneHandler.drop_genes
test
def drop_genes(self, build=None): """Delete the genes collection""" if build: LOG.info("Dropping the hgnc_gene collection, build %s", build) self.hgnc_collection.delete_many({'build': build}) else: LOG.info("Dropping the hgnc_gene collection") self...
python
{ "resource": "" }
q273410
GeneHandler.drop_transcripts
test
def drop_transcripts(self, build=None): """Delete the transcripts collection""" if build: LOG.info("Dropping the transcripts collection, build %s", build) self.transcript_collection.delete_many({'build': build}) else: LOG.info("Dropping the transcripts collect...
python
{ "resource": "" }
q273411
GeneHandler.drop_exons
test
def drop_exons(self, build=None): """Delete the exons collection""" if build: LOG.info("Dropping the exons collection, build %s", build) self.exon_collection.delete_many({'build': build}) else: LOG.info("Dropping the exons collection") self.exon_co...
python
{ "resource": "" }
q273412
GeneHandler.ensembl_transcripts
test
def ensembl_transcripts(self, build='37'): """Return a dictionary with ensembl ids as keys and transcripts as value. Args: build(str) Returns: ensembl_transcripts(dict): {<enst_id>: transcripts_obj, ...} """ ensembl_transcripts = {} LOG.i...
python
{ "resource": "" }
q273413
GeneHandler.hgncsymbol_to_gene
test
def hgncsymbol_to_gene(self, build='37', genes=None): """Return a dictionary with hgnc_symbol as key and gene_obj as value The result will have ONE entry for each gene in the database. (For a specific build) Args: build(str) genes(iterable(scout.models.HgncGene)...
python
{ "resource": "" }
q273414
GeneHandler.gene_by_alias
test
def gene_by_alias(self, symbol, build='37'): """Return a iterable with hgnc_genes. If the gene symbol is listed as primary the iterable will only have one result. If not the iterable will include all hgnc genes that have the symbol as an alias. Args: symbol(str) ...
python
{ "resource": "" }
q273415
GeneHandler.genes_by_alias
test
def genes_by_alias(self, build='37', genes=None): """Return a dictionary with hgnc symbols as keys and a list of hgnc ids as value. If a gene symbol is listed as primary the list of ids will only consist of that entry if not the gene can not be determined so the result is a list ...
python
{ "resource": "" }
q273416
GeneHandler.ensembl_genes
test
def ensembl_genes(self, build='37'): """Return a dictionary with ensembl ids as keys and gene objects as value. Args: build(str) Returns: genes(dict): {<ensg_id>: gene_obj, ...} """ genes = {} LOG.info("Fetching all genes") ...
python
{ "resource": "" }
q273417
GeneHandler.to_hgnc
test
def to_hgnc(self, hgnc_alias, build='37'): """Check if a hgnc symbol is an alias Return the correct hgnc symbol, if not existing return None Args: hgnc_alias(str) Returns: hgnc_symbol(str) """ result = self.hgnc_genes(hgnc_sy...
python
{ "resource": "" }
q273418
GeneHandler.add_hgnc_id
test
def add_hgnc_id(self, genes): """Add the correct hgnc id to a set of genes with hgnc symbols Args: genes(list(dict)): A set of genes with hgnc symbols only """ genes_by_alias = self.genes_by_alias() for gene in genes: id_info = genes_by_alias.get(gene['...
python
{ "resource": "" }
q273419
GeneHandler.get_coding_intervals
test
def get_coding_intervals(self, build='37', genes=None): """Return a dictionary with chromosomes as keys and interval trees as values Each interval represents a coding region of overlapping genes. Args: build(str): The genome build genes(iterable(scout.models.HgncGene)):...
python
{ "resource": "" }
q273420
omim
test
def omim(context, api_key, institute): """ Update the automate generated omim gene panel in the database. """ LOG.info("Running scout update omim") adapter = context.obj['adapter'] api_key = api_key or context.obj.get('omim_api_key') if not api_key: LOG.warning("Please provide a...
python
{ "resource": "" }
q273421
cases
test
def cases(institute_id): """Display a list of cases for an institute.""" institute_obj = institute_and_case(store, institute_id) query = request.args.get('query') limit = 100 if request.args.get('limit'): limit = int(request.args.get('limit')) skip_assigned = request.args.get('skip_ass...
python
{ "resource": "" }
q273422
case
test
def case(institute_id, case_name): """Display one case.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) data = controllers.case(store, institute_obj, case_obj) return dict(institute=institute_obj, case=case_obj, **data)
python
{ "resource": "" }
q273423
matchmaker_matches
test
def matchmaker_matches(institute_id, case_name): """Show all MatchMaker matches for a given case""" # check that only authorized users can access MME patients matches user_obj = store.user(current_user.email) if 'mme_submitter' not in user_obj['roles']: flash('unauthorized request', 'warning') ...
python
{ "resource": "" }
q273424
matchmaker_match
test
def matchmaker_match(institute_id, case_name, target): """Starts an internal match or a match against one or all MME external nodes""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) # check that only authorized users can run matches user_obj = store.user(current_user.email...
python
{ "resource": "" }
q273425
matchmaker_delete
test
def matchmaker_delete(institute_id, case_name): """Remove a case from MatchMaker""" # check that only authorized users can delete patients from MME user_obj = store.user(current_user.email) if 'mme_submitter' not in user_obj['roles']: flash('unauthorized request', 'warning') return redi...
python
{ "resource": "" }
q273426
case_report
test
def case_report(institute_id, case_name): """Visualize case report""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) data = controllers.case_report_content(store, institute_obj, case_obj) return dict(institute=institute_obj, case=case_obj, format='html', **data)
python
{ "resource": "" }
q273427
pdf_case_report
test
def pdf_case_report(institute_id, case_name): """Download a pdf report for a case""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) data = controllers.case_report_content(store, institute_obj, case_obj) # add coverage report on the bottom of this report if current_app...
python
{ "resource": "" }
q273428
case_diagnosis
test
def case_diagnosis(institute_id, case_name): """Add or remove a diagnosis for a case.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) user_obj = store.user(current_user.email) link = url_for('.case', institute_id=institute_id, case_name=case_name) level = 'phenotype' ...
python
{ "resource": "" }
q273429
phenotypes
test
def phenotypes(institute_id, case_name, phenotype_id=None): """Handle phenotypes.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) case_url = url_for('.case', institute_id=institute_id, case_name=case_name) is_group = request.args.get('is_group') == 'yes' user_obj = st...
python
{ "resource": "" }
q273430
phenotypes_actions
test
def phenotypes_actions(institute_id, case_name): """Perform actions on multiple phenotypes.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) case_url = url_for('.case', institute_id=institute_id, case_name=case_name) action = request.form['action'] hpo_ids = request.fo...
python
{ "resource": "" }
q273431
events
test
def events(institute_id, case_name, event_id=None): """Handle events.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) link = request.form.get('link') content = request.form.get('content') variant_id = request.args.get('variant_id') user_obj = store.user(current_us...
python
{ "resource": "" }
q273432
status
test
def status(institute_id, case_name): """Update status of a specific case.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) user_obj = store.user(current_user.email) status = request.form.get('status', case_obj['status']) link = url_for('.case', institute_id=institute_...
python
{ "resource": "" }
q273433
assign
test
def assign(institute_id, case_name, user_id=None): """Assign and unassign a user from a case.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) link = url_for('.case', institute_id=institute_id, case_name=case_name) if user_id: user_obj = store.user(user_id) els...
python
{ "resource": "" }
q273434
hpoterms
test
def hpoterms(): """Search for HPO terms.""" query = request.args.get('query') if query is None: return abort(500) terms = sorted(store.hpo_terms(query=query), key=itemgetter('hpo_number')) json_terms = [ {'name': '{} | {}'.format(term['_id'], term['description']), 'id': term...
python
{ "resource": "" }
q273435
mark_validation
test
def mark_validation(institute_id, case_name, variant_id): """Mark a variant as sanger validated.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) variant_obj = store.variant(variant_id) user_obj = store.user(current_user.email) validate_type = request.form['type'] or N...
python
{ "resource": "" }
q273436
mark_causative
test
def mark_causative(institute_id, case_name, variant_id): """Mark a variant as confirmed causative.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) variant_obj = store.variant(variant_id) user_obj = store.user(current_user.email) link = url_for('variants.variant', inst...
python
{ "resource": "" }
q273437
delivery_report
test
def delivery_report(institute_id, case_name): """Display delivery report.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) if case_obj.get('delivery_report') is None: return abort(404) date_str = request.args.get('date') if date_str: delivery_report = ...
python
{ "resource": "" }
q273438
share
test
def share(institute_id, case_name): """Share a case with a different institute.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) user_obj = store.user(current_user.email) collaborator_id = request.form['collaborator'] revoke_access = 'revoke' in request.form link =...
python
{ "resource": "" }
q273439
rerun
test
def rerun(institute_id, case_name): """Request a case to be rerun.""" sender = current_app.config['MAIL_USERNAME'] recipient = current_app.config['TICKET_SYSTEM_EMAIL'] controllers.rerun(store, mail, current_user, institute_id, case_name, sender, recipient) return redirect(requ...
python
{ "resource": "" }
q273440
research
test
def research(institute_id, case_name): """Open the research list for a case.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) user_obj = store.user(current_user.email) link = url_for('.case', institute_id=institute_id, case_name=case_name) store.open_research(institute...
python
{ "resource": "" }
q273441
vcf2cytosure
test
def vcf2cytosure(institute_id, case_name, individual_id): """Download vcf2cytosure file for individual.""" (display_name, vcf2cytosure) = controllers.vcf2cytosure(store, institute_id, case_name, individual_id) outdir = os.path.abspath(os.path.dirname(vcf2cytosure)) filename = os.path.basename(...
python
{ "resource": "" }
q273442
multiqc
test
def multiqc(institute_id, case_name): """Load multiqc report for the case.""" data = controllers.multiqc(store, institute_id, case_name) if data['case'].get('multiqc') is None: return abort(404) out_dir = os.path.abspath(os.path.dirname(data['case']['multiqc'])) filename = os.path.basename(d...
python
{ "resource": "" }
q273443
cases
test
def cases(store, case_query, limit=100): """Preprocess case objects. Add the necessary information to display the 'cases' view Args: store(adapter.MongoAdapter) case_query(pymongo.Cursor) limit(int): Maximum number of cases to display Returns: data(dict): includes the ...
python
{ "resource": "" }
q273444
case_report_content
test
def case_report_content(store, institute_obj, case_obj): """Gather contents to be visualized in a case report Args: store(adapter.MongoAdapter) institute_obj(models.Institute) case_obj(models.Case) Returns: data(dict) """ variant_types = { 'causatives_detai...
python
{ "resource": "" }
q273445
coverage_report_contents
test
def coverage_report_contents(store, institute_obj, case_obj, base_url): """Posts a request to chanjo-report and capture the body of the returned response to include it in case report Args: store(adapter.MongoAdapter) institute_obj(models.Institute) case_obj(models.Case) base_url...
python
{ "resource": "" }
q273446
clinvar_submissions
test
def clinvar_submissions(store, user_id, institute_id): """Get all Clinvar submissions for a user and an institute""" submissions = list(store.clinvar_submissions(user_id, institute_id)) return submissions
python
{ "resource": "" }
q273447
mt_excel_files
test
def mt_excel_files(store, case_obj, temp_excel_dir): """Collect MT variants and format line of a MT variant report to be exported in excel format Args: store(adapter.MongoAdapter) case_obj(models.Case) temp_excel_dir(os.Path): folder where the temp excel files are written to Re...
python
{ "resource": "" }
q273448
update_synopsis
test
def update_synopsis(store, institute_obj, case_obj, user_obj, new_synopsis): """Update synopsis.""" # create event only if synopsis was actually changed if case_obj['synopsis'] != new_synopsis: link = url_for('cases.case', institute_id=institute_obj['_id'], case_name=case_obj[...
python
{ "resource": "" }
q273449
hpo_diseases
test
def hpo_diseases(username, password, hpo_ids, p_value_treshold=1): """Return the list of HGNC symbols that match annotated HPO terms. Args: username (str): username to use for phenomizer connection password (str): password to use for phenomizer connection Returns: query_result: a g...
python
{ "resource": "" }
q273450
vcf2cytosure
test
def vcf2cytosure(store, institute_id, case_name, individual_id): """vcf2cytosure CGH file for inidividual.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) for individual in case_obj['individuals']: if individual['individual_id'] == individual_id: individu...
python
{ "resource": "" }
q273451
multiqc
test
def multiqc(store, institute_id, case_name): """Find MultiQC report for the case.""" institute_obj, case_obj = institute_and_case(store, institute_id, case_name) return dict( institute=institute_obj, case=case_obj, )
python
{ "resource": "" }
q273452
get_sanger_unevaluated
test
def get_sanger_unevaluated(store, institute_id, user_id): """Get all variants for an institute having Sanger validations ordered but still not evaluated Args: store(scout.adapter.MongoAdapter) institute_id(str) Returns: unevaluated: a list that looks like this: ...
python
{ "resource": "" }
q273453
mme_add
test
def mme_add(store, user_obj, case_obj, add_gender, add_features, add_disorders, genes_only, mme_base_url, mme_accepts, mme_token): """Add a patient to MatchMaker server Args: store(adapter.MongoAdapter) user_obj(dict) a scout user object (to be added as matchmaker contact) case_obj(...
python
{ "resource": "" }
q273454
mme_delete
test
def mme_delete(case_obj, mme_base_url, mme_token): """Delete all affected samples for a case from MatchMaker Args: case_obj(dict) a scout case object mme_base_url(str) base url of the MME server mme_token(str) auth token of the MME server Returns: server_responses(list): a...
python
{ "resource": "" }
q273455
mme_matches
test
def mme_matches(case_obj, institute_obj, mme_base_url, mme_token): """Show Matchmaker submission data for a sample and eventual matches. Args: case_obj(dict): a scout case object institute_obj(dict): an institute object mme_base_url(str) base url of the MME server mme_token(str)...
python
{ "resource": "" }
q273456
mme_match
test
def mme_match(case_obj, match_type, mme_base_url, mme_token, nodes=None, mme_accepts=None): """Initiate a MatchMaker match against either other Scout patients or external nodes Args: case_obj(dict): a scout case object already submitted to MME match_type(str): 'internal' or 'external' m...
python
{ "resource": "" }
q273457
genes
test
def genes(context, build, api_key): """ Load the hgnc aliases to the mongo database. """ LOG.info("Running scout update genes") adapter = context.obj['adapter'] # Fetch the omim information api_key = api_key or context.obj.get('omim_api_key') if not api_key: LOG.warning("Please ...
python
{ "resource": "" }
q273458
parse_callers
test
def parse_callers(variant, category='snv'): """Parse how the different variant callers have performed Args: variant (cyvcf2.Variant): A variant object Returns: callers (dict): A dictionary on the format {'gatk': <filter>,'freebayes': <filter>,'samtools': <filter...
python
{ "resource": "" }
q273459
build_transcript
test
def build_transcript(transcript_info, build='37'): """Build a hgnc_transcript object Args: transcript_info(dict): Transcript information Returns: transcript_obj(HgncTranscript) { transcript_id: str, required hgnc_id: int, required...
python
{ "resource": "" }
q273460
load_institute
test
def load_institute(adapter, internal_id, display_name, sanger_recipients=None): """Load a institute into the database Args: adapter(MongoAdapter) internal_id(str) display_name(str) sanger_recipients(list(email)) """ institute_obj = build_institute( ...
python
{ "resource": "" }
q273461
parse_cadd
test
def parse_cadd(variant, transcripts): """Check if the cadd phred score is annotated""" cadd = 0 cadd_keys = ['CADD', 'CADD_PHRED'] for key in cadd_keys: cadd = variant.INFO.get(key, 0) if cadd: return float(cadd) for transcript in transcripts: cadd_entry = tr...
python
{ "resource": "" }
q273462
case
test
def case(context, vcf, vcf_sv, vcf_cancer, vcf_str, owner, ped, update, config, no_variants, peddy_ped, peddy_sex, peddy_check): """Load a case into the database. A case can be loaded without specifying vcf files and/or bam files """ adapter = context.obj['adapter'] if config is None and ...
python
{ "resource": "" }
q273463
VariantLoader.update_variant
test
def update_variant(self, variant_obj): """Update one variant document in the database. This means that the variant in the database will be replaced by variant_obj. Args: variant_obj(dict) Returns: new_variant(dict) """ LOG.debug('Updating varian...
python
{ "resource": "" }
q273464
VariantLoader.update_variant_rank
test
def update_variant_rank(self, case_obj, variant_type='clinical', category='snv'): """Updates the manual rank for all variants in a case Add a variant rank based on the rank score Whenever variants are added or removed from a case we need to update the variant rank Args: cas...
python
{ "resource": "" }
q273465
VariantLoader.update_variant_compounds
test
def update_variant_compounds(self, variant, variant_objs = None): """Update compounds for a variant. This will add all the necessary information of a variant on a compound object. Args: variant(scout.models.Variant) variant_objs(dict): A dictionary with _ids as keys and...
python
{ "resource": "" }
q273466
VariantLoader.update_compounds
test
def update_compounds(self, variants): """Update the compounds for a set of variants. Args: variants(dict): A dictionary with _ids as keys and variant objs as values """ LOG.debug("Updating compound objects") for var_id in variants: variant_obj = variant...
python
{ "resource": "" }
q273467
VariantLoader.update_mongo_compound_variants
test
def update_mongo_compound_variants(self, bulk): """Update the compound information for a bulk of variants in the database Args: bulk(dict): {'_id': scout.models.Variant} """ requests = [] for var_id in bulk: var_obj = bulk[var_id] if ...
python
{ "resource": "" }
q273468
VariantLoader.update_case_compounds
test
def update_case_compounds(self, case_obj, build='37'): """Update the compounds for a case Loop over all coding intervals to get coordinates for all potential compound positions. Update all variants within a gene with a bulk operation. """ case_id = case_obj['_id'] # Pos...
python
{ "resource": "" }
q273469
VariantLoader.load_variant
test
def load_variant(self, variant_obj): """Load a variant object Args: variant_obj(dict) Returns: inserted_id """ # LOG.debug("Loading variant %s", variant_obj['_id']) try: result = self.variant_collection.insert_one(variant_obj) ...
python
{ "resource": "" }
q273470
VariantLoader.upsert_variant
test
def upsert_variant(self, variant_obj): """Load a variant object, if the object already exists update compounds. Args: variant_obj(dict) Returns: result """ LOG.debug("Upserting variant %s", variant_obj['_id']) try: result = self.varia...
python
{ "resource": "" }
q273471
VariantLoader.load_variant_bulk
test
def load_variant_bulk(self, variants): """Load a bulk of variants Args: variants(iterable(scout.models.Variant)) Returns: object_ids """ if not len(variants) > 0: return LOG.debug("Loading variant bulk") try: resu...
python
{ "resource": "" }
q273472
CaseEventHandler.assign
test
def assign(self, institute, case, user, link): """Assign a user to a case. This function will create an Event to log that a person has been assigned to a case. Also the user will be added to case "assignees". Arguments: institute (dict): A institute case (dict):...
python
{ "resource": "" }
q273473
CaseEventHandler.share
test
def share(self, institute, case, collaborator_id, user, link): """Share a case with a new institute. Arguments: institute (dict): A Institute object case (dict): Case object collaborator_id (str): A instute id user (dict): A User object link (...
python
{ "resource": "" }
q273474
CaseEventHandler.diagnose
test
def diagnose(self, institute, case, user, link, level, omim_id, remove=False): """Diagnose a case using OMIM ids. Arguments: institute (dict): A Institute object case (dict): Case object user (dict): A User object link (str): The url to be used in the eve...
python
{ "resource": "" }
q273475
CaseEventHandler.mark_checked
test
def mark_checked(self, institute, case, user, link, unmark=False): """Mark a case as checked from an analysis point of view. Arguments: institute (dict): A Institute object case (dict): Case object user (dict): A User object link (str...
python
{ "resource": "" }
q273476
VariantEventHandler.order_verification
test
def order_verification(self, institute, case, user, link, variant): """Create an event for a variant verification for a variant and an event for a variant verification for a case Arguments: institute (dict): A Institute object case (dict): Case object user (d...
python
{ "resource": "" }
q273477
VariantEventHandler.sanger_ordered
test
def sanger_ordered(self, institute_id=None, user_id=None): """Get all variants with validations ever ordered. Args: institute_id(str) : The id of an institute user_id(str) : The id of an user Returns: sanger_ordered(list) : a list of dictionaries, each with ...
python
{ "resource": "" }
q273478
VariantEventHandler.validate
test
def validate(self, institute, case, user, link, variant, validate_type): """Mark validation status for a variant. Arguments: institute (dict): A Institute object case (dict): Case object user (dict): A User object link (str): The url to be used in the eve...
python
{ "resource": "" }
q273479
VariantEventHandler.mark_causative
test
def mark_causative(self, institute, case, user, link, variant): """Create an event for marking a variant causative. Arguments: institute (dict): A Institute object case (dict): Case object user (dict): A User object link (str): The url to be used in the event ...
python
{ "resource": "" }
q273480
VariantEventHandler.update_dismiss_variant
test
def update_dismiss_variant(self, institute, case, user, link, variant, dismiss_variant): """Create an event for updating the manual dismiss variant entry This function will create a event and update the dismiss variant field of the variant. Arguments:...
python
{ "resource": "" }
q273481
VariantEventHandler.update_acmg
test
def update_acmg(self, institute_obj, case_obj, user_obj, link, variant_obj, acmg_str): """Create an event for updating the ACMG classification of a variant. Arguments: institute_obj (dict): A Institute object case_obj (dict): Case object user_obj (dict): A User objec...
python
{ "resource": "" }
q273482
parse_ids
test
def parse_ids(chrom, pos, ref, alt, case_id, variant_type): """Construct the necessary ids for a variant Args: chrom(str): Variant chromosome pos(int): Variant position ref(str): Variant reference alt(str): Variant alternative case_id(str): Unique case id variant...
python
{ "resource": "" }
q273483
parse_simple_id
test
def parse_simple_id(chrom, pos, ref, alt): """Parse the simple id for a variant Simple id is used as a human readable reference for a position, it is in no way unique. Args: chrom(str) pos(str) ref(str) alt(str) Returns: simple_id(str): The simple human rea...
python
{ "resource": "" }
q273484
parse_document_id
test
def parse_document_id(chrom, pos, ref, alt, variant_type, case_id): """Parse the unique document id for a variant. This will always be unique in the database. Args: chrom(str) pos(str) ref(str) alt(str) variant_type(str): 'clinical' or 'research' case_id(str...
python
{ "resource": "" }
q273485
convert
test
def convert(context, panel): """Convert a gene panel with hgnc symbols to a new one with hgnc ids.""" adapter = context.obj['adapter'] new_header = ["hgnc_id","hgnc_symbol","disease_associated_transcripts", "reduced_penetrance", "genetic_disease_models", "mosaicism", "datab...
python
{ "resource": "" }
q273486
get_variantid
test
def get_variantid(variant_obj, family_id): """Create a new variant id. Args: variant_obj(dict) family_id(str) Returns: new_id(str): The new variant id """ new_id = parse_document_id( chrom=variant_obj['chromosome'], pos=str(variant_obj['position']), ...
python
{ "resource": "" }
q273487
CaseHandler.nr_cases
test
def nr_cases(self, institute_id=None): """Return the number of cases This function will change when we migrate to 3.7.1 Args: collaborator(str): Institute id Returns: nr_cases(int) """ query = {} if institute_id: query['coll...
python
{ "resource": "" }
q273488
CaseHandler.update_dynamic_gene_list
test
def update_dynamic_gene_list(self, case, hgnc_symbols=None, hgnc_ids=None, phenotype_ids=None, build='37'): """Update the dynamic gene list for a case Adds a list of dictionaries to case['dynamic_gene_list'] that looks like { hgnc_symbol: str, ...
python
{ "resource": "" }
q273489
CaseHandler.case
test
def case(self, case_id=None, institute_id=None, display_name=None): """Fetches a single case from database Use either the _id or combination of institute_id and display_name Args: case_id(str): _id for a caes institute_id(str): display_name(str) Yie...
python
{ "resource": "" }
q273490
CaseHandler.delete_case
test
def delete_case(self, case_id=None, institute_id=None, display_name=None): """Delete a single case from database Args: institute_id(str) case_id(str) Returns: case_obj(dict): The case that was deleted """ query = {} if case_id: ...
python
{ "resource": "" }
q273491
CaseHandler._add_case
test
def _add_case(self, case_obj): """Add a case to the database If the case already exists exception is raised Args: case_obj(Case) """ if self.case(case_obj['_id']): raise IntegrityError("Case %s already exists in database" % case_obj['_id']) ...
python
{ "resource": "" }
q273492
CaseHandler.replace_case
test
def replace_case(self, case_obj): """Replace a existing case with a new one Keeps the object id Args: case_obj(dict) Returns: updated_case(dict) """ # Todo: Figure out and describe when this method destroys a case if invoked instead of #...
python
{ "resource": "" }
q273493
CaseHandler.update_caseid
test
def update_caseid(self, case_obj, family_id): """Update case id for a case across the database. This function is used when a case is a rerun or updated for another reason. Args: case_obj(dict) family_id(str): The new family id Returns: new_case(dict...
python
{ "resource": "" }
q273494
ACMGHandler.submit_evaluation
test
def submit_evaluation(self, variant_obj, user_obj, institute_obj, case_obj, link, criteria): """Submit an evaluation to the database Get all the relevant information, build a evaluation_obj Args: variant_obj(dict) user_obj(dict) institute_obj(dict) ...
python
{ "resource": "" }
q273495
ACMGHandler.get_evaluations
test
def get_evaluations(self, variant_obj): """Return all evaluations for a certain variant. Args: variant_obj (dict): variant dict from the database Returns: pymongo.cursor: database cursor """ query = dict(variant_id=variant_obj['variant_id']) res ...
python
{ "resource": "" }
q273496
parse_transcripts
test
def parse_transcripts(transcript_lines): """Parse and massage the transcript information There could be multiple lines with information about the same transcript. This is why it is necessary to parse the transcripts first and then return a dictionary where all information has been merged. Args: ...
python
{ "resource": "" }
q273497
parse_ensembl_gene_request
test
def parse_ensembl_gene_request(result): """Parse a dataframe with ensembl gene information Args: res(pandas.DataFrame) Yields: gene_info(dict) """ LOG.info("Parsing genes from request") for index, row in result.iterrows(): # print(index, row) ensembl_info = {} ...
python
{ "resource": "" }
q273498
parse_ensembl_transcript_request
test
def parse_ensembl_transcript_request(result): """Parse a dataframe with ensembl transcript information Args: res(pandas.DataFrame) Yields: transcript_info(dict) """ LOG.info("Parsing transcripts from request") keys = [ 'chrom', 'ensembl_gene_id', 'ensem...
python
{ "resource": "" }
q273499
parse_ensembl_line
test
def parse_ensembl_line(line, header): """Parse an ensembl formated line Args: line(list): A list with ensembl gene info header(list): A list with the header info Returns: ensembl_info(dict): A dictionary with the relevant info """ line = line.rstrip().sp...
python
{ "resource": "" }