repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
inveniosoftware/invenio-access | invenio_access/permissions.py | Permission._load_permissions | def _load_permissions(self):
"""Load permissions associated to actions."""
result = _P(needs=set(), excludes=set())
if not self.allow_by_default:
result.needs.update(self.explicit_needs)
for explicit_need in self.explicit_needs:
if explicit_need.method == 'action... | python | def _load_permissions(self):
"""Load permissions associated to actions."""
result = _P(needs=set(), excludes=set())
if not self.allow_by_default:
result.needs.update(self.explicit_needs)
for explicit_need in self.explicit_needs:
if explicit_need.method == 'action... | [
"def",
"_load_permissions",
"(",
"self",
")",
":",
"result",
"=",
"_P",
"(",
"needs",
"=",
"set",
"(",
")",
",",
"excludes",
"=",
"set",
"(",
")",
")",
"if",
"not",
"self",
".",
"allow_by_default",
":",
"result",
".",
"needs",
".",
"update",
"(",
"... | Load permissions associated to actions. | [
"Load",
"permissions",
"associated",
"to",
"actions",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/permissions.py#L122-L165 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | lazy_result | def lazy_result(f):
"""Decorate function to return LazyProxy."""
@wraps(f)
def decorated(ctx, param, value):
return LocalProxy(lambda: f(ctx, param, value))
return decorated | python | def lazy_result(f):
"""Decorate function to return LazyProxy."""
@wraps(f)
def decorated(ctx, param, value):
return LocalProxy(lambda: f(ctx, param, value))
return decorated | [
"def",
"lazy_result",
"(",
"f",
")",
":",
"@",
"wraps",
"(",
"f",
")",
"def",
"decorated",
"(",
"ctx",
",",
"param",
",",
"value",
")",
":",
"return",
"LocalProxy",
"(",
"lambda",
":",
"f",
"(",
"ctx",
",",
"param",
",",
"value",
")",
")",
"retur... | Decorate function to return LazyProxy. | [
"Decorate",
"function",
"to",
"return",
"LazyProxy",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L30-L35 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | process_action | def process_action(ctx, param, value):
"""Return an action if exists."""
actions = current_app.extensions['invenio-access'].actions
if value not in actions:
raise click.BadParameter('Action "%s" is not registered.', value)
return actions[value] | python | def process_action(ctx, param, value):
"""Return an action if exists."""
actions = current_app.extensions['invenio-access'].actions
if value not in actions:
raise click.BadParameter('Action "%s" is not registered.', value)
return actions[value] | [
"def",
"process_action",
"(",
"ctx",
",",
"param",
",",
"value",
")",
":",
"actions",
"=",
"current_app",
".",
"extensions",
"[",
"'invenio-access'",
"]",
".",
"actions",
"if",
"value",
"not",
"in",
"actions",
":",
"raise",
"click",
".",
"BadParameter",
"(... | Return an action if exists. | [
"Return",
"an",
"action",
"if",
"exists",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L39-L44 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | process_email | def process_email(ctx, param, value):
"""Return an user if it exists."""
user = User.query.filter(User.email == value).first()
if not user:
raise click.BadParameter('User with email \'%s\' not found.', value)
return user | python | def process_email(ctx, param, value):
"""Return an user if it exists."""
user = User.query.filter(User.email == value).first()
if not user:
raise click.BadParameter('User with email \'%s\' not found.', value)
return user | [
"def",
"process_email",
"(",
"ctx",
",",
"param",
",",
"value",
")",
":",
"user",
"=",
"User",
".",
"query",
".",
"filter",
"(",
"User",
".",
"email",
"==",
"value",
")",
".",
"first",
"(",
")",
"if",
"not",
"user",
":",
"raise",
"click",
".",
"B... | Return an user if it exists. | [
"Return",
"an",
"user",
"if",
"it",
"exists",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L48-L53 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | process_role | def process_role(ctx, param, value):
"""Return a role if it exists."""
role = Role.query.filter(Role.name == value).first()
if not role:
raise click.BadParameter('Role with name \'%s\' not found.', value)
return role | python | def process_role(ctx, param, value):
"""Return a role if it exists."""
role = Role.query.filter(Role.name == value).first()
if not role:
raise click.BadParameter('Role with name \'%s\' not found.', value)
return role | [
"def",
"process_role",
"(",
"ctx",
",",
"param",
",",
"value",
")",
":",
"role",
"=",
"Role",
".",
"query",
".",
"filter",
"(",
"Role",
".",
"name",
"==",
"value",
")",
".",
"first",
"(",
")",
"if",
"not",
"role",
":",
"raise",
"click",
".",
"Bad... | Return a role if it exists. | [
"Return",
"a",
"role",
"if",
"it",
"exists",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L57-L62 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | allow_user | def allow_user(user):
"""Allow a user identified by an email address."""
def processor(action, argument):
db.session.add(
ActionUsers.allow(action, argument=argument, user_id=user.id)
)
return processor | python | def allow_user(user):
"""Allow a user identified by an email address."""
def processor(action, argument):
db.session.add(
ActionUsers.allow(action, argument=argument, user_id=user.id)
)
return processor | [
"def",
"allow_user",
"(",
"user",
")",
":",
"def",
"processor",
"(",
"action",
",",
"argument",
")",
":",
"db",
".",
"session",
".",
"add",
"(",
"ActionUsers",
".",
"allow",
"(",
"action",
",",
"argument",
"=",
"argument",
",",
"user_id",
"=",
"user",
... | Allow a user identified by an email address. | [
"Allow",
"a",
"user",
"identified",
"by",
"an",
"email",
"address",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L108-L114 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | allow_role | def allow_role(role):
"""Allow a role identified by an email address."""
def processor(action, argument):
db.session.add(
ActionRoles.allow(action, argument=argument, role_id=role.id)
)
return processor | python | def allow_role(role):
"""Allow a role identified by an email address."""
def processor(action, argument):
db.session.add(
ActionRoles.allow(action, argument=argument, role_id=role.id)
)
return processor | [
"def",
"allow_role",
"(",
"role",
")",
":",
"def",
"processor",
"(",
"action",
",",
"argument",
")",
":",
"db",
".",
"session",
".",
"add",
"(",
"ActionRoles",
".",
"allow",
"(",
"action",
",",
"argument",
"=",
"argument",
",",
"role_id",
"=",
"role",
... | Allow a role identified by an email address. | [
"Allow",
"a",
"role",
"identified",
"by",
"an",
"email",
"address",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L119-L125 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | process_allow_action | def process_allow_action(processors, action, argument):
"""Process allow action."""
for processor in processors:
processor(action, argument)
db.session.commit() | python | def process_allow_action(processors, action, argument):
"""Process allow action."""
for processor in processors:
processor(action, argument)
db.session.commit() | [
"def",
"process_allow_action",
"(",
"processors",
",",
"action",
",",
"argument",
")",
":",
"for",
"processor",
"in",
"processors",
":",
"processor",
"(",
"action",
",",
"argument",
")",
"db",
".",
"session",
".",
"commit",
"(",
")"
] | Process allow action. | [
"Process",
"allow",
"action",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L130-L134 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | deny_user | def deny_user(user):
"""Deny a user identified by an email address."""
def processor(action, argument):
db.session.add(
ActionUsers.deny(action, argument=argument, user_id=user.id)
)
return processor | python | def deny_user(user):
"""Deny a user identified by an email address."""
def processor(action, argument):
db.session.add(
ActionUsers.deny(action, argument=argument, user_id=user.id)
)
return processor | [
"def",
"deny_user",
"(",
"user",
")",
":",
"def",
"processor",
"(",
"action",
",",
"argument",
")",
":",
"db",
".",
"session",
".",
"add",
"(",
"ActionUsers",
".",
"deny",
"(",
"action",
",",
"argument",
"=",
"argument",
",",
"user_id",
"=",
"user",
... | Deny a user identified by an email address. | [
"Deny",
"a",
"user",
"identified",
"by",
"an",
"email",
"address",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L149-L155 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | deny_role | def deny_role(role):
"""Deny a role identified by an email address."""
def processor(action, argument):
db.session.add(
ActionRoles.deny(action, argument=argument, role_id=role.id)
)
return processor | python | def deny_role(role):
"""Deny a role identified by an email address."""
def processor(action, argument):
db.session.add(
ActionRoles.deny(action, argument=argument, role_id=role.id)
)
return processor | [
"def",
"deny_role",
"(",
"role",
")",
":",
"def",
"processor",
"(",
"action",
",",
"argument",
")",
":",
"db",
".",
"session",
".",
"add",
"(",
"ActionRoles",
".",
"deny",
"(",
"action",
",",
"argument",
"=",
"argument",
",",
"role_id",
"=",
"role",
... | Deny a role identified by an email address. | [
"Deny",
"a",
"role",
"identified",
"by",
"an",
"email",
"address",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L160-L166 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | process_deny_action | def process_deny_action(processors, action, argument):
"""Process deny action."""
for processor in processors:
processor(action, argument)
db.session.commit() | python | def process_deny_action(processors, action, argument):
"""Process deny action."""
for processor in processors:
processor(action, argument)
db.session.commit() | [
"def",
"process_deny_action",
"(",
"processors",
",",
"action",
",",
"argument",
")",
":",
"for",
"processor",
"in",
"processors",
":",
"processor",
"(",
"action",
",",
"argument",
")",
"db",
".",
"session",
".",
"commit",
"(",
")"
] | Process deny action. | [
"Process",
"deny",
"action",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L171-L175 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | remove_global | def remove_global():
"""Remove global action rule."""
def processor(action, argument):
ActionUsers.query_by_action(action, argument=argument).filter(
ActionUsers.user_id.is_(None)
).delete(synchronize_session=False)
return processor | python | def remove_global():
"""Remove global action rule."""
def processor(action, argument):
ActionUsers.query_by_action(action, argument=argument).filter(
ActionUsers.user_id.is_(None)
).delete(synchronize_session=False)
return processor | [
"def",
"remove_global",
"(",
")",
":",
"def",
"processor",
"(",
"action",
",",
"argument",
")",
":",
"ActionUsers",
".",
"query_by_action",
"(",
"action",
",",
"argument",
"=",
"argument",
")",
".",
"filter",
"(",
"ActionUsers",
".",
"user_id",
".",
"is_",... | Remove global action rule. | [
"Remove",
"global",
"action",
"rule",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L193-L199 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | remove_user | def remove_user(user):
"""Remove a action for a user."""
def processor(action, argument):
ActionUsers.query_by_action(action, argument=argument).filter(
ActionUsers.user_id == user.id
).delete(synchronize_session=False)
return processor | python | def remove_user(user):
"""Remove a action for a user."""
def processor(action, argument):
ActionUsers.query_by_action(action, argument=argument).filter(
ActionUsers.user_id == user.id
).delete(synchronize_session=False)
return processor | [
"def",
"remove_user",
"(",
"user",
")",
":",
"def",
"processor",
"(",
"action",
",",
"argument",
")",
":",
"ActionUsers",
".",
"query_by_action",
"(",
"action",
",",
"argument",
"=",
"argument",
")",
".",
"filter",
"(",
"ActionUsers",
".",
"user_id",
"==",... | Remove a action for a user. | [
"Remove",
"a",
"action",
"for",
"a",
"user",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L204-L210 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | remove_role | def remove_role(role):
"""Remove a action for a role."""
def processor(action, argument):
ActionRoles.query_by_action(action, argument=argument).filter(
ActionRoles.role_id == role.id
).delete(synchronize_session=False)
return processor | python | def remove_role(role):
"""Remove a action for a role."""
def processor(action, argument):
ActionRoles.query_by_action(action, argument=argument).filter(
ActionRoles.role_id == role.id
).delete(synchronize_session=False)
return processor | [
"def",
"remove_role",
"(",
"role",
")",
":",
"def",
"processor",
"(",
"action",
",",
"argument",
")",
":",
"ActionRoles",
".",
"query_by_action",
"(",
"action",
",",
"argument",
"=",
"argument",
")",
".",
"filter",
"(",
"ActionRoles",
".",
"role_id",
"==",... | Remove a action for a role. | [
"Remove",
"a",
"action",
"for",
"a",
"role",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L215-L221 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | process_remove_action | def process_remove_action(processors, action, argument):
"""Process action removals."""
for processor in processors:
processor(action, argument)
db.session.commit() | python | def process_remove_action(processors, action, argument):
"""Process action removals."""
for processor in processors:
processor(action, argument)
db.session.commit() | [
"def",
"process_remove_action",
"(",
"processors",
",",
"action",
",",
"argument",
")",
":",
"for",
"processor",
"in",
"processors",
":",
"processor",
"(",
"action",
",",
"argument",
")",
"db",
".",
"session",
".",
"commit",
"(",
")"
] | Process action removals. | [
"Process",
"action",
"removals",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L226-L230 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | list_actions | def list_actions():
"""List all registered actions."""
for name, action in _current_actions.items():
click.echo('{0}:{1}'.format(
name, '*' if hasattr(action, 'argument') else ''
)) | python | def list_actions():
"""List all registered actions."""
for name, action in _current_actions.items():
click.echo('{0}:{1}'.format(
name, '*' if hasattr(action, 'argument') else ''
)) | [
"def",
"list_actions",
"(",
")",
":",
"for",
"name",
",",
"action",
"in",
"_current_actions",
".",
"items",
"(",
")",
":",
"click",
".",
"echo",
"(",
"'{0}:{1}'",
".",
"format",
"(",
"name",
",",
"'*'",
"if",
"hasattr",
"(",
"action",
",",
"'argument'"... | List all registered actions. | [
"List",
"all",
"registered",
"actions",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L235-L240 | train |
inveniosoftware/invenio-access | invenio_access/cli.py | show_actions | def show_actions(email, role):
"""Show all assigned actions."""
if email:
actions = ActionUsers.query.join(ActionUsers.user).filter(
User.email.in_(email)
).all()
for action in actions:
click.secho('user:{0}:{1}:{2}:{3}'.format(
action.user.email,
... | python | def show_actions(email, role):
"""Show all assigned actions."""
if email:
actions = ActionUsers.query.join(ActionUsers.user).filter(
User.email.in_(email)
).all()
for action in actions:
click.secho('user:{0}:{1}:{2}:{3}'.format(
action.user.email,
... | [
"def",
"show_actions",
"(",
"email",
",",
"role",
")",
":",
"if",
"email",
":",
"actions",
"=",
"ActionUsers",
".",
"query",
".",
"join",
"(",
"ActionUsers",
".",
"user",
")",
".",
"filter",
"(",
"User",
".",
"email",
".",
"in_",
"(",
"email",
")",
... | Show all assigned actions. | [
"Show",
"all",
"assigned",
"actions",
"."
] | 3b033a4bdc110eb2f7e9f08f0744a780884bfc80 | https://github.com/inveniosoftware/invenio-access/blob/3b033a4bdc110eb2f7e9f08f0744a780884bfc80/invenio_access/cli.py#L247-L271 | train |
BD2KGenomics/protect | src/protect/addons/assess_mhc_pathway.py | run_mhc_gene_assessment | def run_mhc_gene_assessment(job, rsem_files, rna_haplotype, univ_options, reports_options):
"""
A wrapper for assess_mhc_genes.
:param dict rsem_files: Results from running rsem
:param str rna_haplotype: The job store id for the rna haplotype file
:param dict univ_options: Dict of universal options... | python | def run_mhc_gene_assessment(job, rsem_files, rna_haplotype, univ_options, reports_options):
"""
A wrapper for assess_mhc_genes.
:param dict rsem_files: Results from running rsem
:param str rna_haplotype: The job store id for the rna haplotype file
:param dict univ_options: Dict of universal options... | [
"def",
"run_mhc_gene_assessment",
"(",
"job",
",",
"rsem_files",
",",
"rna_haplotype",
",",
"univ_options",
",",
"reports_options",
")",
":",
"return",
"job",
".",
"addChildJobFn",
"(",
"assess_mhc_genes",
",",
"rsem_files",
"[",
"'rsem.genes.results'",
"]",
",",
... | A wrapper for assess_mhc_genes.
:param dict rsem_files: Results from running rsem
:param str rna_haplotype: The job store id for the rna haplotype file
:param dict univ_options: Dict of universal options used by almost all tools
:param dict reports_options: Options specific to reporting modules
:re... | [
"A",
"wrapper",
"for",
"assess_mhc_genes",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/addons/assess_mhc_pathway.py#L27-L39 | train |
BD2KGenomics/protect | attic/ProTECT.py | parse_config_file | def parse_config_file(job, config_file):
"""
This module will parse the config file withing params and set up the variables that will be
passed to the various tools in the pipeline.
ARGUMENTS
config_file: string containing path to a config file. An example config
file is available... | python | def parse_config_file(job, config_file):
"""
This module will parse the config file withing params and set up the variables that will be
passed to the various tools in the pipeline.
ARGUMENTS
config_file: string containing path to a config file. An example config
file is available... | [
"def",
"parse_config_file",
"(",
"job",
",",
"config_file",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Parsing config file'",
")",
"config_file",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"config_file",
")",
"if",
"not",
"os",
".",
"p... | This module will parse the config file withing params and set up the variables that will be
passed to the various tools in the pipeline.
ARGUMENTS
config_file: string containing path to a config file. An example config
file is available at
https://s3-us-west-2.amaz... | [
"This",
"module",
"will",
"parse",
"the",
"config",
"file",
"withing",
"params",
"and",
"set",
"up",
"the",
"variables",
"that",
"will",
"be",
"passed",
"to",
"the",
"various",
"tools",
"in",
"the",
"pipeline",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L46-L109 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_cutadapt | def run_cutadapt(job, fastqs, univ_options, cutadapt_options):
"""
This module runs cutadapt on the input RNA fastq files and then calls the RNA aligners.
ARGUMENTS
1. fastqs: Dict of list of input RNA-Seq fastqs
fastqs
+- 'tumor_rna': [<JSid for 1.fastq> , <JSid for 2.fastq>]
... | python | def run_cutadapt(job, fastqs, univ_options, cutadapt_options):
"""
This module runs cutadapt on the input RNA fastq files and then calls the RNA aligners.
ARGUMENTS
1. fastqs: Dict of list of input RNA-Seq fastqs
fastqs
+- 'tumor_rna': [<JSid for 1.fastq> , <JSid for 2.fastq>]
... | [
"def",
"run_cutadapt",
"(",
"job",
",",
"fastqs",
",",
"univ_options",
",",
"cutadapt_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running cutadapt on %s'",
"%",
"univ_options",
"[",
"'patient'",
"]",
")",
"work_dir",
"=",
"job",
"."... | This module runs cutadapt on the input RNA fastq files and then calls the RNA aligners.
ARGUMENTS
1. fastqs: Dict of list of input RNA-Seq fastqs
fastqs
+- 'tumor_rna': [<JSid for 1.fastq> , <JSid for 2.fastq>]
2. univ_options: Dict of universal arguments used by almost all tools
... | [
"This",
"module",
"runs",
"cutadapt",
"on",
"the",
"input",
"RNA",
"fastq",
"files",
"and",
"then",
"calls",
"the",
"RNA",
"aligners",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L256-L298 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_star | def run_star(job, fastqs, univ_options, star_options):
"""
This module uses STAR to align the RNA fastqs to the reference
ARGUMENTS
1. fastqs: REFER RETURN VALUE of run_cutadapt()
2. univ_options: Dict of universal arguments used by almost all tools
univ_options
+- 'dockerhub... | python | def run_star(job, fastqs, univ_options, star_options):
"""
This module uses STAR to align the RNA fastqs to the reference
ARGUMENTS
1. fastqs: REFER RETURN VALUE of run_cutadapt()
2. univ_options: Dict of universal arguments used by almost all tools
univ_options
+- 'dockerhub... | [
"def",
"run_star",
"(",
"job",
",",
"fastqs",
",",
"univ_options",
",",
"star_options",
")",
":",
"assert",
"star_options",
"[",
"'type'",
"]",
"in",
"(",
"'star'",
",",
"'starlong'",
")",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running STAR on %... | This module uses STAR to align the RNA fastqs to the reference
ARGUMENTS
1. fastqs: REFER RETURN VALUE of run_cutadapt()
2. univ_options: Dict of universal arguments used by almost all tools
univ_options
+- 'dockerhub': <dockerhub to use>
3. star_options: Dict of parameters speci... | [
"This",
"module",
"uses",
"STAR",
"to",
"align",
"the",
"RNA",
"fastqs",
"to",
"the",
"reference"
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L301-L361 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_bwa | def run_bwa(job, fastqs, sample_type, univ_options, bwa_options):
"""
This module aligns the SAMPLE_TYPE dna fastqs to the reference
ARGUMENTS -- <ST> depicts the sample type. Substitute with 'tumor'/'normal'
1. fastqs: Dict of list of input WGS/WXS fastqs
fastqs
+- '<ST>_dna': [... | python | def run_bwa(job, fastqs, sample_type, univ_options, bwa_options):
"""
This module aligns the SAMPLE_TYPE dna fastqs to the reference
ARGUMENTS -- <ST> depicts the sample type. Substitute with 'tumor'/'normal'
1. fastqs: Dict of list of input WGS/WXS fastqs
fastqs
+- '<ST>_dna': [... | [
"def",
"run_bwa",
"(",
"job",
",",
"fastqs",
",",
"sample_type",
",",
"univ_options",
",",
"bwa_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running bwa on %s:%s'",
"%",
"(",
"univ_options",
"[",
"'patient'",
"]",
",",
"sample_type",... | This module aligns the SAMPLE_TYPE dna fastqs to the reference
ARGUMENTS -- <ST> depicts the sample type. Substitute with 'tumor'/'normal'
1. fastqs: Dict of list of input WGS/WXS fastqs
fastqs
+- '<ST>_dna': [<JSid for 1.fastq> , <JSid for 2.fastq>]
2. sample_type: string of 'tumor_... | [
"This",
"module",
"aligns",
"the",
"SAMPLE_TYPE",
"dna",
"fastqs",
"to",
"the",
"reference"
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L364-L414 | train |
BD2KGenomics/protect | attic/ProTECT.py | bam_conversion | def bam_conversion(job, samfile, sample_type, univ_options):
"""
This module converts SAMFILE from sam to bam
ARGUMENTS
1. samfile: <JSid for a sam file>
2. sample_type: string of 'tumor_dna' or 'normal_dna'
3. univ_options: Dict of universal arguments used by almost all tools
univ_opt... | python | def bam_conversion(job, samfile, sample_type, univ_options):
"""
This module converts SAMFILE from sam to bam
ARGUMENTS
1. samfile: <JSid for a sam file>
2. sample_type: string of 'tumor_dna' or 'normal_dna'
3. univ_options: Dict of universal arguments used by almost all tools
univ_opt... | [
"def",
"bam_conversion",
"(",
"job",
",",
"samfile",
",",
"sample_type",
",",
"univ_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running sam2bam on %s:%s'",
"%",
"(",
"univ_options",
"[",
"'patient'",
"]",
",",
"sample_type",
")",
")... | This module converts SAMFILE from sam to bam
ARGUMENTS
1. samfile: <JSid for a sam file>
2. sample_type: string of 'tumor_dna' or 'normal_dna'
3. univ_options: Dict of universal arguments used by almost all tools
univ_options
+- 'dockerhub': <dockerhub to use>
RETURN VALUES... | [
"This",
"module",
"converts",
"SAMFILE",
"from",
"sam",
"to",
"bam"
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L417-L448 | train |
BD2KGenomics/protect | attic/ProTECT.py | fix_bam_header | def fix_bam_header(job, bamfile, sample_type, univ_options):
"""
This module modified the header in BAMFILE
ARGUMENTS
1. bamfile: <JSid for a bam file>
2. sample_type: string of 'tumor_dna' or 'normal_dna'
3. univ_options: Dict of universal arguments used by almost all tools
univ_optio... | python | def fix_bam_header(job, bamfile, sample_type, univ_options):
"""
This module modified the header in BAMFILE
ARGUMENTS
1. bamfile: <JSid for a bam file>
2. sample_type: string of 'tumor_dna' or 'normal_dna'
3. univ_options: Dict of universal arguments used by almost all tools
univ_optio... | [
"def",
"fix_bam_header",
"(",
"job",
",",
"bamfile",
",",
"sample_type",
",",
"univ_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running reheader on %s:%s'",
"%",
"(",
"univ_options",
"[",
"'patient'",
"]",
",",
"sample_type",
")",
"... | This module modified the header in BAMFILE
ARGUMENTS
1. bamfile: <JSid for a bam file>
2. sample_type: string of 'tumor_dna' or 'normal_dna'
3. univ_options: Dict of universal arguments used by almost all tools
univ_options
+- 'dockerhub': <dockerhub to use>
RETURN VALUES
... | [
"This",
"module",
"modified",
"the",
"header",
"in",
"BAMFILE"
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L451-L491 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_rsem | def run_rsem(job, star_bams, univ_options, rsem_options):
"""
This module will run rsem on the RNA Bam file.
ARGUMENTS
1. star_bams: Dict of input STAR bams
star_bams
+- 'rnaAligned.toTranscriptome.out.bam': <JSid>
2. univ_options: Dict of universal arguments used by almost a... | python | def run_rsem(job, star_bams, univ_options, rsem_options):
"""
This module will run rsem on the RNA Bam file.
ARGUMENTS
1. star_bams: Dict of input STAR bams
star_bams
+- 'rnaAligned.toTranscriptome.out.bam': <JSid>
2. univ_options: Dict of universal arguments used by almost a... | [
"def",
"run_rsem",
"(",
"job",
",",
"star_bams",
",",
"univ_options",
",",
"rsem_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running rsem index on %s'",
"%",
"univ_options",
"[",
"'patient'",
"]",
")",
"work_dir",
"=",
"job",
".",
... | This module will run rsem on the RNA Bam file.
ARGUMENTS
1. star_bams: Dict of input STAR bams
star_bams
+- 'rnaAligned.toTranscriptome.out.bam': <JSid>
2. univ_options: Dict of universal arguments used by almost all tools
univ_options
+- 'dockerhub': <docker... | [
"This",
"module",
"will",
"run",
"rsem",
"on",
"the",
"RNA",
"Bam",
"file",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L565-L603 | train |
BD2KGenomics/protect | attic/ProTECT.py | merge_radia | def merge_radia(job, perchrom_rvs):
"""
This module will merge the per-chromosome radia files created by spawn_radia into a genome vcf.
It will make 2 vcfs, one for PASSing non-germline calls, and one for all calls.
ARGUMENTS
1. perchrom_rvs: REFER RETURN VALUE of spawn_radia()
RETURN VALUES
... | python | def merge_radia(job, perchrom_rvs):
"""
This module will merge the per-chromosome radia files created by spawn_radia into a genome vcf.
It will make 2 vcfs, one for PASSing non-germline calls, and one for all calls.
ARGUMENTS
1. perchrom_rvs: REFER RETURN VALUE of spawn_radia()
RETURN VALUES
... | [
"def",
"merge_radia",
"(",
"job",
",",
"perchrom_rvs",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running merge_radia'",
")",
"work_dir",
"=",
"job",
".",
"fileStore",
".",
"getLocalTempDir",
"(",
")",
"input_files",
"=",
"{",
"filename",
... | This module will merge the per-chromosome radia files created by spawn_radia into a genome vcf.
It will make 2 vcfs, one for PASSing non-germline calls, and one for all calls.
ARGUMENTS
1. perchrom_rvs: REFER RETURN VALUE of spawn_radia()
RETURN VALUES
1. output_files: Dict of outputs
... | [
"This",
"module",
"will",
"merge",
"the",
"per",
"-",
"chromosome",
"radia",
"files",
"created",
"by",
"spawn_radia",
"into",
"a",
"genome",
"vcf",
".",
"It",
"will",
"make",
"2",
"vcfs",
"one",
"for",
"PASSing",
"non",
"-",
"germline",
"calls",
"and",
"... | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L738-L787 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_radia | def run_radia(job, bams, univ_options, radia_options, chrom):
"""
This module will run radia on the RNA and DNA bams
ARGUMENTS
1. bams: Dict of bams and their indexes
bams
|- 'tumor_rna': <JSid>
|- 'tumor_rnai': <JSid>
|- 'tumor_dna': <JSid>
|- 'tumor_dnai': ... | python | def run_radia(job, bams, univ_options, radia_options, chrom):
"""
This module will run radia on the RNA and DNA bams
ARGUMENTS
1. bams: Dict of bams and their indexes
bams
|- 'tumor_rna': <JSid>
|- 'tumor_rnai': <JSid>
|- 'tumor_dna': <JSid>
|- 'tumor_dnai': ... | [
"def",
"run_radia",
"(",
"job",
",",
"bams",
",",
"univ_options",
",",
"radia_options",
",",
"chrom",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running radia on %s:%s'",
"%",
"(",
"univ_options",
"[",
"'patient'",
"]",
",",
"chrom",
")",
... | This module will run radia on the RNA and DNA bams
ARGUMENTS
1. bams: Dict of bams and their indexes
bams
|- 'tumor_rna': <JSid>
|- 'tumor_rnai': <JSid>
|- 'tumor_dna': <JSid>
|- 'tumor_dnai': <JSid>
|- 'normal_dna': <JSid>
+- 'normal_dnai': <JSid>
... | [
"This",
"module",
"will",
"run",
"radia",
"on",
"the",
"RNA",
"and",
"DNA",
"bams"
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L790-L857 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_filter_radia | def run_filter_radia(job, bams, radia_file, univ_options, radia_options, chrom):
"""
This module will run filterradia on the RNA and DNA bams.
ARGUMENTS
1. bams: REFER ARGUMENTS of run_radia()
2. univ_options: REFER ARGUMENTS of run_radia()
3. radia_file: <JSid of vcf generated by run_radia()>
... | python | def run_filter_radia(job, bams, radia_file, univ_options, radia_options, chrom):
"""
This module will run filterradia on the RNA and DNA bams.
ARGUMENTS
1. bams: REFER ARGUMENTS of run_radia()
2. univ_options: REFER ARGUMENTS of run_radia()
3. radia_file: <JSid of vcf generated by run_radia()>
... | [
"def",
"run_filter_radia",
"(",
"job",
",",
"bams",
",",
"radia_file",
",",
"univ_options",
",",
"radia_options",
",",
"chrom",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running filter-radia on %s:%s'",
"%",
"(",
"univ_options",
"[",
"'patien... | This module will run filterradia on the RNA and DNA bams.
ARGUMENTS
1. bams: REFER ARGUMENTS of run_radia()
2. univ_options: REFER ARGUMENTS of run_radia()
3. radia_file: <JSid of vcf generated by run_radia()>
3. radia_options: REFER ARGUMENTS of run_radia()
4. chrom: REFER ARGUMENTS of run_rad... | [
"This",
"module",
"will",
"run",
"filterradia",
"on",
"the",
"RNA",
"and",
"DNA",
"bams",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L860-L921 | train |
BD2KGenomics/protect | attic/ProTECT.py | merge_mutect | def merge_mutect(job, perchrom_rvs):
"""
This module will merge the per-chromosome mutect files created by spawn_mutect into a genome
vcf. It will make 2 vcfs, one for PASSing non-germline calls, and one for all calls.
ARGUMENTS
1. perchrom_rvs: REFER RETURN VALUE of spawn_mutect()
RETURN VAL... | python | def merge_mutect(job, perchrom_rvs):
"""
This module will merge the per-chromosome mutect files created by spawn_mutect into a genome
vcf. It will make 2 vcfs, one for PASSing non-germline calls, and one for all calls.
ARGUMENTS
1. perchrom_rvs: REFER RETURN VALUE of spawn_mutect()
RETURN VAL... | [
"def",
"merge_mutect",
"(",
"job",
",",
"perchrom_rvs",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running merge_mutect'",
")",
"work_dir",
"=",
"job",
".",
"fileStore",
".",
"getLocalTempDir",
"(",
")",
"input_files",
"=",
"{",
"filename",
... | This module will merge the per-chromosome mutect files created by spawn_mutect into a genome
vcf. It will make 2 vcfs, one for PASSing non-germline calls, and one for all calls.
ARGUMENTS
1. perchrom_rvs: REFER RETURN VALUE of spawn_mutect()
RETURN VALUES
1. output_files: <JSid for mutect_passing... | [
"This",
"module",
"will",
"merge",
"the",
"per",
"-",
"chromosome",
"mutect",
"files",
"created",
"by",
"spawn_mutect",
"into",
"a",
"genome",
"vcf",
".",
"It",
"will",
"make",
"2",
"vcfs",
"one",
"for",
"PASSing",
"non",
"-",
"germline",
"calls",
"and",
... | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L973-L1026 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_mutect | def run_mutect(job, tumor_bam, normal_bam, univ_options, mutect_options, chrom):
"""
This module will run mutect on the DNA bams
ARGUMENTS
1. tumor_bam: REFER ARGUMENTS of spawn_mutect()
2. normal_bam: REFER ARGUMENTS of spawn_mutect()
3. univ_options: REFER ARGUMENTS of spawn_mutect()
4. m... | python | def run_mutect(job, tumor_bam, normal_bam, univ_options, mutect_options, chrom):
"""
This module will run mutect on the DNA bams
ARGUMENTS
1. tumor_bam: REFER ARGUMENTS of spawn_mutect()
2. normal_bam: REFER ARGUMENTS of spawn_mutect()
3. univ_options: REFER ARGUMENTS of spawn_mutect()
4. m... | [
"def",
"run_mutect",
"(",
"job",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"mutect_options",
",",
"chrom",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running mutect on %s:%s'",
"%",
"(",
"univ_options",
"[",
"'patient'",
... | This module will run mutect on the DNA bams
ARGUMENTS
1. tumor_bam: REFER ARGUMENTS of spawn_mutect()
2. normal_bam: REFER ARGUMENTS of spawn_mutect()
3. univ_options: REFER ARGUMENTS of spawn_mutect()
4. mutect_options: REFER ARGUMENTS of spawn_mutect()
5. chrom: String containing chromosome n... | [
"This",
"module",
"will",
"run",
"mutect",
"on",
"the",
"DNA",
"bams"
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L1029-L1083 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_indel_caller | def run_indel_caller(job, tumor_bam, normal_bam, univ_options, indel_options):
"""
This module will run an indel caller on the DNA bams. This module will be
implemented in the future.
This module corresponds to node 13 on the tree
"""
job.fileStore.logToMaster('Running INDEL on %s' % univ_opti... | python | def run_indel_caller(job, tumor_bam, normal_bam, univ_options, indel_options):
"""
This module will run an indel caller on the DNA bams. This module will be
implemented in the future.
This module corresponds to node 13 on the tree
"""
job.fileStore.logToMaster('Running INDEL on %s' % univ_opti... | [
"def",
"run_indel_caller",
"(",
"job",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"indel_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running INDEL on %s'",
"%",
"univ_options",
"[",
"'patient'",
"]",
")",
"indel_fi... | This module will run an indel caller on the DNA bams. This module will be
implemented in the future.
This module corresponds to node 13 on the tree | [
"This",
"module",
"will",
"run",
"an",
"indel",
"caller",
"on",
"the",
"DNA",
"bams",
".",
"This",
"module",
"will",
"be",
"implemented",
"in",
"the",
"future",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L1086-L1096 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_fusion_caller | def run_fusion_caller(job, star_bam, univ_options, fusion_options):
"""
This module will run a fusion caller on DNA bams. This module will be
implemented in the future.
This module corresponds to node 10 on the tree
"""
job.fileStore.logToMaster('Running FUSION on %s' % univ_options['patient']... | python | def run_fusion_caller(job, star_bam, univ_options, fusion_options):
"""
This module will run a fusion caller on DNA bams. This module will be
implemented in the future.
This module corresponds to node 10 on the tree
"""
job.fileStore.logToMaster('Running FUSION on %s' % univ_options['patient']... | [
"def",
"run_fusion_caller",
"(",
"job",
",",
"star_bam",
",",
"univ_options",
",",
"fusion_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running FUSION on %s'",
"%",
"univ_options",
"[",
"'patient'",
"]",
")",
"fusion_file",
"=",
"job",... | This module will run a fusion caller on DNA bams. This module will be
implemented in the future.
This module corresponds to node 10 on the tree | [
"This",
"module",
"will",
"run",
"a",
"fusion",
"caller",
"on",
"DNA",
"bams",
".",
"This",
"module",
"will",
"be",
"implemented",
"in",
"the",
"future",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L1099-L1109 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_mutation_aggregator | def run_mutation_aggregator(job, fusion_output, radia_output, mutect_output, indel_output,
univ_options):
"""
This module will aggregate all the mutations called in the previous steps and will then call
snpeff on the results.
ARGUMENTS
1. fusion_output: <JSid for vcf gen... | python | def run_mutation_aggregator(job, fusion_output, radia_output, mutect_output, indel_output,
univ_options):
"""
This module will aggregate all the mutations called in the previous steps and will then call
snpeff on the results.
ARGUMENTS
1. fusion_output: <JSid for vcf gen... | [
"def",
"run_mutation_aggregator",
"(",
"job",
",",
"fusion_output",
",",
"radia_output",
",",
"mutect_output",
",",
"indel_output",
",",
"univ_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Aggregating mutations for %s'",
"%",
"univ_options",
... | This module will aggregate all the mutations called in the previous steps and will then call
snpeff on the results.
ARGUMENTS
1. fusion_output: <JSid for vcf generated by the fusion caller>
2. radia_output: <JSid for vcf generated by radia>
3. mutect_output: <JSid for vcf generated by mutect>
4... | [
"This",
"module",
"will",
"aggregate",
"all",
"the",
"mutations",
"called",
"in",
"the",
"previous",
"steps",
"and",
"will",
"then",
"call",
"snpeff",
"on",
"the",
"results",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L1112-L1161 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_snpeff | def run_snpeff(job, merged_mutation_file, univ_options, snpeff_options):
"""
This module will run snpeff on the aggregated mutation calls. Currently the only mutations
called are SNPs hence SnpEff suffices. This node will be replaced in the future with another
translator.
ARGUMENTS
1. merged_m... | python | def run_snpeff(job, merged_mutation_file, univ_options, snpeff_options):
"""
This module will run snpeff on the aggregated mutation calls. Currently the only mutations
called are SNPs hence SnpEff suffices. This node will be replaced in the future with another
translator.
ARGUMENTS
1. merged_m... | [
"def",
"run_snpeff",
"(",
"job",
",",
"merged_mutation_file",
",",
"univ_options",
",",
"snpeff_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running snpeff on %s'",
"%",
"univ_options",
"[",
"'patient'",
"]",
")",
"work_dir",
"=",
"job... | This module will run snpeff on the aggregated mutation calls. Currently the only mutations
called are SNPs hence SnpEff suffices. This node will be replaced in the future with another
translator.
ARGUMENTS
1. merged_mutation_file: <JSid for merged vcf>
2. univ_options: Dict of universal arguments ... | [
"This",
"module",
"will",
"run",
"snpeff",
"on",
"the",
"aggregated",
"mutation",
"calls",
".",
"Currently",
"the",
"only",
"mutations",
"called",
"are",
"SNPs",
"hence",
"SnpEff",
"suffices",
".",
"This",
"node",
"will",
"be",
"replaced",
"in",
"the",
"futu... | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L1164-L1205 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_transgene | def run_transgene(job, snpeffed_file, univ_options, transgene_options):
"""
This module will run transgene on the input vcf file from the aggregator and produce the
peptides for MHC prediction
ARGUMENTS
1. snpeffed_file: <JSid for snpeffed vcf>
2. univ_options: Dict of universal arguments used ... | python | def run_transgene(job, snpeffed_file, univ_options, transgene_options):
"""
This module will run transgene on the input vcf file from the aggregator and produce the
peptides for MHC prediction
ARGUMENTS
1. snpeffed_file: <JSid for snpeffed vcf>
2. univ_options: Dict of universal arguments used ... | [
"def",
"run_transgene",
"(",
"job",
",",
"snpeffed_file",
",",
"univ_options",
",",
"transgene_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running transgene on %s'",
"%",
"univ_options",
"[",
"'patient'",
"]",
")",
"work_dir",
"=",
"j... | This module will run transgene on the input vcf file from the aggregator and produce the
peptides for MHC prediction
ARGUMENTS
1. snpeffed_file: <JSid for snpeffed vcf>
2. univ_options: Dict of universal arguments used by almost all tools
univ_options
+- 'dockerhub': <dockerhub... | [
"This",
"module",
"will",
"run",
"transgene",
"on",
"the",
"input",
"vcf",
"file",
"from",
"the",
"aggregator",
"and",
"produce",
"the",
"peptides",
"for",
"MHC",
"prediction"
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L1208-L1249 | train |
BD2KGenomics/protect | attic/ProTECT.py | run_phlat | def run_phlat(job, fastqs, sample_type, univ_options, phlat_options):
"""
This module will run PHLAT on SAMPLE_TYPE fastqs.
ARGUMENTS -- <ST> depicts the sample type. Substitute with 'tumor_dna',
'normal_dna', or 'tumor_rna'
1. fastqs: Dict of list of input WGS/WXS fastqs
fast... | python | def run_phlat(job, fastqs, sample_type, univ_options, phlat_options):
"""
This module will run PHLAT on SAMPLE_TYPE fastqs.
ARGUMENTS -- <ST> depicts the sample type. Substitute with 'tumor_dna',
'normal_dna', or 'tumor_rna'
1. fastqs: Dict of list of input WGS/WXS fastqs
fast... | [
"def",
"run_phlat",
"(",
"job",
",",
"fastqs",
",",
"sample_type",
",",
"univ_options",
",",
"phlat_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running phlat on %s:%s'",
"%",
"(",
"univ_options",
"[",
"'patient'",
"]",
",",
"sample_... | This module will run PHLAT on SAMPLE_TYPE fastqs.
ARGUMENTS -- <ST> depicts the sample type. Substitute with 'tumor_dna',
'normal_dna', or 'tumor_rna'
1. fastqs: Dict of list of input WGS/WXS fastqs
fastqs
+- '<ST>': [<JSid for 1.fastq> , <JSid for 2.fastq>]
2. sampl... | [
"This",
"module",
"will",
"run",
"PHLAT",
"on",
"SAMPLE_TYPE",
"fastqs",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L1252-L1294 | train |
BD2KGenomics/protect | attic/ProTECT.py | merge_phlat_calls | def merge_phlat_calls(job, tumor_phlat, normal_phlat, rna_phlat):
"""
This module will merge the results form running PHLAT on the 3 input fastq
pairs.
ARGUMENTS
1. tumor_phlat: <JSid for tumor DNA called alleles>
2. normal_phlat: <JSid for normal DNA called alleles>
3. rna_phlat: <JSid for... | python | def merge_phlat_calls(job, tumor_phlat, normal_phlat, rna_phlat):
"""
This module will merge the results form running PHLAT on the 3 input fastq
pairs.
ARGUMENTS
1. tumor_phlat: <JSid for tumor DNA called alleles>
2. normal_phlat: <JSid for normal DNA called alleles>
3. rna_phlat: <JSid for... | [
"def",
"merge_phlat_calls",
"(",
"job",
",",
"tumor_phlat",
",",
"normal_phlat",
",",
"rna_phlat",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Merging Phlat calls'",
")",
"work_dir",
"=",
"job",
".",
"fileStore",
".",
"getLocalTempDir",
"(",
... | This module will merge the results form running PHLAT on the 3 input fastq
pairs.
ARGUMENTS
1. tumor_phlat: <JSid for tumor DNA called alleles>
2. normal_phlat: <JSid for normal DNA called alleles>
3. rna_phlat: <JSid for tumor RNA called alleles>
RETURN VALUES
1. output_files: Dict of JSi... | [
"This",
"module",
"will",
"merge",
"the",
"results",
"form",
"running",
"PHLAT",
"on",
"the",
"3",
"input",
"fastq",
"pairs",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L1297-L1347 | train |
BD2KGenomics/protect | attic/ProTECT.py | boost_ranks | def boost_ranks(job, isoform_expression, merged_mhc_calls, transgene_out, univ_options,
rank_boost_options):
"""
This is the final module in the pipeline. It will call the rank boosting R
script.
This module corresponds to node 21 in the tree
"""
job.fileStore.logToMaster('Runn... | python | def boost_ranks(job, isoform_expression, merged_mhc_calls, transgene_out, univ_options,
rank_boost_options):
"""
This is the final module in the pipeline. It will call the rank boosting R
script.
This module corresponds to node 21 in the tree
"""
job.fileStore.logToMaster('Runn... | [
"def",
"boost_ranks",
"(",
"job",
",",
"isoform_expression",
",",
"merged_mhc_calls",
",",
"transgene_out",
",",
"univ_options",
",",
"rank_boost_options",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Running boost_ranks on %s'",
"%",
"univ_options",
... | This is the final module in the pipeline. It will call the rank boosting R
script.
This module corresponds to node 21 in the tree | [
"This",
"is",
"the",
"final",
"module",
"in",
"the",
"pipeline",
".",
"It",
"will",
"call",
"the",
"rank",
"boosting",
"R",
"script",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L1676-L1712 | train |
BD2KGenomics/protect | attic/ProTECT.py | get_files_from_filestore | def get_files_from_filestore(job, files, work_dir, cache=True, docker=False):
"""
This is adapted from John Vivian's return_input_paths from the RNA-Seq pipeline.
Returns the paths of files from the FileStore if they are not present.
If docker=True, return the docker path for the file.
If the file ... | python | def get_files_from_filestore(job, files, work_dir, cache=True, docker=False):
"""
This is adapted from John Vivian's return_input_paths from the RNA-Seq pipeline.
Returns the paths of files from the FileStore if they are not present.
If docker=True, return the docker path for the file.
If the file ... | [
"def",
"get_files_from_filestore",
"(",
"job",
",",
"files",
",",
"work_dir",
",",
"cache",
"=",
"True",
",",
"docker",
"=",
"False",
")",
":",
"for",
"name",
"in",
"files",
".",
"keys",
"(",
")",
":",
"outfile",
"=",
"job",
".",
"fileStore",
".",
"r... | This is adapted from John Vivian's return_input_paths from the RNA-Seq pipeline.
Returns the paths of files from the FileStore if they are not present.
If docker=True, return the docker path for the file.
If the file extension is tar.gz, then tar -zxvf it.
files is a dict with:
keys = the name... | [
"This",
"is",
"adapted",
"from",
"John",
"Vivian",
"s",
"return_input_paths",
"from",
"the",
"RNA",
"-",
"Seq",
"pipeline",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L1866-L1904 | train |
BD2KGenomics/protect | attic/ProTECT.py | merge_vcfs | def merge_vcfs(vcf_file, merged_mut_file):
"""
This module will accept the vcf files for mutect and radia read into memory in a dict object
VCF_FILE and will merge the calls. Merged calls are printed to MERGED_MUT_FILE.
VCF_FILE is a dict with
key : mutation caller (mutect or radia)
value : di... | python | def merge_vcfs(vcf_file, merged_mut_file):
"""
This module will accept the vcf files for mutect and radia read into memory in a dict object
VCF_FILE and will merge the calls. Merged calls are printed to MERGED_MUT_FILE.
VCF_FILE is a dict with
key : mutation caller (mutect or radia)
value : di... | [
"def",
"merge_vcfs",
"(",
"vcf_file",
",",
"merged_mut_file",
")",
":",
"mutect_keys",
"=",
"set",
"(",
"vcf_file",
"[",
"'mutect'",
"]",
".",
"keys",
"(",
")",
")",
"radia_keys",
"=",
"set",
"(",
"vcf_file",
"[",
"'radia'",
"]",
".",
"keys",
"(",
")",... | This module will accept the vcf files for mutect and radia read into memory in a dict object
VCF_FILE and will merge the calls. Merged calls are printed to MERGED_MUT_FILE.
VCF_FILE is a dict with
key : mutation caller (mutect or radia)
value : dict with
key: (chrom, pos, ref, alt)
... | [
"This",
"module",
"will",
"accept",
"the",
"vcf",
"files",
"for",
"mutect",
"and",
"radia",
"read",
"into",
"memory",
"in",
"a",
"dict",
"object",
"VCF_FILE",
"and",
"will",
"merge",
"the",
"calls",
".",
"Merged",
"calls",
"are",
"printed",
"to",
"MERGED_M... | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L1956-L1974 | train |
BD2KGenomics/protect | attic/ProTECT.py | docker_call | def docker_call(tool, tool_parameters, work_dir, java_opts=None, outfile=None,
dockerhub='aarjunrao', interactive=False):
"""
Makes subprocess call of a command to a docker container. work_dir MUST BE AN ABSOLUTE PATH or
the call will fail. outfile is an open file descriptor to a writeable ... | python | def docker_call(tool, tool_parameters, work_dir, java_opts=None, outfile=None,
dockerhub='aarjunrao', interactive=False):
"""
Makes subprocess call of a command to a docker container. work_dir MUST BE AN ABSOLUTE PATH or
the call will fail. outfile is an open file descriptor to a writeable ... | [
"def",
"docker_call",
"(",
"tool",
",",
"tool_parameters",
",",
"work_dir",
",",
"java_opts",
"=",
"None",
",",
"outfile",
"=",
"None",
",",
"dockerhub",
"=",
"'aarjunrao'",
",",
"interactive",
"=",
"False",
")",
":",
"if",
"outfile",
":",
"assert",
"isins... | Makes subprocess call of a command to a docker container. work_dir MUST BE AN ABSOLUTE PATH or
the call will fail. outfile is an open file descriptor to a writeable file. | [
"Makes",
"subprocess",
"call",
"of",
"a",
"command",
"to",
"a",
"docker",
"container",
".",
"work_dir",
"MUST",
"BE",
"AN",
"ABSOLUTE",
"PATH",
"or",
"the",
"call",
"will",
"fail",
".",
"outfile",
"is",
"an",
"open",
"file",
"descriptor",
"to",
"a",
"wri... | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L2130-L2182 | train |
BD2KGenomics/protect | attic/ProTECT.py | untargz | def untargz(input_targz_file, untar_to_dir):
"""
This module accepts a tar.gz archive and untars it.
RETURN VALUE: path to the untar-ed directory/file
NOTE: this module expects the multiple files to be in a directory before
being tar-ed.
"""
assert tarfile.is_tarfile(input_targz_file... | python | def untargz(input_targz_file, untar_to_dir):
"""
This module accepts a tar.gz archive and untars it.
RETURN VALUE: path to the untar-ed directory/file
NOTE: this module expects the multiple files to be in a directory before
being tar-ed.
"""
assert tarfile.is_tarfile(input_targz_file... | [
"def",
"untargz",
"(",
"input_targz_file",
",",
"untar_to_dir",
")",
":",
"assert",
"tarfile",
".",
"is_tarfile",
"(",
"input_targz_file",
")",
",",
"'Not a tar file.'",
"tarball",
"=",
"tarfile",
".",
"open",
"(",
"input_targz_file",
")",
"return_value",
"=",
"... | This module accepts a tar.gz archive and untars it.
RETURN VALUE: path to the untar-ed directory/file
NOTE: this module expects the multiple files to be in a directory before
being tar-ed. | [
"This",
"module",
"accepts",
"a",
"tar",
".",
"gz",
"archive",
"and",
"untars",
"it",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L2185-L2199 | train |
BD2KGenomics/protect | attic/ProTECT.py | bam2fastq | def bam2fastq(job, bamfile, univ_options):
"""
split an input bam to paired fastqs.
ARGUMENTS
1. bamfile: Path to a bam file
2. univ_options: Dict of universal arguments used by almost all tools
univ_options
|- 'dockerhub': <dockerhub to use>
+- 'java_Xmx': ... | python | def bam2fastq(job, bamfile, univ_options):
"""
split an input bam to paired fastqs.
ARGUMENTS
1. bamfile: Path to a bam file
2. univ_options: Dict of universal arguments used by almost all tools
univ_options
|- 'dockerhub': <dockerhub to use>
+- 'java_Xmx': ... | [
"def",
"bam2fastq",
"(",
"job",
",",
"bamfile",
",",
"univ_options",
")",
":",
"work_dir",
"=",
"os",
".",
"path",
".",
"split",
"(",
"bamfile",
")",
"[",
"0",
"]",
"base_name",
"=",
"os",
".",
"path",
".",
"split",
"(",
"os",
".",
"path",
".",
"... | split an input bam to paired fastqs.
ARGUMENTS
1. bamfile: Path to a bam file
2. univ_options: Dict of universal arguments used by almost all tools
univ_options
|- 'dockerhub': <dockerhub to use>
+- 'java_Xmx': value for max heap passed to java | [
"split",
"an",
"input",
"bam",
"to",
"paired",
"fastqs",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L2386-L2408 | train |
BD2KGenomics/protect | attic/ProTECT.py | main | def main():
"""
This is the main function for the UCSC Precision Immuno pipeline.
"""
parser = argparse.ArgumentParser()
parser.add_argument('--config_file', dest='config_file', help='Config file to be used in the' +
'run.', type=str, required=True, default=None)
Job.Runn... | python | def main():
"""
This is the main function for the UCSC Precision Immuno pipeline.
"""
parser = argparse.ArgumentParser()
parser.add_argument('--config_file', dest='config_file', help='Config file to be used in the' +
'run.', type=str, required=True, default=None)
Job.Runn... | [
"def",
"main",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
")",
"parser",
".",
"add_argument",
"(",
"'--config_file'",
",",
"dest",
"=",
"'config_file'",
",",
"help",
"=",
"'Config file to be used in the'",
"+",
"'run.'",
",",
"type",... | This is the main function for the UCSC Precision Immuno pipeline. | [
"This",
"is",
"the",
"main",
"function",
"for",
"the",
"UCSC",
"Precision",
"Immuno",
"pipeline",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/ProTECT.py#L2530-L2541 | train |
BD2KGenomics/protect | src/protect/mutation_calling/strelka.py | run_strelka_with_merge | def run_strelka_with_merge(job, tumor_bam, normal_bam, univ_options, strelka_options):
"""
A wrapper for the the entire strelka sub-graph.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of un... | python | def run_strelka_with_merge(job, tumor_bam, normal_bam, univ_options, strelka_options):
"""
A wrapper for the the entire strelka sub-graph.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of un... | [
"def",
"run_strelka_with_merge",
"(",
"job",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"strelka_options",
")",
":",
"spawn",
"=",
"job",
".",
"wrapJobFn",
"(",
"run_strelka",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"... | A wrapper for the the entire strelka sub-graph.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal options used by almost all tools
:param dict strelka_options: Options specific to strel... | [
"A",
"wrapper",
"for",
"the",
"the",
"entire",
"strelka",
"sub",
"-",
"graph",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/strelka.py#L39-L53 | train |
BD2KGenomics/protect | src/protect/mutation_calling/strelka.py | run_strelka | def run_strelka(job, tumor_bam, normal_bam, univ_options, strelka_options, split=True):
"""
Run the strelka subgraph on the DNA bams. Optionally split the results into per-chromosome
vcfs.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for ... | python | def run_strelka(job, tumor_bam, normal_bam, univ_options, strelka_options, split=True):
"""
Run the strelka subgraph on the DNA bams. Optionally split the results into per-chromosome
vcfs.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for ... | [
"def",
"run_strelka",
"(",
"job",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"strelka_options",
",",
"split",
"=",
"True",
")",
":",
"if",
"strelka_options",
"[",
"'chromosomes'",
"]",
":",
"chromosomes",
"=",
"strelka_options",
"[",
"'chro... | Run the strelka subgraph on the DNA bams. Optionally split the results into per-chromosome
vcfs.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal options used by almost all tools
... | [
"Run",
"the",
"strelka",
"subgraph",
"on",
"the",
"DNA",
"bams",
".",
"Optionally",
"split",
"the",
"results",
"into",
"per",
"-",
"chromosome",
"vcfs",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/strelka.py#L56-L102 | train |
BD2KGenomics/protect | src/protect/mutation_calling/strelka.py | run_strelka_full | def run_strelka_full(job, tumor_bam, normal_bam, univ_options, strelka_options):
"""
Run strelka on the DNA bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal options used by a... | python | def run_strelka_full(job, tumor_bam, normal_bam, univ_options, strelka_options):
"""
Run strelka on the DNA bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal options used by a... | [
"def",
"run_strelka_full",
"(",
"job",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"strelka_options",
")",
":",
"work_dir",
"=",
"os",
".",
"getcwd",
"(",
")",
"input_files",
"=",
"{",
"'tumor.bam'",
":",
"tumor_bam",
"[",
"'tumor_dna_fix_pg... | Run strelka on the DNA bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal options used by almost all tools
:param dict strelka_options: Options specific to strelka
:return: Dic... | [
"Run",
"strelka",
"on",
"the",
"DNA",
"bams",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/strelka.py#L105-L148 | train |
BD2KGenomics/protect | src/protect/mutation_calling/strelka.py | wrap_unmerge | def wrap_unmerge(job, strelka_out, chromosomes, strelka_options, univ_options):
"""
A wwrapper to unmerge the strelka snvs and indels
:param dict strelka_out: Results from run_strelka
:param list chromosomes: List of chromosomes to retain
:param dict strelka_options: Options specific to strelka
... | python | def wrap_unmerge(job, strelka_out, chromosomes, strelka_options, univ_options):
"""
A wwrapper to unmerge the strelka snvs and indels
:param dict strelka_out: Results from run_strelka
:param list chromosomes: List of chromosomes to retain
:param dict strelka_options: Options specific to strelka
... | [
"def",
"wrap_unmerge",
"(",
"job",
",",
"strelka_out",
",",
"chromosomes",
",",
"strelka_options",
",",
"univ_options",
")",
":",
"return",
"{",
"'snvs'",
":",
"job",
".",
"addChildJobFn",
"(",
"unmerge",
",",
"strelka_out",
"[",
"'snvs'",
"]",
",",
"'strelk... | A wwrapper to unmerge the strelka snvs and indels
:param dict strelka_out: Results from run_strelka
:param list chromosomes: List of chromosomes to retain
:param dict strelka_options: Options specific to strelka
:param dict univ_options: Dict of universal options used by almost all tools
:return: D... | [
"A",
"wwrapper",
"to",
"unmerge",
"the",
"strelka",
"snvs",
"and",
"indels"
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/strelka.py#L165-L190 | train |
budacom/trading-bots | trading_bots/utils.py | get_iso_time_str | def get_iso_time_str(timestamp: Union[int, float, str, datetime]=None) -> str:
"""Get the ISO time string from a timestamp or date obj. Returns current time str if no timestamp is passed"""
if isinstance(timestamp, (int, float)):
maya_dt = maya.MayaDT(timestamp)
elif isinstance(timestamp, str):
... | python | def get_iso_time_str(timestamp: Union[int, float, str, datetime]=None) -> str:
"""Get the ISO time string from a timestamp or date obj. Returns current time str if no timestamp is passed"""
if isinstance(timestamp, (int, float)):
maya_dt = maya.MayaDT(timestamp)
elif isinstance(timestamp, str):
... | [
"def",
"get_iso_time_str",
"(",
"timestamp",
":",
"Union",
"[",
"int",
",",
"float",
",",
"str",
",",
"datetime",
"]",
"=",
"None",
")",
"->",
"str",
":",
"if",
"isinstance",
"(",
"timestamp",
",",
"(",
"int",
",",
"float",
")",
")",
":",
"maya_dt",
... | Get the ISO time string from a timestamp or date obj. Returns current time str if no timestamp is passed | [
"Get",
"the",
"ISO",
"time",
"string",
"from",
"a",
"timestamp",
"or",
"date",
"obj",
".",
"Returns",
"current",
"time",
"str",
"if",
"no",
"timestamp",
"is",
"passed"
] | 8cb68bb8d0b5f822108db1cc5dae336e3d3c3452 | https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/utils.py#L27-L37 | train |
budacom/trading-bots | trading_bots/utils.py | truncate | def truncate(value: Decimal, n_digits: int) -> Decimal:
"""Truncates a value to a number of decimals places"""
return Decimal(math.trunc(value * (10 ** n_digits))) / (10 ** n_digits) | python | def truncate(value: Decimal, n_digits: int) -> Decimal:
"""Truncates a value to a number of decimals places"""
return Decimal(math.trunc(value * (10 ** n_digits))) / (10 ** n_digits) | [
"def",
"truncate",
"(",
"value",
":",
"Decimal",
",",
"n_digits",
":",
"int",
")",
"->",
"Decimal",
":",
"return",
"Decimal",
"(",
"math",
".",
"trunc",
"(",
"value",
"*",
"(",
"10",
"**",
"n_digits",
")",
")",
")",
"/",
"(",
"10",
"**",
"n_digits"... | Truncates a value to a number of decimals places | [
"Truncates",
"a",
"value",
"to",
"a",
"number",
"of",
"decimals",
"places"
] | 8cb68bb8d0b5f822108db1cc5dae336e3d3c3452 | https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/utils.py#L40-L42 | train |
budacom/trading-bots | trading_bots/utils.py | truncate_to | def truncate_to(value: Decimal, currency: str) -> Decimal:
"""Truncates a value to the number of decimals corresponding to the currency"""
decimal_places = DECIMALS.get(currency.upper(), 2)
return truncate(value, decimal_places) | python | def truncate_to(value: Decimal, currency: str) -> Decimal:
"""Truncates a value to the number of decimals corresponding to the currency"""
decimal_places = DECIMALS.get(currency.upper(), 2)
return truncate(value, decimal_places) | [
"def",
"truncate_to",
"(",
"value",
":",
"Decimal",
",",
"currency",
":",
"str",
")",
"->",
"Decimal",
":",
"decimal_places",
"=",
"DECIMALS",
".",
"get",
"(",
"currency",
".",
"upper",
"(",
")",
",",
"2",
")",
"return",
"truncate",
"(",
"value",
",",
... | Truncates a value to the number of decimals corresponding to the currency | [
"Truncates",
"a",
"value",
"to",
"the",
"number",
"of",
"decimals",
"corresponding",
"to",
"the",
"currency"
] | 8cb68bb8d0b5f822108db1cc5dae336e3d3c3452 | https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/utils.py#L45-L48 | train |
budacom/trading-bots | trading_bots/utils.py | truncate_money | def truncate_money(money: Money) -> Money:
"""Truncates money amount to the number of decimals corresponding to the currency"""
amount = truncate_to(money.amount, money.currency)
return Money(amount, money.currency) | python | def truncate_money(money: Money) -> Money:
"""Truncates money amount to the number of decimals corresponding to the currency"""
amount = truncate_to(money.amount, money.currency)
return Money(amount, money.currency) | [
"def",
"truncate_money",
"(",
"money",
":",
"Money",
")",
"->",
"Money",
":",
"amount",
"=",
"truncate_to",
"(",
"money",
".",
"amount",
",",
"money",
".",
"currency",
")",
"return",
"Money",
"(",
"amount",
",",
"money",
".",
"currency",
")"
] | Truncates money amount to the number of decimals corresponding to the currency | [
"Truncates",
"money",
"amount",
"to",
"the",
"number",
"of",
"decimals",
"corresponding",
"to",
"the",
"currency"
] | 8cb68bb8d0b5f822108db1cc5dae336e3d3c3452 | https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/utils.py#L51-L54 | train |
budacom/trading-bots | trading_bots/utils.py | spread_value | def spread_value(value: Decimal, spread_p: Decimal) -> Tuple[Decimal, Decimal]:
"""Returns a lower and upper value separated by a spread percentage"""
upper = value * (1 + spread_p)
lower = value / (1 + spread_p)
return lower, upper | python | def spread_value(value: Decimal, spread_p: Decimal) -> Tuple[Decimal, Decimal]:
"""Returns a lower and upper value separated by a spread percentage"""
upper = value * (1 + spread_p)
lower = value / (1 + spread_p)
return lower, upper | [
"def",
"spread_value",
"(",
"value",
":",
"Decimal",
",",
"spread_p",
":",
"Decimal",
")",
"->",
"Tuple",
"[",
"Decimal",
",",
"Decimal",
"]",
":",
"upper",
"=",
"value",
"*",
"(",
"1",
"+",
"spread_p",
")",
"lower",
"=",
"value",
"/",
"(",
"1",
"+... | Returns a lower and upper value separated by a spread percentage | [
"Returns",
"a",
"lower",
"and",
"upper",
"value",
"separated",
"by",
"a",
"spread",
"percentage"
] | 8cb68bb8d0b5f822108db1cc5dae336e3d3c3452 | https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/utils.py#L57-L61 | train |
budacom/trading-bots | trading_bots/utils.py | spread_money | def spread_money(money: Money, spread_p: Decimal) -> Tuple[Money, Money]:
"""Returns a lower and upper money amount separated by a spread percentage"""
upper, lower = spread_value(money.amount, spread_p)
return Money(upper, money.currency), Money(lower, money.currency) | python | def spread_money(money: Money, spread_p: Decimal) -> Tuple[Money, Money]:
"""Returns a lower and upper money amount separated by a spread percentage"""
upper, lower = spread_value(money.amount, spread_p)
return Money(upper, money.currency), Money(lower, money.currency) | [
"def",
"spread_money",
"(",
"money",
":",
"Money",
",",
"spread_p",
":",
"Decimal",
")",
"->",
"Tuple",
"[",
"Money",
",",
"Money",
"]",
":",
"upper",
",",
"lower",
"=",
"spread_value",
"(",
"money",
".",
"amount",
",",
"spread_p",
")",
"return",
"Mone... | Returns a lower and upper money amount separated by a spread percentage | [
"Returns",
"a",
"lower",
"and",
"upper",
"money",
"amount",
"separated",
"by",
"a",
"spread",
"percentage"
] | 8cb68bb8d0b5f822108db1cc5dae336e3d3c3452 | https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/utils.py#L64-L67 | train |
nepalicalendar/nepalicalendar-py | nepalicalendar/functions.py | check_valid_ad_range | def check_valid_ad_range(date):
"""
Checks if the english date is in valid range for conversion
"""
if date < values.START_EN_DATE or date > values.END_EN_DATE:
raise ValueError("Date out of range")
return True | python | def check_valid_ad_range(date):
"""
Checks if the english date is in valid range for conversion
"""
if date < values.START_EN_DATE or date > values.END_EN_DATE:
raise ValueError("Date out of range")
return True | [
"def",
"check_valid_ad_range",
"(",
"date",
")",
":",
"if",
"date",
"<",
"values",
".",
"START_EN_DATE",
"or",
"date",
">",
"values",
".",
"END_EN_DATE",
":",
"raise",
"ValueError",
"(",
"\"Date out of range\"",
")",
"return",
"True"
] | Checks if the english date is in valid range for conversion | [
"Checks",
"if",
"the",
"english",
"date",
"is",
"in",
"valid",
"range",
"for",
"conversion"
] | a589c28b8e085049f30a7287753476b59eca6f50 | https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/functions.py#L8-L14 | train |
nepalicalendar/nepalicalendar-py | nepalicalendar/functions.py | check_valid_bs_range | def check_valid_bs_range(date):
"""
Checks if the nepali date is in valid range for conversion
"""
ERR_MSG = "%s out of range" % str(date)
if date.year < values.START_NP_YEAR or date.year > values.END_NP_YEAR:
raise ValueError(ERR_MSG)
if date.month < 1 or date.month > 12:
raise... | python | def check_valid_bs_range(date):
"""
Checks if the nepali date is in valid range for conversion
"""
ERR_MSG = "%s out of range" % str(date)
if date.year < values.START_NP_YEAR or date.year > values.END_NP_YEAR:
raise ValueError(ERR_MSG)
if date.month < 1 or date.month > 12:
raise... | [
"def",
"check_valid_bs_range",
"(",
"date",
")",
":",
"ERR_MSG",
"=",
"\"%s out of range\"",
"%",
"str",
"(",
"date",
")",
"if",
"date",
".",
"year",
"<",
"values",
".",
"START_NP_YEAR",
"or",
"date",
".",
"year",
">",
"values",
".",
"END_NP_YEAR",
":",
... | Checks if the nepali date is in valid range for conversion | [
"Checks",
"if",
"the",
"nepali",
"date",
"is",
"in",
"valid",
"range",
"for",
"conversion"
] | a589c28b8e085049f30a7287753476b59eca6f50 | https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/functions.py#L17-L29 | train |
nepalicalendar/nepalicalendar-py | nepalicalendar/functions.py | nepali_number | def nepali_number(number):
"""
Convert a number to nepali
"""
nepnum = ""
for n in str(number):
nepnum += values.NEPDIGITS[int(n)]
return nepnum | python | def nepali_number(number):
"""
Convert a number to nepali
"""
nepnum = ""
for n in str(number):
nepnum += values.NEPDIGITS[int(n)]
return nepnum | [
"def",
"nepali_number",
"(",
"number",
")",
":",
"nepnum",
"=",
"\"\"",
"for",
"n",
"in",
"str",
"(",
"number",
")",
":",
"nepnum",
"+=",
"values",
".",
"NEPDIGITS",
"[",
"int",
"(",
"n",
")",
"]",
"return",
"nepnum"
] | Convert a number to nepali | [
"Convert",
"a",
"number",
"to",
"nepali"
] | a589c28b8e085049f30a7287753476b59eca6f50 | https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/functions.py#L31-L38 | train |
bkg/django-spillway | spillway/serializers.py | GeoModelSerializer.get_fields | def get_fields(self):
"""Returns a fields dict for this serializer with a 'geometry' field
added.
"""
fields = super(GeoModelSerializer, self).get_fields()
# Set the geometry field name when it's undeclared.
if not self.Meta.geom_field:
for name, field in fiel... | python | def get_fields(self):
"""Returns a fields dict for this serializer with a 'geometry' field
added.
"""
fields = super(GeoModelSerializer, self).get_fields()
# Set the geometry field name when it's undeclared.
if not self.Meta.geom_field:
for name, field in fiel... | [
"def",
"get_fields",
"(",
"self",
")",
":",
"fields",
"=",
"super",
"(",
"GeoModelSerializer",
",",
"self",
")",
".",
"get_fields",
"(",
")",
"if",
"not",
"self",
".",
"Meta",
".",
"geom_field",
":",
"for",
"name",
",",
"field",
"in",
"fields",
".",
... | Returns a fields dict for this serializer with a 'geometry' field
added. | [
"Returns",
"a",
"fields",
"dict",
"for",
"this",
"serializer",
"with",
"a",
"geometry",
"field",
"added",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/serializers.py#L31-L42 | train |
BD2KGenomics/protect | src/protect/mutation_calling/muse.py | run_muse_with_merge | def run_muse_with_merge(job, tumor_bam, normal_bam, univ_options, muse_options):
"""
A wrapper for the the entire MuSE sub-graph.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal o... | python | def run_muse_with_merge(job, tumor_bam, normal_bam, univ_options, muse_options):
"""
A wrapper for the the entire MuSE sub-graph.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal o... | [
"def",
"run_muse_with_merge",
"(",
"job",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"muse_options",
")",
":",
"spawn",
"=",
"job",
".",
"wrapJobFn",
"(",
"run_muse",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"muse_opti... | A wrapper for the the entire MuSE sub-graph.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal options used by almost all tools
:param dict muse_options: Options specific to MuSE
:r... | [
"A",
"wrapper",
"for",
"the",
"the",
"entire",
"MuSE",
"sub",
"-",
"graph",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/muse.py#L44-L60 | train |
BD2KGenomics/protect | src/protect/mutation_calling/muse.py | run_muse | def run_muse(job, tumor_bam, normal_bam, univ_options, muse_options):
"""
Spawn a MuSE job for each chromosome on the DNA bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal opt... | python | def run_muse(job, tumor_bam, normal_bam, univ_options, muse_options):
"""
Spawn a MuSE job for each chromosome on the DNA bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal opt... | [
"def",
"run_muse",
"(",
"job",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"muse_options",
")",
":",
"if",
"muse_options",
"[",
"'chromosomes'",
"]",
":",
"chromosomes",
"=",
"muse_options",
"[",
"'chromosomes'",
"]",
"else",
":",
"chromosom... | Spawn a MuSE job for each chromosome on the DNA bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal options used by almost all tools
:param dict muse_options: Options specific to Mu... | [
"Spawn",
"a",
"MuSE",
"job",
"for",
"each",
"chromosome",
"on",
"the",
"DNA",
"bams",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/muse.py#L63-L101 | train |
BD2KGenomics/protect | src/protect/mutation_calling/muse.py | run_muse_perchrom | def run_muse_perchrom(job, tumor_bam, normal_bam, univ_options, muse_options, chrom):
"""
Run MuSE call on a single chromosome in the input bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dic... | python | def run_muse_perchrom(job, tumor_bam, normal_bam, univ_options, muse_options, chrom):
"""
Run MuSE call on a single chromosome in the input bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dic... | [
"def",
"run_muse_perchrom",
"(",
"job",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"muse_options",
",",
"chrom",
")",
":",
"work_dir",
"=",
"os",
".",
"getcwd",
"(",
")",
"input_files",
"=",
"{",
"'tumor.bam'",
":",
"tumor_bam",
"[",
"'... | Run MuSE call on a single chromosome in the input bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal options used by almost all tools
:param dict muse_options: Options specific to ... | [
"Run",
"MuSE",
"call",
"on",
"a",
"single",
"chromosome",
"in",
"the",
"input",
"bams",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/muse.py#L104-L142 | train |
BD2KGenomics/protect | src/protect/mutation_calling/muse.py | run_muse_sump_perchrom | def run_muse_sump_perchrom(job, muse_output, univ_options, muse_options, chrom):
"""
Run MuSE sump on the MuSE call generated vcf.
:param toil.fileStore.FileID muse_output: vcf generated by MuSE call
:param dict univ_options: Dict of universal options used by almost all tools
:param dict muse_optio... | python | def run_muse_sump_perchrom(job, muse_output, univ_options, muse_options, chrom):
"""
Run MuSE sump on the MuSE call generated vcf.
:param toil.fileStore.FileID muse_output: vcf generated by MuSE call
:param dict univ_options: Dict of universal options used by almost all tools
:param dict muse_optio... | [
"def",
"run_muse_sump_perchrom",
"(",
"job",
",",
"muse_output",
",",
"univ_options",
",",
"muse_options",
",",
"chrom",
")",
":",
"work_dir",
"=",
"os",
".",
"getcwd",
"(",
")",
"input_files",
"=",
"{",
"'MuSE.txt'",
":",
"muse_output",
",",
"'dbsnp_coding.vc... | Run MuSE sump on the MuSE call generated vcf.
:param toil.fileStore.FileID muse_output: vcf generated by MuSE call
:param dict univ_options: Dict of universal options used by almost all tools
:param dict muse_options: Options specific to MuSE
:param str chrom: Chromosome to process
:return: fsID fo... | [
"Run",
"MuSE",
"sump",
"on",
"the",
"MuSE",
"call",
"generated",
"vcf",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/muse.py#L145-L182 | train |
bkg/django-spillway | spillway/models.py | AbstractRasterStore.linear | def linear(self, limits=None, k=5):
"""Returns an ndarray of linear breaks."""
start, stop = limits or (self.minval, self.maxval)
return np.linspace(start, stop, k) | python | def linear(self, limits=None, k=5):
"""Returns an ndarray of linear breaks."""
start, stop = limits or (self.minval, self.maxval)
return np.linspace(start, stop, k) | [
"def",
"linear",
"(",
"self",
",",
"limits",
"=",
"None",
",",
"k",
"=",
"5",
")",
":",
"start",
",",
"stop",
"=",
"limits",
"or",
"(",
"self",
".",
"minval",
",",
"self",
".",
"maxval",
")",
"return",
"np",
".",
"linspace",
"(",
"start",
",",
... | Returns an ndarray of linear breaks. | [
"Returns",
"an",
"ndarray",
"of",
"linear",
"breaks",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/models.py#L81-L84 | train |
bkg/django-spillway | spillway/models.py | AbstractRasterStore.quantiles | def quantiles(self, k=5):
"""Returns an ndarray of quantile breaks."""
arr = self.array()
q = list(np.linspace(0, 100, k))
return np.percentile(arr.compressed(), q) | python | def quantiles(self, k=5):
"""Returns an ndarray of quantile breaks."""
arr = self.array()
q = list(np.linspace(0, 100, k))
return np.percentile(arr.compressed(), q) | [
"def",
"quantiles",
"(",
"self",
",",
"k",
"=",
"5",
")",
":",
"arr",
"=",
"self",
".",
"array",
"(",
")",
"q",
"=",
"list",
"(",
"np",
".",
"linspace",
"(",
"0",
",",
"100",
",",
"k",
")",
")",
"return",
"np",
".",
"percentile",
"(",
"arr",
... | Returns an ndarray of quantile breaks. | [
"Returns",
"an",
"ndarray",
"of",
"quantile",
"breaks",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/models.py#L86-L90 | train |
bkg/django-spillway | spillway/forms/fields.py | CommaSepFloatField.to_python | def to_python(self, value):
"""Normalize data to a list of floats."""
if not value:
return []
return map(super(CommaSepFloatField, self).to_python, value.split(',')) | python | def to_python(self, value):
"""Normalize data to a list of floats."""
if not value:
return []
return map(super(CommaSepFloatField, self).to_python, value.split(',')) | [
"def",
"to_python",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"value",
":",
"return",
"[",
"]",
"return",
"map",
"(",
"super",
"(",
"CommaSepFloatField",
",",
"self",
")",
".",
"to_python",
",",
"value",
".",
"split",
"(",
"','",
")",
")"
] | Normalize data to a list of floats. | [
"Normalize",
"data",
"to",
"a",
"list",
"of",
"floats",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/forms/fields.py#L27-L31 | train |
bkg/django-spillway | spillway/forms/fields.py | CommaSepFloatField.run_validators | def run_validators(self, values):
"""Run validators for each item separately."""
for val in values:
super(CommaSepFloatField, self).run_validators(val) | python | def run_validators(self, values):
"""Run validators for each item separately."""
for val in values:
super(CommaSepFloatField, self).run_validators(val) | [
"def",
"run_validators",
"(",
"self",
",",
"values",
")",
":",
"for",
"val",
"in",
"values",
":",
"super",
"(",
"CommaSepFloatField",
",",
"self",
")",
".",
"run_validators",
"(",
"val",
")"
] | Run validators for each item separately. | [
"Run",
"validators",
"for",
"each",
"item",
"separately",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/forms/fields.py#L33-L36 | train |
bkg/django-spillway | spillway/forms/fields.py | BoundingBoxField.to_python | def to_python(self, value):
"""Returns a GEOS Polygon from bounding box values."""
value = super(BoundingBoxField, self).to_python(value)
try:
bbox = gdal.OGRGeometry.from_bbox(value).geos
except (ValueError, AttributeError):
return []
bbox.srid = self.sri... | python | def to_python(self, value):
"""Returns a GEOS Polygon from bounding box values."""
value = super(BoundingBoxField, self).to_python(value)
try:
bbox = gdal.OGRGeometry.from_bbox(value).geos
except (ValueError, AttributeError):
return []
bbox.srid = self.sri... | [
"def",
"to_python",
"(",
"self",
",",
"value",
")",
":",
"value",
"=",
"super",
"(",
"BoundingBoxField",
",",
"self",
")",
".",
"to_python",
"(",
"value",
")",
"try",
":",
"bbox",
"=",
"gdal",
".",
"OGRGeometry",
".",
"from_bbox",
"(",
"value",
")",
... | Returns a GEOS Polygon from bounding box values. | [
"Returns",
"a",
"GEOS",
"Polygon",
"from",
"bounding",
"box",
"values",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/forms/fields.py#L46-L54 | train |
BD2KGenomics/protect | src/protect/mutation_calling/mutect.py | run_mutect_with_merge | def run_mutect_with_merge(job, tumor_bam, normal_bam, univ_options, mutect_options):
"""
A wrapper for the the entire MuTect sub-graph.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of unive... | python | def run_mutect_with_merge(job, tumor_bam, normal_bam, univ_options, mutect_options):
"""
A wrapper for the the entire MuTect sub-graph.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of unive... | [
"def",
"run_mutect_with_merge",
"(",
"job",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"mutect_options",
")",
":",
"spawn",
"=",
"job",
".",
"wrapJobFn",
"(",
"run_mutect",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"mut... | A wrapper for the the entire MuTect sub-graph.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal options used by almost all tools
:param dict mutect_options: Options specific to MuTect
... | [
"A",
"wrapper",
"for",
"the",
"the",
"entire",
"MuTect",
"sub",
"-",
"graph",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/mutect.py#L41-L57 | train |
BD2KGenomics/protect | src/protect/mutation_calling/mutect.py | run_mutect | def run_mutect(job, tumor_bam, normal_bam, univ_options, mutect_options):
"""
Spawn a MuTect job for each chromosome on the DNA bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of univers... | python | def run_mutect(job, tumor_bam, normal_bam, univ_options, mutect_options):
"""
Spawn a MuTect job for each chromosome on the DNA bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of univers... | [
"def",
"run_mutect",
"(",
"job",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"mutect_options",
")",
":",
"if",
"mutect_options",
"[",
"'chromosomes'",
"]",
":",
"chromosomes",
"=",
"mutect_options",
"[",
"'chromosomes'",
"]",
"else",
":",
"c... | Spawn a MuTect job for each chromosome on the DNA bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal options used by almost all tools
:param dict mutect_options: Options specific t... | [
"Spawn",
"a",
"MuTect",
"job",
"for",
"each",
"chromosome",
"on",
"the",
"DNA",
"bams",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/mutect.py#L60-L93 | train |
BD2KGenomics/protect | src/protect/mutation_calling/mutect.py | run_mutect_perchrom | def run_mutect_perchrom(job, tumor_bam, normal_bam, univ_options, mutect_options, chrom):
"""
Run MuTect call on a single chromosome in the input bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_option... | python | def run_mutect_perchrom(job, tumor_bam, normal_bam, univ_options, mutect_options, chrom):
"""
Run MuTect call on a single chromosome in the input bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_option... | [
"def",
"run_mutect_perchrom",
"(",
"job",
",",
"tumor_bam",
",",
"normal_bam",
",",
"univ_options",
",",
"mutect_options",
",",
"chrom",
")",
":",
"work_dir",
"=",
"os",
".",
"getcwd",
"(",
")",
"input_files",
"=",
"{",
"'tumor.bam'",
":",
"tumor_bam",
"[",
... | Run MuTect call on a single chromosome in the input bams.
:param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq
:param dict normal_bam: Dict of bam and bai for normal DNA-Seq
:param dict univ_options: Dict of universal options used by almost all tools
:param dict mutect_options: Options specific... | [
"Run",
"MuTect",
"call",
"on",
"a",
"single",
"chromosome",
"in",
"the",
"input",
"bams",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/mutect.py#L96-L150 | train |
BD2KGenomics/protect | src/protect/mutation_calling/mutect.py | process_mutect_vcf | def process_mutect_vcf(job, mutect_vcf, work_dir, univ_options):
"""
Process the MuTect vcf for accepted calls.
:param toil.fileStore.FileID mutect_vcf: fsID for a MuTect generated chromosome vcf
:param str work_dir: Working directory
:param dict univ_options: Dict of universal options used by almo... | python | def process_mutect_vcf(job, mutect_vcf, work_dir, univ_options):
"""
Process the MuTect vcf for accepted calls.
:param toil.fileStore.FileID mutect_vcf: fsID for a MuTect generated chromosome vcf
:param str work_dir: Working directory
:param dict univ_options: Dict of universal options used by almo... | [
"def",
"process_mutect_vcf",
"(",
"job",
",",
"mutect_vcf",
",",
"work_dir",
",",
"univ_options",
")",
":",
"mutect_vcf",
"=",
"job",
".",
"fileStore",
".",
"readGlobalFile",
"(",
"mutect_vcf",
")",
"with",
"open",
"(",
"mutect_vcf",
",",
"'r'",
")",
"as",
... | Process the MuTect vcf for accepted calls.
:param toil.fileStore.FileID mutect_vcf: fsID for a MuTect generated chromosome vcf
:param str work_dir: Working directory
:param dict univ_options: Dict of universal options used by almost all tools
:return: Path to the processed vcf
:rtype: str | [
"Process",
"the",
"MuTect",
"vcf",
"for",
"accepted",
"calls",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/mutect.py#L153-L174 | train |
idlesign/steampak | steampak/libsteam/resources/utils.py | Utils.get_universe | def get_universe(self, as_str=False):
"""Returns universe the client is connected to. See ``Universe``.
:param bool as_str: Return human-friendly universe name instead of an ID.
:rtype: int|str
"""
result = self._iface.get_connected_universe()
if as_str:
ret... | python | def get_universe(self, as_str=False):
"""Returns universe the client is connected to. See ``Universe``.
:param bool as_str: Return human-friendly universe name instead of an ID.
:rtype: int|str
"""
result = self._iface.get_connected_universe()
if as_str:
ret... | [
"def",
"get_universe",
"(",
"self",
",",
"as_str",
"=",
"False",
")",
":",
"result",
"=",
"self",
".",
"_iface",
".",
"get_connected_universe",
"(",
")",
"if",
"as_str",
":",
"return",
"Universe",
".",
"get_alias",
"(",
"result",
")",
"return",
"result"
] | Returns universe the client is connected to. See ``Universe``.
:param bool as_str: Return human-friendly universe name instead of an ID.
:rtype: int|str | [
"Returns",
"universe",
"the",
"client",
"is",
"connected",
"to",
".",
"See",
"Universe",
"."
] | cb3f2c737e272b0360802d947e388df7e34f50f3 | https://github.com/idlesign/steampak/blob/cb3f2c737e272b0360802d947e388df7e34f50f3/steampak/libsteam/resources/utils.py#L136-L147 | train |
APSL/django-kaio | kaio/mixins/logs.py | LogsMixin.EXTRA_LOGGING | def EXTRA_LOGGING(self):
"""
lista modulos con los distintos niveles a logear y su
nivel de debug
Por ejemplo:
[Logs]
EXTRA_LOGGING = oscar.paypal:DEBUG, django.db:INFO
"""
input_text = get('EXTRA_LOGGING', '')
modules = input_text.spli... | python | def EXTRA_LOGGING(self):
"""
lista modulos con los distintos niveles a logear y su
nivel de debug
Por ejemplo:
[Logs]
EXTRA_LOGGING = oscar.paypal:DEBUG, django.db:INFO
"""
input_text = get('EXTRA_LOGGING', '')
modules = input_text.spli... | [
"def",
"EXTRA_LOGGING",
"(",
"self",
")",
":",
"input_text",
"=",
"get",
"(",
"'EXTRA_LOGGING'",
",",
"''",
")",
"modules",
"=",
"input_text",
".",
"split",
"(",
"','",
")",
"if",
"input_text",
":",
"modules",
"=",
"input_text",
".",
"split",
"(",
"','",... | lista modulos con los distintos niveles a logear y su
nivel de debug
Por ejemplo:
[Logs]
EXTRA_LOGGING = oscar.paypal:DEBUG, django.db:INFO | [
"lista",
"modulos",
"con",
"los",
"distintos",
"niveles",
"a",
"logear",
"y",
"su",
"nivel",
"de",
"debug"
] | b74b109bcfba31d973723bc419e2c95d190b80b7 | https://github.com/APSL/django-kaio/blob/b74b109bcfba31d973723bc419e2c95d190b80b7/kaio/mixins/logs.py#L26-L45 | train |
nepalicalendar/nepalicalendar-py | nepalicalendar/nepdate.py | NepDate.from_ad_date | def from_ad_date(cls, date):
""" Gets a NepDate object from gregorian calendar date """
functions.check_valid_ad_range(date)
days = values.START_EN_DATE - date
# Add the required number of days to the start nepali date
start_date = NepDate(values.START_NP_YEAR, 1, 1)
# N... | python | def from_ad_date(cls, date):
""" Gets a NepDate object from gregorian calendar date """
functions.check_valid_ad_range(date)
days = values.START_EN_DATE - date
# Add the required number of days to the start nepali date
start_date = NepDate(values.START_NP_YEAR, 1, 1)
# N... | [
"def",
"from_ad_date",
"(",
"cls",
",",
"date",
")",
":",
"functions",
".",
"check_valid_ad_range",
"(",
"date",
")",
"days",
"=",
"values",
".",
"START_EN_DATE",
"-",
"date",
"start_date",
"=",
"NepDate",
"(",
"values",
".",
"START_NP_YEAR",
",",
"1",
","... | Gets a NepDate object from gregorian calendar date | [
"Gets",
"a",
"NepDate",
"object",
"from",
"gregorian",
"calendar",
"date"
] | a589c28b8e085049f30a7287753476b59eca6f50 | https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/nepdate.py#L207-L215 | train |
nepalicalendar/nepalicalendar-py | nepalicalendar/nepdate.py | NepDate.from_bs_date | def from_bs_date(cls, year, month, day):
""" Create and update an NepDate object for bikram sambat date """
return NepDate(year, month, day).update() | python | def from_bs_date(cls, year, month, day):
""" Create and update an NepDate object for bikram sambat date """
return NepDate(year, month, day).update() | [
"def",
"from_bs_date",
"(",
"cls",
",",
"year",
",",
"month",
",",
"day",
")",
":",
"return",
"NepDate",
"(",
"year",
",",
"month",
",",
"day",
")",
".",
"update",
"(",
")"
] | Create and update an NepDate object for bikram sambat date | [
"Create",
"and",
"update",
"an",
"NepDate",
"object",
"for",
"bikram",
"sambat",
"date"
] | a589c28b8e085049f30a7287753476b59eca6f50 | https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/nepdate.py#L218-L220 | train |
nepalicalendar/nepalicalendar-py | nepalicalendar/nepdate.py | NepDate.events_list | def events_list(self):
""" Returns the events today """
evt = []
evt.extend(events.NEPALI_EVENTS[self.month, self.day])
evt.extend(events.ENGLISH_EVENTS[self.en_date.month, self.en_date.day])
return evt | python | def events_list(self):
""" Returns the events today """
evt = []
evt.extend(events.NEPALI_EVENTS[self.month, self.day])
evt.extend(events.ENGLISH_EVENTS[self.en_date.month, self.en_date.day])
return evt | [
"def",
"events_list",
"(",
"self",
")",
":",
"evt",
"=",
"[",
"]",
"evt",
".",
"extend",
"(",
"events",
".",
"NEPALI_EVENTS",
"[",
"self",
".",
"month",
",",
"self",
".",
"day",
"]",
")",
"evt",
".",
"extend",
"(",
"events",
".",
"ENGLISH_EVENTS",
... | Returns the events today | [
"Returns",
"the",
"events",
"today"
] | a589c28b8e085049f30a7287753476b59eca6f50 | https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/nepdate.py#L269-L274 | train |
nepalicalendar/nepalicalendar-py | nepalicalendar/nepdate.py | NepDate.update | def update(self):
""" Updates information about the NepDate """
functions.check_valid_bs_range(self)
# Here's a trick to find the gregorian date:
# We find the number of days from earliest nepali date to the current
# day. We then add the number of days to the earliest english da... | python | def update(self):
""" Updates information about the NepDate """
functions.check_valid_bs_range(self)
# Here's a trick to find the gregorian date:
# We find the number of days from earliest nepali date to the current
# day. We then add the number of days to the earliest english da... | [
"def",
"update",
"(",
"self",
")",
":",
"functions",
".",
"check_valid_bs_range",
"(",
"self",
")",
"self",
".",
"en_date",
"=",
"values",
".",
"START_EN_DATE",
"+",
"(",
"self",
"-",
"NepDate",
"(",
"values",
".",
"START_NP_YEAR",
",",
"1",
",",
"1",
... | Updates information about the NepDate | [
"Updates",
"information",
"about",
"the",
"NepDate"
] | a589c28b8e085049f30a7287753476b59eca6f50 | https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/nepdate.py#L291-L305 | train |
BD2KGenomics/protect | attic/precision_immuno.py | get_file_from_s3 | def get_file_from_s3(job, s3_url, encryption_key=None, write_to_jobstore=True):
"""
Downloads a supplied URL that points to an unencrypted, unprotected file on Amazon S3. The file
is downloaded and a subsequently written to the jobstore and the return value is a the path to
the file in the jobstore.
... | python | def get_file_from_s3(job, s3_url, encryption_key=None, write_to_jobstore=True):
"""
Downloads a supplied URL that points to an unencrypted, unprotected file on Amazon S3. The file
is downloaded and a subsequently written to the jobstore and the return value is a the path to
the file in the jobstore.
... | [
"def",
"get_file_from_s3",
"(",
"job",
",",
"s3_url",
",",
"encryption_key",
"=",
"None",
",",
"write_to_jobstore",
"=",
"True",
")",
":",
"work_dir",
"=",
"job",
".",
"fileStore",
".",
"getLocalTempDir",
"(",
")",
"filename",
"=",
"'/'",
".",
"join",
"(",... | Downloads a supplied URL that points to an unencrypted, unprotected file on Amazon S3. The file
is downloaded and a subsequently written to the jobstore and the return value is a the path to
the file in the jobstore. | [
"Downloads",
"a",
"supplied",
"URL",
"that",
"points",
"to",
"an",
"unencrypted",
"unprotected",
"file",
"on",
"Amazon",
"S3",
".",
"The",
"file",
"is",
"downloaded",
"and",
"a",
"subsequently",
"written",
"to",
"the",
"jobstore",
"and",
"the",
"return",
"va... | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/precision_immuno.py#L2159-L2191 | train |
bkg/django-spillway | spillway/query.py | filter_geometry | def filter_geometry(queryset, **filters):
"""Helper function for spatial lookups filters.
Provide spatial lookup types as keywords without underscores instead of the
usual "geometryfield__lookuptype" format.
"""
fieldname = geo_field(queryset).name
query = {'%s__%s' % (fieldname, k): v for k, v... | python | def filter_geometry(queryset, **filters):
"""Helper function for spatial lookups filters.
Provide spatial lookup types as keywords without underscores instead of the
usual "geometryfield__lookuptype" format.
"""
fieldname = geo_field(queryset).name
query = {'%s__%s' % (fieldname, k): v for k, v... | [
"def",
"filter_geometry",
"(",
"queryset",
",",
"**",
"filters",
")",
":",
"fieldname",
"=",
"geo_field",
"(",
"queryset",
")",
".",
"name",
"query",
"=",
"{",
"'%s__%s'",
"%",
"(",
"fieldname",
",",
"k",
")",
":",
"v",
"for",
"k",
",",
"v",
"in",
... | Helper function for spatial lookups filters.
Provide spatial lookup types as keywords without underscores instead of the
usual "geometryfield__lookuptype" format. | [
"Helper",
"function",
"for",
"spatial",
"lookups",
"filters",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/query.py#L16-L24 | train |
bkg/django-spillway | spillway/query.py | geo_field | def geo_field(queryset):
"""Returns the GeometryField for a django or spillway GeoQuerySet."""
for field in queryset.model._meta.fields:
if isinstance(field, models.GeometryField):
return field
raise exceptions.FieldDoesNotExist('No GeometryField found') | python | def geo_field(queryset):
"""Returns the GeometryField for a django or spillway GeoQuerySet."""
for field in queryset.model._meta.fields:
if isinstance(field, models.GeometryField):
return field
raise exceptions.FieldDoesNotExist('No GeometryField found') | [
"def",
"geo_field",
"(",
"queryset",
")",
":",
"for",
"field",
"in",
"queryset",
".",
"model",
".",
"_meta",
".",
"fields",
":",
"if",
"isinstance",
"(",
"field",
",",
"models",
".",
"GeometryField",
")",
":",
"return",
"field",
"raise",
"exceptions",
".... | Returns the GeometryField for a django or spillway GeoQuerySet. | [
"Returns",
"the",
"GeometryField",
"for",
"a",
"django",
"or",
"spillway",
"GeoQuerySet",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/query.py#L26-L31 | train |
bkg/django-spillway | spillway/query.py | get_srid | def get_srid(queryset):
"""Returns the GeoQuerySet spatial reference identifier."""
try:
srid = list(six.viewvalues(queryset.query.annotations))[0].srid
except (AttributeError, IndexError):
srid = None
return srid or geo_field(queryset).srid | python | def get_srid(queryset):
"""Returns the GeoQuerySet spatial reference identifier."""
try:
srid = list(six.viewvalues(queryset.query.annotations))[0].srid
except (AttributeError, IndexError):
srid = None
return srid or geo_field(queryset).srid | [
"def",
"get_srid",
"(",
"queryset",
")",
":",
"try",
":",
"srid",
"=",
"list",
"(",
"six",
".",
"viewvalues",
"(",
"queryset",
".",
"query",
".",
"annotations",
")",
")",
"[",
"0",
"]",
".",
"srid",
"except",
"(",
"AttributeError",
",",
"IndexError",
... | Returns the GeoQuerySet spatial reference identifier. | [
"Returns",
"the",
"GeoQuerySet",
"spatial",
"reference",
"identifier",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/query.py#L33-L39 | train |
bkg/django-spillway | spillway/query.py | agg_dims | def agg_dims(arr, stat):
"""Returns a 1D array with higher dimensions aggregated using stat fn.
Arguments:
arr -- ndarray
stat -- numpy or numpy.ma function as str to call
"""
axis = None
if arr.ndim > 2:
axis = 1
arr = arr.reshape(arr.shape[0], -1)
module = np.ma if has... | python | def agg_dims(arr, stat):
"""Returns a 1D array with higher dimensions aggregated using stat fn.
Arguments:
arr -- ndarray
stat -- numpy or numpy.ma function as str to call
"""
axis = None
if arr.ndim > 2:
axis = 1
arr = arr.reshape(arr.shape[0], -1)
module = np.ma if has... | [
"def",
"agg_dims",
"(",
"arr",
",",
"stat",
")",
":",
"axis",
"=",
"None",
"if",
"arr",
".",
"ndim",
">",
"2",
":",
"axis",
"=",
"1",
"arr",
"=",
"arr",
".",
"reshape",
"(",
"arr",
".",
"shape",
"[",
"0",
"]",
",",
"-",
"1",
")",
"module",
... | Returns a 1D array with higher dimensions aggregated using stat fn.
Arguments:
arr -- ndarray
stat -- numpy or numpy.ma function as str to call | [
"Returns",
"a",
"1D",
"array",
"with",
"higher",
"dimensions",
"aggregated",
"using",
"stat",
"fn",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/query.py#L41-L53 | train |
bkg/django-spillway | spillway/query.py | GeoQuerySet.extent | def extent(self, srid=None):
"""Returns the GeoQuerySet extent as a 4-tuple.
Keyword args:
srid -- EPSG id for for transforming the output geometry.
"""
expr = self.geo_field.name
if srid:
expr = geofn.Transform(expr, srid)
expr = models.Extent(expr)
... | python | def extent(self, srid=None):
"""Returns the GeoQuerySet extent as a 4-tuple.
Keyword args:
srid -- EPSG id for for transforming the output geometry.
"""
expr = self.geo_field.name
if srid:
expr = geofn.Transform(expr, srid)
expr = models.Extent(expr)
... | [
"def",
"extent",
"(",
"self",
",",
"srid",
"=",
"None",
")",
":",
"expr",
"=",
"self",
".",
"geo_field",
".",
"name",
"if",
"srid",
":",
"expr",
"=",
"geofn",
".",
"Transform",
"(",
"expr",
",",
"srid",
")",
"expr",
"=",
"models",
".",
"Extent",
... | Returns the GeoQuerySet extent as a 4-tuple.
Keyword args:
srid -- EPSG id for for transforming the output geometry. | [
"Returns",
"the",
"GeoQuerySet",
"extent",
"as",
"a",
"4",
"-",
"tuple",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/query.py#L87-L99 | train |
bkg/django-spillway | spillway/query.py | GeoQuerySet.pbf | def pbf(self, bbox, geo_col=None, scale=4096):
"""Returns tranlated and scaled geometries suitable for Mapbox vector
tiles.
"""
col = geo_col or self.geo_field.name
w, s, e, n = bbox.extent
trans = self._trans_scale(col, -w, -s,
scale / (... | python | def pbf(self, bbox, geo_col=None, scale=4096):
"""Returns tranlated and scaled geometries suitable for Mapbox vector
tiles.
"""
col = geo_col or self.geo_field.name
w, s, e, n = bbox.extent
trans = self._trans_scale(col, -w, -s,
scale / (... | [
"def",
"pbf",
"(",
"self",
",",
"bbox",
",",
"geo_col",
"=",
"None",
",",
"scale",
"=",
"4096",
")",
":",
"col",
"=",
"geo_col",
"or",
"self",
".",
"geo_field",
".",
"name",
"w",
",",
"s",
",",
"e",
",",
"n",
"=",
"bbox",
".",
"extent",
"trans"... | Returns tranlated and scaled geometries suitable for Mapbox vector
tiles. | [
"Returns",
"tranlated",
"and",
"scaled",
"geometries",
"suitable",
"for",
"Mapbox",
"vector",
"tiles",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/query.py#L110-L120 | train |
bkg/django-spillway | spillway/query.py | GeoQuerySet.tile | def tile(self, bbox, z=0, format=None, clip=True):
"""Returns a GeoQuerySet intersecting a tile boundary.
Arguments:
bbox -- tile extent as geometry
Keyword args:
z -- tile zoom level used as basis for geometry simplification
format -- vector tile format as str (pbf, geo... | python | def tile(self, bbox, z=0, format=None, clip=True):
"""Returns a GeoQuerySet intersecting a tile boundary.
Arguments:
bbox -- tile extent as geometry
Keyword args:
z -- tile zoom level used as basis for geometry simplification
format -- vector tile format as str (pbf, geo... | [
"def",
"tile",
"(",
"self",
",",
"bbox",
",",
"z",
"=",
"0",
",",
"format",
"=",
"None",
",",
"clip",
"=",
"True",
")",
":",
"tile_srid",
"=",
"3857",
"bbox",
"=",
"getattr",
"(",
"bbox",
",",
"'geos'",
",",
"bbox",
")",
"clone",
"=",
"filter_geo... | Returns a GeoQuerySet intersecting a tile boundary.
Arguments:
bbox -- tile extent as geometry
Keyword args:
z -- tile zoom level used as basis for geometry simplification
format -- vector tile format as str (pbf, geojson)
clip -- clip geometries to tile boundary as bool... | [
"Returns",
"a",
"GeoQuerySet",
"intersecting",
"a",
"tile",
"boundary",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/query.py#L122-L157 | train |
bkg/django-spillway | spillway/query.py | RasterQuerySet.arrays | def arrays(self, field_name=None):
"""Returns a list of ndarrays.
Keyword args:
field_name -- raster field name as str
"""
fieldname = field_name or self.raster_field.name
arrays = []
for obj in self:
arr = getattr(obj, fieldname)
if isins... | python | def arrays(self, field_name=None):
"""Returns a list of ndarrays.
Keyword args:
field_name -- raster field name as str
"""
fieldname = field_name or self.raster_field.name
arrays = []
for obj in self:
arr = getattr(obj, fieldname)
if isins... | [
"def",
"arrays",
"(",
"self",
",",
"field_name",
"=",
"None",
")",
":",
"fieldname",
"=",
"field_name",
"or",
"self",
".",
"raster_field",
".",
"name",
"arrays",
"=",
"[",
"]",
"for",
"obj",
"in",
"self",
":",
"arr",
"=",
"getattr",
"(",
"obj",
",",
... | Returns a list of ndarrays.
Keyword args:
field_name -- raster field name as str | [
"Returns",
"a",
"list",
"of",
"ndarrays",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/query.py#L161-L175 | train |
bkg/django-spillway | spillway/query.py | RasterQuerySet.aggregate_periods | def aggregate_periods(self, periods):
"""Returns list of ndarrays averaged to a given number of periods.
Arguments:
periods -- desired number of periods as int
"""
try:
fieldname = self.raster_field.name
except TypeError:
raise exceptions.FieldDoe... | python | def aggregate_periods(self, periods):
"""Returns list of ndarrays averaged to a given number of periods.
Arguments:
periods -- desired number of periods as int
"""
try:
fieldname = self.raster_field.name
except TypeError:
raise exceptions.FieldDoe... | [
"def",
"aggregate_periods",
"(",
"self",
",",
"periods",
")",
":",
"try",
":",
"fieldname",
"=",
"self",
".",
"raster_field",
".",
"name",
"except",
"TypeError",
":",
"raise",
"exceptions",
".",
"FieldDoesNotExist",
"(",
"'Raster field not found'",
")",
"arrays"... | Returns list of ndarrays averaged to a given number of periods.
Arguments:
periods -- desired number of periods as int | [
"Returns",
"list",
"of",
"ndarrays",
"averaged",
"to",
"a",
"given",
"number",
"of",
"periods",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/query.py#L177-L202 | train |
bkg/django-spillway | spillway/query.py | RasterQuerySet.raster_field | def raster_field(self):
"""Returns the raster FileField instance on the model."""
for field in self.model._meta.fields:
if isinstance(field, models.FileField):
return field
return False | python | def raster_field(self):
"""Returns the raster FileField instance on the model."""
for field in self.model._meta.fields:
if isinstance(field, models.FileField):
return field
return False | [
"def",
"raster_field",
"(",
"self",
")",
":",
"for",
"field",
"in",
"self",
".",
"model",
".",
"_meta",
".",
"fields",
":",
"if",
"isinstance",
"(",
"field",
",",
"models",
".",
"FileField",
")",
":",
"return",
"field",
"return",
"False"
] | Returns the raster FileField instance on the model. | [
"Returns",
"the",
"raster",
"FileField",
"instance",
"on",
"the",
"model",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/query.py#L218-L223 | train |
bkg/django-spillway | spillway/query.py | RasterQuerySet.zipfiles | def zipfiles(self, path=None, arcdirname='data'):
"""Returns a .zip archive of selected rasters."""
if path:
fp = open(path, 'w+b')
else:
prefix = '%s-' % arcdirname
fp = tempfile.NamedTemporaryFile(prefix=prefix, suffix='.zip')
with zipfile.ZipFile(fp... | python | def zipfiles(self, path=None, arcdirname='data'):
"""Returns a .zip archive of selected rasters."""
if path:
fp = open(path, 'w+b')
else:
prefix = '%s-' % arcdirname
fp = tempfile.NamedTemporaryFile(prefix=prefix, suffix='.zip')
with zipfile.ZipFile(fp... | [
"def",
"zipfiles",
"(",
"self",
",",
"path",
"=",
"None",
",",
"arcdirname",
"=",
"'data'",
")",
":",
"if",
"path",
":",
"fp",
"=",
"open",
"(",
"path",
",",
"'w+b'",
")",
"else",
":",
"prefix",
"=",
"'%s-'",
"%",
"arcdirname",
"fp",
"=",
"tempfile... | Returns a .zip archive of selected rasters. | [
"Returns",
"a",
".",
"zip",
"archive",
"of",
"selected",
"rasters",
"."
] | c488a62642430b005f1e0d4a19e160d8d5964b67 | https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/query.py#L265-L284 | train |
idlesign/steampak | steampak/libsteam/resources/main.py | Api.init | def init(self, app_id=None):
"""Initializes Steam API library.
:param str|int app_id: Application ID.
:raises: SteamApiStartupError
"""
self.set_app_id(app_id)
err_msg = (
'Unable to initialize. Check Steam client is running '
'and Steam applicat... | python | def init(self, app_id=None):
"""Initializes Steam API library.
:param str|int app_id: Application ID.
:raises: SteamApiStartupError
"""
self.set_app_id(app_id)
err_msg = (
'Unable to initialize. Check Steam client is running '
'and Steam applicat... | [
"def",
"init",
"(",
"self",
",",
"app_id",
"=",
"None",
")",
":",
"self",
".",
"set_app_id",
"(",
"app_id",
")",
"err_msg",
"=",
"(",
"'Unable to initialize. Check Steam client is running '",
"'and Steam application ID is defined in steam_appid.txt or passed to Api.'",
")",... | Initializes Steam API library.
:param str|int app_id: Application ID.
:raises: SteamApiStartupError | [
"Initializes",
"Steam",
"API",
"library",
"."
] | cb3f2c737e272b0360802d947e388df7e34f50f3 | https://github.com/idlesign/steampak/blob/cb3f2c737e272b0360802d947e388df7e34f50f3/steampak/libsteam/resources/main.py#L125-L155 | train |
BD2KGenomics/protect | src/protect/common.py | get_files_from_filestore | def get_files_from_filestore(job, files, work_dir, docker=False):
"""
Download a dict of files to the given directory and modify the path to a docker-friendly one if
requested.
:param dict files: A dictionary of filenames: fsIDs
:param str work_dir: The destination directory
:param bool docker:... | python | def get_files_from_filestore(job, files, work_dir, docker=False):
"""
Download a dict of files to the given directory and modify the path to a docker-friendly one if
requested.
:param dict files: A dictionary of filenames: fsIDs
:param str work_dir: The destination directory
:param bool docker:... | [
"def",
"get_files_from_filestore",
"(",
"job",
",",
"files",
",",
"work_dir",
",",
"docker",
"=",
"False",
")",
":",
"for",
"name",
"in",
"files",
".",
"keys",
"(",
")",
":",
"outfile",
"=",
"job",
".",
"fileStore",
".",
"readGlobalFile",
"(",
"files",
... | Download a dict of files to the given directory and modify the path to a docker-friendly one if
requested.
:param dict files: A dictionary of filenames: fsIDs
:param str work_dir: The destination directory
:param bool docker: Should the file path be converted to our standard docker '/data/filename'?
... | [
"Download",
"a",
"dict",
"of",
"files",
"to",
"the",
"given",
"directory",
"and",
"modify",
"the",
"path",
"to",
"a",
"docker",
"-",
"friendly",
"one",
"if",
"requested",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/common.py#L45-L64 | train |
BD2KGenomics/protect | src/protect/common.py | gunzip | def gunzip(input_gzip_file, block_size=1024):
"""
Gunzips the input file to the same directory
:param input_gzip_file: File to be gunzipped
:return: path to the gunzipped file
:rtype: str
"""
assert os.path.splitext(input_gzip_file)[1] == '.gz'
assert is_gzipfile(input_gzip_file)
wi... | python | def gunzip(input_gzip_file, block_size=1024):
"""
Gunzips the input file to the same directory
:param input_gzip_file: File to be gunzipped
:return: path to the gunzipped file
:rtype: str
"""
assert os.path.splitext(input_gzip_file)[1] == '.gz'
assert is_gzipfile(input_gzip_file)
wi... | [
"def",
"gunzip",
"(",
"input_gzip_file",
",",
"block_size",
"=",
"1024",
")",
":",
"assert",
"os",
".",
"path",
".",
"splitext",
"(",
"input_gzip_file",
")",
"[",
"1",
"]",
"==",
"'.gz'",
"assert",
"is_gzipfile",
"(",
"input_gzip_file",
")",
"with",
"gzip"... | Gunzips the input file to the same directory
:param input_gzip_file: File to be gunzipped
:return: path to the gunzipped file
:rtype: str | [
"Gunzips",
"the",
"input",
"file",
"to",
"the",
"same",
"directory"
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/common.py#L163-L181 | train |
BD2KGenomics/protect | src/protect/common.py | is_gzipfile | def is_gzipfile(filename):
"""
Attempt to ascertain the gzip status of a file based on the "magic signatures" of the file.
This was taken from the stack overflow post
http://stackoverflow.com/questions/13044562/python-mechanism-to-identify-compressed-file-type\
-and-uncompress
:param str f... | python | def is_gzipfile(filename):
"""
Attempt to ascertain the gzip status of a file based on the "magic signatures" of the file.
This was taken from the stack overflow post
http://stackoverflow.com/questions/13044562/python-mechanism-to-identify-compressed-file-type\
-and-uncompress
:param str f... | [
"def",
"is_gzipfile",
"(",
"filename",
")",
":",
"assert",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
",",
"'Input {} does not '",
".",
"format",
"(",
"filename",
")",
"+",
"'point to a file.'",
"with",
"open",
"(",
"filename",
",",
"'rb'",
")... | Attempt to ascertain the gzip status of a file based on the "magic signatures" of the file.
This was taken from the stack overflow post
http://stackoverflow.com/questions/13044562/python-mechanism-to-identify-compressed-file-type\
-and-uncompress
:param str filename: A path to a file
:return: ... | [
"Attempt",
"to",
"ascertain",
"the",
"gzip",
"status",
"of",
"a",
"file",
"based",
"on",
"the",
"magic",
"signatures",
"of",
"the",
"file",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/common.py#L184-L203 | train |
BD2KGenomics/protect | src/protect/common.py | get_file_from_gdc | def get_file_from_gdc(job, gdc_url, gdc_download_token, write_to_jobstore=True):
"""
Download a supplied "URL" that points to a file in the NCBI GDC database. The path to the gdc
download token must be provided. The file is downloaded and written to the jobstore if
requested.
:param str gdc_url: ... | python | def get_file_from_gdc(job, gdc_url, gdc_download_token, write_to_jobstore=True):
"""
Download a supplied "URL" that points to a file in the NCBI GDC database. The path to the gdc
download token must be provided. The file is downloaded and written to the jobstore if
requested.
:param str gdc_url: ... | [
"def",
"get_file_from_gdc",
"(",
"job",
",",
"gdc_url",
",",
"gdc_download_token",
",",
"write_to_jobstore",
"=",
"True",
")",
":",
"work_dir",
"=",
"job",
".",
"fileStore",
".",
"getLocalTempDir",
"(",
")",
"parsed_url",
"=",
"urlparse",
"(",
"gdc_url",
")",
... | Download a supplied "URL" that points to a file in the NCBI GDC database. The path to the gdc
download token must be provided. The file is downloaded and written to the jobstore if
requested.
:param str gdc_url: URL for the file (in the form of gdc://<UUID>)
:param str gdc_download_token: Path to the... | [
"Download",
"a",
"supplied",
"URL",
"that",
"points",
"to",
"a",
"file",
"in",
"the",
"NCBI",
"GDC",
"database",
".",
"The",
"path",
"to",
"the",
"gdc",
"download",
"token",
"must",
"be",
"provided",
".",
"The",
"file",
"is",
"downloaded",
"and",
"writte... | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/common.py#L206-L248 | train |
BD2KGenomics/protect | src/protect/common.py | get_file_from_url | def get_file_from_url(job, any_url, encryption_key=None, per_file_encryption=True,
write_to_jobstore=True):
"""
Download a supplied URL that points to a file on an http, https or ftp server. If the file is
found to be an https s3 link then the file is downloaded using `get_file_from_s... | python | def get_file_from_url(job, any_url, encryption_key=None, per_file_encryption=True,
write_to_jobstore=True):
"""
Download a supplied URL that points to a file on an http, https or ftp server. If the file is
found to be an https s3 link then the file is downloaded using `get_file_from_s... | [
"def",
"get_file_from_url",
"(",
"job",
",",
"any_url",
",",
"encryption_key",
"=",
"None",
",",
"per_file_encryption",
"=",
"True",
",",
"write_to_jobstore",
"=",
"True",
")",
":",
"work_dir",
"=",
"job",
".",
"fileStore",
".",
"getLocalTempDir",
"(",
")",
... | Download a supplied URL that points to a file on an http, https or ftp server. If the file is
found to be an https s3 link then the file is downloaded using `get_file_from_s3`. The file is
downloaded and written to the jobstore if requested.
Encryption arguments are for passing to `get_file_from_s3` if req... | [
"Download",
"a",
"supplied",
"URL",
"that",
"points",
"to",
"a",
"file",
"on",
"an",
"http",
"https",
"or",
"ftp",
"server",
".",
"If",
"the",
"file",
"is",
"found",
"to",
"be",
"an",
"https",
"s3",
"link",
"then",
"the",
"file",
"is",
"downloaded",
... | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/common.py#L337-L373 | train |
BD2KGenomics/protect | src/protect/common.py | bam2fastq | def bam2fastq(bamfile, univ_options, picard_options):
"""
Split an input bam to paired fastqs.
:param str bamfile: Path to a bam file
:param dict univ_options: Dict of universal options used by almost all tools
:param dict picard_options: Dict of options specific to Picard
:return: Path to the ... | python | def bam2fastq(bamfile, univ_options, picard_options):
"""
Split an input bam to paired fastqs.
:param str bamfile: Path to a bam file
:param dict univ_options: Dict of universal options used by almost all tools
:param dict picard_options: Dict of options specific to Picard
:return: Path to the ... | [
"def",
"bam2fastq",
"(",
"bamfile",
",",
"univ_options",
",",
"picard_options",
")",
":",
"work_dir",
"=",
"os",
".",
"path",
".",
"split",
"(",
"bamfile",
")",
"[",
"0",
"]",
"base_name",
"=",
"os",
".",
"path",
".",
"split",
"(",
"os",
".",
"path",... | Split an input bam to paired fastqs.
:param str bamfile: Path to a bam file
:param dict univ_options: Dict of universal options used by almost all tools
:param dict picard_options: Dict of options specific to Picard
:return: Path to the _1.fastq file
:rtype: str | [
"Split",
"an",
"input",
"bam",
"to",
"paired",
"fastqs",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/common.py#L376-L398 | train |
BD2KGenomics/protect | src/protect/common.py | export_results | def export_results(job, fsid, file_name, univ_options, subfolder=None):
"""
Write out a file to a given location. The location can be either a directory on the local
machine, or a folder with a bucket on AWS.
:param str fsid: The file store id for the file to be exported
:param str file_name: The n... | python | def export_results(job, fsid, file_name, univ_options, subfolder=None):
"""
Write out a file to a given location. The location can be either a directory on the local
machine, or a folder with a bucket on AWS.
:param str fsid: The file store id for the file to be exported
:param str file_name: The n... | [
"def",
"export_results",
"(",
"job",
",",
"fsid",
",",
"file_name",
",",
"univ_options",
",",
"subfolder",
"=",
"None",
")",
":",
"job",
".",
"fileStore",
".",
"logToMaster",
"(",
"'Exporting %s to output location'",
"%",
"fsid",
")",
"file_name",
"=",
"os",
... | Write out a file to a given location. The location can be either a directory on the local
machine, or a folder with a bucket on AWS.
:param str fsid: The file store id for the file to be exported
:param str file_name: The name of the file that neeeds to be exported (path to file is also
acceptab... | [
"Write",
"out",
"a",
"file",
"to",
"a",
"given",
"location",
".",
"The",
"location",
"can",
"be",
"either",
"a",
"directory",
"on",
"the",
"local",
"machine",
"or",
"a",
"folder",
"with",
"a",
"bucket",
"on",
"AWS",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/common.py#L401-L448 | train |
BD2KGenomics/protect | src/protect/common.py | parse_chromosome_string | def parse_chromosome_string(job, chromosome_string):
"""
Parse a chromosome string into a list.
:param chromosome_string: Input chromosome string
:return: list of chromosomes to handle
:rtype: list
"""
if chromosome_string is None:
return []
else:
assert isinstance(chrom... | python | def parse_chromosome_string(job, chromosome_string):
"""
Parse a chromosome string into a list.
:param chromosome_string: Input chromosome string
:return: list of chromosomes to handle
:rtype: list
"""
if chromosome_string is None:
return []
else:
assert isinstance(chrom... | [
"def",
"parse_chromosome_string",
"(",
"job",
",",
"chromosome_string",
")",
":",
"if",
"chromosome_string",
"is",
"None",
":",
"return",
"[",
"]",
"else",
":",
"assert",
"isinstance",
"(",
"chromosome_string",
",",
"str",
")",
"chroms",
"=",
"[",
"c",
".",
... | Parse a chromosome string into a list.
:param chromosome_string: Input chromosome string
:return: list of chromosomes to handle
:rtype: list | [
"Parse",
"a",
"chromosome",
"string",
"into",
"a",
"list",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/common.py#L521-L554 | train |
BD2KGenomics/protect | src/protect/common.py | email_report | def email_report(job, univ_options):
"""
Send an email to the user when the run finishes.
:param dict univ_options: Dict of universal options used by almost all tools
"""
fromadd = "results@protect.cgl.genomics.ucsc.edu"
msg = MIMEMultipart()
msg['From'] = fromadd
if univ_options['mail... | python | def email_report(job, univ_options):
"""
Send an email to the user when the run finishes.
:param dict univ_options: Dict of universal options used by almost all tools
"""
fromadd = "results@protect.cgl.genomics.ucsc.edu"
msg = MIMEMultipart()
msg['From'] = fromadd
if univ_options['mail... | [
"def",
"email_report",
"(",
"job",
",",
"univ_options",
")",
":",
"fromadd",
"=",
"\"results@protect.cgl.genomics.ucsc.edu\"",
"msg",
"=",
"MIMEMultipart",
"(",
")",
"msg",
"[",
"'From'",
"]",
"=",
"fromadd",
"if",
"univ_options",
"[",
"'mail_to'",
"]",
"is",
... | Send an email to the user when the run finishes.
:param dict univ_options: Dict of universal options used by almost all tools | [
"Send",
"an",
"email",
"to",
"the",
"user",
"when",
"the",
"run",
"finishes",
"."
] | 06310682c50dcf8917b912c8e551299ff7ee41ce | https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/common.py#L619-L649 | train |
0k/kids.cache | src/kids/cache/__init__.py | make_key_hippie | def make_key_hippie(obj, typed=True):
"""Return hashable structure from non-hashable structure using hippie means
dict and set are sorted and their content subjected to same hippie means.
Note that the key identifies the current content of the structure.
"""
ftype = type if typed else lambda o: N... | python | def make_key_hippie(obj, typed=True):
"""Return hashable structure from non-hashable structure using hippie means
dict and set are sorted and their content subjected to same hippie means.
Note that the key identifies the current content of the structure.
"""
ftype = type if typed else lambda o: N... | [
"def",
"make_key_hippie",
"(",
"obj",
",",
"typed",
"=",
"True",
")",
":",
"ftype",
"=",
"type",
"if",
"typed",
"else",
"lambda",
"o",
":",
"None",
"if",
"is_hashable",
"(",
"obj",
")",
":",
"return",
"obj",
",",
"ftype",
"(",
"obj",
")",
"if",
"is... | Return hashable structure from non-hashable structure using hippie means
dict and set are sorted and their content subjected to same hippie means.
Note that the key identifies the current content of the structure. | [
"Return",
"hashable",
"structure",
"from",
"non",
"-",
"hashable",
"structure",
"using",
"hippie",
"means"
] | 668f3b966877c4a0855d60e05cc3706cf37e4570 | https://github.com/0k/kids.cache/blob/668f3b966877c4a0855d60e05cc3706cf37e4570/src/kids/cache/__init__.py#L29-L54 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.