partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
test | parse_sv_frequencies | Parsing of some custom sv frequencies
These are very specific at the moment, this will hopefully get better over time when the
field of structural variants is more developed.
Args:
variant(cyvcf2.Variant)
Returns:
sv_frequencies(dict) | scout/parse/variant/frequency.py | def parse_sv_frequencies(variant):
"""Parsing of some custom sv frequencies
These are very specific at the moment, this will hopefully get better over time when the
field of structural variants is more developed.
Args:
variant(cyvcf2.Variant)
Returns:
sv_frequencies(dict)
... | def parse_sv_frequencies(variant):
"""Parsing of some custom sv frequencies
These are very specific at the moment, this will hopefully get better over time when the
field of structural variants is more developed.
Args:
variant(cyvcf2.Variant)
Returns:
sv_frequencies(dict)
... | [
"Parsing",
"of",
"some",
"custom",
"sv",
"frequencies",
"These",
"are",
"very",
"specific",
"at",
"the",
"moment",
"this",
"will",
"hopefully",
"get",
"better",
"over",
"time",
"when",
"the",
"field",
"of",
"structural",
"variants",
"is",
"more",
"developed",
... | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/frequency.py#L113-L147 | [
"def",
"parse_sv_frequencies",
"(",
"variant",
")",
":",
"frequency_keys",
"=",
"[",
"'clingen_cgh_benignAF'",
",",
"'clingen_cgh_benign'",
",",
"'clingen_cgh_pathogenicAF'",
",",
"'clingen_cgh_pathogenic'",
",",
"'clingen_ngi'",
",",
"'clingen_ngiAF'",
",",
"'swegen'",
"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | users | Show all users in the database | scout/commands/view/users.py | def users(context):
"""Show all users in the database"""
LOG.info("Running scout view users")
adapter = context.obj['adapter']
user_objs = adapter.users()
if user_objs.count() == 0:
LOG.info("No users found")
context.abort()
click.echo("#name\temail\troles\tinstitutes")
for... | def users(context):
"""Show all users in the database"""
LOG.info("Running scout view users")
adapter = context.obj['adapter']
user_objs = adapter.users()
if user_objs.count() == 0:
LOG.info("No users found")
context.abort()
click.echo("#name\temail\troles\tinstitutes")
for... | [
"Show",
"all",
"users",
"in",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/commands/view/users.py#L9-L27 | [
"def",
"users",
"(",
"context",
")",
":",
"LOG",
".",
"info",
"(",
"\"Running scout view users\"",
")",
"adapter",
"=",
"context",
".",
"obj",
"[",
"'adapter'",
"]",
"user_objs",
"=",
"adapter",
".",
"users",
"(",
")",
"if",
"user_objs",
".",
"count",
"(... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | load_case | Load a case into the database
If the case already exists the function will exit.
If the user want to load a case that is already in the database
'update' has to be 'True'
Args:
adapter (MongoAdapter): connection to the database
case_obj (dict): case object to persist to the database
... | scout/load/case.py | def load_case(adapter, case_obj, update=False):
"""Load a case into the database
If the case already exists the function will exit.
If the user want to load a case that is already in the database
'update' has to be 'True'
Args:
adapter (MongoAdapter): connection to the database
cas... | def load_case(adapter, case_obj, update=False):
"""Load a case into the database
If the case already exists the function will exit.
If the user want to load a case that is already in the database
'update' has to be 'True'
Args:
adapter (MongoAdapter): connection to the database
cas... | [
"Load",
"a",
"case",
"into",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/load/case.py#L9-L36 | [
"def",
"load_case",
"(",
"adapter",
",",
"case_obj",
",",
"update",
"=",
"False",
")",
":",
"logger",
".",
"info",
"(",
"'Loading case {} into database'",
".",
"format",
"(",
"case_obj",
"[",
"'display_name'",
"]",
")",
")",
"# Check if case exists in database",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | build_hgnc_gene | Build a hgnc_gene object
Args:
gene_info(dict): Gene information
Returns:
gene_obj(dict)
{
'_id': ObjectId(),
# This is the hgnc id, required:
'hgnc_id': int,
# The primary symbol, required
... | scout/build/genes/hgnc_gene.py | def build_hgnc_gene(gene_info, build='37'):
"""Build a hgnc_gene object
Args:
gene_info(dict): Gene information
Returns:
gene_obj(dict)
{
'_id': ObjectId(),
# This is the hgnc id, required:
'hgnc_id': int,
... | def build_hgnc_gene(gene_info, build='37'):
"""Build a hgnc_gene object
Args:
gene_info(dict): Gene information
Returns:
gene_obj(dict)
{
'_id': ObjectId(),
# This is the hgnc id, required:
'hgnc_id': int,
... | [
"Build",
"a",
"hgnc_gene",
"object"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/build/genes/hgnc_gene.py#L16-L148 | [
"def",
"build_hgnc_gene",
"(",
"gene_info",
",",
"build",
"=",
"'37'",
")",
":",
"try",
":",
"hgnc_id",
"=",
"int",
"(",
"gene_info",
"[",
"'hgnc_id'",
"]",
")",
"except",
"KeyError",
"as",
"err",
":",
"raise",
"KeyError",
"(",
"\"Gene has to have a hgnc_id\... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.load_panel | Load a gene panel based on the info sent
A panel object is built and integrity checks are made.
The panel object is then loaded into the database.
Args:
path(str): Path to panel file
institute(str): Name of institute that owns the panel
panel_id(str): Panel i... | scout/adapter/mongo/panel.py | def load_panel(self, parsed_panel):
"""Load a gene panel based on the info sent
A panel object is built and integrity checks are made.
The panel object is then loaded into the database.
Args:
path(str): Path to panel file
institute(str): Name of institute that ow... | def load_panel(self, parsed_panel):
"""Load a gene panel based on the info sent
A panel object is built and integrity checks are made.
The panel object is then loaded into the database.
Args:
path(str): Path to panel file
institute(str): Name of institute that ow... | [
"Load",
"a",
"gene",
"panel",
"based",
"on",
"the",
"info",
"sent",
"A",
"panel",
"object",
"is",
"built",
"and",
"integrity",
"checks",
"are",
"made",
".",
"The",
"panel",
"object",
"is",
"then",
"loaded",
"into",
"the",
"database",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L25-L50 | [
"def",
"load_panel",
"(",
"self",
",",
"parsed_panel",
")",
":",
"panel_obj",
"=",
"build_panel",
"(",
"parsed_panel",
",",
"self",
")",
"self",
".",
"add_gene_panel",
"(",
"panel_obj",
")"
] | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.load_omim_panel | Create and load the OMIM-AUTO panel | scout/adapter/mongo/panel.py | def load_omim_panel(self, api_key, institute=None):
"""Create and load the OMIM-AUTO panel"""
existing_panel = self.gene_panel(panel_id='OMIM-AUTO')
if not existing_panel:
LOG.warning("OMIM-AUTO does not exists in database")
LOG.info('Creating a first version')
... | def load_omim_panel(self, api_key, institute=None):
"""Create and load the OMIM-AUTO panel"""
existing_panel = self.gene_panel(panel_id='OMIM-AUTO')
if not existing_panel:
LOG.warning("OMIM-AUTO does not exists in database")
LOG.info('Creating a first version')
... | [
"Create",
"and",
"load",
"the",
"OMIM",
"-",
"AUTO",
"panel"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L52-L115 | [
"def",
"load_omim_panel",
"(",
"self",
",",
"api_key",
",",
"institute",
"=",
"None",
")",
":",
"existing_panel",
"=",
"self",
".",
"gene_panel",
"(",
"panel_id",
"=",
"'OMIM-AUTO'",
")",
"if",
"not",
"existing_panel",
":",
"LOG",
".",
"warning",
"(",
"\"O... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.compare_mim_panels | Check if the latest version of OMIM differs from the most recent in database
Return all genes that where not in the previous version.
Args:
existing_panel(dict)
new_panel(dict)
Returns:
new_genes(set(str)) | scout/adapter/mongo/panel.py | def compare_mim_panels(self, existing_panel, new_panel):
"""Check if the latest version of OMIM differs from the most recent in database
Return all genes that where not in the previous version.
Args:
existing_panel(dict)
new_panel(dict)
Returns:
n... | def compare_mim_panels(self, existing_panel, new_panel):
"""Check if the latest version of OMIM differs from the most recent in database
Return all genes that where not in the previous version.
Args:
existing_panel(dict)
new_panel(dict)
Returns:
n... | [
"Check",
"if",
"the",
"latest",
"version",
"of",
"OMIM",
"differs",
"from",
"the",
"most",
"recent",
"in",
"database",
"Return",
"all",
"genes",
"that",
"where",
"not",
"in",
"the",
"previous",
"version",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L117-L131 | [
"def",
"compare_mim_panels",
"(",
"self",
",",
"existing_panel",
",",
"new_panel",
")",
":",
"existing_genes",
"=",
"set",
"(",
"[",
"gene",
"[",
"'hgnc_id'",
"]",
"for",
"gene",
"in",
"existing_panel",
"[",
"'genes'",
"]",
"]",
")",
"new_genes",
"=",
"set... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.update_mim_version | Set the correct version for each gene
Loop over the genes in the new panel
Args:
new_genes(set(str)): Set with the new gene symbols
new_panel(dict) | scout/adapter/mongo/panel.py | def update_mim_version(self, new_genes, new_panel, old_version):
"""Set the correct version for each gene
Loop over the genes in the new panel
Args:
new_genes(set(str)): Set with the new gene symbols
new_panel(dict)
"""
LOG.info('Updating versions for ne... | def update_mim_version(self, new_genes, new_panel, old_version):
"""Set the correct version for each gene
Loop over the genes in the new panel
Args:
new_genes(set(str)): Set with the new gene symbols
new_panel(dict)
"""
LOG.info('Updating versions for ne... | [
"Set",
"the",
"correct",
"version",
"for",
"each",
"gene",
"Loop",
"over",
"the",
"genes",
"in",
"the",
"new",
"panel"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L133-L153 | [
"def",
"update_mim_version",
"(",
"self",
",",
"new_genes",
",",
"new_panel",
",",
"old_version",
")",
":",
"LOG",
".",
"info",
"(",
"'Updating versions for new genes'",
")",
"version",
"=",
"new_panel",
"[",
"'version'",
"]",
"for",
"gene",
"in",
"new_panel",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.add_gene_panel | Add a gene panel to the database
Args:
panel_obj(dict) | scout/adapter/mongo/panel.py | def add_gene_panel(self, panel_obj):
"""Add a gene panel to the database
Args:
panel_obj(dict)
"""
panel_name = panel_obj['panel_name']
panel_version = panel_obj['version']
display_name = panel_obj.get('display_name', panel_name)
if self.gene... | def add_gene_panel(self, panel_obj):
"""Add a gene panel to the database
Args:
panel_obj(dict)
"""
panel_name = panel_obj['panel_name']
panel_version = panel_obj['version']
display_name = panel_obj.get('display_name', panel_name)
if self.gene... | [
"Add",
"a",
"gene",
"panel",
"to",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L155-L173 | [
"def",
"add_gene_panel",
"(",
"self",
",",
"panel_obj",
")",
":",
"panel_name",
"=",
"panel_obj",
"[",
"'panel_name'",
"]",
"panel_version",
"=",
"panel_obj",
"[",
"'version'",
"]",
"display_name",
"=",
"panel_obj",
".",
"get",
"(",
"'display_name'",
",",
"pan... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.panel | Fetch a gene panel by '_id'.
Args:
panel_id (str, ObjectId): str or ObjectId of document ObjectId
Returns:
dict: panel object or `None` if panel not found | scout/adapter/mongo/panel.py | def panel(self, panel_id):
"""Fetch a gene panel by '_id'.
Args:
panel_id (str, ObjectId): str or ObjectId of document ObjectId
Returns:
dict: panel object or `None` if panel not found
"""
if not isinstance(panel_id, ObjectId):
panel_id = Obj... | def panel(self, panel_id):
"""Fetch a gene panel by '_id'.
Args:
panel_id (str, ObjectId): str or ObjectId of document ObjectId
Returns:
dict: panel object or `None` if panel not found
"""
if not isinstance(panel_id, ObjectId):
panel_id = Obj... | [
"Fetch",
"a",
"gene",
"panel",
"by",
"_id",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L175-L187 | [
"def",
"panel",
"(",
"self",
",",
"panel_id",
")",
":",
"if",
"not",
"isinstance",
"(",
"panel_id",
",",
"ObjectId",
")",
":",
"panel_id",
"=",
"ObjectId",
"(",
"panel_id",
")",
"panel_obj",
"=",
"self",
".",
"panel_collection",
".",
"find_one",
"(",
"{"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.delete_panel | Delete a panel by '_id'.
Args:
panel_obj(dict)
Returns:
res(pymongo.DeleteResult) | scout/adapter/mongo/panel.py | def delete_panel(self, panel_obj):
"""Delete a panel by '_id'.
Args:
panel_obj(dict)
Returns:
res(pymongo.DeleteResult)
"""
res = self.panel_collection.delete_one({'_id': panel_obj['_id']})
LOG.warning("Deleting panel %s, version %s" % (panel_obj... | def delete_panel(self, panel_obj):
"""Delete a panel by '_id'.
Args:
panel_obj(dict)
Returns:
res(pymongo.DeleteResult)
"""
res = self.panel_collection.delete_one({'_id': panel_obj['_id']})
LOG.warning("Deleting panel %s, version %s" % (panel_obj... | [
"Delete",
"a",
"panel",
"by",
"_id",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L189-L200 | [
"def",
"delete_panel",
"(",
"self",
",",
"panel_obj",
")",
":",
"res",
"=",
"self",
".",
"panel_collection",
".",
"delete_one",
"(",
"{",
"'_id'",
":",
"panel_obj",
"[",
"'_id'",
"]",
"}",
")",
"LOG",
".",
"warning",
"(",
"\"Deleting panel %s, version %s\"",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.gene_panel | Fetch a gene panel.
If no panel is sent return all panels
Args:
panel_id (str): unique id for the panel
version (str): version of the panel. If 'None' latest version will be returned
Returns:
gene_panel: gene panel object | scout/adapter/mongo/panel.py | def gene_panel(self, panel_id, version=None):
"""Fetch a gene panel.
If no panel is sent return all panels
Args:
panel_id (str): unique id for the panel
version (str): version of the panel. If 'None' latest version will be returned
Returns:
gene_pan... | def gene_panel(self, panel_id, version=None):
"""Fetch a gene panel.
If no panel is sent return all panels
Args:
panel_id (str): unique id for the panel
version (str): version of the panel. If 'None' latest version will be returned
Returns:
gene_pan... | [
"Fetch",
"a",
"gene",
"panel",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L202-L228 | [
"def",
"gene_panel",
"(",
"self",
",",
"panel_id",
",",
"version",
"=",
"None",
")",
":",
"query",
"=",
"{",
"'panel_name'",
":",
"panel_id",
"}",
"if",
"version",
":",
"LOG",
".",
"info",
"(",
"\"Fetch gene panel {0}, version {1} from database\"",
".",
"forma... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.gene_panels | Return all gene panels
If panel_id return all versions of panels by that panel name
Args:
panel_id(str)
Returns:
cursor(pymongo.cursor) | scout/adapter/mongo/panel.py | def gene_panels(self, panel_id=None, institute_id=None, version=None):
"""Return all gene panels
If panel_id return all versions of panels by that panel name
Args:
panel_id(str)
Returns:
cursor(pymongo.cursor)
"""
query = {}
if panel_id:... | def gene_panels(self, panel_id=None, institute_id=None, version=None):
"""Return all gene panels
If panel_id return all versions of panels by that panel name
Args:
panel_id(str)
Returns:
cursor(pymongo.cursor)
"""
query = {}
if panel_id:... | [
"Return",
"all",
"gene",
"panels"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L230-L249 | [
"def",
"gene_panels",
"(",
"self",
",",
"panel_id",
"=",
"None",
",",
"institute_id",
"=",
"None",
",",
"version",
"=",
"None",
")",
":",
"query",
"=",
"{",
"}",
"if",
"panel_id",
":",
"query",
"[",
"'panel_name'",
"]",
"=",
"panel_id",
"if",
"version"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.gene_to_panels | Fetch all gene panels and group them by gene
Args:
case_obj(scout.models.Case)
Returns:
gene_dict(dict): A dictionary with gene as keys and a set of
panel names as value | scout/adapter/mongo/panel.py | def gene_to_panels(self, case_obj):
"""Fetch all gene panels and group them by gene
Args:
case_obj(scout.models.Case)
Returns:
gene_dict(dict): A dictionary with gene as keys and a set of
panel names as value
"""
... | def gene_to_panels(self, case_obj):
"""Fetch all gene panels and group them by gene
Args:
case_obj(scout.models.Case)
Returns:
gene_dict(dict): A dictionary with gene as keys and a set of
panel names as value
"""
... | [
"Fetch",
"all",
"gene",
"panels",
"and",
"group",
"them",
"by",
"gene"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L265-L296 | [
"def",
"gene_to_panels",
"(",
"self",
",",
"case_obj",
")",
":",
"LOG",
".",
"info",
"(",
"\"Building gene to panels\"",
")",
"gene_dict",
"=",
"{",
"}",
"for",
"panel_info",
"in",
"case_obj",
".",
"get",
"(",
"'panels'",
",",
"[",
"]",
")",
":",
"panel_... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.update_panel | Replace a existing gene panel with a new one
Keeps the object id
Args:
panel_obj(dict)
version(float)
date_obj(datetime.datetime)
Returns:
updated_panel(dict) | scout/adapter/mongo/panel.py | def update_panel(self, panel_obj, version=None, date_obj=None):
"""Replace a existing gene panel with a new one
Keeps the object id
Args:
panel_obj(dict)
version(float)
date_obj(datetime.datetime)
Returns:
updated_panel(dict)
"""... | def update_panel(self, panel_obj, version=None, date_obj=None):
"""Replace a existing gene panel with a new one
Keeps the object id
Args:
panel_obj(dict)
version(float)
date_obj(datetime.datetime)
Returns:
updated_panel(dict)
"""... | [
"Replace",
"a",
"existing",
"gene",
"panel",
"with",
"a",
"new",
"one"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L298-L331 | [
"def",
"update_panel",
"(",
"self",
",",
"panel_obj",
",",
"version",
"=",
"None",
",",
"date_obj",
"=",
"None",
")",
":",
"LOG",
".",
"info",
"(",
"\"Updating panel %s\"",
",",
"panel_obj",
"[",
"'panel_name'",
"]",
")",
"# update date of panel to \"today\"",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.add_pending | Add a pending action to a gene panel
Store the pending actions in panel.pending
Args:
panel_obj(dict): The panel that is about to be updated
hgnc_gene(dict)
action(str): choices=['add','delete','edit']
info(dict): additional gene info (disease_associated... | scout/adapter/mongo/panel.py | def add_pending(self, panel_obj, hgnc_gene, action, info=None):
"""Add a pending action to a gene panel
Store the pending actions in panel.pending
Args:
panel_obj(dict): The panel that is about to be updated
hgnc_gene(dict)
action(str): choices=['add','delet... | def add_pending(self, panel_obj, hgnc_gene, action, info=None):
"""Add a pending action to a gene panel
Store the pending actions in panel.pending
Args:
panel_obj(dict): The panel that is about to be updated
hgnc_gene(dict)
action(str): choices=['add','delet... | [
"Add",
"a",
"pending",
"action",
"to",
"a",
"gene",
"panel"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L333-L373 | [
"def",
"add_pending",
"(",
"self",
",",
"panel_obj",
",",
"hgnc_gene",
",",
"action",
",",
"info",
"=",
"None",
")",
":",
"valid_actions",
"=",
"[",
"'add'",
",",
"'delete'",
",",
"'edit'",
"]",
"if",
"action",
"not",
"in",
"valid_actions",
":",
"raise",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.apply_pending | Apply the pending changes to an existing gene panel or create a new version of the same panel.
Args:
panel_obj(dict): panel in database to update
version(double): panel version to update
Returns:
inserted_id(str): id of updated panel or the new one | scout/adapter/mongo/panel.py | def apply_pending(self, panel_obj, version):
"""Apply the pending changes to an existing gene panel or create a new version of the same panel.
Args:
panel_obj(dict): panel in database to update
version(double): panel version to update
Returns:
inserted_id(st... | def apply_pending(self, panel_obj, version):
"""Apply the pending changes to an existing gene panel or create a new version of the same panel.
Args:
panel_obj(dict): panel in database to update
version(double): panel version to update
Returns:
inserted_id(st... | [
"Apply",
"the",
"pending",
"changes",
"to",
"an",
"existing",
"gene",
"panel",
"or",
"create",
"a",
"new",
"version",
"of",
"the",
"same",
"panel",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L375-L456 | [
"def",
"apply_pending",
"(",
"self",
",",
"panel_obj",
",",
"version",
")",
":",
"updates",
"=",
"{",
"}",
"new_panel",
"=",
"deepcopy",
"(",
"panel_obj",
")",
"new_panel",
"[",
"'pending'",
"]",
"=",
"[",
"]",
"new_panel",
"[",
"'date'",
"]",
"=",
"dt... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | PanelHandler.clinical_symbols | Return all the clinical gene symbols for a case. | scout/adapter/mongo/panel.py | def clinical_symbols(self, case_obj):
"""Return all the clinical gene symbols for a case."""
panel_ids = [panel['panel_id'] for panel in case_obj['panels']]
query = self.panel_collection.aggregate([
{'$match': {'_id': {'$in': panel_ids}}},
{'$unwind': '$genes'},
... | def clinical_symbols(self, case_obj):
"""Return all the clinical gene symbols for a case."""
panel_ids = [panel['panel_id'] for panel in case_obj['panels']]
query = self.panel_collection.aggregate([
{'$match': {'_id': {'$in': panel_ids}}},
{'$unwind': '$genes'},
... | [
"Return",
"all",
"the",
"clinical",
"gene",
"symbols",
"for",
"a",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/panel.py#L466-L474 | [
"def",
"clinical_symbols",
"(",
"self",
",",
"case_obj",
")",
":",
"panel_ids",
"=",
"[",
"panel",
"[",
"'panel_id'",
"]",
"for",
"panel",
"in",
"case_obj",
"[",
"'panels'",
"]",
"]",
"query",
"=",
"self",
".",
"panel_collection",
".",
"aggregate",
"(",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | cases | Interact with cases existing in the database. | scout/commands/export/case.py | def cases(context, case_id, institute, reruns, finished, causatives, research_requested,
is_research, status, json):
"""Interact with cases existing in the database."""
adapter = context.obj['adapter']
models = []
if case_id:
case_obj = adapter.case(case_id=case_id)
if case_ob... | def cases(context, case_id, institute, reruns, finished, causatives, research_requested,
is_research, status, json):
"""Interact with cases existing in the database."""
adapter = context.obj['adapter']
models = []
if case_id:
case_obj = adapter.case(case_id=case_id)
if case_ob... | [
"Interact",
"with",
"cases",
"existing",
"in",
"the",
"database",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/commands/export/case.py#L49-L76 | [
"def",
"cases",
"(",
"context",
",",
"case_id",
",",
"institute",
",",
"reruns",
",",
"finished",
",",
"causatives",
",",
"research_requested",
",",
"is_research",
",",
"status",
",",
"json",
")",
":",
"adapter",
"=",
"context",
".",
"obj",
"[",
"'adapter'... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | TlsSMTPHandler.emit | Emit a record.
Format the record and send it to the specified addressees. | scout/log/handlers.py | def emit(self, record):
"""Emit a record.
Format the record and send it to the specified addressees.
"""
try:
import smtplib
try:
from email.utils import formatdate
except ImportError:
formatdate = self.date_time
... | def emit(self, record):
"""Emit a record.
Format the record and send it to the specified addressees.
"""
try:
import smtplib
try:
from email.utils import formatdate
except ImportError:
formatdate = self.date_time
... | [
"Emit",
"a",
"record",
".",
"Format",
"the",
"record",
"and",
"send",
"it",
"to",
"the",
"specified",
"addressees",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/log/handlers.py#L7-L44 | [
"def",
"emit",
"(",
"self",
",",
"record",
")",
":",
"try",
":",
"import",
"smtplib",
"try",
":",
"from",
"email",
".",
"utils",
"import",
"formatdate",
"except",
"ImportError",
":",
"formatdate",
"=",
"self",
".",
"date_time",
"port",
"=",
"self",
".",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | IndexHandler.indexes | Return a list with the current indexes
Skip the mandatory _id_ indexes
Args:
collection(str)
Returns:
indexes(list) | scout/adapter/mongo/index.py | def indexes(self, collection=None):
"""Return a list with the current indexes
Skip the mandatory _id_ indexes
Args:
collection(str)
Returns:
indexes(list)
"""
indexes = []
for collection_name in self.collections... | def indexes(self, collection=None):
"""Return a list with the current indexes
Skip the mandatory _id_ indexes
Args:
collection(str)
Returns:
indexes(list)
"""
indexes = []
for collection_name in self.collections... | [
"Return",
"a",
"list",
"with",
"the",
"current",
"indexes",
"Skip",
"the",
"mandatory",
"_id_",
"indexes",
"Args",
":",
"collection",
"(",
"str",
")"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/index.py#L10-L30 | [
"def",
"indexes",
"(",
"self",
",",
"collection",
"=",
"None",
")",
":",
"indexes",
"=",
"[",
"]",
"for",
"collection_name",
"in",
"self",
".",
"collections",
"(",
")",
":",
"if",
"collection",
"and",
"collection",
"!=",
"collection_name",
":",
"continue",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | IndexHandler.load_indexes | Add the proper indexes to the scout instance.
All indexes are specified in scout/constants/indexes.py
If this method is utilised when new indexes are defined those should be added | scout/adapter/mongo/index.py | def load_indexes(self):
"""Add the proper indexes to the scout instance.
All indexes are specified in scout/constants/indexes.py
If this method is utilised when new indexes are defined those should be added
"""
for collection_name in INDEXES:
existing_indexes = sel... | def load_indexes(self):
"""Add the proper indexes to the scout instance.
All indexes are specified in scout/constants/indexes.py
If this method is utilised when new indexes are defined those should be added
"""
for collection_name in INDEXES:
existing_indexes = sel... | [
"Add",
"the",
"proper",
"indexes",
"to",
"the",
"scout",
"instance",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/index.py#L32-L52 | [
"def",
"load_indexes",
"(",
"self",
")",
":",
"for",
"collection_name",
"in",
"INDEXES",
":",
"existing_indexes",
"=",
"self",
".",
"indexes",
"(",
"collection_name",
")",
"indexes",
"=",
"INDEXES",
"[",
"collection_name",
"]",
"for",
"index",
"in",
"indexes",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | IndexHandler.update_indexes | Update the indexes
If there are any indexes that are not added to the database, add those. | scout/adapter/mongo/index.py | def update_indexes(self):
"""Update the indexes
If there are any indexes that are not added to the database, add those.
"""
LOG.info("Updating indexes...")
nr_updated = 0
for collection_name in INDEXES:
existing_indexes = self.indexes(collection_name... | def update_indexes(self):
"""Update the indexes
If there are any indexes that are not added to the database, add those.
"""
LOG.info("Updating indexes...")
nr_updated = 0
for collection_name in INDEXES:
existing_indexes = self.indexes(collection_name... | [
"Update",
"the",
"indexes",
"If",
"there",
"are",
"any",
"indexes",
"that",
"are",
"not",
"added",
"to",
"the",
"database",
"add",
"those",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/index.py#L54-L72 | [
"def",
"update_indexes",
"(",
"self",
")",
":",
"LOG",
".",
"info",
"(",
"\"Updating indexes...\"",
")",
"nr_updated",
"=",
"0",
"for",
"collection_name",
"in",
"INDEXES",
":",
"existing_indexes",
"=",
"self",
".",
"indexes",
"(",
"collection_name",
")",
"inde... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | IndexHandler.drop_indexes | Delete all indexes for the database | scout/adapter/mongo/index.py | def drop_indexes(self):
"""Delete all indexes for the database"""
LOG.warning("Dropping all indexe")
for collection_name in INDEXES:
LOG.warning("Dropping all indexes for collection name %s", collection_name)
self.db[collection_name].drop_indexes() | def drop_indexes(self):
"""Delete all indexes for the database"""
LOG.warning("Dropping all indexe")
for collection_name in INDEXES:
LOG.warning("Dropping all indexes for collection name %s", collection_name)
self.db[collection_name].drop_indexes() | [
"Delete",
"all",
"indexes",
"for",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/index.py#L74-L79 | [
"def",
"drop_indexes",
"(",
"self",
")",
":",
"LOG",
".",
"warning",
"(",
"\"Dropping all indexe\"",
")",
"for",
"collection_name",
"in",
"INDEXES",
":",
"LOG",
".",
"warning",
"(",
"\"Dropping all indexes for collection name %s\"",
",",
"collection_name",
")",
"sel... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | QueryHandler.build_variant_query | Build a mongo query across multiple cases.
Translate query options from a form into a complete mongo query dictionary.
Beware that unindexed queries against a large variant collection will
be extremely slow.
Currently indexed query options:
hgnc_symbols
rank_sco... | scout/adapter/mongo/query.py | def build_variant_query(self, query=None, category='snv', variant_type=['clinical']):
"""Build a mongo query across multiple cases.
Translate query options from a form into a complete mongo query dictionary.
Beware that unindexed queries against a large variant collection will
be extrem... | def build_variant_query(self, query=None, category='snv', variant_type=['clinical']):
"""Build a mongo query across multiple cases.
Translate query options from a form into a complete mongo query dictionary.
Beware that unindexed queries against a large variant collection will
be extrem... | [
"Build",
"a",
"mongo",
"query",
"across",
"multiple",
"cases",
".",
"Translate",
"query",
"options",
"from",
"a",
"form",
"into",
"a",
"complete",
"mongo",
"query",
"dictionary",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/query.py#L11-L50 | [
"def",
"build_variant_query",
"(",
"self",
",",
"query",
"=",
"None",
",",
"category",
"=",
"'snv'",
",",
"variant_type",
"=",
"[",
"'clinical'",
"]",
")",
":",
"query",
"=",
"query",
"or",
"{",
"}",
"mongo_variant_query",
"=",
"{",
"}",
"LOG",
".",
"d... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | QueryHandler.build_query | Build a mongo query
These are the different query options:
{
'genetic_models': list,
'chrom': str,
'thousand_genomes_frequency': float,
'exac_frequency': float,
'clingen_ngi': int,
'cadd_score': float,
... | scout/adapter/mongo/query.py | def build_query(self, case_id, query=None, variant_ids=None, category='snv'):
"""Build a mongo query
These are the different query options:
{
'genetic_models': list,
'chrom': str,
'thousand_genomes_frequency': float,
'exac_freq... | def build_query(self, case_id, query=None, variant_ids=None, category='snv'):
"""Build a mongo query
These are the different query options:
{
'genetic_models': list,
'chrom': str,
'thousand_genomes_frequency': float,
'exac_freq... | [
"Build",
"a",
"mongo",
"query"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/query.py#L53-L209 | [
"def",
"build_query",
"(",
"self",
",",
"case_id",
",",
"query",
"=",
"None",
",",
"variant_ids",
"=",
"None",
",",
"category",
"=",
"'snv'",
")",
":",
"query",
"=",
"query",
"or",
"{",
"}",
"mongo_query",
"=",
"{",
"}",
"gene_query",
"=",
"None",
"#... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | QueryHandler.clinsig_query | Add clinsig filter values to the mongo query object
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is going to be submitted to the database
Returns:
clinsig_query(dict): a dictionary with... | scout/adapter/mongo/query.py | def clinsig_query(self, query, mongo_query):
""" Add clinsig filter values to the mongo query object
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is going to be submitted to the database
Return... | def clinsig_query(self, query, mongo_query):
""" Add clinsig filter values to the mongo query object
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is going to be submitted to the database
Return... | [
"Add",
"clinsig",
"filter",
"values",
"to",
"the",
"mongo",
"query",
"object"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/query.py#L212-L274 | [
"def",
"clinsig_query",
"(",
"self",
",",
"query",
",",
"mongo_query",
")",
":",
"LOG",
".",
"debug",
"(",
"'clinsig is a query parameter'",
")",
"trusted_revision_level",
"=",
"[",
"'mult'",
",",
"'single'",
",",
"'exp'",
",",
"'guideline'",
"]",
"rank",
"=",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | QueryHandler.coordinate_filter | Adds genomic coordinated-related filters to the query object
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is going to be submitted to the database
Returns:
mongo_query(dict): returned object contains coord... | scout/adapter/mongo/query.py | def coordinate_filter(self, query, mongo_query):
""" Adds genomic coordinated-related filters to the query object
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is going to be submitted to the database
Returns:
... | def coordinate_filter(self, query, mongo_query):
""" Adds genomic coordinated-related filters to the query object
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is going to be submitted to the database
Returns:
... | [
"Adds",
"genomic",
"coordinated",
"-",
"related",
"filters",
"to",
"the",
"query",
"object"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/query.py#L278-L297 | [
"def",
"coordinate_filter",
"(",
"self",
",",
"query",
",",
"mongo_query",
")",
":",
"LOG",
".",
"debug",
"(",
"'Adding genomic coordinates to the query'",
")",
"chromosome",
"=",
"query",
"[",
"'chrom'",
"]",
"mongo_query",
"[",
"'chromosome'",
"]",
"=",
"chrom... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | QueryHandler.gene_filter | Adds gene-related filters to the query object
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is going to be submitted to the database
Returns:
mongo_query(dict): returned object contains gene and panel-relat... | scout/adapter/mongo/query.py | def gene_filter(self, query, mongo_query):
""" Adds gene-related filters to the query object
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is going to be submitted to the database
Returns:
mongo_que... | def gene_filter(self, query, mongo_query):
""" Adds gene-related filters to the query object
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is going to be submitted to the database
Returns:
mongo_que... | [
"Adds",
"gene",
"-",
"related",
"filters",
"to",
"the",
"query",
"object"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/query.py#L301-L331 | [
"def",
"gene_filter",
"(",
"self",
",",
"query",
",",
"mongo_query",
")",
":",
"LOG",
".",
"debug",
"(",
"'Adding panel and genes-related parameters to the query'",
")",
"gene_query",
"=",
"[",
"]",
"if",
"query",
".",
"get",
"(",
"'hgnc_symbols'",
")",
"and",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | QueryHandler.secondary_query | Creates a secondary query object based on secondary parameters specified by user
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is going to be submitted to the database
Returns:
mongo_sec... | scout/adapter/mongo/query.py | def secondary_query(self, query, mongo_query, secondary_filter=None):
"""Creates a secondary query object based on secondary parameters specified by user
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is goin... | def secondary_query(self, query, mongo_query, secondary_filter=None):
"""Creates a secondary query object based on secondary parameters specified by user
Args:
query(dict): a dictionary of query filters specified by the users
mongo_query(dict): the query that is goin... | [
"Creates",
"a",
"secondary",
"query",
"object",
"based",
"on",
"secondary",
"parameters",
"specified",
"by",
"user"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/query.py#L335-L493 | [
"def",
"secondary_query",
"(",
"self",
",",
"query",
",",
"mongo_query",
",",
"secondary_filter",
"=",
"None",
")",
":",
"LOG",
".",
"debug",
"(",
"'Creating a query object with secondary parameters'",
")",
"mongo_secondary_query",
"=",
"[",
"]",
"# loop over secondar... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | wipe | Drop the mongo database given. | scout/commands/wipe_database.py | def wipe(ctx):
"""Drop the mongo database given."""
LOG.info("Running scout wipe")
db_name = ctx.obj['mongodb']
LOG.info("Dropping database %s", db_name)
try:
ctx.obj['client'].drop_database(db_name)
except Exception as err:
LOG.warning(err)
ctx.abort()
LOG.info("Drop... | def wipe(ctx):
"""Drop the mongo database given."""
LOG.info("Running scout wipe")
db_name = ctx.obj['mongodb']
LOG.info("Dropping database %s", db_name)
try:
ctx.obj['client'].drop_database(db_name)
except Exception as err:
LOG.warning(err)
ctx.abort()
LOG.info("Drop... | [
"Drop",
"the",
"mongo",
"database",
"given",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/commands/wipe_database.py#L31-L41 | [
"def",
"wipe",
"(",
"ctx",
")",
":",
"LOG",
".",
"info",
"(",
"\"Running scout wipe\"",
")",
"db_name",
"=",
"ctx",
".",
"obj",
"[",
"'mongodb'",
"]",
"LOG",
".",
"info",
"(",
"\"Dropping database %s\"",
",",
"db_name",
")",
"try",
":",
"ctx",
".",
"ob... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_panel | Parse user submitted panel. | scout/server/userpanel.py | def parse_panel(csv_stream):
"""Parse user submitted panel."""
reader = csv.DictReader(csv_stream, delimiter=';', quoting=csv.QUOTE_NONE)
genes = []
for gene_row in reader:
if not gene_row['HGNC_IDnumber'].strip().isdigit():
continue
transcripts_raw = gene_row.get('Disease_as... | def parse_panel(csv_stream):
"""Parse user submitted panel."""
reader = csv.DictReader(csv_stream, delimiter=';', quoting=csv.QUOTE_NONE)
genes = []
for gene_row in reader:
if not gene_row['HGNC_IDnumber'].strip().isdigit():
continue
transcripts_raw = gene_row.get('Disease_as... | [
"Parse",
"user",
"submitted",
"panel",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/userpanel.py#L5-L31 | [
"def",
"parse_panel",
"(",
"csv_stream",
")",
":",
"reader",
"=",
"csv",
".",
"DictReader",
"(",
"csv_stream",
",",
"delimiter",
"=",
"';'",
",",
"quoting",
"=",
"csv",
".",
"QUOTE_NONE",
")",
"genes",
"=",
"[",
"]",
"for",
"gene_row",
"in",
"reader",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | build_clnsig | docstring for build_clnsig | scout/build/variant/clnsig.py | 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 | 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 | [
"docstring",
"for",
"build_clnsig"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/build/variant/clnsig.py#L2-L10 | [
"def",
"build_clnsig",
"(",
"clnsig_info",
")",
":",
"clnsig_obj",
"=",
"dict",
"(",
"value",
"=",
"clnsig_info",
"[",
"'value'",
"]",
",",
"accession",
"=",
"clnsig_info",
".",
"get",
"(",
"'accession'",
")",
",",
"revstat",
"=",
"clnsig_info",
".",
"get"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.load_hgnc_bulk | 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) | scout/adapter/mongo/hgnc.py | 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.... | 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.... | [
"Load",
"a",
"bulk",
"of",
"hgnc",
"gene",
"objects",
"Raises",
"IntegrityError",
"if",
"there",
"are",
"any",
"write",
"concerns"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L27-L45 | [
"def",
"load_hgnc_bulk",
"(",
"self",
",",
"gene_objs",
")",
":",
"LOG",
".",
"info",
"(",
"\"Loading gene bulk with length %s\"",
",",
"len",
"(",
"gene_objs",
")",
")",
"try",
":",
"result",
"=",
"self",
".",
"hgnc_collection",
".",
"insert_many",
"(",
"ge... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.load_transcript_bulk | Load a bulk of transcript objects to the database
Arguments:
transcript_objs(iterable(scout.models.hgnc_transcript)) | scout/adapter/mongo/hgnc.py | 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... | 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... | [
"Load",
"a",
"bulk",
"of",
"transcript",
"objects",
"to",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L57-L70 | [
"def",
"load_transcript_bulk",
"(",
"self",
",",
"transcript_objs",
")",
":",
"LOG",
".",
"info",
"(",
"\"Loading transcript bulk\"",
")",
"try",
":",
"result",
"=",
"self",
".",
"transcript_collection",
".",
"insert_many",
"(",
"transcript_objs",
")",
"except",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.load_exon_bulk | Load a bulk of exon objects to the database
Arguments:
exon_objs(iterable(scout.models.hgnc_exon)) | scout/adapter/mongo/hgnc.py | 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... | 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... | [
"Load",
"a",
"bulk",
"of",
"exon",
"objects",
"to",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L82-L94 | [
"def",
"load_exon_bulk",
"(",
"self",
",",
"exon_objs",
")",
":",
"try",
":",
"result",
"=",
"self",
".",
"exon_collection",
".",
"insert_many",
"(",
"transcript_objs",
")",
"except",
"(",
"DuplicateKeyError",
",",
"BulkWriteError",
")",
"as",
"err",
":",
"r... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.hgnc_gene | Fetch a hgnc gene
Args:
hgnc_identifier(int)
Returns:
gene_obj(HgncGene) | scout/adapter/mongo/hgnc.py | 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 ... | 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 ... | [
"Fetch",
"a",
"hgnc",
"gene"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L96-L130 | [
"def",
"hgnc_gene",
"(",
"self",
",",
"hgnc_identifier",
",",
"build",
"=",
"'37'",
")",
":",
"if",
"not",
"build",
"in",
"[",
"'37'",
",",
"'38'",
"]",
":",
"build",
"=",
"'37'",
"query",
"=",
"{",
"}",
"try",
":",
"# If the identifier is a integer we s... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.hgnc_id | Query the genes with a hgnc symbol and return the hgnc id
Args:
hgnc_symbol(str)
build(str)
Returns:
hgnc_id(int) | scout/adapter/mongo/hgnc.py | 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... | 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... | [
"Query",
"the",
"genes",
"with",
"a",
"hgnc",
"symbol",
"and",
"return",
"the",
"hgnc",
"id"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L132-L150 | [
"def",
"hgnc_id",
"(",
"self",
",",
"hgnc_symbol",
",",
"build",
"=",
"'37'",
")",
":",
"#LOG.debug(\"Fetching gene %s\", hgnc_symbol)",
"query",
"=",
"{",
"'hgnc_symbol'",
":",
"hgnc_symbol",
",",
"'build'",
":",
"build",
"}",
"projection",
"=",
"{",
"'hgnc_id'... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.hgnc_genes | 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 searching should be used
Returns:
result() | scout/adapter/mongo/hgnc.py | 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... | 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... | [
"Fetch",
"all",
"hgnc",
"genes",
"that",
"match",
"a",
"hgnc",
"symbol"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L152-L183 | [
"def",
"hgnc_genes",
"(",
"self",
",",
"hgnc_symbol",
",",
"build",
"=",
"'37'",
",",
"search",
"=",
"False",
")",
":",
"LOG",
".",
"debug",
"(",
"\"Fetching genes with symbol %s\"",
"%",
"hgnc_symbol",
")",
"if",
"search",
":",
"# first search for a full match"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.all_genes | Fetch all hgnc genes
Returns:
result() | scout/adapter/mongo/hgnc.py | 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) | 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) | [
"Fetch",
"all",
"hgnc",
"genes"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L185-L192 | [
"def",
"all_genes",
"(",
"self",
",",
"build",
"=",
"'37'",
")",
":",
"LOG",
".",
"info",
"(",
"\"Fetching all genes\"",
")",
"return",
"self",
".",
"hgnc_collection",
".",
"find",
"(",
"{",
"'build'",
":",
"build",
"}",
")",
".",
"sort",
"(",
"'chromo... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.nr_genes | Return the number of hgnc genes in collection
If build is used, return the number of genes of a certain build
Returns:
result() | scout/adapter/mongo/hgnc.py | 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:
... | 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:
... | [
"Return",
"the",
"number",
"of",
"hgnc",
"genes",
"in",
"collection"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L194-L207 | [
"def",
"nr_genes",
"(",
"self",
",",
"build",
"=",
"None",
")",
":",
"if",
"build",
":",
"LOG",
".",
"info",
"(",
"\"Fetching all genes from build %s\"",
",",
"build",
")",
"else",
":",
"LOG",
".",
"info",
"(",
"\"Fetching all genes\"",
")",
"return",
"sel... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.drop_genes | Delete the genes collection | scout/adapter/mongo/hgnc.py | 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... | 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... | [
"Delete",
"the",
"genes",
"collection"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L209-L216 | [
"def",
"drop_genes",
"(",
"self",
",",
"build",
"=",
"None",
")",
":",
"if",
"build",
":",
"LOG",
".",
"info",
"(",
"\"Dropping the hgnc_gene collection, build %s\"",
",",
"build",
")",
"self",
".",
"hgnc_collection",
".",
"delete_many",
"(",
"{",
"'build'",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.drop_transcripts | Delete the transcripts collection | scout/adapter/mongo/hgnc.py | 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... | 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... | [
"Delete",
"the",
"transcripts",
"collection"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L218-L225 | [
"def",
"drop_transcripts",
"(",
"self",
",",
"build",
"=",
"None",
")",
":",
"if",
"build",
":",
"LOG",
".",
"info",
"(",
"\"Dropping the transcripts collection, build %s\"",
",",
"build",
")",
"self",
".",
"transcript_collection",
".",
"delete_many",
"(",
"{",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.drop_exons | Delete the exons collection | scout/adapter/mongo/hgnc.py | 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... | 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... | [
"Delete",
"the",
"exons",
"collection"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L227-L234 | [
"def",
"drop_exons",
"(",
"self",
",",
"build",
"=",
"None",
")",
":",
"if",
"build",
":",
"LOG",
".",
"info",
"(",
"\"Dropping the exons collection, build %s\"",
",",
"build",
")",
"self",
".",
"exon_collection",
".",
"delete_many",
"(",
"{",
"'build'",
":"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.ensembl_transcripts | Return a dictionary with ensembl ids as keys and transcripts as value.
Args:
build(str)
Returns:
ensembl_transcripts(dict): {<enst_id>: transcripts_obj, ...} | scout/adapter/mongo/hgnc.py | 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... | 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... | [
"Return",
"a",
"dictionary",
"with",
"ensembl",
"ids",
"as",
"keys",
"and",
"transcripts",
"as",
"value",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L236-L252 | [
"def",
"ensembl_transcripts",
"(",
"self",
",",
"build",
"=",
"'37'",
")",
":",
"ensembl_transcripts",
"=",
"{",
"}",
"LOG",
".",
"info",
"(",
"\"Fetching all transcripts\"",
")",
"for",
"transcript_obj",
"in",
"self",
".",
"transcript_collection",
".",
"find",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.hgncsymbol_to_gene | 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)):
Returns:
hgnc_dict(dict): {<hgnc_symbol(s... | scout/adapter/mongo/hgnc.py | 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)... | 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)... | [
"Return",
"a",
"dictionary",
"with",
"hgnc_symbol",
"as",
"key",
"and",
"gene_obj",
"as",
"value"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L278-L300 | [
"def",
"hgncsymbol_to_gene",
"(",
"self",
",",
"build",
"=",
"'37'",
",",
"genes",
"=",
"None",
")",
":",
"hgnc_dict",
"=",
"{",
"}",
"LOG",
".",
"info",
"(",
"\"Building hgncsymbol_to_gene\"",
")",
"if",
"not",
"genes",
":",
"genes",
"=",
"self",
".",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.gene_by_alias | 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)
build(str)
Returns:
res(py... | scout/adapter/mongo/hgnc.py | 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)
... | 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)
... | [
"Return",
"a",
"iterable",
"with",
"hgnc_genes",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L302-L320 | [
"def",
"gene_by_alias",
"(",
"self",
",",
"symbol",
",",
"build",
"=",
"'37'",
")",
":",
"res",
"=",
"self",
".",
"hgnc_collection",
".",
"find",
"(",
"{",
"'hgnc_symbol'",
":",
"symbol",
",",
"'build'",
":",
"build",
"}",
")",
"if",
"res",
".",
"cou... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.genes_by_alias | 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
of hgnc_ids
Args:
build(str)
... | scout/adapter/mongo/hgnc.py | 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
... | 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
... | [
"Return",
"a",
"dictionary",
"with",
"hgnc",
"symbols",
"as",
"keys",
"and",
"a",
"list",
"of",
"hgnc",
"ids",
"as",
"value",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L322-L366 | [
"def",
"genes_by_alias",
"(",
"self",
",",
"build",
"=",
"'37'",
",",
"genes",
"=",
"None",
")",
":",
"LOG",
".",
"info",
"(",
"\"Fetching all genes by alias\"",
")",
"# Collect one entry for each alias symbol that exists",
"alias_genes",
"=",
"{",
"}",
"# Loop over... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.get_id_transcripts | Return a set with identifier transcript(s)
Choose all refseq transcripts with NM symbols, if none where found choose ONE with NR,
if no NR choose ONE with XM. If there are no RefSeq transcripts identifiers choose the
longest ensembl transcript.
Args:
hgnc_id(int)
... | scout/adapter/mongo/hgnc.py | def get_id_transcripts(self, hgnc_id, build='37'):
"""Return a set with identifier transcript(s)
Choose all refseq transcripts with NM symbols, if none where found choose ONE with NR,
if no NR choose ONE with XM. If there are no RefSeq transcripts identifiers choose the
longest ensembl... | def get_id_transcripts(self, hgnc_id, build='37'):
"""Return a set with identifier transcript(s)
Choose all refseq transcripts with NM symbols, if none where found choose ONE with NR,
if no NR choose ONE with XM. If there are no RefSeq transcripts identifiers choose the
longest ensembl... | [
"Return",
"a",
"set",
"with",
"identifier",
"transcript",
"(",
"s",
")"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L368-L414 | [
"def",
"get_id_transcripts",
"(",
"self",
",",
"hgnc_id",
",",
"build",
"=",
"'37'",
")",
":",
"transcripts",
"=",
"self",
".",
"transcripts",
"(",
"build",
"=",
"build",
",",
"hgnc_id",
"=",
"hgnc_id",
")",
"identifier_transcripts",
"=",
"set",
"(",
")",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.transcripts_by_gene | Return a dictionary with hgnc_id as keys and a list of transcripts as value
Args:
build(str)
Returns:
hgnc_transcripts(dict) | scout/adapter/mongo/hgnc.py | def transcripts_by_gene(self, build='37'):
"""Return a dictionary with hgnc_id as keys and a list of transcripts as value
Args:
build(str)
Returns:
hgnc_transcripts(dict)
"""
hgnc_transcripts = {}
LOG.info("Fetchi... | def transcripts_by_gene(self, build='37'):
"""Return a dictionary with hgnc_id as keys and a list of transcripts as value
Args:
build(str)
Returns:
hgnc_transcripts(dict)
"""
hgnc_transcripts = {}
LOG.info("Fetchi... | [
"Return",
"a",
"dictionary",
"with",
"hgnc_id",
"as",
"keys",
"and",
"a",
"list",
"of",
"transcripts",
"as",
"value",
"Args",
":",
"build",
"(",
"str",
")",
"Returns",
":",
"hgnc_transcripts",
"(",
"dict",
")"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L416-L435 | [
"def",
"transcripts_by_gene",
"(",
"self",
",",
"build",
"=",
"'37'",
")",
":",
"hgnc_transcripts",
"=",
"{",
"}",
"LOG",
".",
"info",
"(",
"\"Fetching all transcripts\"",
")",
"for",
"transcript",
"in",
"self",
".",
"transcript_collection",
".",
"find",
"(",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.id_transcripts_by_gene | Return a dictionary with hgnc_id as keys and a set of id transcripts as value
Args:
build(str)
Returns:
hgnc_id_transcripts(dict) | scout/adapter/mongo/hgnc.py | def id_transcripts_by_gene(self, build='37'):
"""Return a dictionary with hgnc_id as keys and a set of id transcripts as value
Args:
build(str)
Returns:
hgnc_id_transcripts(dict)
"""
hgnc_id_transcripts = {}
LOG.info("Fetching all... | def id_transcripts_by_gene(self, build='37'):
"""Return a dictionary with hgnc_id as keys and a set of id transcripts as value
Args:
build(str)
Returns:
hgnc_id_transcripts(dict)
"""
hgnc_id_transcripts = {}
LOG.info("Fetching all... | [
"Return",
"a",
"dictionary",
"with",
"hgnc_id",
"as",
"keys",
"and",
"a",
"set",
"of",
"id",
"transcripts",
"as",
"value",
"Args",
":",
"build",
"(",
"str",
")",
"Returns",
":",
"hgnc_id_transcripts",
"(",
"dict",
")"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L437-L453 | [
"def",
"id_transcripts_by_gene",
"(",
"self",
",",
"build",
"=",
"'37'",
")",
":",
"hgnc_id_transcripts",
"=",
"{",
"}",
"LOG",
".",
"info",
"(",
"\"Fetching all id transcripts\"",
")",
"for",
"gene_obj",
"in",
"self",
".",
"hgnc_collection",
".",
"find",
"(",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.ensembl_genes | Return a dictionary with ensembl ids as keys and gene objects as value.
Args:
build(str)
Returns:
genes(dict): {<ensg_id>: gene_obj, ...} | scout/adapter/mongo/hgnc.py | 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")
... | 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")
... | [
"Return",
"a",
"dictionary",
"with",
"ensembl",
"ids",
"as",
"keys",
"and",
"gene",
"objects",
"as",
"value",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L455-L475 | [
"def",
"ensembl_genes",
"(",
"self",
",",
"build",
"=",
"'37'",
")",
":",
"genes",
"=",
"{",
"}",
"LOG",
".",
"info",
"(",
"\"Fetching all genes\"",
")",
"for",
"gene_obj",
"in",
"self",
".",
"hgnc_collection",
".",
"find",
"(",
"{",
"'build'",
":",
"b... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.transcripts | Return all transcripts.
If a gene is specified return all transcripts for the gene
Args:
build(str)
hgnc_id(int)
Returns:
iterable(transcript) | scout/adapter/mongo/hgnc.py | def transcripts(self, build='37', hgnc_id=None):
"""Return all transcripts.
If a gene is specified return all transcripts for the gene
Args:
build(str)
hgnc_id(int)
Returns:
iterable(transcript)
"""
... | def transcripts(self, build='37', hgnc_id=None):
"""Return all transcripts.
If a gene is specified return all transcripts for the gene
Args:
build(str)
hgnc_id(int)
Returns:
iterable(transcript)
"""
... | [
"Return",
"all",
"transcripts",
".",
"If",
"a",
"gene",
"is",
"specified",
"return",
"all",
"transcripts",
"for",
"the",
"gene",
"Args",
":",
"build",
"(",
"str",
")",
"hgnc_id",
"(",
"int",
")",
"Returns",
":",
"iterable",
"(",
"transcript",
")"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L477-L494 | [
"def",
"transcripts",
"(",
"self",
",",
"build",
"=",
"'37'",
",",
"hgnc_id",
"=",
"None",
")",
":",
"query",
"=",
"{",
"'build'",
":",
"build",
"}",
"if",
"hgnc_id",
":",
"query",
"[",
"'hgnc_id'",
"]",
"=",
"hgnc_id",
"return",
"self",
".",
"transc... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.to_hgnc | 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) | scout/adapter/mongo/hgnc.py | 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... | 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... | [
"Check",
"if",
"a",
"hgnc",
"symbol",
"is",
"an",
"alias"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L497-L513 | [
"def",
"to_hgnc",
"(",
"self",
",",
"hgnc_alias",
",",
"build",
"=",
"'37'",
")",
":",
"result",
"=",
"self",
".",
"hgnc_genes",
"(",
"hgnc_symbol",
"=",
"hgnc_alias",
",",
"build",
"=",
"build",
")",
"if",
"result",
":",
"for",
"gene",
"in",
"result",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.add_hgnc_id | 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 | scout/adapter/mongo/hgnc.py | 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['... | 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['... | [
"Add",
"the",
"correct",
"hgnc",
"id",
"to",
"a",
"set",
"of",
"genes",
"with",
"hgnc",
"symbols"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L515-L533 | [
"def",
"add_hgnc_id",
"(",
"self",
",",
"genes",
")",
":",
"genes_by_alias",
"=",
"self",
".",
"genes_by_alias",
"(",
")",
"for",
"gene",
"in",
"genes",
":",
"id_info",
"=",
"genes_by_alias",
".",
"get",
"(",
"gene",
"[",
"'hgnc_symbol'",
"]",
")",
"if",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.get_coding_intervals | 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)):
Returns:
intervals(dict): A dictionary with c... | scout/adapter/mongo/hgnc.py | 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)):... | 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)):... | [
"Return",
"a",
"dictionary",
"with",
"chromosomes",
"as",
"keys",
"and",
"interval",
"trees",
"as",
"values"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L535-L585 | [
"def",
"get_coding_intervals",
"(",
"self",
",",
"build",
"=",
"'37'",
",",
"genes",
"=",
"None",
")",
":",
"intervals",
"=",
"{",
"}",
"if",
"not",
"genes",
":",
"genes",
"=",
"self",
".",
"all_genes",
"(",
"build",
"=",
"build",
")",
"LOG",
".",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.load_exons | Create exon objects and insert them into the database
Args:
exons(iterable(dict)) | scout/adapter/mongo/hgnc.py | def load_exons(self, exons, genes=None, build='37'):
"""Create exon objects and insert them into the database
Args:
exons(iterable(dict))
"""
genes = genes or self.ensembl_genes(build)
for exon in exons:
exon_obj = build_exon(exon, genes)
... | def load_exons(self, exons, genes=None, build='37'):
"""Create exon objects and insert them into the database
Args:
exons(iterable(dict))
"""
genes = genes or self.ensembl_genes(build)
for exon in exons:
exon_obj = build_exon(exon, genes)
... | [
"Create",
"exon",
"objects",
"and",
"insert",
"them",
"into",
"the",
"database",
"Args",
":",
"exons",
"(",
"iterable",
"(",
"dict",
"))"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L587-L599 | [
"def",
"load_exons",
"(",
"self",
",",
"exons",
",",
"genes",
"=",
"None",
",",
"build",
"=",
"'37'",
")",
":",
"genes",
"=",
"genes",
"or",
"self",
".",
"ensembl_genes",
"(",
"build",
")",
"for",
"exon",
"in",
"exons",
":",
"exon_obj",
"=",
"build_e... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GeneHandler.exons | Return all exons
Args:
hgnc_id(int)
transcript_id(str)
build(str)
Returns:
exons(iterable(dict)) | scout/adapter/mongo/hgnc.py | def exons(self, hgnc_id=None, transcript_id=None, build=None):
"""Return all exons
Args:
hgnc_id(int)
transcript_id(str)
build(str)
Returns:
exons(iterable(dict))
"""
query = {}
if build:
query... | def exons(self, hgnc_id=None, transcript_id=None, build=None):
"""Return all exons
Args:
hgnc_id(int)
transcript_id(str)
build(str)
Returns:
exons(iterable(dict))
"""
query = {}
if build:
query... | [
"Return",
"all",
"exons",
"Args",
":",
"hgnc_id",
"(",
"int",
")",
"transcript_id",
"(",
"str",
")",
"build",
"(",
"str",
")",
"Returns",
":",
"exons",
"(",
"iterable",
"(",
"dict",
"))"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/hgnc.py#L601-L620 | [
"def",
"exons",
"(",
"self",
",",
"hgnc_id",
"=",
"None",
",",
"transcript_id",
"=",
"None",
",",
"build",
"=",
"None",
")",
":",
"query",
"=",
"{",
"}",
"if",
"build",
":",
"query",
"[",
"'build'",
"]",
"=",
"build",
"if",
"hgnc_id",
":",
"query",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | omim | Update the automate generated omim gene panel in the database. | scout/commands/update/omim.py | 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... | 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... | [
"Update",
"the",
"automate",
"generated",
"omim",
"gene",
"panel",
"in",
"the",
"database",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/commands/update/omim.py#L20-L42 | [
"def",
"omim",
"(",
"context",
",",
"api_key",
",",
"institute",
")",
":",
"LOG",
".",
"info",
"(",
"\"Running scout update omim\"",
")",
"adapter",
"=",
"context",
".",
"obj",
"[",
"'adapter'",
"]",
"api_key",
"=",
"api_key",
"or",
"context",
".",
"obj",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | index | Display a list of all user institutes. | scout/server/blueprints/cases/views.py | def index():
"""Display a list of all user institutes."""
institute_objs = user_institutes(store, current_user)
institutes_count = ((institute_obj, store.cases(collaborator=institute_obj['_id']).count())
for institute_obj in institute_objs if institute_obj)
return dict(institutes... | def index():
"""Display a list of all user institutes."""
institute_objs = user_institutes(store, current_user)
institutes_count = ((institute_obj, store.cases(collaborator=institute_obj['_id']).count())
for institute_obj in institute_objs if institute_obj)
return dict(institutes... | [
"Display",
"a",
"list",
"of",
"all",
"user",
"institutes",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L34-L39 | [
"def",
"index",
"(",
")",
":",
"institute_objs",
"=",
"user_institutes",
"(",
"store",
",",
"current_user",
")",
"institutes_count",
"=",
"(",
"(",
"institute_obj",
",",
"store",
".",
"cases",
"(",
"collaborator",
"=",
"institute_obj",
"[",
"'_id'",
"]",
")"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | cases | Display a list of cases for an institute. | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Display",
"a",
"list",
"of",
"cases",
"for",
"an",
"institute",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L44-L64 | [
"def",
"cases",
"(",
"institute_id",
")",
":",
"institute_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
")",
"query",
"=",
"request",
".",
"args",
".",
"get",
"(",
"'query'",
")",
"limit",
"=",
"100",
"if",
"request",
".",
"args",
"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | case | Display one case. | scout/server/blueprints/cases/views.py | 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) | 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) | [
"Display",
"one",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L69-L73 | [
"def",
"case",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"data",
"=",
"controllers",
".",
"case",
"(",
"store",
",",
"institute_obj",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | matchmaker_matches | Show all MatchMaker matches for a given case | scout/server/blueprints/cases/views.py | 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')
... | 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')
... | [
"Show",
"all",
"MatchMaker",
"matches",
"for",
"a",
"given",
"case"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L135-L158 | [
"def",
"matchmaker_matches",
"(",
"institute_id",
",",
"case_name",
")",
":",
"# check that only authorized users can access MME patients matches",
"user_obj",
"=",
"store",
".",
"user",
"(",
"current_user",
".",
"email",
")",
"if",
"'mme_submitter'",
"not",
"in",
"user... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | matchmaker_match | Starts an internal match or a match against one or all MME external nodes | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Starts",
"an",
"internal",
"match",
"or",
"a",
"match",
"against",
"one",
"or",
"all",
"MME",
"external",
"nodes"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L162-L192 | [
"def",
"matchmaker_match",
"(",
"institute_id",
",",
"case_name",
",",
"target",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"# check that only authorized users can run matches",
"user_... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | matchmaker_add | Add or update a case in MatchMaker | scout/server/blueprints/cases/views.py | def matchmaker_add(institute_id, case_name):
"""Add or update a case in MatchMaker"""
# check that only authorized users can add patients to MME
user_obj = store.user(current_user.email)
if 'mme_submitter' not in user_obj['roles']:
flash('unauthorized request', 'warning')
return redirec... | def matchmaker_add(institute_id, case_name):
"""Add or update a case in MatchMaker"""
# check that only authorized users can add patients to MME
user_obj = store.user(current_user.email)
if 'mme_submitter' not in user_obj['roles']:
flash('unauthorized request', 'warning')
return redirec... | [
"Add",
"or",
"update",
"a",
"case",
"in",
"MatchMaker"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L196-L273 | [
"def",
"matchmaker_add",
"(",
"institute_id",
",",
"case_name",
")",
":",
"# check that only authorized users can add patients to MME",
"user_obj",
"=",
"store",
".",
"user",
"(",
"current_user",
".",
"email",
")",
"if",
"'mme_submitter'",
"not",
"in",
"user_obj",
"["... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | matchmaker_delete | Remove a case from MatchMaker | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Remove",
"a",
"case",
"from",
"MatchMaker"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L277-L311 | [
"def",
"matchmaker_delete",
"(",
"institute_id",
",",
"case_name",
")",
":",
"# check that only authorized users can delete patients from MME",
"user_obj",
"=",
"store",
".",
"user",
"(",
"current_user",
".",
"email",
")",
"if",
"'mme_submitter'",
"not",
"in",
"user_obj... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | gene_variants | Display a list of SNV variants. | scout/server/blueprints/cases/views.py | def gene_variants(institute_id):
"""Display a list of SNV variants."""
page = int(request.form.get('page', 1))
institute_obj = institute_and_case(store, institute_id)
# populate form, conditional on request method
if(request.method == "POST"):
form = GeneVariantFiltersForm(request.form... | def gene_variants(institute_id):
"""Display a list of SNV variants."""
page = int(request.form.get('page', 1))
institute_obj = institute_and_case(store, institute_id)
# populate form, conditional on request method
if(request.method == "POST"):
form = GeneVariantFiltersForm(request.form... | [
"Display",
"a",
"list",
"of",
"SNV",
"variants",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L336-L388 | [
"def",
"gene_variants",
"(",
"institute_id",
")",
":",
"page",
"=",
"int",
"(",
"request",
".",
"form",
".",
"get",
"(",
"'page'",
",",
"1",
")",
")",
"institute_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
")",
"# populate form, condi... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | case_synopsis | Update (PUT) synopsis of a specific case. | scout/server/blueprints/cases/views.py | def case_synopsis(institute_id, case_name):
"""Update (PUT) synopsis of a specific case."""
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
user_obj = store.user(current_user.email)
new_synopsis = request.form.get('synopsis')
controllers.update_synopsis(store, institute_... | def case_synopsis(institute_id, case_name):
"""Update (PUT) synopsis of a specific case."""
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
user_obj = store.user(current_user.email)
new_synopsis = request.form.get('synopsis')
controllers.update_synopsis(store, institute_... | [
"Update",
"(",
"PUT",
")",
"synopsis",
"of",
"a",
"specific",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L392-L398 | [
"def",
"case_synopsis",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"user_obj",
"=",
"store",
".",
"user",
"(",
"current_user",
".",
"em... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | case_report | Visualize case report | scout/server/blueprints/cases/views.py | 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) | 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) | [
"Visualize",
"case",
"report"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L403-L407 | [
"def",
"case_report",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"data",
"=",
"controllers",
".",
"case_report_content",
"(",
"store",
",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | pdf_case_report | Download a pdf report for a case | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Download",
"a",
"pdf",
"report",
"for",
"a",
"case"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L411-L427 | [
"def",
"pdf_case_report",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"data",
"=",
"controllers",
".",
"case_report_content",
"(",
"store",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | case_diagnosis | Add or remove a diagnosis for a case. | scout/server/blueprints/cases/views.py | 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' ... | 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' ... | [
"Add",
"or",
"remove",
"a",
"diagnosis",
"for",
"a",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L466-L476 | [
"def",
"case_diagnosis",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"user_obj",
"=",
"store",
".",
"user",
"(",
"current_user",
".",
"e... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | phenotypes | Handle phenotypes. | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Handle",
"phenotypes",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L482-L507 | [
"def",
"phenotypes",
"(",
"institute_id",
",",
"case_name",
",",
"phenotype_id",
"=",
"None",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"case_url",
"=",
"url_for",
"(",
"'.c... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | phenotypes_actions | Perform actions on multiple phenotypes. | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Perform",
"actions",
"on",
"multiple",
"phenotypes",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L511-L551 | [
"def",
"phenotypes_actions",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"case_url",
"=",
"url_for",
"(",
"'.case'",
",",
"institute_id",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | events | Handle events. | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Handle",
"events",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L556-L578 | [
"def",
"events",
"(",
"institute_id",
",",
"case_name",
",",
"event_id",
"=",
"None",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"link",
"=",
"request",
".",
"form",
".",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | status | Update status of a specific case. | scout/server/blueprints/cases/views.py | 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_... | 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_... | [
"Update",
"status",
"of",
"a",
"specific",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L582-L595 | [
"def",
"status",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"user_obj",
"=",
"store",
".",
"user",
"(",
"current_user",
".",
"email",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | assign | Assign and unassign a user from a case. | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Assign",
"and",
"unassign",
"a",
"user",
"from",
"a",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L600-L612 | [
"def",
"assign",
"(",
"institute_id",
",",
"case_name",
",",
"user_id",
"=",
"None",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"link",
"=",
"url_for",
"(",
"'.case'",
",",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | hpoterms | Search for HPO terms. | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Search",
"for",
"HPO",
"terms",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L616-L627 | [
"def",
"hpoterms",
"(",
")",
":",
"query",
"=",
"request",
".",
"args",
".",
"get",
"(",
"'query'",
")",
"if",
"query",
"is",
"None",
":",
"return",
"abort",
"(",
"500",
")",
"terms",
"=",
"sorted",
"(",
"store",
".",
"hpo_terms",
"(",
"query",
"="... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | pin_variant | Pin and unpin variants to/from the list of suspects. | scout/server/blueprints/cases/views.py | def pin_variant(institute_id, case_name, variant_id):
"""Pin and unpin variants to/from the list of suspects."""
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.var... | def pin_variant(institute_id, case_name, variant_id):
"""Pin and unpin variants to/from the list of suspects."""
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.var... | [
"Pin",
"and",
"unpin",
"variants",
"to",
"/",
"from",
"the",
"list",
"of",
"suspects",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L631-L642 | [
"def",
"pin_variant",
"(",
"institute_id",
",",
"case_name",
",",
"variant_id",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"variant_obj",
"=",
"store",
".",
"variant",
"(",
"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | mark_validation | Mark a variant as sanger validated. | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Mark",
"a",
"variant",
"as",
"sanger",
"validated",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L646-L655 | [
"def",
"mark_validation",
"(",
"institute_id",
",",
"case_name",
",",
"variant_id",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"variant_obj",
"=",
"store",
".",
"variant",
"(",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | mark_causative | Mark a variant as confirmed causative. | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Mark",
"a",
"variant",
"as",
"confirmed",
"causative",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L659-L673 | [
"def",
"mark_causative",
"(",
"institute_id",
",",
"case_name",
",",
"variant_id",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"variant_obj",
"=",
"store",
".",
"variant",
"(",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | check_case | Mark a case that is has been checked.
This means to set case['needs_check'] to False | scout/server/blueprints/cases/views.py | def check_case(institute_id, case_name):
"""Mark a case that is has been checked.
This means to set case['needs_check'] to False
"""
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
store.case_collection.find_one_and_update({'_id':case_obj['_id']}, {'$set': {'needs_che... | def check_case(institute_id, case_name):
"""Mark a case that is has been checked.
This means to set case['needs_check'] to False
"""
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
store.case_collection.find_one_and_update({'_id':case_obj['_id']}, {'$set': {'needs_che... | [
"Mark",
"a",
"case",
"that",
"is",
"has",
"been",
"checked",
".",
"This",
"means",
"to",
"set",
"case",
"[",
"needs_check",
"]",
"to",
"False"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L676-L682 | [
"def",
"check_case",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"store",
".",
"case_collection",
".",
"find_one_and_update",
"(",
"{",
"'... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | delivery_report | Display delivery report. | scout/server/blueprints/cases/views.py | 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 = ... | 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 = ... | [
"Display",
"delivery",
"report",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L686-L706 | [
"def",
"delivery_report",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"if",
"case_obj",
".",
"get",
"(",
"'delivery_report'",
")",
"is",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | share | Share a case with a different institute. | scout/server/blueprints/cases/views.py | 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 =... | 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 =... | [
"Share",
"a",
"case",
"with",
"a",
"different",
"institute",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L709-L722 | [
"def",
"share",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"user_obj",
"=",
"store",
".",
"user",
"(",
"current_user",
".",
"email",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | rerun | Request a case to be rerun. | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Request",
"a",
"case",
"to",
"be",
"rerun",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L726-L732 | [
"def",
"rerun",
"(",
"institute_id",
",",
"case_name",
")",
":",
"sender",
"=",
"current_app",
".",
"config",
"[",
"'MAIL_USERNAME'",
"]",
"recipient",
"=",
"current_app",
".",
"config",
"[",
"'TICKET_SYSTEM_EMAIL'",
"]",
"controllers",
".",
"rerun",
"(",
"sto... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | research | Open the research list for a case. | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Open",
"the",
"research",
"list",
"for",
"a",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L736-L742 | [
"def",
"research",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"user_obj",
"=",
"store",
".",
"user",
"(",
"current_user",
".",
"email",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | cohorts | Add/remove institute tags. | scout/server/blueprints/cases/views.py | def cohorts(institute_id, case_name):
"""Add/remove institute tags."""
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)
cohort_tag = request.form['cohort_tag'... | def cohorts(institute_id, case_name):
"""Add/remove institute tags."""
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)
cohort_tag = request.form['cohort_tag'... | [
"Add",
"/",
"remove",
"institute",
"tags",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L746-L756 | [
"def",
"cohorts",
"(",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"user_obj",
"=",
"store",
".",
"user",
"(",
"current_user",
".",
"email",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | default_panels | Update default panels for a case. | scout/server/blueprints/cases/views.py | def default_panels(institute_id, case_name):
"""Update default panels for a case."""
panel_ids = request.form.getlist('panel_ids')
controllers.update_default_panels(store, current_user, institute_id, case_name, panel_ids)
return redirect(request.referrer) | def default_panels(institute_id, case_name):
"""Update default panels for a case."""
panel_ids = request.form.getlist('panel_ids')
controllers.update_default_panels(store, current_user, institute_id, case_name, panel_ids)
return redirect(request.referrer) | [
"Update",
"default",
"panels",
"for",
"a",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L760-L764 | [
"def",
"default_panels",
"(",
"institute_id",
",",
"case_name",
")",
":",
"panel_ids",
"=",
"request",
".",
"form",
".",
"getlist",
"(",
"'panel_ids'",
")",
"controllers",
".",
"update_default_panels",
"(",
"store",
",",
"current_user",
",",
"institute_id",
",",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | vcf2cytosure | Download vcf2cytosure file for individual. | scout/server/blueprints/cases/views.py | 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(... | 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(... | [
"Download",
"vcf2cytosure",
"file",
"for",
"individual",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L767-L782 | [
"def",
"vcf2cytosure",
"(",
"institute_id",
",",
"case_name",
",",
"individual_id",
")",
":",
"(",
"display_name",
",",
"vcf2cytosure",
")",
"=",
"controllers",
".",
"vcf2cytosure",
"(",
"store",
",",
"institute_id",
",",
"case_name",
",",
"individual_id",
")",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | multiqc | Load multiqc report for the case. | scout/server/blueprints/cases/views.py | 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... | 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... | [
"Load",
"multiqc",
"report",
"for",
"the",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/views.py#L785-L792 | [
"def",
"multiqc",
"(",
"institute_id",
",",
"case_name",
")",
":",
"data",
"=",
"controllers",
".",
"multiqc",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"if",
"data",
"[",
"'case'",
"]",
".",
"get",
"(",
"'multiqc'",
")",
"is",
"None",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | update_panels | scout: manage interactions with a scout instance. | scripts/update_variant_panels.py | def update_panels(context, mongodb, username, password, authdb, host, port, loglevel, config):
"""scout: manage interactions with a scout instance."""
coloredlogs.install(level=loglevel)
LOG.info("Running scout version %s", __version__)
LOG.debug("Debug logging enabled.")
mongo_config = {}
... | def update_panels(context, mongodb, username, password, authdb, host, port, loglevel, config):
"""scout: manage interactions with a scout instance."""
coloredlogs.install(level=loglevel)
LOG.info("Running scout version %s", __version__)
LOG.debug("Debug logging enabled.")
mongo_config = {}
... | [
"scout",
":",
"manage",
"interactions",
"with",
"a",
"scout",
"instance",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scripts/update_variant_panels.py#L43-L130 | [
"def",
"update_panels",
"(",
"context",
",",
"mongodb",
",",
"username",
",",
"password",
",",
"authdb",
",",
"host",
",",
"port",
",",
"loglevel",
",",
"config",
")",
":",
"coloredlogs",
".",
"install",
"(",
"level",
"=",
"loglevel",
")",
"LOG",
".",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | cases | 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 cases, how many there are and the limit. | scout/server/blueprints/cases/controllers.py | 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 ... | 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 ... | [
"Preprocess",
"case",
"objects",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L39-L70 | [
"def",
"cases",
"(",
"store",
",",
"case_query",
",",
"limit",
"=",
"100",
")",
":",
"case_groups",
"=",
"{",
"status",
":",
"[",
"]",
"for",
"status",
"in",
"CASE_STATUSES",
"}",
"for",
"case_obj",
"in",
"case_query",
".",
"limit",
"(",
"limit",
")",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | case | Preprocess a single case.
Prepare the case to be displayed in the case view.
Args:
store(adapter.MongoAdapter)
institute_obj(models.Institute)
case_obj(models.Case)
Returns:
data(dict): includes the cases, how many there are and the limit. | scout/server/blueprints/cases/controllers.py | def case(store, institute_obj, case_obj):
"""Preprocess a single case.
Prepare the case to be displayed in the case view.
Args:
store(adapter.MongoAdapter)
institute_obj(models.Institute)
case_obj(models.Case)
Returns:
data(dict): includes the cases, how many there are... | def case(store, institute_obj, case_obj):
"""Preprocess a single case.
Prepare the case to be displayed in the case view.
Args:
store(adapter.MongoAdapter)
institute_obj(models.Institute)
case_obj(models.Case)
Returns:
data(dict): includes the cases, how many there are... | [
"Preprocess",
"a",
"single",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L73-L164 | [
"def",
"case",
"(",
"store",
",",
"institute_obj",
",",
"case_obj",
")",
":",
"# Convert individual information to more readable format",
"case_obj",
"[",
"'individual_ids'",
"]",
"=",
"[",
"]",
"for",
"individual",
"in",
"case_obj",
"[",
"'individuals'",
"]",
":",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | case_report_content | Gather contents to be visualized in a case report
Args:
store(adapter.MongoAdapter)
institute_obj(models.Institute)
case_obj(models.Case)
Returns:
data(dict) | scout/server/blueprints/cases/controllers.py | 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... | 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... | [
"Gather",
"contents",
"to",
"be",
"visualized",
"in",
"a",
"case",
"report"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L167-L258 | [
"def",
"case_report_content",
"(",
"store",
",",
"institute_obj",
",",
"case_obj",
")",
":",
"variant_types",
"=",
"{",
"'causatives_detailed'",
":",
"'causatives'",
",",
"'suspects_detailed'",
":",
"'suspects'",
",",
"'classified_detailed'",
":",
"'acmg_classification'... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | coverage_report_contents | 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(str): base url of server
Returns:
coverage_data(str): string rend... | scout/server/blueprints/cases/controllers.py | 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... | 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... | [
"Posts",
"a",
"request",
"to",
"chanjo",
"-",
"report",
"and",
"capture",
"the",
"body",
"of",
"the",
"returned",
"response",
"to",
"include",
"it",
"in",
"case",
"report"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L261-L306 | [
"def",
"coverage_report_contents",
"(",
"store",
",",
"institute_obj",
",",
"case_obj",
",",
"base_url",
")",
":",
"request_data",
"=",
"{",
"}",
"# extract sample ids from case_obj and add them to the post request object:",
"request_data",
"[",
"'sample_id'",
"]",
"=",
"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | clinvar_submissions | Get all Clinvar submissions for a user and an institute | scout/server/blueprints/cases/controllers.py | 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 | 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 | [
"Get",
"all",
"Clinvar",
"submissions",
"for",
"a",
"user",
"and",
"an",
"institute"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L309-L312 | [
"def",
"clinvar_submissions",
"(",
"store",
",",
"user_id",
",",
"institute_id",
")",
":",
"submissions",
"=",
"list",
"(",
"store",
".",
"clinvar_submissions",
"(",
"user_id",
",",
"institute_id",
")",
")",
"return",
"submissions"
] | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | mt_excel_files | 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
Returns:
written_files(int): the number of files writt... | scout/server/blueprints/cases/controllers.py | 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... | 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... | [
"Collect",
"MT",
"variants",
"and",
"format",
"line",
"of",
"a",
"MT",
"variant",
"report",
"to",
"be",
"exported",
"in",
"excel",
"format"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L329-L372 | [
"def",
"mt_excel_files",
"(",
"store",
",",
"case_obj",
",",
"temp_excel_dir",
")",
":",
"today",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
".",
"strftime",
"(",
"'%Y-%m-%d'",
")",
"samples",
"=",
"case_obj",
".",
"get",
"(",
"'individuals'",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | update_synopsis | Update synopsis. | scout/server/blueprints/cases/controllers.py | 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[... | 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[... | [
"Update",
"synopsis",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L375-L382 | [
"def",
"update_synopsis",
"(",
"store",
",",
"institute_obj",
",",
"case_obj",
",",
"user_obj",
",",
"new_synopsis",
")",
":",
"# create event only if synopsis was actually changed",
"if",
"case_obj",
"[",
"'synopsis'",
"]",
"!=",
"new_synopsis",
":",
"link",
"=",
"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | hpo_diseases | 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 generator of dictionaries on the form
{
'p_value': floa... | scout/server/blueprints/cases/controllers.py | 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... | 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... | [
"Return",
"the",
"list",
"of",
"HGNC",
"symbols",
"that",
"match",
"annotated",
"HPO",
"terms",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L385-L410 | [
"def",
"hpo_diseases",
"(",
"username",
",",
"password",
",",
"hpo_ids",
",",
"p_value_treshold",
"=",
"1",
")",
":",
"# skip querying Phenomizer unless at least one HPO terms exists",
"try",
":",
"results",
"=",
"query_phenomizer",
".",
"query",
"(",
"username",
",",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | rerun | Request a rerun by email. | scout/server/blueprints/cases/controllers.py | def rerun(store, mail, current_user, institute_id, case_name, sender, recipient):
"""Request a rerun by email."""
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
user_obj = store.user(current_user.email)
link = url_for('cases.case', institute_id=institute_id, case_name=case_... | def rerun(store, mail, current_user, institute_id, case_name, sender, recipient):
"""Request a rerun by email."""
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
user_obj = store.user(current_user.email)
link = url_for('cases.case', institute_id=institute_id, case_name=case_... | [
"Request",
"a",
"rerun",
"by",
"email",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L413-L434 | [
"def",
"rerun",
"(",
"store",
",",
"mail",
",",
"current_user",
",",
"institute_id",
",",
"case_name",
",",
"sender",
",",
"recipient",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | update_default_panels | Update default panels for a case. | scout/server/blueprints/cases/controllers.py | def update_default_panels(store, current_user, institute_id, case_name, panel_ids):
"""Update default panels 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('cases.case', institute_id=institute_id, case_... | def update_default_panels(store, current_user, institute_id, case_name, panel_ids):
"""Update default panels 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('cases.case', institute_id=institute_id, case_... | [
"Update",
"default",
"panels",
"for",
"a",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L437-L443 | [
"def",
"update_default_panels",
"(",
"store",
",",
"current_user",
",",
"institute_id",
",",
"case_name",
",",
"panel_ids",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"user_obj",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.