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 | vcf2cytosure | vcf2cytosure CGH file for inidividual. | scout/server/blueprints/cases/controllers.py | def vcf2cytosure(store, institute_id, case_name, individual_id):
"""vcf2cytosure CGH file for inidividual."""
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
for individual in case_obj['individuals']:
if individual['individual_id'] == individual_id:
individu... | def vcf2cytosure(store, institute_id, case_name, individual_id):
"""vcf2cytosure CGH file for inidividual."""
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
for individual in case_obj['individuals']:
if individual['individual_id'] == individual_id:
individu... | [
"vcf2cytosure",
"CGH",
"file",
"for",
"inidividual",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L446-L454 | [
"def",
"vcf2cytosure",
"(",
"store",
",",
"institute_id",
",",
"case_name",
",",
"individual_id",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"for",
"individual",
"in",
"case_ob... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | gene_variants | Pre-process list of variants. | scout/server/blueprints/cases/controllers.py | def gene_variants(store, variants_query, page=1, per_page=50):
"""Pre-process list of variants."""
variant_count = variants_query.count()
skip_count = per_page * max(page - 1, 0)
more_variants = True if variant_count > (skip_count + per_page) else False
variant_res = variants_query.skip(skip_count).... | def gene_variants(store, variants_query, page=1, per_page=50):
"""Pre-process list of variants."""
variant_count = variants_query.count()
skip_count = per_page * max(page - 1, 0)
more_variants = True if variant_count > (skip_count + per_page) else False
variant_res = variants_query.skip(skip_count).... | [
"Pre",
"-",
"process",
"list",
"of",
"variants",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L456-L542 | [
"def",
"gene_variants",
"(",
"store",
",",
"variants_query",
",",
"page",
"=",
"1",
",",
"per_page",
"=",
"50",
")",
":",
"variant_count",
"=",
"variants_query",
".",
"count",
"(",
")",
"skip_count",
"=",
"per_page",
"*",
"max",
"(",
"page",
"-",
"1",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | multiqc | Find MultiQC report for the case. | scout/server/blueprints/cases/controllers.py | def multiqc(store, institute_id, case_name):
"""Find MultiQC report for the case."""
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
return dict(
institute=institute_obj,
case=case_obj,
) | def multiqc(store, institute_id, case_name):
"""Find MultiQC report for the case."""
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
return dict(
institute=institute_obj,
case=case_obj,
) | [
"Find",
"MultiQC",
"report",
"for",
"the",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L544-L550 | [
"def",
"multiqc",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
":",
"institute_obj",
",",
"case_obj",
"=",
"institute_and_case",
"(",
"store",
",",
"institute_id",
",",
"case_name",
")",
"return",
"dict",
"(",
"institute",
"=",
"institute_obj",
",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | get_sanger_unevaluated | Get all variants for an institute having Sanger validations ordered but still not evaluated
Args:
store(scout.adapter.MongoAdapter)
institute_id(str)
Returns:
unevaluated: a list that looks like this: [ {'case1': [varID_1, varID_2, .., varID_n]}, {'case2' : [varID_1... | scout/server/blueprints/cases/controllers.py | def get_sanger_unevaluated(store, institute_id, user_id):
"""Get all variants for an institute having Sanger validations ordered but still not evaluated
Args:
store(scout.adapter.MongoAdapter)
institute_id(str)
Returns:
unevaluated: a list that looks like this: ... | def get_sanger_unevaluated(store, institute_id, user_id):
"""Get all variants for an institute having Sanger validations ordered but still not evaluated
Args:
store(scout.adapter.MongoAdapter)
institute_id(str)
Returns:
unevaluated: a list that looks like this: ... | [
"Get",
"all",
"variants",
"for",
"an",
"institute",
"having",
"Sanger",
"validations",
"ordered",
"but",
"still",
"not",
"evaluated"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L553-L608 | [
"def",
"get_sanger_unevaluated",
"(",
"store",
",",
"institute_id",
",",
"user_id",
")",
":",
"# Retrieve a list of ids for variants with Sanger ordered grouped by case from the 'event' collection",
"# This way is much faster than querying over all variants in all cases of an institute",
"sa... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | mme_add | Add a patient to MatchMaker server
Args:
store(adapter.MongoAdapter)
user_obj(dict) a scout user object (to be added as matchmaker contact)
case_obj(dict) a scout case object
add_gender(bool) if True case gender will be included in matchmaker
add_features(bool) if True HPO f... | scout/server/blueprints/cases/controllers.py | def mme_add(store, user_obj, case_obj, add_gender, add_features, add_disorders, genes_only,
mme_base_url, mme_accepts, mme_token):
"""Add a patient to MatchMaker server
Args:
store(adapter.MongoAdapter)
user_obj(dict) a scout user object (to be added as matchmaker contact)
case_obj(... | def mme_add(store, user_obj, case_obj, add_gender, add_features, add_disorders, genes_only,
mme_base_url, mme_accepts, mme_token):
"""Add a patient to MatchMaker server
Args:
store(adapter.MongoAdapter)
user_obj(dict) a scout user object (to be added as matchmaker contact)
case_obj(... | [
"Add",
"a",
"patient",
"to",
"MatchMaker",
"server"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L611-L692 | [
"def",
"mme_add",
"(",
"store",
",",
"user_obj",
",",
"case_obj",
",",
"add_gender",
",",
"add_features",
",",
"add_disorders",
",",
"genes_only",
",",
"mme_base_url",
",",
"mme_accepts",
",",
"mme_token",
")",
":",
"if",
"not",
"mme_base_url",
"or",
"not",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | mme_delete | Delete all affected samples for a case from MatchMaker
Args:
case_obj(dict) a scout case object
mme_base_url(str) base url of the MME server
mme_token(str) auth token of the MME server
Returns:
server_responses(list): a list of object of this type:
{
... | scout/server/blueprints/cases/controllers.py | def mme_delete(case_obj, mme_base_url, mme_token):
"""Delete all affected samples for a case from MatchMaker
Args:
case_obj(dict) a scout case object
mme_base_url(str) base url of the MME server
mme_token(str) auth token of the MME server
Returns:
server_responses(list): a... | def mme_delete(case_obj, mme_base_url, mme_token):
"""Delete all affected samples for a case from MatchMaker
Args:
case_obj(dict) a scout case object
mme_base_url(str) base url of the MME server
mme_token(str) auth token of the MME server
Returns:
server_responses(list): a... | [
"Delete",
"all",
"affected",
"samples",
"for",
"a",
"case",
"from",
"MatchMaker"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L695-L730 | [
"def",
"mme_delete",
"(",
"case_obj",
",",
"mme_base_url",
",",
"mme_token",
")",
":",
"server_responses",
"=",
"[",
"]",
"if",
"not",
"mme_base_url",
"or",
"not",
"mme_token",
":",
"return",
"'Please check that Matchmaker connection parameters are valid'",
"# for each ... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | mme_matches | Show Matchmaker submission data for a sample and eventual matches.
Args:
case_obj(dict): a scout case object
institute_obj(dict): an institute object
mme_base_url(str) base url of the MME server
mme_token(str) auth token of the MME server
Returns:
data(dict): data to di... | scout/server/blueprints/cases/controllers.py | def mme_matches(case_obj, institute_obj, mme_base_url, mme_token):
"""Show Matchmaker submission data for a sample and eventual matches.
Args:
case_obj(dict): a scout case object
institute_obj(dict): an institute object
mme_base_url(str) base url of the MME server
mme_token(str)... | def mme_matches(case_obj, institute_obj, mme_base_url, mme_token):
"""Show Matchmaker submission data for a sample and eventual matches.
Args:
case_obj(dict): a scout case object
institute_obj(dict): an institute object
mme_base_url(str) base url of the MME server
mme_token(str)... | [
"Show",
"Matchmaker",
"submission",
"data",
"for",
"a",
"sample",
"and",
"eventual",
"matches",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L733-L772 | [
"def",
"mme_matches",
"(",
"case_obj",
",",
"institute_obj",
",",
"mme_base_url",
",",
"mme_token",
")",
":",
"data",
"=",
"{",
"'institute'",
":",
"institute_obj",
",",
"'case'",
":",
"case_obj",
",",
"'server_errors'",
":",
"[",
"]",
"}",
"matches",
"=",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | mme_match | Initiate a MatchMaker match against either other Scout patients or external nodes
Args:
case_obj(dict): a scout case object already submitted to MME
match_type(str): 'internal' or 'external'
mme_base_url(str): base url of the MME server
mme_token(str): auth token of the MME server
... | scout/server/blueprints/cases/controllers.py | def mme_match(case_obj, match_type, mme_base_url, mme_token, nodes=None, mme_accepts=None):
"""Initiate a MatchMaker match against either other Scout patients or external nodes
Args:
case_obj(dict): a scout case object already submitted to MME
match_type(str): 'internal' or 'external'
m... | def mme_match(case_obj, match_type, mme_base_url, mme_token, nodes=None, mme_accepts=None):
"""Initiate a MatchMaker match against either other Scout patients or external nodes
Args:
case_obj(dict): a scout case object already submitted to MME
match_type(str): 'internal' or 'external'
m... | [
"Initiate",
"a",
"MatchMaker",
"match",
"against",
"either",
"other",
"Scout",
"patients",
"or",
"external",
"nodes"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/cases/controllers.py#L775-L827 | [
"def",
"mme_match",
"(",
"case_obj",
",",
"match_type",
",",
"mme_base_url",
",",
"mme_token",
",",
"nodes",
"=",
"None",
",",
"mme_accepts",
"=",
"None",
")",
":",
"query_patients",
"=",
"[",
"]",
"server_responses",
"=",
"[",
"]",
"url",
"=",
"None",
"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | build_variant | Build a variant object based on parsed information
Args:
variant(dict)
institute_id(str)
gene_to_panels(dict): A dictionary with
{<hgnc_id>: {
'panel_names': [<panel_name>, ..],
'disease_associated_transcripts': [<trans... | scout/build/variant/variant.py | def build_variant(variant, institute_id, gene_to_panels = None,
hgncid_to_gene=None, sample_info=None):
"""Build a variant object based on parsed information
Args:
variant(dict)
institute_id(str)
gene_to_panels(dict): A dictionary with
{... | def build_variant(variant, institute_id, gene_to_panels = None,
hgncid_to_gene=None, sample_info=None):
"""Build a variant object based on parsed information
Args:
variant(dict)
institute_id(str)
gene_to_panels(dict): A dictionary with
{... | [
"Build",
"a",
"variant",
"object",
"based",
"on",
"parsed",
"information"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/build/variant/variant.py#L8-L383 | [
"def",
"build_variant",
"(",
"variant",
",",
"institute_id",
",",
"gene_to_panels",
"=",
"None",
",",
"hgncid_to_gene",
"=",
"None",
",",
"sample_info",
"=",
"None",
")",
":",
"gene_to_panels",
"=",
"gene_to_panels",
"or",
"{",
"}",
"hgncid_to_gene",
"=",
"hgn... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | genes | Load the hgnc aliases to the mongo database. | scout/commands/update/genes.py | def genes(context, build, api_key):
"""
Load the hgnc aliases to the mongo database.
"""
LOG.info("Running scout update genes")
adapter = context.obj['adapter']
# Fetch the omim information
api_key = api_key or context.obj.get('omim_api_key')
if not api_key:
LOG.warning("Please ... | def genes(context, build, api_key):
"""
Load the hgnc aliases to the mongo database.
"""
LOG.info("Running scout update genes")
adapter = context.obj['adapter']
# Fetch the omim information
api_key = api_key or context.obj.get('omim_api_key')
if not api_key:
LOG.warning("Please ... | [
"Load",
"the",
"hgnc",
"aliases",
"to",
"the",
"mongo",
"database",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/commands/update/genes.py#L42-L106 | [
"def",
"genes",
"(",
"context",
",",
"build",
",",
"api_key",
")",
":",
"LOG",
".",
"info",
"(",
"\"Running scout update genes\"",
")",
"adapter",
"=",
"context",
".",
"obj",
"[",
"'adapter'",
"]",
"# Fetch the omim information",
"api_key",
"=",
"api_key",
"or... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_callers | Parse how the different variant callers have performed
Args:
variant (cyvcf2.Variant): A variant object
Returns:
callers (dict): A dictionary on the format
{'gatk': <filter>,'freebayes': <filter>,'samtools': <filter>} | scout/parse/variant/callers.py | def parse_callers(variant, category='snv'):
"""Parse how the different variant callers have performed
Args:
variant (cyvcf2.Variant): A variant object
Returns:
callers (dict): A dictionary on the format
{'gatk': <filter>,'freebayes': <filter>,'samtools': <filter... | def parse_callers(variant, category='snv'):
"""Parse how the different variant callers have performed
Args:
variant (cyvcf2.Variant): A variant object
Returns:
callers (dict): A dictionary on the format
{'gatk': <filter>,'freebayes': <filter>,'samtools': <filter... | [
"Parse",
"how",
"the",
"different",
"variant",
"callers",
"have",
"performed"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/callers.py#L4-L40 | [
"def",
"parse_callers",
"(",
"variant",
",",
"category",
"=",
"'snv'",
")",
":",
"relevant_callers",
"=",
"CALLERS",
"[",
"category",
"]",
"callers",
"=",
"{",
"caller",
"[",
"'id'",
"]",
":",
"None",
"for",
"caller",
"in",
"relevant_callers",
"}",
"raw_in... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_header_format | Get the format from a vcf header line description
If format begins with white space it will be stripped
Args:
description(str): Description from a vcf header line
Return:
format(str): The format information from description | scout/parse/variant/headers.py | def parse_header_format(description):
"""Get the format from a vcf header line description
If format begins with white space it will be stripped
Args:
description(str): Description from a vcf header line
Return:
format(str): The format information from description
"""
... | def parse_header_format(description):
"""Get the format from a vcf header line description
If format begins with white space it will be stripped
Args:
description(str): Description from a vcf header line
Return:
format(str): The format information from description
"""
... | [
"Get",
"the",
"format",
"from",
"a",
"vcf",
"header",
"line",
"description",
"If",
"format",
"begins",
"with",
"white",
"space",
"it",
"will",
"be",
"stripped",
"Args",
":",
"description",
"(",
"str",
")",
":",
"Description",
"from",
"a",
"vcf",
"header",
... | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/headers.py#L24-L38 | [
"def",
"parse_header_format",
"(",
"description",
")",
":",
"description",
"=",
"description",
".",
"strip",
"(",
"'\"'",
")",
"keyword",
"=",
"'Format:'",
"before_keyword",
",",
"keyword",
",",
"after_keyword",
"=",
"description",
".",
"partition",
"(",
"keywor... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_vep_header | Return a list with the VEP header
The vep header is collected from CSQ in the vcf file
All keys are capitalized
Args:
vcf_obj(cyvcf2.VCF)
Returns:
vep_header(list) | scout/parse/variant/headers.py | def parse_vep_header(vcf_obj):
"""Return a list with the VEP header
The vep header is collected from CSQ in the vcf file
All keys are capitalized
Args:
vcf_obj(cyvcf2.VCF)
Returns:
vep_header(list)
"""
vep_header = []
if 'CSQ' in vcf_obj:
# Thi... | def parse_vep_header(vcf_obj):
"""Return a list with the VEP header
The vep header is collected from CSQ in the vcf file
All keys are capitalized
Args:
vcf_obj(cyvcf2.VCF)
Returns:
vep_header(list)
"""
vep_header = []
if 'CSQ' in vcf_obj:
# Thi... | [
"Return",
"a",
"list",
"with",
"the",
"VEP",
"header",
"The",
"vep",
"header",
"is",
"collected",
"from",
"CSQ",
"in",
"the",
"vcf",
"file",
"All",
"keys",
"are",
"capitalized",
"Args",
":",
"vcf_obj",
"(",
"cyvcf2",
".",
"VCF",
")",
"Returns",
":",
"v... | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/headers.py#L40-L60 | [
"def",
"parse_vep_header",
"(",
"vcf_obj",
")",
":",
"vep_header",
"=",
"[",
"]",
"if",
"'CSQ'",
"in",
"vcf_obj",
":",
"# This is a dictionary",
"csq_info",
"=",
"vcf_obj",
"[",
"'CSQ'",
"]",
"format_info",
"=",
"parse_header_format",
"(",
"csq_info",
"[",
"'D... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | build_transcript | Build a hgnc_transcript object
Args:
transcript_info(dict): Transcript information
Returns:
transcript_obj(HgncTranscript)
{
transcript_id: str, required
hgnc_id: int, required
build: str, required
refs... | scout/build/genes/transcript.py | def build_transcript(transcript_info, build='37'):
"""Build a hgnc_transcript object
Args:
transcript_info(dict): Transcript information
Returns:
transcript_obj(HgncTranscript)
{
transcript_id: str, required
hgnc_id: int, required... | def build_transcript(transcript_info, build='37'):
"""Build a hgnc_transcript object
Args:
transcript_info(dict): Transcript information
Returns:
transcript_obj(HgncTranscript)
{
transcript_id: str, required
hgnc_id: int, required... | [
"Build",
"a",
"hgnc_transcript",
"object"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/build/genes/transcript.py#L3-L75 | [
"def",
"build_transcript",
"(",
"transcript_info",
",",
"build",
"=",
"'37'",
")",
":",
"try",
":",
"transcript_id",
"=",
"transcript_info",
"[",
"'ensembl_transcript_id'",
"]",
"except",
"KeyError",
":",
"raise",
"KeyError",
"(",
"\"Transcript has to have ensembl id\... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | load_institute | Load a institute into the database
Args:
adapter(MongoAdapter)
internal_id(str)
display_name(str)
sanger_recipients(list(email)) | scout/load/institute.py | def load_institute(adapter, internal_id, display_name, sanger_recipients=None):
"""Load a institute into the database
Args:
adapter(MongoAdapter)
internal_id(str)
display_name(str)
sanger_recipients(list(email))
"""
institute_obj = build_institute(
... | def load_institute(adapter, internal_id, display_name, sanger_recipients=None):
"""Load a institute into the database
Args:
adapter(MongoAdapter)
internal_id(str)
display_name(str)
sanger_recipients(list(email))
"""
institute_obj = build_institute(
... | [
"Load",
"a",
"institute",
"into",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/load/institute.py#L7-L25 | [
"def",
"load_institute",
"(",
"adapter",
",",
"internal_id",
",",
"display_name",
",",
"sanger_recipients",
"=",
"None",
")",
":",
"institute_obj",
"=",
"build_institute",
"(",
"internal_id",
"=",
"internal_id",
",",
"display_name",
"=",
"display_name",
",",
"sang... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_cadd | Check if the cadd phred score is annotated | scout/parse/variant/deleteriousness.py | def parse_cadd(variant, transcripts):
"""Check if the cadd phred score is annotated"""
cadd = 0
cadd_keys = ['CADD', 'CADD_PHRED']
for key in cadd_keys:
cadd = variant.INFO.get(key, 0)
if cadd:
return float(cadd)
for transcript in transcripts:
cadd_entry = tr... | def parse_cadd(variant, transcripts):
"""Check if the cadd phred score is annotated"""
cadd = 0
cadd_keys = ['CADD', 'CADD_PHRED']
for key in cadd_keys:
cadd = variant.INFO.get(key, 0)
if cadd:
return float(cadd)
for transcript in transcripts:
cadd_entry = tr... | [
"Check",
"if",
"the",
"cadd",
"phred",
"score",
"is",
"annotated"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/deleteriousness.py#L2-L16 | [
"def",
"parse_cadd",
"(",
"variant",
",",
"transcripts",
")",
":",
"cadd",
"=",
"0",
"cadd_keys",
"=",
"[",
"'CADD'",
",",
"'CADD_PHRED'",
"]",
"for",
"key",
"in",
"cadd_keys",
":",
"cadd",
"=",
"variant",
".",
"INFO",
".",
"get",
"(",
"key",
",",
"0... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | case | Load a case into the database.
A case can be loaded without specifying vcf files and/or bam files | scout/commands/load/case.py | def case(context, vcf, vcf_sv, vcf_cancer, vcf_str, owner, ped, update, config,
no_variants, peddy_ped, peddy_sex, peddy_check):
"""Load a case into the database.
A case can be loaded without specifying vcf files and/or bam files
"""
adapter = context.obj['adapter']
if config is None and ... | def case(context, vcf, vcf_sv, vcf_cancer, vcf_str, owner, ped, update, config,
no_variants, peddy_ped, peddy_sex, peddy_check):
"""Load a case into the database.
A case can be loaded without specifying vcf files and/or bam files
"""
adapter = context.obj['adapter']
if config is None and ... | [
"Load",
"a",
"case",
"into",
"the",
"database",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/commands/load/case.py#L63-L103 | [
"def",
"case",
"(",
"context",
",",
"vcf",
",",
"vcf_sv",
",",
"vcf_cancer",
",",
"vcf_str",
",",
"owner",
",",
"ped",
",",
"update",
",",
"config",
",",
"no_variants",
",",
"peddy_ped",
",",
"peddy_sex",
",",
"peddy_check",
")",
":",
"adapter",
"=",
"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantLoader.update_variant | Update one variant document in the database.
This means that the variant in the database will be replaced by variant_obj.
Args:
variant_obj(dict)
Returns:
new_variant(dict) | scout/adapter/mongo/variant_loader.py | def update_variant(self, variant_obj):
"""Update one variant document in the database.
This means that the variant in the database will be replaced by variant_obj.
Args:
variant_obj(dict)
Returns:
new_variant(dict)
"""
LOG.debug('Updating varian... | def update_variant(self, variant_obj):
"""Update one variant document in the database.
This means that the variant in the database will be replaced by variant_obj.
Args:
variant_obj(dict)
Returns:
new_variant(dict)
"""
LOG.debug('Updating varian... | [
"Update",
"one",
"variant",
"document",
"in",
"the",
"database",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_loader.py#L37-L55 | [
"def",
"update_variant",
"(",
"self",
",",
"variant_obj",
")",
":",
"LOG",
".",
"debug",
"(",
"'Updating variant %s'",
",",
"variant_obj",
".",
"get",
"(",
"'simple_id'",
")",
")",
"new_variant",
"=",
"self",
".",
"variant_collection",
".",
"find_one_and_replace... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantLoader.update_variant_rank | Updates the manual rank for all variants in a case
Add a variant rank based on the rank score
Whenever variants are added or removed from a case we need to update the variant rank
Args:
case_obj(Case)
variant_type(str) | scout/adapter/mongo/variant_loader.py | def update_variant_rank(self, case_obj, variant_type='clinical', category='snv'):
"""Updates the manual rank for all variants in a case
Add a variant rank based on the rank score
Whenever variants are added or removed from a case we need to update the variant rank
Args:
cas... | def update_variant_rank(self, case_obj, variant_type='clinical', category='snv'):
"""Updates the manual rank for all variants in a case
Add a variant rank based on the rank score
Whenever variants are added or removed from a case we need to update the variant rank
Args:
cas... | [
"Updates",
"the",
"manual",
"rank",
"for",
"all",
"variants",
"in",
"a",
"case"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_loader.py#L57-L103 | [
"def",
"update_variant_rank",
"(",
"self",
",",
"case_obj",
",",
"variant_type",
"=",
"'clinical'",
",",
"category",
"=",
"'snv'",
")",
":",
"# Get all variants sorted by rank score",
"variants",
"=",
"self",
".",
"variant_collection",
".",
"find",
"(",
"{",
"'cas... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantLoader.update_variant_compounds | Update compounds for a variant.
This will add all the necessary information of a variant on a compound object.
Args:
variant(scout.models.Variant)
variant_objs(dict): A dictionary with _ids as keys and variant objs as values.
Returns:
compound_objs(list(dic... | scout/adapter/mongo/variant_loader.py | def update_variant_compounds(self, variant, variant_objs = None):
"""Update compounds for a variant.
This will add all the necessary information of a variant on a compound object.
Args:
variant(scout.models.Variant)
variant_objs(dict): A dictionary with _ids as keys and... | def update_variant_compounds(self, variant, variant_objs = None):
"""Update compounds for a variant.
This will add all the necessary information of a variant on a compound object.
Args:
variant(scout.models.Variant)
variant_objs(dict): A dictionary with _ids as keys and... | [
"Update",
"compounds",
"for",
"a",
"variant",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_loader.py#L105-L144 | [
"def",
"update_variant_compounds",
"(",
"self",
",",
"variant",
",",
"variant_objs",
"=",
"None",
")",
":",
"compound_objs",
"=",
"[",
"]",
"for",
"compound",
"in",
"variant",
".",
"get",
"(",
"'compounds'",
",",
"[",
"]",
")",
":",
"not_loaded",
"=",
"T... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantLoader.update_compounds | Update the compounds for a set of variants.
Args:
variants(dict): A dictionary with _ids as keys and variant objs as values | scout/adapter/mongo/variant_loader.py | def update_compounds(self, variants):
"""Update the compounds for a set of variants.
Args:
variants(dict): A dictionary with _ids as keys and variant objs as values
"""
LOG.debug("Updating compound objects")
for var_id in variants:
variant_obj = variant... | def update_compounds(self, variants):
"""Update the compounds for a set of variants.
Args:
variants(dict): A dictionary with _ids as keys and variant objs as values
"""
LOG.debug("Updating compound objects")
for var_id in variants:
variant_obj = variant... | [
"Update",
"the",
"compounds",
"for",
"a",
"set",
"of",
"variants",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_loader.py#L146-L165 | [
"def",
"update_compounds",
"(",
"self",
",",
"variants",
")",
":",
"LOG",
".",
"debug",
"(",
"\"Updating compound objects\"",
")",
"for",
"var_id",
"in",
"variants",
":",
"variant_obj",
"=",
"variants",
"[",
"var_id",
"]",
"if",
"not",
"variant_obj",
".",
"g... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantLoader.update_mongo_compound_variants | Update the compound information for a bulk of variants in the database
Args:
bulk(dict): {'_id': scout.models.Variant} | scout/adapter/mongo/variant_loader.py | def update_mongo_compound_variants(self, bulk):
"""Update the compound information for a bulk of variants in the database
Args:
bulk(dict): {'_id': scout.models.Variant}
"""
requests = []
for var_id in bulk:
var_obj = bulk[var_id]
if ... | def update_mongo_compound_variants(self, bulk):
"""Update the compound information for a bulk of variants in the database
Args:
bulk(dict): {'_id': scout.models.Variant}
"""
requests = []
for var_id in bulk:
var_obj = bulk[var_id]
if ... | [
"Update",
"the",
"compound",
"information",
"for",
"a",
"bulk",
"of",
"variants",
"in",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_loader.py#L167-L196 | [
"def",
"update_mongo_compound_variants",
"(",
"self",
",",
"bulk",
")",
":",
"requests",
"=",
"[",
"]",
"for",
"var_id",
"in",
"bulk",
":",
"var_obj",
"=",
"bulk",
"[",
"var_id",
"]",
"if",
"not",
"var_obj",
".",
"get",
"(",
"'compounds'",
")",
":",
"c... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantLoader.update_case_compounds | Update the compounds for a case
Loop over all coding intervals to get coordinates for all potential compound positions.
Update all variants within a gene with a bulk operation. | scout/adapter/mongo/variant_loader.py | def update_case_compounds(self, case_obj, build='37'):
"""Update the compounds for a case
Loop over all coding intervals to get coordinates for all potential compound positions.
Update all variants within a gene with a bulk operation.
"""
case_id = case_obj['_id']
# Pos... | def update_case_compounds(self, case_obj, build='37'):
"""Update the compounds for a case
Loop over all coding intervals to get coordinates for all potential compound positions.
Update all variants within a gene with a bulk operation.
"""
case_id = case_obj['_id']
# Pos... | [
"Update",
"the",
"compounds",
"for",
"a",
"case"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_loader.py#L198-L288 | [
"def",
"update_case_compounds",
"(",
"self",
",",
"case_obj",
",",
"build",
"=",
"'37'",
")",
":",
"case_id",
"=",
"case_obj",
"[",
"'_id'",
"]",
"# Possible categories 'snv', 'sv', 'str', 'cancer':",
"categories",
"=",
"set",
"(",
")",
"# Possible variant types 'clin... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantLoader.load_variant | Load a variant object
Args:
variant_obj(dict)
Returns:
inserted_id | scout/adapter/mongo/variant_loader.py | def load_variant(self, variant_obj):
"""Load a variant object
Args:
variant_obj(dict)
Returns:
inserted_id
"""
# LOG.debug("Loading variant %s", variant_obj['_id'])
try:
result = self.variant_collection.insert_one(variant_obj)
... | def load_variant(self, variant_obj):
"""Load a variant object
Args:
variant_obj(dict)
Returns:
inserted_id
"""
# LOG.debug("Loading variant %s", variant_obj['_id'])
try:
result = self.variant_collection.insert_one(variant_obj)
... | [
"Load",
"a",
"variant",
"object"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_loader.py#L290-L304 | [
"def",
"load_variant",
"(",
"self",
",",
"variant_obj",
")",
":",
"# LOG.debug(\"Loading variant %s\", variant_obj['_id'])",
"try",
":",
"result",
"=",
"self",
".",
"variant_collection",
".",
"insert_one",
"(",
"variant_obj",
")",
"except",
"DuplicateKeyError",
"as",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantLoader.upsert_variant | Load a variant object, if the object already exists update compounds.
Args:
variant_obj(dict)
Returns:
result | scout/adapter/mongo/variant_loader.py | def upsert_variant(self, variant_obj):
"""Load a variant object, if the object already exists update compounds.
Args:
variant_obj(dict)
Returns:
result
"""
LOG.debug("Upserting variant %s", variant_obj['_id'])
try:
result = self.varia... | def upsert_variant(self, variant_obj):
"""Load a variant object, if the object already exists update compounds.
Args:
variant_obj(dict)
Returns:
result
"""
LOG.debug("Upserting variant %s", variant_obj['_id'])
try:
result = self.varia... | [
"Load",
"a",
"variant",
"object",
"if",
"the",
"object",
"already",
"exists",
"update",
"compounds",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_loader.py#L306-L329 | [
"def",
"upsert_variant",
"(",
"self",
",",
"variant_obj",
")",
":",
"LOG",
".",
"debug",
"(",
"\"Upserting variant %s\"",
",",
"variant_obj",
"[",
"'_id'",
"]",
")",
"try",
":",
"result",
"=",
"self",
".",
"variant_collection",
".",
"insert_one",
"(",
"varia... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantLoader.load_variant_bulk | Load a bulk of variants
Args:
variants(iterable(scout.models.Variant))
Returns:
object_ids | scout/adapter/mongo/variant_loader.py | def load_variant_bulk(self, variants):
"""Load a bulk of variants
Args:
variants(iterable(scout.models.Variant))
Returns:
object_ids
"""
if not len(variants) > 0:
return
LOG.debug("Loading variant bulk")
try:
resu... | def load_variant_bulk(self, variants):
"""Load a bulk of variants
Args:
variants(iterable(scout.models.Variant))
Returns:
object_ids
"""
if not len(variants) > 0:
return
LOG.debug("Loading variant bulk")
try:
resu... | [
"Load",
"a",
"bulk",
"of",
"variants"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_loader.py#L331-L355 | [
"def",
"load_variant_bulk",
"(",
"self",
",",
"variants",
")",
":",
"if",
"not",
"len",
"(",
"variants",
")",
">",
"0",
":",
"return",
"LOG",
".",
"debug",
"(",
"\"Loading variant bulk\"",
")",
"try",
":",
"result",
"=",
"self",
".",
"variant_collection",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantLoader._load_variants | Perform the loading of variants
This is the function that loops over the variants, parse them and build the variant
objects so they are ready to be inserted into the database. | scout/adapter/mongo/variant_loader.py | def _load_variants(self, variants, variant_type, case_obj, individual_positions, rank_threshold,
institute_id, build=None, rank_results_header=None, vep_header=None,
category='snv', sample_info = None):
"""Perform the loading of variants
This is the functio... | def _load_variants(self, variants, variant_type, case_obj, individual_positions, rank_threshold,
institute_id, build=None, rank_results_header=None, vep_header=None,
category='snv', sample_info = None):
"""Perform the loading of variants
This is the functio... | [
"Perform",
"the",
"loading",
"of",
"variants"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_loader.py#L357-L489 | [
"def",
"_load_variants",
"(",
"self",
",",
"variants",
",",
"variant_type",
",",
"case_obj",
",",
"individual_positions",
",",
"rank_threshold",
",",
"institute_id",
",",
"build",
"=",
"None",
",",
"rank_results_header",
"=",
"None",
",",
"vep_header",
"=",
"Non... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantLoader.load_variants | Load variants for a case into scout.
Load the variants for a specific analysis type and category into scout.
If no region is specified, load all variants above rank score threshold
If region or gene is specified, load all variants from that region
disregarding variant rank(if not specif... | scout/adapter/mongo/variant_loader.py | def load_variants(self, case_obj, variant_type='clinical', category='snv',
rank_threshold=None, chrom=None, start=None, end=None,
gene_obj=None, build='37'):
"""Load variants for a case into scout.
Load the variants for a specific analysis type and category i... | def load_variants(self, case_obj, variant_type='clinical', category='snv',
rank_threshold=None, chrom=None, start=None, end=None,
gene_obj=None, build='37'):
"""Load variants for a case into scout.
Load the variants for a specific analysis type and category i... | [
"Load",
"variants",
"for",
"a",
"case",
"into",
"scout",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_loader.py#L491-L609 | [
"def",
"load_variants",
"(",
"self",
",",
"case_obj",
",",
"variant_type",
"=",
"'clinical'",
",",
"category",
"=",
"'snv'",
",",
"rank_threshold",
"=",
"None",
",",
"chrom",
"=",
"None",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"gene_obj... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseEventHandler.assign | Assign a user to a case.
This function will create an Event to log that a person has been assigned
to a case. Also the user will be added to case "assignees".
Arguments:
institute (dict): A institute
case (dict): A case
user (dict): A User object
... | scout/adapter/mongo/case_events.py | def assign(self, institute, case, user, link):
"""Assign a user to a case.
This function will create an Event to log that a person has been assigned
to a case. Also the user will be added to case "assignees".
Arguments:
institute (dict): A institute
case (dict):... | def assign(self, institute, case, user, link):
"""Assign a user to a case.
This function will create an Event to log that a person has been assigned
to a case. Also the user will be added to case "assignees".
Arguments:
institute (dict): A institute
case (dict):... | [
"Assign",
"a",
"user",
"to",
"a",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case_events.py#L15-L50 | [
"def",
"assign",
"(",
"self",
",",
"institute",
",",
"case",
",",
"user",
",",
"link",
")",
":",
"LOG",
".",
"info",
"(",
"\"Creating event for assigning {0} to {1}\"",
".",
"format",
"(",
"user",
"[",
"'name'",
"]",
".",
"encode",
"(",
"'utf-8'",
")",
"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseEventHandler.share | Share a case with a new institute.
Arguments:
institute (dict): A Institute object
case (dict): Case object
collaborator_id (str): A instute id
user (dict): A User object
link (str): The url to be used in the event
Return:
updated... | scout/adapter/mongo/case_events.py | def share(self, institute, case, collaborator_id, user, link):
"""Share a case with a new institute.
Arguments:
institute (dict): A Institute object
case (dict): Case object
collaborator_id (str): A instute id
user (dict): A User object
link (... | def share(self, institute, case, collaborator_id, user, link):
"""Share a case with a new institute.
Arguments:
institute (dict): A Institute object
case (dict): Case object
collaborator_id (str): A instute id
user (dict): A User object
link (... | [
"Share",
"a",
"case",
"with",
"a",
"new",
"institute",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case_events.py#L284-L318 | [
"def",
"share",
"(",
"self",
",",
"institute",
",",
"case",
",",
"collaborator_id",
",",
"user",
",",
"link",
")",
":",
"if",
"collaborator_id",
"in",
"case",
".",
"get",
"(",
"'collaborators'",
",",
"[",
"]",
")",
":",
"raise",
"ValueError",
"(",
"'ne... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseEventHandler.diagnose | Diagnose a case using OMIM ids.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str): The url to be used in the event
level (str): choices=('phenotype','gene')
Return:
upda... | scout/adapter/mongo/case_events.py | def diagnose(self, institute, case, user, link, level, omim_id, remove=False):
"""Diagnose a case using OMIM ids.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str): The url to be used in the eve... | def diagnose(self, institute, case, user, link, level, omim_id, remove=False):
"""Diagnose a case using OMIM ids.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str): The url to be used in the eve... | [
"Diagnose",
"a",
"case",
"using",
"OMIM",
"ids",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case_events.py#L357-L408 | [
"def",
"diagnose",
"(",
"self",
",",
"institute",
",",
"case",
",",
"user",
",",
"link",
",",
"level",
",",
"omim_id",
",",
"remove",
"=",
"False",
")",
":",
"if",
"level",
"==",
"'phenotype'",
":",
"case_key",
"=",
"'diagnosis_phenotypes'",
"elif",
"lev... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseEventHandler.mark_checked | Mark a case as checked from an analysis point of view.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str): The url to be used in the event
unmark (bool): If case should ve unmarked
R... | scout/adapter/mongo/case_events.py | def mark_checked(self, institute, case, user, link,
unmark=False):
"""Mark a case as checked from an analysis point of view.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str... | def mark_checked(self, institute, case, user, link,
unmark=False):
"""Mark a case as checked from an analysis point of view.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str... | [
"Mark",
"a",
"case",
"as",
"checked",
"from",
"an",
"analysis",
"point",
"of",
"view",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case_events.py#L482-L522 | [
"def",
"mark_checked",
"(",
"self",
",",
"institute",
",",
"case",
",",
"user",
",",
"link",
",",
"unmark",
"=",
"False",
")",
":",
"LOG",
".",
"info",
"(",
"\"Updating checked status of {}\"",
".",
"format",
"(",
"case",
"[",
"'display_name'",
"]",
")",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseEventHandler.update_default_panels | Update default panels for a case.
Arguments:
institute_obj (dict): A Institute object
case_obj (dict): Case object
user_obj (dict): A User object
link (str): The url to be used in the event
panel_objs (list(dict)): List of panel objs
Return:
... | scout/adapter/mongo/case_events.py | def update_default_panels(self, institute_obj, case_obj, user_obj, link, panel_objs):
"""Update default panels for a case.
Arguments:
institute_obj (dict): A Institute object
case_obj (dict): Case object
user_obj (dict): A User object
link (str): The url ... | def update_default_panels(self, institute_obj, case_obj, user_obj, link, panel_objs):
"""Update default panels for a case.
Arguments:
institute_obj (dict): A Institute object
case_obj (dict): Case object
user_obj (dict): A User object
link (str): The url ... | [
"Update",
"default",
"panels",
"for",
"a",
"case",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case_events.py#L525-L568 | [
"def",
"update_default_panels",
"(",
"self",
",",
"institute_obj",
",",
"case_obj",
",",
"user_obj",
",",
"link",
",",
"panel_objs",
")",
":",
"self",
".",
"create_event",
"(",
"institute",
"=",
"institute_obj",
",",
"case",
"=",
"case_obj",
",",
"user",
"="... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantEventHandler.order_verification | Create an event for a variant verification for a variant
and an event for a variant verification for a case
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str): The url to be used in the event
... | scout/adapter/mongo/variant_events.py | def order_verification(self, institute, case, user, link, variant):
"""Create an event for a variant verification for a variant
and an event for a variant verification for a case
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (d... | def order_verification(self, institute, case, user, link, variant):
"""Create an event for a variant verification for a variant
and an event for a variant verification for a case
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (d... | [
"Create",
"an",
"event",
"for",
"a",
"variant",
"verification",
"for",
"a",
"variant",
"and",
"an",
"event",
"for",
"a",
"variant",
"verification",
"for",
"a",
"case"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_events.py#L91-L138 | [
"def",
"order_verification",
"(",
"self",
",",
"institute",
",",
"case",
",",
"user",
",",
"link",
",",
"variant",
")",
":",
"LOG",
".",
"info",
"(",
"\"Creating event for ordering validation for variant\"",
"\" {0}\"",
".",
"format",
"(",
"variant",
"[",
"'disp... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantEventHandler.sanger_ordered | Get all variants with validations ever ordered.
Args:
institute_id(str) : The id of an institute
user_id(str) : The id of an user
Returns:
sanger_ordered(list) : a list of dictionaries, each with "case_id" as keys and list of variant ids as values | scout/adapter/mongo/variant_events.py | def sanger_ordered(self, institute_id=None, user_id=None):
"""Get all variants with validations ever ordered.
Args:
institute_id(str) : The id of an institute
user_id(str) : The id of an user
Returns:
sanger_ordered(list) : a list of dictionaries, each with ... | def sanger_ordered(self, institute_id=None, user_id=None):
"""Get all variants with validations ever ordered.
Args:
institute_id(str) : The id of an institute
user_id(str) : The id of an user
Returns:
sanger_ordered(list) : a list of dictionaries, each with ... | [
"Get",
"all",
"variants",
"with",
"validations",
"ever",
"ordered",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_events.py#L188-L219 | [
"def",
"sanger_ordered",
"(",
"self",
",",
"institute_id",
"=",
"None",
",",
"user_id",
"=",
"None",
")",
":",
"query",
"=",
"{",
"'$match'",
":",
"{",
"'$and'",
":",
"[",
"{",
"'verb'",
":",
"'sanger'",
"}",
",",
"]",
",",
"}",
"}",
"if",
"institu... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantEventHandler.validate | Mark validation status for a variant.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str): The url to be used in the event
variant (dict): A variant object
validate_type(str): The ... | scout/adapter/mongo/variant_events.py | def validate(self, institute, case, user, link, variant, validate_type):
"""Mark validation status for a variant.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str): The url to be used in the eve... | def validate(self, institute, case, user, link, variant, validate_type):
"""Mark validation status for a variant.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str): The url to be used in the eve... | [
"Mark",
"validation",
"status",
"for",
"a",
"variant",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_events.py#L221-L257 | [
"def",
"validate",
"(",
"self",
",",
"institute",
",",
"case",
",",
"user",
",",
"link",
",",
"variant",
",",
"validate_type",
")",
":",
"if",
"not",
"validate_type",
"in",
"SANGER_OPTIONS",
":",
"LOG",
".",
"warning",
"(",
"\"Invalid validation string: %s\"",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantEventHandler.mark_causative | Create an event for marking a variant causative.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str): The url to be used in the event
variant (variant): A variant object
Returns:
up... | scout/adapter/mongo/variant_events.py | def mark_causative(self, institute, case, user, link, variant):
"""Create an event for marking a variant causative.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str): The url to be used in the event
... | def mark_causative(self, institute, case, user, link, variant):
"""Create an event for marking a variant causative.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
link (str): The url to be used in the event
... | [
"Create",
"an",
"event",
"for",
"marking",
"a",
"variant",
"causative",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_events.py#L259-L318 | [
"def",
"mark_causative",
"(",
"self",
",",
"institute",
",",
"case",
",",
"user",
",",
"link",
",",
"variant",
")",
":",
"display_name",
"=",
"variant",
"[",
"'display_name'",
"]",
"LOG",
".",
"info",
"(",
"\"Mark variant {0} as causative in the case {1}\"",
"."... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantEventHandler.update_dismiss_variant | Create an event for updating the manual dismiss variant entry
This function will create a event and update the dismiss variant
field of the variant.
Arguments:
institute (dict): A Institute object
case (dict): Case object
user (dict): A User object
... | scout/adapter/mongo/variant_events.py | def update_dismiss_variant(self, institute, case, user, link, variant,
dismiss_variant):
"""Create an event for updating the manual dismiss variant entry
This function will create a event and update the dismiss variant
field of the variant.
Arguments:... | def update_dismiss_variant(self, institute, case, user, link, variant,
dismiss_variant):
"""Create an event for updating the manual dismiss variant entry
This function will create a event and update the dismiss variant
field of the variant.
Arguments:... | [
"Create",
"an",
"event",
"for",
"updating",
"the",
"manual",
"dismiss",
"variant",
"entry"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_events.py#L434-L482 | [
"def",
"update_dismiss_variant",
"(",
"self",
",",
"institute",
",",
"case",
",",
"user",
",",
"link",
",",
"variant",
",",
"dismiss_variant",
")",
":",
"LOG",
".",
"info",
"(",
"\"Creating event for updating dismiss variant for \"",
"\"variant {0}\"",
".",
"format"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | VariantEventHandler.update_acmg | Create an event for updating the ACMG classification of a variant.
Arguments:
institute_obj (dict): A Institute object
case_obj (dict): Case object
user_obj (dict): A User object
link (str): The url to be used in the event
variant_obj (dict): A varian... | scout/adapter/mongo/variant_events.py | def update_acmg(self, institute_obj, case_obj, user_obj, link, variant_obj, acmg_str):
"""Create an event for updating the ACMG classification of a variant.
Arguments:
institute_obj (dict): A Institute object
case_obj (dict): Case object
user_obj (dict): A User objec... | def update_acmg(self, institute_obj, case_obj, user_obj, link, variant_obj, acmg_str):
"""Create an event for updating the ACMG classification of a variant.
Arguments:
institute_obj (dict): A Institute object
case_obj (dict): Case object
user_obj (dict): A User objec... | [
"Create",
"an",
"event",
"for",
"updating",
"the",
"ACMG",
"classification",
"of",
"a",
"variant",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/variant_events.py#L532-L572 | [
"def",
"update_acmg",
"(",
"self",
",",
"institute_obj",
",",
"case_obj",
",",
"user_obj",
",",
"link",
",",
"variant_obj",
",",
"acmg_str",
")",
":",
"self",
".",
"create_event",
"(",
"institute",
"=",
"institute_obj",
",",
"case",
"=",
"case_obj",
",",
"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_ids | Construct the necessary ids for a variant
Args:
chrom(str): Variant chromosome
pos(int): Variant position
ref(str): Variant reference
alt(str): Variant alternative
case_id(str): Unique case id
variant_type(str): 'clinical' or 'research'
Returns:
ids(dict... | scout/parse/variant/ids.py | def parse_ids(chrom, pos, ref, alt, case_id, variant_type):
"""Construct the necessary ids for a variant
Args:
chrom(str): Variant chromosome
pos(int): Variant position
ref(str): Variant reference
alt(str): Variant alternative
case_id(str): Unique case id
variant... | def parse_ids(chrom, pos, ref, alt, case_id, variant_type):
"""Construct the necessary ids for a variant
Args:
chrom(str): Variant chromosome
pos(int): Variant position
ref(str): Variant reference
alt(str): Variant alternative
case_id(str): Unique case id
variant... | [
"Construct",
"the",
"necessary",
"ids",
"for",
"a",
"variant"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/ids.py#L3-L25 | [
"def",
"parse_ids",
"(",
"chrom",
",",
"pos",
",",
"ref",
",",
"alt",
",",
"case_id",
",",
"variant_type",
")",
":",
"ids",
"=",
"{",
"}",
"pos",
"=",
"str",
"(",
"pos",
")",
"ids",
"[",
"'simple_id'",
"]",
"=",
"parse_simple_id",
"(",
"chrom",
","... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_simple_id | Parse the simple id for a variant
Simple id is used as a human readable reference for a position, it is
in no way unique.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
Returns:
simple_id(str): The simple human readable variant id | scout/parse/variant/ids.py | def parse_simple_id(chrom, pos, ref, alt):
"""Parse the simple id for a variant
Simple id is used as a human readable reference for a position, it is
in no way unique.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
Returns:
simple_id(str): The simple human rea... | def parse_simple_id(chrom, pos, ref, alt):
"""Parse the simple id for a variant
Simple id is used as a human readable reference for a position, it is
in no way unique.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
Returns:
simple_id(str): The simple human rea... | [
"Parse",
"the",
"simple",
"id",
"for",
"a",
"variant"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/ids.py#L27-L42 | [
"def",
"parse_simple_id",
"(",
"chrom",
",",
"pos",
",",
"ref",
",",
"alt",
")",
":",
"return",
"'_'",
".",
"join",
"(",
"[",
"chrom",
",",
"pos",
",",
"ref",
",",
"alt",
"]",
")"
] | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_variant_id | Parse the variant id for a variant
variant_id is used to identify variants within a certain type of
analysis. It is not human readable since it is a md5 key.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
variant_type(str): 'clinical' or 'research'
Returns:
... | scout/parse/variant/ids.py | def parse_variant_id(chrom, pos, ref, alt, variant_type):
"""Parse the variant id for a variant
variant_id is used to identify variants within a certain type of
analysis. It is not human readable since it is a md5 key.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
... | def parse_variant_id(chrom, pos, ref, alt, variant_type):
"""Parse the variant id for a variant
variant_id is used to identify variants within a certain type of
analysis. It is not human readable since it is a md5 key.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
... | [
"Parse",
"the",
"variant",
"id",
"for",
"a",
"variant"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/ids.py#L44-L60 | [
"def",
"parse_variant_id",
"(",
"chrom",
",",
"pos",
",",
"ref",
",",
"alt",
",",
"variant_type",
")",
":",
"return",
"generate_md5_key",
"(",
"[",
"chrom",
",",
"pos",
",",
"ref",
",",
"alt",
",",
"variant_type",
"]",
")"
] | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_display_name | Parse the variant id for a variant
This is used to display the variant in scout.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
variant_type(str): 'clinical' or 'research'
Returns:
variant_id(str): The variant id in human readable format | scout/parse/variant/ids.py | def parse_display_name(chrom, pos, ref, alt, variant_type):
"""Parse the variant id for a variant
This is used to display the variant in scout.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
variant_type(str): 'clinical' or 'research'
Returns:
variant_id(s... | def parse_display_name(chrom, pos, ref, alt, variant_type):
"""Parse the variant id for a variant
This is used to display the variant in scout.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
variant_type(str): 'clinical' or 'research'
Returns:
variant_id(s... | [
"Parse",
"the",
"variant",
"id",
"for",
"a",
"variant"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/ids.py#L62-L77 | [
"def",
"parse_display_name",
"(",
"chrom",
",",
"pos",
",",
"ref",
",",
"alt",
",",
"variant_type",
")",
":",
"return",
"'_'",
".",
"join",
"(",
"[",
"chrom",
",",
"pos",
",",
"ref",
",",
"alt",
",",
"variant_type",
"]",
")"
] | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_document_id | Parse the unique document id for a variant.
This will always be unique in the database.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
variant_type(str): 'clinical' or 'research'
case_id(str): unqiue family id
Returns:
document_id(str): The unique docu... | scout/parse/variant/ids.py | def parse_document_id(chrom, pos, ref, alt, variant_type, case_id):
"""Parse the unique document id for a variant.
This will always be unique in the database.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
variant_type(str): 'clinical' or 'research'
case_id(str... | def parse_document_id(chrom, pos, ref, alt, variant_type, case_id):
"""Parse the unique document id for a variant.
This will always be unique in the database.
Args:
chrom(str)
pos(str)
ref(str)
alt(str)
variant_type(str): 'clinical' or 'research'
case_id(str... | [
"Parse",
"the",
"unique",
"document",
"id",
"for",
"a",
"variant",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/ids.py#L79-L95 | [
"def",
"parse_document_id",
"(",
"chrom",
",",
"pos",
",",
"ref",
",",
"alt",
",",
"variant_type",
",",
"case_id",
")",
":",
"return",
"generate_md5_key",
"(",
"[",
"chrom",
",",
"pos",
",",
"ref",
",",
"alt",
",",
"variant_type",
",",
"case_id",
"]",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | convert | Convert a gene panel with hgnc symbols to a new one with hgnc ids. | scout/commands/convert.py | def convert(context, panel):
"""Convert a gene panel with hgnc symbols to a new one with hgnc ids."""
adapter = context.obj['adapter']
new_header = ["hgnc_id","hgnc_symbol","disease_associated_transcripts",
"reduced_penetrance", "genetic_disease_models", "mosaicism",
"datab... | def convert(context, panel):
"""Convert a gene panel with hgnc symbols to a new one with hgnc ids."""
adapter = context.obj['adapter']
new_header = ["hgnc_id","hgnc_symbol","disease_associated_transcripts",
"reduced_penetrance", "genetic_disease_models", "mosaicism",
"datab... | [
"Convert",
"a",
"gene",
"panel",
"with",
"hgnc",
"symbols",
"to",
"a",
"new",
"one",
"with",
"hgnc",
"ids",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/commands/convert.py#L15-L33 | [
"def",
"convert",
"(",
"context",
",",
"panel",
")",
":",
"adapter",
"=",
"context",
".",
"obj",
"[",
"'adapter'",
"]",
"new_header",
"=",
"[",
"\"hgnc_id\"",
",",
"\"hgnc_symbol\"",
",",
"\"disease_associated_transcripts\"",
",",
"\"reduced_penetrance\"",
",",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | get_variantid | Create a new variant id.
Args:
variant_obj(dict)
family_id(str)
Returns:
new_id(str): The new variant id | scout/adapter/mongo/case.py | def get_variantid(variant_obj, family_id):
"""Create a new variant id.
Args:
variant_obj(dict)
family_id(str)
Returns:
new_id(str): The new variant id
"""
new_id = parse_document_id(
chrom=variant_obj['chromosome'],
pos=str(variant_obj['position']),
... | def get_variantid(variant_obj, family_id):
"""Create a new variant id.
Args:
variant_obj(dict)
family_id(str)
Returns:
new_id(str): The new variant id
"""
new_id = parse_document_id(
chrom=variant_obj['chromosome'],
pos=str(variant_obj['position']),
... | [
"Create",
"a",
"new",
"variant",
"id",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case.py#L512-L530 | [
"def",
"get_variantid",
"(",
"variant_obj",
",",
"family_id",
")",
":",
"new_id",
"=",
"parse_document_id",
"(",
"chrom",
"=",
"variant_obj",
"[",
"'chromosome'",
"]",
",",
"pos",
"=",
"str",
"(",
"variant_obj",
"[",
"'position'",
"]",
")",
",",
"ref",
"="... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseHandler.cases | Fetches all cases from the backend.
Args:
collaborator(str): If collaborator should be considered
owner(str): Query cases for specified case owner only
query(dict): If a specific query is used
skip_assigned(bool)
has_causatives(bool)
rerun... | scout/adapter/mongo/case.py | def cases(self, owner=None, collaborator=None, query=None, skip_assigned=False,
has_causatives=False, reruns=False, finished=False,
research_requested=False, is_research=False, status=None,
phenotype_terms=False, pinned=False, cohort=False, name_query=None,
yield_... | def cases(self, owner=None, collaborator=None, query=None, skip_assigned=False,
has_causatives=False, reruns=False, finished=False,
research_requested=False, is_research=False, status=None,
phenotype_terms=False, pinned=False, cohort=False, name_query=None,
yield_... | [
"Fetches",
"all",
"cases",
"from",
"the",
"backend",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case.py#L21-L140 | [
"def",
"cases",
"(",
"self",
",",
"owner",
"=",
"None",
",",
"collaborator",
"=",
"None",
",",
"query",
"=",
"None",
",",
"skip_assigned",
"=",
"False",
",",
"has_causatives",
"=",
"False",
",",
"reruns",
"=",
"False",
",",
"finished",
"=",
"False",
",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseHandler.nr_cases | Return the number of cases
This function will change when we migrate to 3.7.1
Args:
collaborator(str): Institute id
Returns:
nr_cases(int) | scout/adapter/mongo/case.py | def nr_cases(self, institute_id=None):
"""Return the number of cases
This function will change when we migrate to 3.7.1
Args:
collaborator(str): Institute id
Returns:
nr_cases(int)
"""
query = {}
if institute_id:
query['coll... | def nr_cases(self, institute_id=None):
"""Return the number of cases
This function will change when we migrate to 3.7.1
Args:
collaborator(str): Institute id
Returns:
nr_cases(int)
"""
query = {}
if institute_id:
query['coll... | [
"Return",
"the",
"number",
"of",
"cases"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case.py#L142-L161 | [
"def",
"nr_cases",
"(",
"self",
",",
"institute_id",
"=",
"None",
")",
":",
"query",
"=",
"{",
"}",
"if",
"institute_id",
":",
"query",
"[",
"'collaborators'",
"]",
"=",
"institute_id",
"LOG",
".",
"debug",
"(",
"\"Fetch all cases with query {0}\"",
".",
"fo... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseHandler.update_dynamic_gene_list | Update the dynamic gene list for a case
Adds a list of dictionaries to case['dynamic_gene_list'] that looks like
{
hgnc_symbol: str,
hgnc_id: int,
description: str
}
Arguments:
case (dict): The case that should be updated
hgn... | scout/adapter/mongo/case.py | def update_dynamic_gene_list(self, case, hgnc_symbols=None, hgnc_ids=None,
phenotype_ids=None, build='37'):
"""Update the dynamic gene list for a case
Adds a list of dictionaries to case['dynamic_gene_list'] that looks like
{
hgnc_symbol: str,
... | def update_dynamic_gene_list(self, case, hgnc_symbols=None, hgnc_ids=None,
phenotype_ids=None, build='37'):
"""Update the dynamic gene list for a case
Adds a list of dictionaries to case['dynamic_gene_list'] that looks like
{
hgnc_symbol: str,
... | [
"Update",
"the",
"dynamic",
"gene",
"list",
"for",
"a",
"case"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case.py#L164-L213 | [
"def",
"update_dynamic_gene_list",
"(",
"self",
",",
"case",
",",
"hgnc_symbols",
"=",
"None",
",",
"hgnc_ids",
"=",
"None",
",",
"phenotype_ids",
"=",
"None",
",",
"build",
"=",
"'37'",
")",
":",
"dynamic_gene_list",
"=",
"[",
"]",
"res",
"=",
"[",
"]",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseHandler.case | Fetches a single case from database
Use either the _id or combination of institute_id and display_name
Args:
case_id(str): _id for a caes
institute_id(str):
display_name(str)
Yields:
A single Case | scout/adapter/mongo/case.py | def case(self, case_id=None, institute_id=None, display_name=None):
"""Fetches a single case from database
Use either the _id or combination of institute_id and display_name
Args:
case_id(str): _id for a caes
institute_id(str):
display_name(str)
Yie... | def case(self, case_id=None, institute_id=None, display_name=None):
"""Fetches a single case from database
Use either the _id or combination of institute_id and display_name
Args:
case_id(str): _id for a caes
institute_id(str):
display_name(str)
Yie... | [
"Fetches",
"a",
"single",
"case",
"from",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case.py#L215-L239 | [
"def",
"case",
"(",
"self",
",",
"case_id",
"=",
"None",
",",
"institute_id",
"=",
"None",
",",
"display_name",
"=",
"None",
")",
":",
"query",
"=",
"{",
"}",
"if",
"case_id",
":",
"query",
"[",
"'_id'",
"]",
"=",
"case_id",
"LOG",
".",
"info",
"("... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseHandler.delete_case | Delete a single case from database
Args:
institute_id(str)
case_id(str)
Returns:
case_obj(dict): The case that was deleted | scout/adapter/mongo/case.py | def delete_case(self, case_id=None, institute_id=None, display_name=None):
"""Delete a single case from database
Args:
institute_id(str)
case_id(str)
Returns:
case_obj(dict): The case that was deleted
"""
query = {}
if case_id:
... | def delete_case(self, case_id=None, institute_id=None, display_name=None):
"""Delete a single case from database
Args:
institute_id(str)
case_id(str)
Returns:
case_obj(dict): The case that was deleted
"""
query = {}
if case_id:
... | [
"Delete",
"a",
"single",
"case",
"from",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case.py#L253-L275 | [
"def",
"delete_case",
"(",
"self",
",",
"case_id",
"=",
"None",
",",
"institute_id",
"=",
"None",
",",
"display_name",
"=",
"None",
")",
":",
"query",
"=",
"{",
"}",
"if",
"case_id",
":",
"query",
"[",
"'_id'",
"]",
"=",
"case_id",
"LOG",
".",
"info"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseHandler.load_case | Load a case into the database
Check if the owner and the institute exists.
Args:
config_data(dict): A dictionary with all the necessary information
update(bool): If existing case should be updated
Returns:
case_obj(dict) | scout/adapter/mongo/case.py | def load_case(self, config_data, update=False):
"""Load a case into the database
Check if the owner and the institute exists.
Args:
config_data(dict): A dictionary with all the necessary information
update(bool): If existing case should be updated
Returns:
... | def load_case(self, config_data, update=False):
"""Load a case into the database
Check if the owner and the institute exists.
Args:
config_data(dict): A dictionary with all the necessary information
update(bool): If existing case should be updated
Returns:
... | [
"Load",
"a",
"case",
"into",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case.py#L277-L349 | [
"def",
"load_case",
"(",
"self",
",",
"config_data",
",",
"update",
"=",
"False",
")",
":",
"# Check that the owner exists in the database",
"institute_obj",
"=",
"self",
".",
"institute",
"(",
"config_data",
"[",
"'owner'",
"]",
")",
"if",
"not",
"institute_obj",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseHandler._add_case | Add a case to the database
If the case already exists exception is raised
Args:
case_obj(Case) | scout/adapter/mongo/case.py | def _add_case(self, case_obj):
"""Add a case to the database
If the case already exists exception is raised
Args:
case_obj(Case)
"""
if self.case(case_obj['_id']):
raise IntegrityError("Case %s already exists in database" % case_obj['_id'])
... | def _add_case(self, case_obj):
"""Add a case to the database
If the case already exists exception is raised
Args:
case_obj(Case)
"""
if self.case(case_obj['_id']):
raise IntegrityError("Case %s already exists in database" % case_obj['_id'])
... | [
"Add",
"a",
"case",
"to",
"the",
"database",
"If",
"the",
"case",
"already",
"exists",
"exception",
"is",
"raised"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case.py#L352-L362 | [
"def",
"_add_case",
"(",
"self",
",",
"case_obj",
")",
":",
"if",
"self",
".",
"case",
"(",
"case_obj",
"[",
"'_id'",
"]",
")",
":",
"raise",
"IntegrityError",
"(",
"\"Case %s already exists in database\"",
"%",
"case_obj",
"[",
"'_id'",
"]",
")",
"return",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseHandler.update_case | Update a case in the database
The following will be updated:
- collaborators: If new collaborators these will be added to the old ones
- analysis_date: Is updated to the new date
- analyses: The new analysis date will be added to old runs
- individuals: There cou... | scout/adapter/mongo/case.py | def update_case(self, case_obj):
"""Update a case in the database
The following will be updated:
- collaborators: If new collaborators these will be added to the old ones
- analysis_date: Is updated to the new date
- analyses: The new analysis date will be added to o... | def update_case(self, case_obj):
"""Update a case in the database
The following will be updated:
- collaborators: If new collaborators these will be added to the old ones
- analysis_date: Is updated to the new date
- analyses: The new analysis date will be added to o... | [
"Update",
"a",
"case",
"in",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case.py#L364-L431 | [
"def",
"update_case",
"(",
"self",
",",
"case_obj",
")",
":",
"# Todo: rename to match the intended purpose",
"LOG",
".",
"info",
"(",
"\"Updating case {0}\"",
".",
"format",
"(",
"case_obj",
"[",
"'_id'",
"]",
")",
")",
"old_case",
"=",
"self",
".",
"case_colle... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseHandler.replace_case | Replace a existing case with a new one
Keeps the object id
Args:
case_obj(dict)
Returns:
updated_case(dict) | scout/adapter/mongo/case.py | def replace_case(self, case_obj):
"""Replace a existing case with a new one
Keeps the object id
Args:
case_obj(dict)
Returns:
updated_case(dict)
"""
# Todo: Figure out and describe when this method destroys a case if invoked instead of
#... | def replace_case(self, case_obj):
"""Replace a existing case with a new one
Keeps the object id
Args:
case_obj(dict)
Returns:
updated_case(dict)
"""
# Todo: Figure out and describe when this method destroys a case if invoked instead of
#... | [
"Replace",
"a",
"existing",
"case",
"with",
"a",
"new",
"one"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case.py#L433-L457 | [
"def",
"replace_case",
"(",
"self",
",",
"case_obj",
")",
":",
"# Todo: Figure out and describe when this method destroys a case if invoked instead of",
"# update_case",
"LOG",
".",
"info",
"(",
"\"Saving case %s\"",
",",
"case_obj",
"[",
"'_id'",
"]",
")",
"# update update... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | CaseHandler.update_caseid | Update case id for a case across the database.
This function is used when a case is a rerun or updated for another reason.
Args:
case_obj(dict)
family_id(str): The new family id
Returns:
new_case(dict): The updated case object | scout/adapter/mongo/case.py | def update_caseid(self, case_obj, family_id):
"""Update case id for a case across the database.
This function is used when a case is a rerun or updated for another reason.
Args:
case_obj(dict)
family_id(str): The new family id
Returns:
new_case(dict... | def update_caseid(self, case_obj, family_id):
"""Update case id for a case across the database.
This function is used when a case is a rerun or updated for another reason.
Args:
case_obj(dict)
family_id(str): The new family id
Returns:
new_case(dict... | [
"Update",
"case",
"id",
"for",
"a",
"case",
"across",
"the",
"database",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/case.py#L459-L509 | [
"def",
"update_caseid",
"(",
"self",
",",
"case_obj",
",",
"family_id",
")",
":",
"new_case",
"=",
"deepcopy",
"(",
"case_obj",
")",
"new_case",
"[",
"'_id'",
"]",
"=",
"family_id",
"# update suspects and causatives",
"for",
"case_variants",
"in",
"[",
"'suspect... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | ACMGHandler.submit_evaluation | Submit an evaluation to the database
Get all the relevant information, build a evaluation_obj
Args:
variant_obj(dict)
user_obj(dict)
institute_obj(dict)
case_obj(dict)
link(str): variant url
criteria(list(dict)):
... | scout/adapter/mongo/acmg.py | def submit_evaluation(self, variant_obj, user_obj, institute_obj, case_obj, link, criteria):
"""Submit an evaluation to the database
Get all the relevant information, build a evaluation_obj
Args:
variant_obj(dict)
user_obj(dict)
institute_obj(dict)
... | def submit_evaluation(self, variant_obj, user_obj, institute_obj, case_obj, link, criteria):
"""Submit an evaluation to the database
Get all the relevant information, build a evaluation_obj
Args:
variant_obj(dict)
user_obj(dict)
institute_obj(dict)
... | [
"Submit",
"an",
"evaluation",
"to",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/acmg.py#L15-L64 | [
"def",
"submit_evaluation",
"(",
"self",
",",
"variant_obj",
",",
"user_obj",
",",
"institute_obj",
",",
"case_obj",
",",
"link",
",",
"criteria",
")",
":",
"variant_specific",
"=",
"variant_obj",
"[",
"'_id'",
"]",
"variant_id",
"=",
"variant_obj",
"[",
"'var... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | ACMGHandler.get_evaluations | Return all evaluations for a certain variant.
Args:
variant_obj (dict): variant dict from the database
Returns:
pymongo.cursor: database cursor | scout/adapter/mongo/acmg.py | def get_evaluations(self, variant_obj):
"""Return all evaluations for a certain variant.
Args:
variant_obj (dict): variant dict from the database
Returns:
pymongo.cursor: database cursor
"""
query = dict(variant_id=variant_obj['variant_id'])
res ... | def get_evaluations(self, variant_obj):
"""Return all evaluations for a certain variant.
Args:
variant_obj (dict): variant dict from the database
Returns:
pymongo.cursor: database cursor
"""
query = dict(variant_id=variant_obj['variant_id'])
res ... | [
"Return",
"all",
"evaluations",
"for",
"a",
"certain",
"variant",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/adapter/mongo/acmg.py#L89-L100 | [
"def",
"get_evaluations",
"(",
"self",
",",
"variant_obj",
")",
":",
"query",
"=",
"dict",
"(",
"variant_id",
"=",
"variant_obj",
"[",
"'variant_id'",
"]",
")",
"res",
"=",
"self",
".",
"acmg_collection",
".",
"find",
"(",
"query",
")",
".",
"sort",
"(",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_transcripts | Parse and massage the transcript information
There could be multiple lines with information about the same transcript.
This is why it is necessary to parse the transcripts first and then return a dictionary
where all information has been merged.
Args:
transcript_lines(): This could be an itera... | scout/parse/ensembl.py | def parse_transcripts(transcript_lines):
"""Parse and massage the transcript information
There could be multiple lines with information about the same transcript.
This is why it is necessary to parse the transcripts first and then return a dictionary
where all information has been merged.
Args:
... | def parse_transcripts(transcript_lines):
"""Parse and massage the transcript information
There could be multiple lines with information about the same transcript.
This is why it is necessary to parse the transcripts first and then return a dictionary
where all information has been merged.
Args:
... | [
"Parse",
"and",
"massage",
"the",
"transcript",
"information"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/ensembl.py#L10-L62 | [
"def",
"parse_transcripts",
"(",
"transcript_lines",
")",
":",
"LOG",
".",
"info",
"(",
"\"Parsing transcripts\"",
")",
"# Parse the transcripts, we need to check if it is a request or a file handle",
"if",
"isinstance",
"(",
"transcript_lines",
",",
"DataFrame",
")",
":",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_ensembl_gene_request | Parse a dataframe with ensembl gene information
Args:
res(pandas.DataFrame)
Yields:
gene_info(dict) | scout/parse/ensembl.py | def parse_ensembl_gene_request(result):
"""Parse a dataframe with ensembl gene information
Args:
res(pandas.DataFrame)
Yields:
gene_info(dict)
"""
LOG.info("Parsing genes from request")
for index, row in result.iterrows():
# print(index, row)
ensembl_info = {}
... | def parse_ensembl_gene_request(result):
"""Parse a dataframe with ensembl gene information
Args:
res(pandas.DataFrame)
Yields:
gene_info(dict)
"""
LOG.info("Parsing genes from request")
for index, row in result.iterrows():
# print(index, row)
ensembl_info = {}
... | [
"Parse",
"a",
"dataframe",
"with",
"ensembl",
"gene",
"information"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/ensembl.py#L65-L100 | [
"def",
"parse_ensembl_gene_request",
"(",
"result",
")",
":",
"LOG",
".",
"info",
"(",
"\"Parsing genes from request\"",
")",
"for",
"index",
",",
"row",
"in",
"result",
".",
"iterrows",
"(",
")",
":",
"# print(index, row)",
"ensembl_info",
"=",
"{",
"}",
"# P... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_ensembl_transcript_request | Parse a dataframe with ensembl transcript information
Args:
res(pandas.DataFrame)
Yields:
transcript_info(dict) | scout/parse/ensembl.py | def parse_ensembl_transcript_request(result):
"""Parse a dataframe with ensembl transcript information
Args:
res(pandas.DataFrame)
Yields:
transcript_info(dict)
"""
LOG.info("Parsing transcripts from request")
keys = [
'chrom',
'ensembl_gene_id',
'ensem... | def parse_ensembl_transcript_request(result):
"""Parse a dataframe with ensembl transcript information
Args:
res(pandas.DataFrame)
Yields:
transcript_info(dict)
"""
LOG.info("Parsing transcripts from request")
keys = [
'chrom',
'ensembl_gene_id',
'ensem... | [
"Parse",
"a",
"dataframe",
"with",
"ensembl",
"transcript",
"information"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/ensembl.py#L103-L142 | [
"def",
"parse_ensembl_transcript_request",
"(",
"result",
")",
":",
"LOG",
".",
"info",
"(",
"\"Parsing transcripts from request\"",
")",
"keys",
"=",
"[",
"'chrom'",
",",
"'ensembl_gene_id'",
",",
"'ensembl_transcript_id'",
",",
"'transcript_start'",
",",
"'transcript_... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_ensembl_line | Parse an ensembl formated line
Args:
line(list): A list with ensembl gene info
header(list): A list with the header info
Returns:
ensembl_info(dict): A dictionary with the relevant info | scout/parse/ensembl.py | def parse_ensembl_line(line, header):
"""Parse an ensembl formated line
Args:
line(list): A list with ensembl gene info
header(list): A list with the header info
Returns:
ensembl_info(dict): A dictionary with the relevant info
"""
line = line.rstrip().sp... | def parse_ensembl_line(line, header):
"""Parse an ensembl formated line
Args:
line(list): A list with ensembl gene info
header(list): A list with the header info
Returns:
ensembl_info(dict): A dictionary with the relevant info
"""
line = line.rstrip().sp... | [
"Parse",
"an",
"ensembl",
"formated",
"line"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/ensembl.py#L145-L228 | [
"def",
"parse_ensembl_line",
"(",
"line",
",",
"header",
")",
":",
"line",
"=",
"line",
".",
"rstrip",
"(",
")",
".",
"split",
"(",
"'\\t'",
")",
"header",
"=",
"[",
"head",
".",
"lower",
"(",
")",
"for",
"head",
"in",
"header",
"]",
"raw_info",
"=... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_ensembl_genes | Parse lines with ensembl formated genes
This is designed to take a biomart dump with genes from ensembl.
Mandatory columns are:
'Gene ID' 'Chromosome' 'Gene Start' 'Gene End' 'HGNC symbol
Args:
lines(iterable(str)): An iterable with ensembl formated genes
Yields:
... | scout/parse/ensembl.py | def parse_ensembl_genes(lines):
"""Parse lines with ensembl formated genes
This is designed to take a biomart dump with genes from ensembl.
Mandatory columns are:
'Gene ID' 'Chromosome' 'Gene Start' 'Gene End' 'HGNC symbol
Args:
lines(iterable(str)): An iterable with en... | def parse_ensembl_genes(lines):
"""Parse lines with ensembl formated genes
This is designed to take a biomart dump with genes from ensembl.
Mandatory columns are:
'Gene ID' 'Chromosome' 'Gene Start' 'Gene End' 'HGNC symbol
Args:
lines(iterable(str)): An iterable with en... | [
"Parse",
"lines",
"with",
"ensembl",
"formated",
"genes"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/ensembl.py#L231-L253 | [
"def",
"parse_ensembl_genes",
"(",
"lines",
")",
":",
"LOG",
".",
"info",
"(",
"\"Parsing ensembl genes from file\"",
")",
"header",
"=",
"[",
"]",
"for",
"index",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"# File allways start with a header line",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_ensembl_exons | Parse lines with ensembl formated exons
This is designed to take a biomart dump with exons from ensembl.
Check documentation for spec for download
Args:
lines(iterable(str)): An iterable with ensembl formated exons
Yields:
ensembl_gene(dict): A dictionary with t... | scout/parse/ensembl.py | def parse_ensembl_exons(lines):
"""Parse lines with ensembl formated exons
This is designed to take a biomart dump with exons from ensembl.
Check documentation for spec for download
Args:
lines(iterable(str)): An iterable with ensembl formated exons
Yields:
... | def parse_ensembl_exons(lines):
"""Parse lines with ensembl formated exons
This is designed to take a biomart dump with exons from ensembl.
Check documentation for spec for download
Args:
lines(iterable(str)): An iterable with ensembl formated exons
Yields:
... | [
"Parse",
"lines",
"with",
"ensembl",
"formated",
"exons"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/ensembl.py#L280-L337 | [
"def",
"parse_ensembl_exons",
"(",
"lines",
")",
":",
"header",
"=",
"[",
"]",
"LOG",
".",
"debug",
"(",
"\"Parsing ensembl exons...\"",
")",
"for",
"index",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"# File allways start with a header line",
"if",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_ensembl_exon_request | Parse a dataframe with ensembl exon information
Args:
res(pandas.DataFrame)
Yields:
gene_info(dict) | scout/parse/ensembl.py | def parse_ensembl_exon_request(result):
"""Parse a dataframe with ensembl exon information
Args:
res(pandas.DataFrame)
Yields:
gene_info(dict)
"""
keys = [
'chrom',
'gene',
'transcript',
'exon_id',
'exon_chrom_start',
'exon_chrom_end'... | def parse_ensembl_exon_request(result):
"""Parse a dataframe with ensembl exon information
Args:
res(pandas.DataFrame)
Yields:
gene_info(dict)
"""
keys = [
'chrom',
'gene',
'transcript',
'exon_id',
'exon_chrom_start',
'exon_chrom_end'... | [
"Parse",
"a",
"dataframe",
"with",
"ensembl",
"exon",
"information"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/ensembl.py#L340-L395 | [
"def",
"parse_ensembl_exon_request",
"(",
"result",
")",
":",
"keys",
"=",
"[",
"'chrom'",
",",
"'gene'",
",",
"'transcript'",
",",
"'exon_id'",
",",
"'exon_chrom_start'",
",",
"'exon_chrom_end'",
",",
"'5_utr_start'",
",",
"'5_utr_end'",
",",
"'3_utr_start'",
","... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | init_log | Initializes the log file in the proper format.
Arguments:
filename (str): Path to a file. Or None if logging is to
be disabled.
loglevel (str): Determines the level of the log output. | scout/log/log.py | def init_log(logger, filename=None, loglevel=None):
"""
Initializes the log file in the proper format.
Arguments:
filename (str): Path to a file. Or None if logging is to
be disabled.
loglevel (str): Determines the level of the log output.
"""
template = '[... | def init_log(logger, filename=None, loglevel=None):
"""
Initializes the log file in the proper format.
Arguments:
filename (str): Path to a file. Or None if logging is to
be disabled.
loglevel (str): Determines the level of the log output.
"""
template = '[... | [
"Initializes",
"the",
"log",
"file",
"in",
"the",
"proper",
"format",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/log/log.py#L5-L38 | [
"def",
"init_log",
"(",
"logger",
",",
"filename",
"=",
"None",
",",
"loglevel",
"=",
"None",
")",
":",
"template",
"=",
"'[%(asctime)s] %(levelname)-8s: %(name)-25s: %(message)s'",
"formatter",
"=",
"logging",
".",
"Formatter",
"(",
"template",
")",
"if",
"loglev... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_omim_line | docstring for parse_omim_2_line | scout/parse/omim.py | def parse_omim_line(line, header):
"""docstring for parse_omim_2_line"""
omim_info = dict(zip(header, line.split('\t')))
return omim_info | def parse_omim_line(line, header):
"""docstring for parse_omim_2_line"""
omim_info = dict(zip(header, line.split('\t')))
return omim_info | [
"docstring",
"for",
"parse_omim_2_line"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/omim.py#L38-L41 | [
"def",
"parse_omim_line",
"(",
"line",
",",
"header",
")",
":",
"omim_info",
"=",
"dict",
"(",
"zip",
"(",
"header",
",",
"line",
".",
"split",
"(",
"'\\t'",
")",
")",
")",
"return",
"omim_info"
] | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_genemap2 | Parse the omim source file called genemap2.txt
Explanation of Phenotype field:
Brackets, "[ ]", indicate "nondiseases," mainly genetic variations that
lead to apparently abnormal laboratory test values.
Braces, "{ }", indicate mutations that contribute to susceptibility to
multifactorial dis... | scout/parse/omim.py | def parse_genemap2(lines):
"""Parse the omim source file called genemap2.txt
Explanation of Phenotype field:
Brackets, "[ ]", indicate "nondiseases," mainly genetic variations that
lead to apparently abnormal laboratory test values.
Braces, "{ }", indicate mutations that contribute to suscept... | def parse_genemap2(lines):
"""Parse the omim source file called genemap2.txt
Explanation of Phenotype field:
Brackets, "[ ]", indicate "nondiseases," mainly genetic variations that
lead to apparently abnormal laboratory test values.
Braces, "{ }", indicate mutations that contribute to suscept... | [
"Parse",
"the",
"omim",
"source",
"file",
"called",
"genemap2",
".",
"txt",
"Explanation",
"of",
"Phenotype",
"field",
":",
"Brackets",
"[",
"]",
"indicate",
"nondiseases",
"mainly",
"genetic",
"variations",
"that",
"lead",
"to",
"apparently",
"abnormal",
"labor... | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/omim.py#L43-L166 | [
"def",
"parse_genemap2",
"(",
"lines",
")",
":",
"LOG",
".",
"info",
"(",
"\"Parsing the omim genemap2\"",
")",
"header",
"=",
"[",
"]",
"for",
"i",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"line",
"=",
"line",
".",
"rstrip",
"(",
")",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_mim2gene | Parse the file called mim2gene
This file describes what type(s) the different mim numbers have.
The different entry types are: 'gene', 'gene/phenotype', 'moved/removed',
'phenotype', 'predominantly phenotypes'
Where:
gene: Is a gene entry
gene/phenotype: This entry describes both a ... | scout/parse/omim.py | def parse_mim2gene(lines):
"""Parse the file called mim2gene
This file describes what type(s) the different mim numbers have.
The different entry types are: 'gene', 'gene/phenotype', 'moved/removed',
'phenotype', 'predominantly phenotypes'
Where:
gene: Is a gene entry
gene/pheno... | def parse_mim2gene(lines):
"""Parse the file called mim2gene
This file describes what type(s) the different mim numbers have.
The different entry types are: 'gene', 'gene/phenotype', 'moved/removed',
'phenotype', 'predominantly phenotypes'
Where:
gene: Is a gene entry
gene/pheno... | [
"Parse",
"the",
"file",
"called",
"mim2gene",
"This",
"file",
"describes",
"what",
"type",
"(",
"s",
")",
"the",
"different",
"mim",
"numbers",
"have",
".",
"The",
"different",
"entry",
"types",
"are",
":",
"gene",
"gene",
"/",
"phenotype",
"moved",
"/",
... | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/omim.py#L169-L224 | [
"def",
"parse_mim2gene",
"(",
"lines",
")",
":",
"LOG",
".",
"info",
"(",
"\"Parsing mim2gene\"",
")",
"header",
"=",
"[",
"\"mim_number\"",
",",
"\"entry_type\"",
",",
"\"entrez_gene_id\"",
",",
"\"hgnc_symbol\"",
",",
"\"ensembl_gene_id\"",
"]",
"for",
"i",
",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_omim_morbid | docstring for parse_omim_morbid | scout/parse/omim.py | def parse_omim_morbid(lines):
"""docstring for parse_omim_morbid"""
header = []
for i,line in enumerate(lines):
line = line.rstrip()
if line.startswith('#'):
if i < 10:
if line.startswith('# Phenotype'):
header = line[2:].split('\t')
el... | def parse_omim_morbid(lines):
"""docstring for parse_omim_morbid"""
header = []
for i,line in enumerate(lines):
line = line.rstrip()
if line.startswith('#'):
if i < 10:
if line.startswith('# Phenotype'):
header = line[2:].split('\t')
el... | [
"docstring",
"for",
"parse_omim_morbid"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/omim.py#L226-L236 | [
"def",
"parse_omim_morbid",
"(",
"lines",
")",
":",
"header",
"=",
"[",
"]",
"for",
"i",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"line",
"=",
"line",
".",
"rstrip",
"(",
")",
"if",
"line",
".",
"startswith",
"(",
"'#'",
")",
":",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_mim_titles | Parse the mimTitles.txt file
This file hold information about the description for each entry in omim.
There is not information about entry type.
parse_mim_titles collects the preferred title and maps it to the mim number.
Args:
lines(iterable): lines from mimTitles file
Yields... | scout/parse/omim.py | def parse_mim_titles(lines):
"""Parse the mimTitles.txt file
This file hold information about the description for each entry in omim.
There is not information about entry type.
parse_mim_titles collects the preferred title and maps it to the mim number.
Args:
lines(iterable): lines... | def parse_mim_titles(lines):
"""Parse the mimTitles.txt file
This file hold information about the description for each entry in omim.
There is not information about entry type.
parse_mim_titles collects the preferred title and maps it to the mim number.
Args:
lines(iterable): lines... | [
"Parse",
"the",
"mimTitles",
".",
"txt",
"file",
"This",
"file",
"hold",
"information",
"about",
"the",
"description",
"for",
"each",
"entry",
"in",
"omim",
".",
"There",
"is",
"not",
"information",
"about",
"entry",
"type",
".",
"parse_mim_titles",
"collects"... | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/omim.py#L238-L264 | [
"def",
"parse_mim_titles",
"(",
"lines",
")",
":",
"header",
"=",
"[",
"'prefix'",
",",
"'mim_number'",
",",
"'preferred_title'",
",",
"'alternative_title'",
",",
"'included_title'",
"]",
"for",
"i",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"l... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | get_mim_genes | Get a dictionary with genes and their omim information
Args:
genemap_lines(iterable(str))
mim2gene_lines(iterable(str))
Returns.
hgnc_genes(dict): A dictionary with hgnc_symbol as keys | scout/parse/omim.py | def get_mim_genes(genemap_lines, mim2gene_lines):
"""Get a dictionary with genes and their omim information
Args:
genemap_lines(iterable(str))
mim2gene_lines(iterable(str))
Returns.
hgnc_genes(dict): A dictionary with hgnc_symbol as keys
"""
LOG.info("Get the m... | def get_mim_genes(genemap_lines, mim2gene_lines):
"""Get a dictionary with genes and their omim information
Args:
genemap_lines(iterable(str))
mim2gene_lines(iterable(str))
Returns.
hgnc_genes(dict): A dictionary with hgnc_symbol as keys
"""
LOG.info("Get the m... | [
"Get",
"a",
"dictionary",
"with",
"genes",
"and",
"their",
"omim",
"information",
"Args",
":",
"genemap_lines",
"(",
"iterable",
"(",
"str",
"))",
"mim2gene_lines",
"(",
"iterable",
"(",
"str",
"))",
"Returns",
".",
"hgnc_genes",
"(",
"dict",
")",
":",
"A"... | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/omim.py#L266-L319 | [
"def",
"get_mim_genes",
"(",
"genemap_lines",
",",
"mim2gene_lines",
")",
":",
"LOG",
".",
"info",
"(",
"\"Get the mim genes\"",
")",
"genes",
"=",
"{",
"}",
"hgnc_genes",
"=",
"{",
"}",
"gene_nr",
"=",
"0",
"no_hgnc",
"=",
"0",
"for",
"entry",
"in",
"pa... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | get_mim_phenotypes | Get a dictionary with phenotypes
Use the mim numbers for phenotypes as keys and phenotype information as
values.
Args:
genemap_lines(iterable(str))
Returns:
phenotypes_found(dict): A dictionary with mim_numbers as keys and
dictionaries with phenotype information as v... | scout/parse/omim.py | def get_mim_phenotypes(genemap_lines):
"""Get a dictionary with phenotypes
Use the mim numbers for phenotypes as keys and phenotype information as
values.
Args:
genemap_lines(iterable(str))
Returns:
phenotypes_found(dict): A dictionary with mim_numbers as keys and
... | def get_mim_phenotypes(genemap_lines):
"""Get a dictionary with phenotypes
Use the mim numbers for phenotypes as keys and phenotype information as
values.
Args:
genemap_lines(iterable(str))
Returns:
phenotypes_found(dict): A dictionary with mim_numbers as keys and
... | [
"Get",
"a",
"dictionary",
"with",
"phenotypes",
"Use",
"the",
"mim",
"numbers",
"for",
"phenotypes",
"as",
"keys",
"and",
"phenotype",
"information",
"as",
"values",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/omim.py#L321-L364 | [
"def",
"get_mim_phenotypes",
"(",
"genemap_lines",
")",
":",
"# Set with all omim numbers that are phenotypes",
"# Parsed from mim2gene.txt",
"phenotype_mims",
"=",
"set",
"(",
")",
"phenotypes_found",
"=",
"{",
"}",
"# Genemap is a file with one entry per gene.",
"# Each line ho... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | cli | Parse the omim files | scout/parse/omim.py | def cli(context, morbid, genemap, mim2gene, mim_titles, phenotypes):
"""Parse the omim files"""
# if not (morbid and genemap and mim2gene, mim_titles):
# print("Please provide all files")
# context.abort()
from scout.utils.handle import get_file_handle
from pprint import pprint as pp
... | def cli(context, morbid, genemap, mim2gene, mim_titles, phenotypes):
"""Parse the omim files"""
# if not (morbid and genemap and mim2gene, mim_titles):
# print("Please provide all files")
# context.abort()
from scout.utils.handle import get_file_handle
from pprint import pprint as pp
... | [
"Parse",
"the",
"omim",
"files"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/omim.py#L374-L427 | [
"def",
"cli",
"(",
"context",
",",
"morbid",
",",
"genemap",
",",
"mim2gene",
",",
"mim_titles",
",",
"phenotypes",
")",
":",
"# if not (morbid and genemap and mim2gene, mim_titles):",
"# print(\"Please provide all files\")",
"# context.abort()",
"from",
"scout",
".... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | convert_number | Convert a string to number
If int convert to int otherwise float
If not possible return None | scout/utils/convert.py | def convert_number(string):
"""Convert a string to number
If int convert to int otherwise float
If not possible return None
"""
res = None
if isint(string):
res = int(string)
elif isfloat(string):
res = float(string)
return res | def convert_number(string):
"""Convert a string to number
If int convert to int otherwise float
If not possible return None
"""
res = None
if isint(string):
res = int(string)
elif isfloat(string):
res = float(string)
return res | [
"Convert",
"a",
"string",
"to",
"number",
"If",
"int",
"convert",
"to",
"int",
"otherwise",
"float",
"If",
"not",
"possible",
"return",
"None"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/utils/convert.py#L24-L35 | [
"def",
"convert_number",
"(",
"string",
")",
":",
"res",
"=",
"None",
"if",
"isint",
"(",
"string",
")",
":",
"res",
"=",
"int",
"(",
"string",
")",
"elif",
"isfloat",
"(",
"string",
")",
":",
"res",
"=",
"float",
"(",
"string",
")",
"return",
"res... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | case | Update a case in the database | scout/commands/update/case.py | def case(context, case_id, case_name, institute, collaborator, vcf, vcf_sv,
vcf_cancer, vcf_research, vcf_sv_research, vcf_cancer_research, peddy_ped,
reupload_sv, rankscore_treshold, rankmodel_version):
"""
Update a case in the database
"""
adapter = context.obj['adapter']
if not ... | def case(context, case_id, case_name, institute, collaborator, vcf, vcf_sv,
vcf_cancer, vcf_research, vcf_sv_research, vcf_cancer_research, peddy_ped,
reupload_sv, rankscore_treshold, rankmodel_version):
"""
Update a case in the database
"""
adapter = context.obj['adapter']
if not ... | [
"Update",
"a",
"case",
"in",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/commands/update/case.py#L41-L125 | [
"def",
"case",
"(",
"context",
",",
"case_id",
",",
"case_name",
",",
"institute",
",",
"collaborator",
",",
"vcf",
",",
"vcf_sv",
",",
"vcf_cancer",
",",
"vcf_research",
",",
"vcf_sv_research",
",",
"vcf_cancer_research",
",",
"peddy_ped",
",",
"reupload_sv",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | setup_scout | docstring for setup_scout | scout/load/setup.py | def setup_scout(adapter, institute_id='cust000', user_name='Clark Kent',
user_mail='clark.kent@mail.com', api_key=None, demo=False):
"""docstring for setup_scout"""
########################## Delete previous information ##########################
LOG.info("Deleting previous database")
fo... | def setup_scout(adapter, institute_id='cust000', user_name='Clark Kent',
user_mail='clark.kent@mail.com', api_key=None, demo=False):
"""docstring for setup_scout"""
########################## Delete previous information ##########################
LOG.info("Deleting previous database")
fo... | [
"docstring",
"for",
"setup_scout"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/load/setup.py#L46-L183 | [
"def",
"setup_scout",
"(",
"adapter",
",",
"institute_id",
"=",
"'cust000'",
",",
"user_name",
"=",
"'Clark Kent'",
",",
"user_mail",
"=",
"'clark.kent@mail.com'",
",",
"api_key",
"=",
"None",
",",
"demo",
"=",
"False",
")",
":",
"########################## Delete... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | export_transcripts | Export all transcripts from the database
Args:
adapter(scout.adapter.MongoAdapter)
build(str)
Yields:
transcript(scout.models.Transcript) | scout/export/transcript.py | def export_transcripts(adapter, build='37'):
"""Export all transcripts from the database
Args:
adapter(scout.adapter.MongoAdapter)
build(str)
Yields:
transcript(scout.models.Transcript)
"""
LOG.info("Exporting all transcripts")
for tx_obj in adapter.transcripts... | def export_transcripts(adapter, build='37'):
"""Export all transcripts from the database
Args:
adapter(scout.adapter.MongoAdapter)
build(str)
Yields:
transcript(scout.models.Transcript)
"""
LOG.info("Exporting all transcripts")
for tx_obj in adapter.transcripts... | [
"Export",
"all",
"transcripts",
"from",
"the",
"database",
"Args",
":",
"adapter",
"(",
"scout",
".",
"adapter",
".",
"MongoAdapter",
")",
"build",
"(",
"str",
")",
"Yields",
":",
"transcript",
"(",
"scout",
".",
"models",
".",
"Transcript",
")"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/export/transcript.py#L5-L18 | [
"def",
"export_transcripts",
"(",
"adapter",
",",
"build",
"=",
"'37'",
")",
":",
"LOG",
".",
"info",
"(",
"\"Exporting all transcripts\"",
")",
"for",
"tx_obj",
"in",
"adapter",
".",
"transcripts",
"(",
"build",
"=",
"build",
")",
":",
"yield",
"tx_obj"
] | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | GenericCalendar.formatmonth | Return a formatted month as a table. | happenings/utils/calendars.py | def formatmonth(self, theyear, themonth, withyear=True, net=None, qs=None, template='happenings/partials/calendar/month_table.html'):
"""Return a formatted month as a table."""
context = self.get_context()
context['month_start_date'] = date(self.yr, self.mo, 1)
context['week_rows'] = []
... | def formatmonth(self, theyear, themonth, withyear=True, net=None, qs=None, template='happenings/partials/calendar/month_table.html'):
"""Return a formatted month as a table."""
context = self.get_context()
context['month_start_date'] = date(self.yr, self.mo, 1)
context['week_rows'] = []
... | [
"Return",
"a",
"formatted",
"month",
"as",
"a",
"table",
"."
] | wreckage/django-happenings | python | https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/calendars.py#L96-L112 | [
"def",
"formatmonth",
"(",
"self",
",",
"theyear",
",",
"themonth",
",",
"withyear",
"=",
"True",
",",
"net",
"=",
"None",
",",
"qs",
"=",
"None",
",",
"template",
"=",
"'happenings/partials/calendar/month_table.html'",
")",
":",
"context",
"=",
"self",
".",... | 7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d |
test | EventCalendar.formatday | Return a day as a table cell. | happenings/utils/calendars.py | def formatday(
self, day, weekday,
day_template='happenings/partials/calendar/day_cell.html',
noday_template='happenings/partials/calendar/day_noday_cell.html',
popover_template='happenings/partials/calendar/popover.html',
):
"""Return a day as a table... | def formatday(
self, day, weekday,
day_template='happenings/partials/calendar/day_cell.html',
noday_template='happenings/partials/calendar/day_noday_cell.html',
popover_template='happenings/partials/calendar/popover.html',
):
"""Return a day as a table... | [
"Return",
"a",
"day",
"as",
"a",
"table",
"cell",
"."
] | wreckage/django-happenings | python | https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/calendars.py#L123-L168 | [
"def",
"formatday",
"(",
"self",
",",
"day",
",",
"weekday",
",",
"day_template",
"=",
"'happenings/partials/calendar/day_cell.html'",
",",
"noday_template",
"=",
"'happenings/partials/calendar/day_noday_cell.html'",
",",
"popover_template",
"=",
"'happenings/partials/calendar/... | 7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d |
test | MiniEventCalendar.formatday | Return a day as a table cell. | happenings/utils/calendars.py | def formatday(self, day, weekday):
"""Return a day as a table cell."""
return super(MiniEventCalendar, self).formatday(
day, weekday,
day_template='happenings/partials/calendar/mini_day_cell.html',
popover_template='happenings/partials/calendar/mini_popover.html',
... | def formatday(self, day, weekday):
"""Return a day as a table cell."""
return super(MiniEventCalendar, self).formatday(
day, weekday,
day_template='happenings/partials/calendar/mini_day_cell.html',
popover_template='happenings/partials/calendar/mini_popover.html',
... | [
"Return",
"a",
"day",
"as",
"a",
"table",
"cell",
"."
] | wreckage/django-happenings | python | https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/calendars.py#L179-L185 | [
"def",
"formatday",
"(",
"self",
",",
"day",
",",
"weekday",
")",
":",
"return",
"super",
"(",
"MiniEventCalendar",
",",
"self",
")",
".",
"formatday",
"(",
"day",
",",
"weekday",
",",
"day_template",
"=",
"'happenings/partials/calendar/mini_day_cell.html'",
","... | 7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d |
test | LegacyGenericCalendar.formatday | Set some commonly used variables. | happenings/utils/calendars.py | def formatday(self, day, weekday):
"""Set some commonly used variables."""
self.wkday_not_today = '<td class="%s"><div class="td-inner">' % (
self.cssclasses[weekday])
self.wkday_today = (
'<td class="%s calendar-today"><div class="td-inner">' % (
self.cs... | def formatday(self, day, weekday):
"""Set some commonly used variables."""
self.wkday_not_today = '<td class="%s"><div class="td-inner">' % (
self.cssclasses[weekday])
self.wkday_today = (
'<td class="%s calendar-today"><div class="td-inner">' % (
self.cs... | [
"Set",
"some",
"commonly",
"used",
"variables",
"."
] | wreckage/django-happenings | python | https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/calendars.py#L219-L240 | [
"def",
"formatday",
"(",
"self",
",",
"day",
",",
"weekday",
")",
":",
"self",
".",
"wkday_not_today",
"=",
"'<td class=\"%s\"><div class=\"td-inner\">'",
"%",
"(",
"self",
".",
"cssclasses",
"[",
"weekday",
"]",
")",
"self",
".",
"wkday_today",
"=",
"(",
"'... | 7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d |
test | LegacyGenericCalendar.formatmonthname | Change colspan to "5", add "today" button, and return a month
name as a table row. | happenings/utils/calendars.py | def formatmonthname(self, theyear, themonth, withyear=True):
"""
Change colspan to "5", add "today" button, and return a month
name as a table row.
"""
display_month = month_name[themonth]
if isinstance(display_month, six.binary_type) and self.encoding:
displ... | def formatmonthname(self, theyear, themonth, withyear=True):
"""
Change colspan to "5", add "today" button, and return a month
name as a table row.
"""
display_month = month_name[themonth]
if isinstance(display_month, six.binary_type) and self.encoding:
displ... | [
"Change",
"colspan",
"to",
"5",
"add",
"today",
"button",
"and",
"return",
"a",
"month",
"name",
"as",
"a",
"table",
"row",
"."
] | wreckage/django-happenings | python | https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/calendars.py#L249-L265 | [
"def",
"formatmonthname",
"(",
"self",
",",
"theyear",
",",
"themonth",
",",
"withyear",
"=",
"True",
")",
":",
"display_month",
"=",
"month_name",
"[",
"themonth",
"]",
"if",
"isinstance",
"(",
"display_month",
",",
"six",
".",
"binary_type",
")",
"and",
... | 7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d |
test | LegacyEventCalendar.popover_helper | Populate variables used to build popovers. | happenings/utils/calendars.py | def popover_helper(self):
"""Populate variables used to build popovers."""
# when
display_month = month_name[self.mo]
if isinstance(display_month, six.binary_type) and self.encoding:
display_month = display_month.decode('utf-8')
self.when = ('<p><b>When:</b> ' + dis... | def popover_helper(self):
"""Populate variables used to build popovers."""
# when
display_month = month_name[self.mo]
if isinstance(display_month, six.binary_type) and self.encoding:
display_month = display_month.decode('utf-8')
self.when = ('<p><b>When:</b> ' + dis... | [
"Populate",
"variables",
"used",
"to",
"build",
"popovers",
"."
] | wreckage/django-happenings | python | https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/calendars.py#L270-L300 | [
"def",
"popover_helper",
"(",
"self",
")",
":",
"# when",
"display_month",
"=",
"month_name",
"[",
"self",
".",
"mo",
"]",
"if",
"isinstance",
"(",
"display_month",
",",
"six",
".",
"binary_type",
")",
"and",
"self",
".",
"encoding",
":",
"display_month",
... | 7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d |
test | LegacyEventCalendar.formatday | Return a day as a table cell. | happenings/utils/calendars.py | def formatday(self, day, weekday):
"""Return a day as a table cell."""
super(EventCalendar, self).formatday(day, weekday)
now = get_now()
self.day = day
out = ''
if day == 0:
return '<td class="noday"> </td>' # day outside month
elif now.month =... | def formatday(self, day, weekday):
"""Return a day as a table cell."""
super(EventCalendar, self).formatday(day, weekday)
now = get_now()
self.day = day
out = ''
if day == 0:
return '<td class="noday"> </td>' # day outside month
elif now.month =... | [
"Return",
"a",
"day",
"as",
"a",
"table",
"cell",
"."
] | wreckage/django-happenings | python | https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/calendars.py#L302-L349 | [
"def",
"formatday",
"(",
"self",
",",
"day",
",",
"weekday",
")",
":",
"super",
"(",
"EventCalendar",
",",
"self",
")",
".",
"formatday",
"(",
"day",
",",
"weekday",
")",
"now",
"=",
"get_now",
"(",
")",
"self",
".",
"day",
"=",
"day",
"out",
"=",
... | 7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d |
test | LegacyMiniEventCalendar.formatday | Return a day as a table cell. | happenings/utils/calendars.py | def formatday(self, day, weekday):
"""Return a day as a table cell."""
super(MiniEventCalendar, self).formatday(day, weekday)
now = get_now()
self.day = day
if day == 0:
return '<td class="noday"> </td>' # day outside month
elif now.month == self.mo and... | def formatday(self, day, weekday):
"""Return a day as a table cell."""
super(MiniEventCalendar, self).formatday(day, weekday)
now = get_now()
self.day = day
if day == 0:
return '<td class="noday"> </td>' # day outside month
elif now.month == self.mo and... | [
"Return",
"a",
"day",
"as",
"a",
"table",
"cell",
"."
] | wreckage/django-happenings | python | https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/calendars.py#L380-L398 | [
"def",
"formatday",
"(",
"self",
",",
"day",
",",
"weekday",
")",
":",
"super",
"(",
"MiniEventCalendar",
",",
"self",
")",
".",
"formatday",
"(",
"day",
",",
"weekday",
")",
"now",
"=",
"get_now",
"(",
")",
"self",
".",
"day",
"=",
"day",
"if",
"d... | 7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d |
test | get_panel_info | Parse metadata for a gene panel
For historical reasons it is possible to include all information about a gene panel in the
header of a panel file. This function parses the header.
Args:
panel_lines(iterable(str))
Returns:
panel_info(dict): Dictionary with panel information | scout/parse/panel.py | def get_panel_info(panel_lines=None, panel_id=None, institute=None, version=None, date=None,
display_name=None):
"""Parse metadata for a gene panel
For historical reasons it is possible to include all information about a gene panel in the
header of a panel file. This function parses the ... | def get_panel_info(panel_lines=None, panel_id=None, institute=None, version=None, date=None,
display_name=None):
"""Parse metadata for a gene panel
For historical reasons it is possible to include all information about a gene panel in the
header of a panel file. This function parses the ... | [
"Parse",
"metadata",
"for",
"a",
"gene",
"panel"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/panel.py#L38-L75 | [
"def",
"get_panel_info",
"(",
"panel_lines",
"=",
"None",
",",
"panel_id",
"=",
"None",
",",
"institute",
"=",
"None",
",",
"version",
"=",
"None",
",",
"date",
"=",
"None",
",",
"display_name",
"=",
"None",
")",
":",
"panel_info",
"=",
"{",
"'panel_id'"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_gene | Parse a gene line with information from a panel file
Args:
gene_info(dict): dictionary with gene info
Returns:
gene(dict): A dictionary with the gene information
{
'hgnc_id': int,
'hgnc_symbol': str,
'disease_assoc... | scout/parse/panel.py | def parse_gene(gene_info):
"""Parse a gene line with information from a panel file
Args:
gene_info(dict): dictionary with gene info
Returns:
gene(dict): A dictionary with the gene information
{
'hgnc_id': int,
'hgnc_symbol': s... | def parse_gene(gene_info):
"""Parse a gene line with information from a panel file
Args:
gene_info(dict): dictionary with gene info
Returns:
gene(dict): A dictionary with the gene information
{
'hgnc_id': int,
'hgnc_symbol': s... | [
"Parse",
"a",
"gene",
"line",
"with",
"information",
"from",
"a",
"panel",
"file"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/panel.py#L78-L173 | [
"def",
"parse_gene",
"(",
"gene_info",
")",
":",
"gene",
"=",
"{",
"}",
"# This is either hgnc id or hgnc symbol",
"identifier",
"=",
"None",
"hgnc_id",
"=",
"None",
"try",
":",
"if",
"'hgnc_id'",
"in",
"gene_info",
":",
"hgnc_id",
"=",
"int",
"(",
"gene_info"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_genes | Parse a file with genes and return the hgnc ids
Args:
gene_lines(iterable(str)): Stream with genes
Returns:
genes(list(dict)): Dictionaries with relevant gene info | scout/parse/panel.py | def parse_genes(gene_lines):
"""Parse a file with genes and return the hgnc ids
Args:
gene_lines(iterable(str)): Stream with genes
Returns:
genes(list(dict)): Dictionaries with relevant gene info
"""
genes = []
header = []
hgnc_identifiers = set()
delimiter = '\t'
#... | def parse_genes(gene_lines):
"""Parse a file with genes and return the hgnc ids
Args:
gene_lines(iterable(str)): Stream with genes
Returns:
genes(list(dict)): Dictionaries with relevant gene info
"""
genes = []
header = []
hgnc_identifiers = set()
delimiter = '\t'
#... | [
"Parse",
"a",
"file",
"with",
"genes",
"and",
"return",
"the",
"hgnc",
"ids"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/panel.py#L175-L257 | [
"def",
"parse_genes",
"(",
"gene_lines",
")",
":",
"genes",
"=",
"[",
"]",
"header",
"=",
"[",
"]",
"hgnc_identifiers",
"=",
"set",
"(",
")",
"delimiter",
"=",
"'\\t'",
"# This can be '\\t' or ';'",
"delimiters",
"=",
"[",
"'\\t'",
",",
"' '",
",",
"';'",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_gene_panel | Parse the panel info and return a gene panel
Args:
path(str): Path to panel file
institute(str): Name of institute that owns the panel
panel_id(str): Panel id
date(datetime.datetime): Date of creation
version(float)
full_name(str): Option ... | scout/parse/panel.py | def parse_gene_panel(path, institute='cust000', panel_id='test', panel_type='clinical', date=datetime.now(),
version=1.0, display_name=None, genes = None):
"""Parse the panel info and return a gene panel
Args:
path(str): Path to panel file
institute(str): Name ... | def parse_gene_panel(path, institute='cust000', panel_id='test', panel_type='clinical', date=datetime.now(),
version=1.0, display_name=None, genes = None):
"""Parse the panel info and return a gene panel
Args:
path(str): Path to panel file
institute(str): Name ... | [
"Parse",
"the",
"panel",
"info",
"and",
"return",
"a",
"gene",
"panel"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/panel.py#L260-L293 | [
"def",
"parse_gene_panel",
"(",
"path",
",",
"institute",
"=",
"'cust000'",
",",
"panel_id",
"=",
"'test'",
",",
"panel_type",
"=",
"'clinical'",
",",
"date",
"=",
"datetime",
".",
"now",
"(",
")",
",",
"version",
"=",
"1.0",
",",
"display_name",
"=",
"N... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_panel_app_gene | Parse a panel app formated gene
Args:
app_gene(dict): Dict with panel app info
hgnc_map(dict): Map from hgnc_symbol to hgnc_id
Returns:
gene_info(dict): Scout infromation | scout/parse/panel.py | def parse_panel_app_gene(app_gene, hgnc_map):
"""Parse a panel app formated gene
Args:
app_gene(dict): Dict with panel app info
hgnc_map(dict): Map from hgnc_symbol to hgnc_id
Returns:
gene_info(dict): Scout infromation
"""
gene_info = {}
confidence_level = app_... | def parse_panel_app_gene(app_gene, hgnc_map):
"""Parse a panel app formated gene
Args:
app_gene(dict): Dict with panel app info
hgnc_map(dict): Map from hgnc_symbol to hgnc_id
Returns:
gene_info(dict): Scout infromation
"""
gene_info = {}
confidence_level = app_... | [
"Parse",
"a",
"panel",
"app",
"formated",
"gene",
"Args",
":",
"app_gene",
"(",
"dict",
")",
":",
"Dict",
"with",
"panel",
"app",
"info",
"hgnc_map",
"(",
"dict",
")",
":",
"Map",
"from",
"hgnc_symbol",
"to",
"hgnc_id",
"Returns",
":",
"gene_info",
"(",
... | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/panel.py#L295-L333 | [
"def",
"parse_panel_app_gene",
"(",
"app_gene",
",",
"hgnc_map",
")",
":",
"gene_info",
"=",
"{",
"}",
"confidence_level",
"=",
"app_gene",
"[",
"'LevelOfConfidence'",
"]",
"# Return empty gene if not confident gene",
"if",
"not",
"confidence_level",
"==",
"'HighEvidenc... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_panel_app_panel | Parse a PanelApp panel
Args:
panel_info(dict)
hgnc_map(dict): Map from symbol to hgnc ids
institute(str)
panel_type(str)
Returns:
gene_panel(dict) | scout/parse/panel.py | def parse_panel_app_panel(panel_info, hgnc_map, institute='cust000', panel_type='clinical'):
"""Parse a PanelApp panel
Args:
panel_info(dict)
hgnc_map(dict): Map from symbol to hgnc ids
institute(str)
panel_type(str)
Returns:
gene_panel(dict)
"""
dat... | def parse_panel_app_panel(panel_info, hgnc_map, institute='cust000', panel_type='clinical'):
"""Parse a PanelApp panel
Args:
panel_info(dict)
hgnc_map(dict): Map from symbol to hgnc ids
institute(str)
panel_type(str)
Returns:
gene_panel(dict)
"""
dat... | [
"Parse",
"a",
"PanelApp",
"panel",
"Args",
":",
"panel_info",
"(",
"dict",
")",
"hgnc_map",
"(",
"dict",
")",
":",
"Map",
"from",
"symbol",
"to",
"hgnc",
"ids",
"institute",
"(",
"str",
")",
"panel_type",
"(",
"str",
")",
"Returns",
":",
"gene_panel",
... | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/panel.py#L335-L372 | [
"def",
"parse_panel_app_panel",
"(",
"panel_info",
",",
"hgnc_map",
",",
"institute",
"=",
"'cust000'",
",",
"panel_type",
"=",
"'clinical'",
")",
":",
"date_format",
"=",
"\"%Y-%m-%dT%H:%M:%S.%f\"",
"gene_panel",
"=",
"{",
"}",
"gene_panel",
"[",
"'version'",
"]"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | get_omim_panel_genes | Return all genes that should be included in the OMIM-AUTO panel
Return the hgnc symbols
Genes that have at least one 'established' or 'provisional' phenotype connection
are included in the gene panel
Args:
genemap2_lines(iterable)
mim2gene_lines(iterable)
alias_genes(di... | scout/parse/panel.py | def get_omim_panel_genes(genemap2_lines, mim2gene_lines, alias_genes):
"""Return all genes that should be included in the OMIM-AUTO panel
Return the hgnc symbols
Genes that have at least one 'established' or 'provisional' phenotype connection
are included in the gene panel
Args:
ge... | def get_omim_panel_genes(genemap2_lines, mim2gene_lines, alias_genes):
"""Return all genes that should be included in the OMIM-AUTO panel
Return the hgnc symbols
Genes that have at least one 'established' or 'provisional' phenotype connection
are included in the gene panel
Args:
ge... | [
"Return",
"all",
"genes",
"that",
"should",
"be",
"included",
"in",
"the",
"OMIM",
"-",
"AUTO",
"panel",
"Return",
"the",
"hgnc",
"symbols",
"Genes",
"that",
"have",
"at",
"least",
"one",
"established",
"or",
"provisional",
"phenotype",
"connection",
"are",
... | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/panel.py#L374-L418 | [
"def",
"get_omim_panel_genes",
"(",
"genemap2_lines",
",",
"mim2gene_lines",
",",
"alias_genes",
")",
":",
"parsed_genes",
"=",
"get_mim_genes",
"(",
"genemap2_lines",
",",
"mim2gene_lines",
")",
"STATUS_TO_ADD",
"=",
"set",
"(",
"[",
"'established'",
",",
"'provisi... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | diseases | Show all diseases in the database | scout/commands/view/diseases.py | def diseases(context):
"""Show all diseases in the database"""
LOG.info("Running scout view diseases")
adapter = context.obj['adapter']
disease_objs = adapter.disease_terms()
nr_diseases = disease_objs.count()
if nr_diseases == 0:
click.echo("No diseases found")
else:
click... | def diseases(context):
"""Show all diseases in the database"""
LOG.info("Running scout view diseases")
adapter = context.obj['adapter']
disease_objs = adapter.disease_terms()
nr_diseases = disease_objs.count()
if nr_diseases == 0:
click.echo("No diseases found")
else:
click... | [
"Show",
"all",
"diseases",
"in",
"the",
"database"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/commands/view/diseases.py#L9-L23 | [
"def",
"diseases",
"(",
"context",
")",
":",
"LOG",
".",
"info",
"(",
"\"Running scout view diseases\"",
")",
"adapter",
"=",
"context",
".",
"obj",
"[",
"'adapter'",
"]",
"disease_objs",
"=",
"adapter",
".",
"disease_terms",
"(",
")",
"nr_diseases",
"=",
"d... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | hpo | Update the hpo terms in the database. Fetch the latest release and update terms. | scout/commands/update/hpo.py | def hpo(context):
"""
Update the hpo terms in the database. Fetch the latest release and update terms.
"""
LOG.info("Running scout update hpo")
adapter = context.obj['adapter']
LOG.info("Dropping HPO terms")
adapter.hpo_term_collection.drop()
LOG.debug("HPO terms dropped")
load_hpo... | def hpo(context):
"""
Update the hpo terms in the database. Fetch the latest release and update terms.
"""
LOG.info("Running scout update hpo")
adapter = context.obj['adapter']
LOG.info("Dropping HPO terms")
adapter.hpo_term_collection.drop()
LOG.debug("HPO terms dropped")
load_hpo... | [
"Update",
"the",
"hpo",
"terms",
"in",
"the",
"database",
".",
"Fetch",
"the",
"latest",
"release",
"and",
"update",
"terms",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/commands/update/hpo.py#L19-L30 | [
"def",
"hpo",
"(",
"context",
")",
":",
"LOG",
".",
"info",
"(",
"\"Running scout update hpo\"",
")",
"adapter",
"=",
"context",
".",
"obj",
"[",
"'adapter'",
"]",
"LOG",
".",
"info",
"(",
"\"Dropping HPO terms\"",
")",
"adapter",
".",
"hpo_term_collection",
... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | UpcomingEvents.get_upcoming_events | Repeats an event and returns 'num' (or fewer)
upcoming events from 'now'. | happenings/utils/upcoming.py | def get_upcoming_events(self):
"""
Repeats an event and returns 'num' (or fewer)
upcoming events from 'now'.
"""
if self.event.repeats('NEVER'):
has_ended = False
now_gt_start = self.now > self.event.l_start_date
now_gt_end = self.now > self.ev... | def get_upcoming_events(self):
"""
Repeats an event and returns 'num' (or fewer)
upcoming events from 'now'.
"""
if self.event.repeats('NEVER'):
has_ended = False
now_gt_start = self.now > self.event.l_start_date
now_gt_end = self.now > self.ev... | [
"Repeats",
"an",
"event",
"and",
"returns",
"num",
"(",
"or",
"fewer",
")",
"upcoming",
"events",
"from",
"now",
"."
] | wreckage/django-happenings | python | https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/upcoming.py#L21-L45 | [
"def",
"get_upcoming_events",
"(",
"self",
")",
":",
"if",
"self",
".",
"event",
".",
"repeats",
"(",
"'NEVER'",
")",
":",
"has_ended",
"=",
"False",
"now_gt_start",
"=",
"self",
".",
"now",
">",
"self",
".",
"event",
".",
"l_start_date",
"now_gt_end",
"... | 7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d |
test | UpcomingEvents.we_should_stop | Checks 'start' to see if we should stop collecting upcoming events.
'start' should be a datetime.datetime, 'start_' should be the same
as 'start', but it should be a datetime.date to allow comparison
w/ end_repeat. | happenings/utils/upcoming.py | def we_should_stop(self, start, start_):
"""
Checks 'start' to see if we should stop collecting upcoming events.
'start' should be a datetime.datetime, 'start_' should be the same
as 'start', but it should be a datetime.date to allow comparison
w/ end_repeat.
"""
... | def we_should_stop(self, start, start_):
"""
Checks 'start' to see if we should stop collecting upcoming events.
'start' should be a datetime.datetime, 'start_' should be the same
as 'start', but it should be a datetime.date to allow comparison
w/ end_repeat.
"""
... | [
"Checks",
"start",
"to",
"see",
"if",
"we",
"should",
"stop",
"collecting",
"upcoming",
"events",
".",
"start",
"should",
"be",
"a",
"datetime",
".",
"datetime",
"start_",
"should",
"be",
"the",
"same",
"as",
"start",
"but",
"it",
"should",
"be",
"a",
"d... | wreckage/django-happenings | python | https://github.com/wreckage/django-happenings/blob/7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d/happenings/utils/upcoming.py#L47-L59 | [
"def",
"we_should_stop",
"(",
"self",
",",
"start",
",",
"start_",
")",
":",
"if",
"start",
">",
"self",
".",
"finish",
"or",
"self",
".",
"event",
".",
"end_repeat",
"is",
"not",
"None",
"and",
"start_",
">",
"self",
".",
"event",
".",
"end_repeat",
... | 7bca5576efa6cd4c4e87356bf9e5b8cd538ae91d |
test | users | Display a list of all users and which institutes they belong to. | scout/server/blueprints/login/controllers.py | def users(store):
"""Display a list of all users and which institutes they belong to."""
user_objs = list(store.users())
total_events = store.user_events().count()
for user_obj in user_objs:
if user_obj.get('institutes'):
user_obj['institutes'] = [store.institute(inst_id) for inst_id... | def users(store):
"""Display a list of all users and which institutes they belong to."""
user_objs = list(store.users())
total_events = store.user_events().count()
for user_obj in user_objs:
if user_obj.get('institutes'):
user_obj['institutes'] = [store.institute(inst_id) for inst_id... | [
"Display",
"a",
"list",
"of",
"all",
"users",
"and",
"which",
"institutes",
"they",
"belong",
"to",
"."
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/server/blueprints/login/controllers.py#L20-L34 | [
"def",
"users",
"(",
"store",
")",
":",
"user_objs",
"=",
"list",
"(",
"store",
".",
"users",
"(",
")",
")",
"total_events",
"=",
"store",
".",
"user_events",
"(",
")",
".",
"count",
"(",
")",
"for",
"user_obj",
"in",
"user_objs",
":",
"if",
"user_ob... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_conservations | Parse the conservation predictors
Args:
variant(dict): A variant dictionary
Returns:
conservations(dict): A dictionary with the conservations | scout/parse/variant/conservation.py | def parse_conservations(variant):
"""Parse the conservation predictors
Args:
variant(dict): A variant dictionary
Returns:
conservations(dict): A dictionary with the conservations
"""
conservations = {}
conservations['gerp'] = parse_conservation(
... | def parse_conservations(variant):
"""Parse the conservation predictors
Args:
variant(dict): A variant dictionary
Returns:
conservations(dict): A dictionary with the conservations
"""
conservations = {}
conservations['gerp'] = parse_conservation(
... | [
"Parse",
"the",
"conservation",
"predictors"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/conservation.py#L4-L27 | [
"def",
"parse_conservations",
"(",
"variant",
")",
":",
"conservations",
"=",
"{",
"}",
"conservations",
"[",
"'gerp'",
"]",
"=",
"parse_conservation",
"(",
"variant",
",",
"'dbNSFP_GERP___RS'",
")",
"conservations",
"[",
"'phast'",
"]",
"=",
"parse_conservation",... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
test | parse_conservation | Get the conservation prediction
Args:
variant(dict): A variant dictionary
info_key(str)
Returns:
conservations(list): List of censervation terms | scout/parse/variant/conservation.py | def parse_conservation(variant, info_key):
"""Get the conservation prediction
Args:
variant(dict): A variant dictionary
info_key(str)
Returns:
conservations(list): List of censervation terms
"""
raw_score = variant.INFO.get(info_key)
conservations = ... | def parse_conservation(variant, info_key):
"""Get the conservation prediction
Args:
variant(dict): A variant dictionary
info_key(str)
Returns:
conservations(list): List of censervation terms
"""
raw_score = variant.INFO.get(info_key)
conservations = ... | [
"Get",
"the",
"conservation",
"prediction"
] | Clinical-Genomics/scout | python | https://github.com/Clinical-Genomics/scout/blob/90a551e2e1653a319e654c2405c2866f93d0ebb9/scout/parse/variant/conservation.py#L29-L52 | [
"def",
"parse_conservation",
"(",
"variant",
",",
"info_key",
")",
":",
"raw_score",
"=",
"variant",
".",
"INFO",
".",
"get",
"(",
"info_key",
")",
"conservations",
"=",
"[",
"]",
"if",
"raw_score",
":",
"if",
"isinstance",
"(",
"raw_score",
",",
"numbers"... | 90a551e2e1653a319e654c2405c2866f93d0ebb9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.