repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
knipknap/Gelatin | Gelatin/generator/Builder.py | Builder.enter | def enter(self, path):
"""
Enters the given node. Creates it if it does not exist.
Returns the node.
"""
self.current.append(self.add(path))
return self.current[-1] | python | def enter(self, path):
"""
Enters the given node. Creates it if it does not exist.
Returns the node.
"""
self.current.append(self.add(path))
return self.current[-1] | [
"def",
"enter",
"(",
"self",
",",
"path",
")",
":",
"self",
".",
"current",
".",
"append",
"(",
"self",
".",
"add",
"(",
"path",
")",
")",
"return",
"self",
".",
"current",
"[",
"-",
"1",
"]"
] | Enters the given node. Creates it if it does not exist.
Returns the node. | [
"Enters",
"the",
"given",
"node",
".",
"Creates",
"it",
"if",
"it",
"does",
"not",
"exist",
".",
"Returns",
"the",
"node",
"."
] | d2afa85a48034d6ee34580e49e16542f31ad208e | https://github.com/knipknap/Gelatin/blob/d2afa85a48034d6ee34580e49e16542f31ad208e/Gelatin/generator/Builder.py#L241-L247 | train |
knipknap/Gelatin | Gelatin/util.py | generate | def generate(converter, input_file, format='xml', encoding='utf8'):
"""
Given a converter (as returned by compile()), this function reads
the given input file and converts it to the requested output format.
Supported output formats are 'xml', 'yaml', 'json', or 'none'.
:type converter: compiler.C... | python | def generate(converter, input_file, format='xml', encoding='utf8'):
"""
Given a converter (as returned by compile()), this function reads
the given input file and converts it to the requested output format.
Supported output formats are 'xml', 'yaml', 'json', or 'none'.
:type converter: compiler.C... | [
"def",
"generate",
"(",
"converter",
",",
"input_file",
",",
"format",
"=",
"'xml'",
",",
"encoding",
"=",
"'utf8'",
")",
":",
"with",
"codecs",
".",
"open",
"(",
"input_file",
",",
"encoding",
"=",
"encoding",
")",
"as",
"thefile",
":",
"return",
"gener... | Given a converter (as returned by compile()), this function reads
the given input file and converts it to the requested output format.
Supported output formats are 'xml', 'yaml', 'json', or 'none'.
:type converter: compiler.Context
:param converter: The compiled converter.
:type input_file: str
... | [
"Given",
"a",
"converter",
"(",
"as",
"returned",
"by",
"compile",
"()",
")",
"this",
"function",
"reads",
"the",
"given",
"input",
"file",
"and",
"converts",
"it",
"to",
"the",
"requested",
"output",
"format",
"."
] | d2afa85a48034d6ee34580e49e16542f31ad208e | https://github.com/knipknap/Gelatin/blob/d2afa85a48034d6ee34580e49e16542f31ad208e/Gelatin/util.py#L56-L75 | train |
knipknap/Gelatin | Gelatin/util.py | generate_to_file | def generate_to_file(converter,
input_file,
output_file,
format='xml',
in_encoding='utf8',
out_encoding='utf8'):
"""
Like generate(), but writes the output to the given output file
instead.
:type c... | python | def generate_to_file(converter,
input_file,
output_file,
format='xml',
in_encoding='utf8',
out_encoding='utf8'):
"""
Like generate(), but writes the output to the given output file
instead.
:type c... | [
"def",
"generate_to_file",
"(",
"converter",
",",
"input_file",
",",
"output_file",
",",
"format",
"=",
"'xml'",
",",
"in_encoding",
"=",
"'utf8'",
",",
"out_encoding",
"=",
"'utf8'",
")",
":",
"with",
"codecs",
".",
"open",
"(",
"output_file",
",",
"'w'",
... | Like generate(), but writes the output to the given output file
instead.
:type converter: compiler.Context
:param converter: The compiled converter.
:type input_file: str
:param input_file: Name of a file to convert.
:type output_file: str
:param output_file: The output filename.
:ty... | [
"Like",
"generate",
"()",
"but",
"writes",
"the",
"output",
"to",
"the",
"given",
"output",
"file",
"instead",
"."
] | d2afa85a48034d6ee34580e49e16542f31ad208e | https://github.com/knipknap/Gelatin/blob/d2afa85a48034d6ee34580e49e16542f31ad208e/Gelatin/util.py#L78-L105 | train |
knipknap/Gelatin | Gelatin/util.py | generate_string | def generate_string(converter, input, format='xml'):
"""
Like generate(), but reads the input from a string instead of
from a file.
:type converter: compiler.Context
:param converter: The compiled converter.
:type input: str
:param input: The string to convert.
:type format: str
... | python | def generate_string(converter, input, format='xml'):
"""
Like generate(), but reads the input from a string instead of
from a file.
:type converter: compiler.Context
:param converter: The compiled converter.
:type input: str
:param input: The string to convert.
:type format: str
... | [
"def",
"generate_string",
"(",
"converter",
",",
"input",
",",
"format",
"=",
"'xml'",
")",
":",
"serializer",
"=",
"generator",
".",
"new",
"(",
"format",
")",
"if",
"serializer",
"is",
"None",
":",
"raise",
"TypeError",
"(",
"'invalid output format '",
"+"... | Like generate(), but reads the input from a string instead of
from a file.
:type converter: compiler.Context
:param converter: The compiled converter.
:type input: str
:param input: The string to convert.
:type format: str
:param format: The output format.
:rtype: str
:return: T... | [
"Like",
"generate",
"()",
"but",
"reads",
"the",
"input",
"from",
"a",
"string",
"instead",
"of",
"from",
"a",
"file",
"."
] | d2afa85a48034d6ee34580e49e16542f31ad208e | https://github.com/knipknap/Gelatin/blob/d2afa85a48034d6ee34580e49e16542f31ad208e/Gelatin/util.py#L108-L127 | train |
knipknap/Gelatin | Gelatin/util.py | generate_string_to_file | def generate_string_to_file(converter,
input,
output_file,
format='xml',
out_encoding='utf8'):
"""
Like generate(), but reads the input from a string instead of
from a file, and writes the output ... | python | def generate_string_to_file(converter,
input,
output_file,
format='xml',
out_encoding='utf8'):
"""
Like generate(), but reads the input from a string instead of
from a file, and writes the output ... | [
"def",
"generate_string_to_file",
"(",
"converter",
",",
"input",
",",
"output_file",
",",
"format",
"=",
"'xml'",
",",
"out_encoding",
"=",
"'utf8'",
")",
":",
"with",
"codecs",
".",
"open",
"(",
"output_file",
",",
"'w'",
",",
"encoding",
"=",
"out_encodin... | Like generate(), but reads the input from a string instead of
from a file, and writes the output to the given output file.
:type converter: compiler.Context
:param converter: The compiled converter.
:type input: str
:param input: The string to convert.
:type output_file: str
:param outpu... | [
"Like",
"generate",
"()",
"but",
"reads",
"the",
"input",
"from",
"a",
"string",
"instead",
"of",
"from",
"a",
"file",
"and",
"writes",
"the",
"output",
"to",
"the",
"given",
"output",
"file",
"."
] | d2afa85a48034d6ee34580e49e16542f31ad208e | https://github.com/knipknap/Gelatin/blob/d2afa85a48034d6ee34580e49e16542f31ad208e/Gelatin/util.py#L130-L154 | train |
kipe/pycron | pycron/__init__.py | is_now | def is_now(s, dt=None):
'''
A very simple cron-like parser to determine, if (cron-like) string is valid for this date and time.
@input:
s = cron-like string (minute, hour, day of month, month, day of week)
dt = datetime to use as reference time, defaults to now
@output: boolean of result... | python | def is_now(s, dt=None):
'''
A very simple cron-like parser to determine, if (cron-like) string is valid for this date and time.
@input:
s = cron-like string (minute, hour, day of month, month, day of week)
dt = datetime to use as reference time, defaults to now
@output: boolean of result... | [
"def",
"is_now",
"(",
"s",
",",
"dt",
"=",
"None",
")",
":",
"if",
"dt",
"is",
"None",
":",
"dt",
"=",
"datetime",
".",
"now",
"(",
")",
"minute",
",",
"hour",
",",
"dom",
",",
"month",
",",
"dow",
"=",
"s",
".",
"split",
"(",
"' '",
")",
"... | A very simple cron-like parser to determine, if (cron-like) string is valid for this date and time.
@input:
s = cron-like string (minute, hour, day of month, month, day of week)
dt = datetime to use as reference time, defaults to now
@output: boolean of result | [
"A",
"very",
"simple",
"cron",
"-",
"like",
"parser",
"to",
"determine",
"if",
"(",
"cron",
"-",
"like",
")",
"string",
"is",
"valid",
"for",
"this",
"date",
"and",
"time",
"."
] | 25319f5ca175b9db6a5e966e1ab2f75bd57fd269 | https://github.com/kipe/pycron/blob/25319f5ca175b9db6a5e966e1ab2f75bd57fd269/pycron/__init__.py#L92-L109 | train |
kipe/pycron | pycron/__init__.py | has_been | def has_been(s, since, dt=None):
'''
A parser to check whether a (cron-like) string has been true during a certain time period.
Useful for applications which cannot check every minute or need to catch up during a restart.
@input:
s = cron-like string (minute, hour, day of month, month, day of we... | python | def has_been(s, since, dt=None):
'''
A parser to check whether a (cron-like) string has been true during a certain time period.
Useful for applications which cannot check every minute or need to catch up during a restart.
@input:
s = cron-like string (minute, hour, day of month, month, day of we... | [
"def",
"has_been",
"(",
"s",
",",
"since",
",",
"dt",
"=",
"None",
")",
":",
"if",
"dt",
"is",
"None",
":",
"dt",
"=",
"datetime",
".",
"now",
"(",
"tz",
"=",
"since",
".",
"tzinfo",
")",
"if",
"dt",
"<",
"since",
":",
"raise",
"ValueError",
"(... | A parser to check whether a (cron-like) string has been true during a certain time period.
Useful for applications which cannot check every minute or need to catch up during a restart.
@input:
s = cron-like string (minute, hour, day of month, month, day of week)
since = datetime to use as refere... | [
"A",
"parser",
"to",
"check",
"whether",
"a",
"(",
"cron",
"-",
"like",
")",
"string",
"has",
"been",
"true",
"during",
"a",
"certain",
"time",
"period",
".",
"Useful",
"for",
"applications",
"which",
"cannot",
"check",
"every",
"minute",
"or",
"need",
"... | 25319f5ca175b9db6a5e966e1ab2f75bd57fd269 | https://github.com/kipe/pycron/blob/25319f5ca175b9db6a5e966e1ab2f75bd57fd269/pycron/__init__.py#L112-L133 | train |
Avsecz/kopt | kopt/eval_metrics.py | auprc | def auprc(y_true, y_pred):
"""Area under the precision-recall curve
"""
y_true, y_pred = _mask_value_nan(y_true, y_pred)
return skm.average_precision_score(y_true, y_pred) | python | def auprc(y_true, y_pred):
"""Area under the precision-recall curve
"""
y_true, y_pred = _mask_value_nan(y_true, y_pred)
return skm.average_precision_score(y_true, y_pred) | [
"def",
"auprc",
"(",
"y_true",
",",
"y_pred",
")",
":",
"y_true",
",",
"y_pred",
"=",
"_mask_value_nan",
"(",
"y_true",
",",
"y_pred",
")",
"return",
"skm",
".",
"average_precision_score",
"(",
"y_true",
",",
"y_pred",
")"
] | Area under the precision-recall curve | [
"Area",
"under",
"the",
"precision",
"-",
"recall",
"curve"
] | fe4f929c8938590845306a759547daa5ba8bd7a9 | https://github.com/Avsecz/kopt/blob/fe4f929c8938590845306a759547daa5ba8bd7a9/kopt/eval_metrics.py#L49-L53 | train |
Avsecz/kopt | kopt/hyopt.py | KMongoTrials.best_trial_tid | def best_trial_tid(self, rank=0):
"""Get tid of the best trial
rank=0 means the best model
rank=1 means second best
...
"""
candidates = [t for t in self.trials
if t['result']['status'] == STATUS_OK]
if len(candidates) == 0:
retu... | python | def best_trial_tid(self, rank=0):
"""Get tid of the best trial
rank=0 means the best model
rank=1 means second best
...
"""
candidates = [t for t in self.trials
if t['result']['status'] == STATUS_OK]
if len(candidates) == 0:
retu... | [
"def",
"best_trial_tid",
"(",
"self",
",",
"rank",
"=",
"0",
")",
":",
"candidates",
"=",
"[",
"t",
"for",
"t",
"in",
"self",
".",
"trials",
"if",
"t",
"[",
"'result'",
"]",
"[",
"'status'",
"]",
"==",
"STATUS_OK",
"]",
"if",
"len",
"(",
"candidate... | Get tid of the best trial
rank=0 means the best model
rank=1 means second best
... | [
"Get",
"tid",
"of",
"the",
"best",
"trial"
] | fe4f929c8938590845306a759547daa5ba8bd7a9 | https://github.com/Avsecz/kopt/blob/fe4f929c8938590845306a759547daa5ba8bd7a9/kopt/hyopt.py#L129-L143 | train |
Avsecz/kopt | kopt/hyopt.py | KMongoTrials.count_by_state_unsynced | def count_by_state_unsynced(self, arg):
"""Extends the original object in order to inject checking
for stalled jobs and killing them if they are running for too long
"""
if self.kill_timeout is not None:
self.delete_running(self.kill_timeout)
return super(KMongoTrials... | python | def count_by_state_unsynced(self, arg):
"""Extends the original object in order to inject checking
for stalled jobs and killing them if they are running for too long
"""
if self.kill_timeout is not None:
self.delete_running(self.kill_timeout)
return super(KMongoTrials... | [
"def",
"count_by_state_unsynced",
"(",
"self",
",",
"arg",
")",
":",
"if",
"self",
".",
"kill_timeout",
"is",
"not",
"None",
":",
"self",
".",
"delete_running",
"(",
"self",
".",
"kill_timeout",
")",
"return",
"super",
"(",
"KMongoTrials",
",",
"self",
")"... | Extends the original object in order to inject checking
for stalled jobs and killing them if they are running for too long | [
"Extends",
"the",
"original",
"object",
"in",
"order",
"to",
"inject",
"checking",
"for",
"stalled",
"jobs",
"and",
"killing",
"them",
"if",
"they",
"are",
"running",
"for",
"too",
"long"
] | fe4f929c8938590845306a759547daa5ba8bd7a9 | https://github.com/Avsecz/kopt/blob/fe4f929c8938590845306a759547daa5ba8bd7a9/kopt/hyopt.py#L171-L177 | train |
Avsecz/kopt | kopt/hyopt.py | KMongoTrials.plot_history | def plot_history(self, tid, scores=["loss", "f1", "accuracy"],
figsize=(15, 3)):
"""Plot the loss curves"""
history = self.train_history(tid)
import matplotlib.pyplot as plt
fig = plt.figure(figsize=figsize)
for i, score in enumerate(scores):
plt... | python | def plot_history(self, tid, scores=["loss", "f1", "accuracy"],
figsize=(15, 3)):
"""Plot the loss curves"""
history = self.train_history(tid)
import matplotlib.pyplot as plt
fig = plt.figure(figsize=figsize)
for i, score in enumerate(scores):
plt... | [
"def",
"plot_history",
"(",
"self",
",",
"tid",
",",
"scores",
"=",
"[",
"\"loss\"",
",",
"\"f1\"",
",",
"\"accuracy\"",
"]",
",",
"figsize",
"=",
"(",
"15",
",",
"3",
")",
")",
":",
"history",
"=",
"self",
".",
"train_history",
"(",
"tid",
")",
"i... | Plot the loss curves | [
"Plot",
"the",
"loss",
"curves"
] | fe4f929c8938590845306a759547daa5ba8bd7a9 | https://github.com/Avsecz/kopt/blob/fe4f929c8938590845306a759547daa5ba8bd7a9/kopt/hyopt.py#L245-L261 | train |
Avsecz/kopt | kopt/hyopt.py | KMongoTrials.load_model | def load_model(self, tid, custom_objects=None):
"""Load saved keras model of the trial.
If tid = None, get the best model
Not applicable for trials ran in cross validion (i.e. not applicable
for `CompileFN.cv_n_folds is None`
"""
if tid is None:
tid = self.b... | python | def load_model(self, tid, custom_objects=None):
"""Load saved keras model of the trial.
If tid = None, get the best model
Not applicable for trials ran in cross validion (i.e. not applicable
for `CompileFN.cv_n_folds is None`
"""
if tid is None:
tid = self.b... | [
"def",
"load_model",
"(",
"self",
",",
"tid",
",",
"custom_objects",
"=",
"None",
")",
":",
"if",
"tid",
"is",
"None",
":",
"tid",
"=",
"self",
".",
"best_trial_tid",
"(",
")",
"model_path",
"=",
"self",
".",
"get_trial",
"(",
"tid",
")",
"[",
"\"res... | Load saved keras model of the trial.
If tid = None, get the best model
Not applicable for trials ran in cross validion (i.e. not applicable
for `CompileFN.cv_n_folds is None` | [
"Load",
"saved",
"keras",
"model",
"of",
"the",
"trial",
"."
] | fe4f929c8938590845306a759547daa5ba8bd7a9 | https://github.com/Avsecz/kopt/blob/fe4f929c8938590845306a759547daa5ba8bd7a9/kopt/hyopt.py#L263-L275 | train |
Avsecz/kopt | kopt/hyopt.py | KMongoTrials.n_ok | def n_ok(self):
"""Number of ok trials()
"""
if len(self.trials) == 0:
return 0
else:
return np.sum(np.array(self.statuses()) == "ok") | python | def n_ok(self):
"""Number of ok trials()
"""
if len(self.trials) == 0:
return 0
else:
return np.sum(np.array(self.statuses()) == "ok") | [
"def",
"n_ok",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"trials",
")",
"==",
"0",
":",
"return",
"0",
"else",
":",
"return",
"np",
".",
"sum",
"(",
"np",
".",
"array",
"(",
"self",
".",
"statuses",
"(",
")",
")",
"==",
"\"ok\"",
... | Number of ok trials() | [
"Number",
"of",
"ok",
"trials",
"()"
] | fe4f929c8938590845306a759547daa5ba8bd7a9 | https://github.com/Avsecz/kopt/blob/fe4f929c8938590845306a759547daa5ba8bd7a9/kopt/hyopt.py#L277-L283 | train |
Avsecz/kopt | kopt/hyopt.py | KMongoTrials.get_ok_results | def get_ok_results(self, verbose=True):
"""Return a list of results with ok status
"""
if len(self.trials) == 0:
return []
not_ok = np.where(np.array(self.statuses()) != "ok")[0]
if len(not_ok) > 0 and verbose:
print("{0}/{1} trials were not ok.".format(... | python | def get_ok_results(self, verbose=True):
"""Return a list of results with ok status
"""
if len(self.trials) == 0:
return []
not_ok = np.where(np.array(self.statuses()) != "ok")[0]
if len(not_ok) > 0 and verbose:
print("{0}/{1} trials were not ok.".format(... | [
"def",
"get_ok_results",
"(",
"self",
",",
"verbose",
"=",
"True",
")",
":",
"if",
"len",
"(",
"self",
".",
"trials",
")",
"==",
"0",
":",
"return",
"[",
"]",
"not_ok",
"=",
"np",
".",
"where",
"(",
"np",
".",
"array",
"(",
"self",
".",
"statuses... | Return a list of results with ok status | [
"Return",
"a",
"list",
"of",
"results",
"with",
"ok",
"status"
] | fe4f929c8938590845306a759547daa5ba8bd7a9 | https://github.com/Avsecz/kopt/blob/fe4f929c8938590845306a759547daa5ba8bd7a9/kopt/hyopt.py#L285-L300 | train |
ga4gh/ga4gh-server | oidc-provider/simple_op/src/provider/server/server.py | VerifierMiddleware | def VerifierMiddleware(verifier):
"""Common wrapper for the authentication modules.
* Parses the request before passing it on to the authentication module.
* Sets 'pyoidc' cookie if authentication succeeds.
* Redirects the user to complete the authentication.
* Allows the user to ret... | python | def VerifierMiddleware(verifier):
"""Common wrapper for the authentication modules.
* Parses the request before passing it on to the authentication module.
* Sets 'pyoidc' cookie if authentication succeeds.
* Redirects the user to complete the authentication.
* Allows the user to ret... | [
"def",
"VerifierMiddleware",
"(",
"verifier",
")",
":",
"@",
"wraps",
"(",
"verifier",
".",
"verify",
")",
"def",
"wrapper",
"(",
"environ",
",",
"start_response",
")",
":",
"data",
"=",
"get_post",
"(",
"environ",
")",
"kwargs",
"=",
"dict",
"(",
"urlpa... | Common wrapper for the authentication modules.
* Parses the request before passing it on to the authentication module.
* Sets 'pyoidc' cookie if authentication succeeds.
* Redirects the user to complete the authentication.
* Allows the user to retry authentication if it fails.
:param... | [
"Common",
"wrapper",
"for",
"the",
"authentication",
"modules",
".",
"*",
"Parses",
"the",
"request",
"before",
"passing",
"it",
"on",
"to",
"the",
"authentication",
"module",
".",
"*",
"Sets",
"pyoidc",
"cookie",
"if",
"authentication",
"succeeds",
".",
"*",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/oidc-provider/simple_op/src/provider/server/server.py#L34-L67 | train |
ga4gh/ga4gh-server | oidc-provider/simple_op/src/provider/server/server.py | pyoidcMiddleware | def pyoidcMiddleware(func):
"""Common wrapper for the underlying pyoidc library functions.
Reads GET params and POST data before passing it on the library and
converts the response from oic.utils.http_util to wsgi.
:param func: underlying library function
"""
def wrapper(environ, start_response... | python | def pyoidcMiddleware(func):
"""Common wrapper for the underlying pyoidc library functions.
Reads GET params and POST data before passing it on the library and
converts the response from oic.utils.http_util to wsgi.
:param func: underlying library function
"""
def wrapper(environ, start_response... | [
"def",
"pyoidcMiddleware",
"(",
"func",
")",
":",
"def",
"wrapper",
"(",
"environ",
",",
"start_response",
")",
":",
"data",
"=",
"get_or_post",
"(",
"environ",
")",
"cookies",
"=",
"environ",
".",
"get",
"(",
"\"HTTP_COOKIE\"",
",",
"\"\"",
")",
"resp",
... | Common wrapper for the underlying pyoidc library functions.
Reads GET params and POST data before passing it on the library and
converts the response from oic.utils.http_util to wsgi.
:param func: underlying library function | [
"Common",
"wrapper",
"for",
"the",
"underlying",
"pyoidc",
"library",
"functions",
".",
"Reads",
"GET",
"params",
"and",
"POST",
"data",
"before",
"passing",
"it",
"on",
"the",
"library",
"and",
"converts",
"the",
"response",
"from",
"oic",
".",
"utils",
"."... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/oidc-provider/simple_op/src/provider/server/server.py#L70-L83 | train |
ga4gh/ga4gh-server | oidc-provider/simple_op/src/provider/server/server.py | resp2flask | def resp2flask(resp):
"""Convert an oic.utils.http_util instance to Flask."""
if isinstance(resp, Redirect) or isinstance(resp, SeeOther):
code = int(resp.status.split()[0])
raise cherrypy.HTTPRedirect(resp.message, code)
return resp.message, resp.status, resp.headers | python | def resp2flask(resp):
"""Convert an oic.utils.http_util instance to Flask."""
if isinstance(resp, Redirect) or isinstance(resp, SeeOther):
code = int(resp.status.split()[0])
raise cherrypy.HTTPRedirect(resp.message, code)
return resp.message, resp.status, resp.headers | [
"def",
"resp2flask",
"(",
"resp",
")",
":",
"if",
"isinstance",
"(",
"resp",
",",
"Redirect",
")",
"or",
"isinstance",
"(",
"resp",
",",
"SeeOther",
")",
":",
"code",
"=",
"int",
"(",
"resp",
".",
"status",
".",
"split",
"(",
")",
"[",
"0",
"]",
... | Convert an oic.utils.http_util instance to Flask. | [
"Convert",
"an",
"oic",
".",
"utils",
".",
"http_util",
"instance",
"to",
"Flask",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/oidc-provider/simple_op/src/provider/server/server.py#L86-L91 | train |
ga4gh/ga4gh-server | oidc-provider/simple_op/src/provider/server/server.py | setup_authentication_methods | def setup_authentication_methods(authn_config, template_env):
"""Add all authentication methods specified in the configuration."""
routing = {}
ac = AuthnBroker()
for authn_method in authn_config:
cls = make_cls_from_name(authn_method["class"])
instance = cls(template_env=template_env, *... | python | def setup_authentication_methods(authn_config, template_env):
"""Add all authentication methods specified in the configuration."""
routing = {}
ac = AuthnBroker()
for authn_method in authn_config:
cls = make_cls_from_name(authn_method["class"])
instance = cls(template_env=template_env, *... | [
"def",
"setup_authentication_methods",
"(",
"authn_config",
",",
"template_env",
")",
":",
"routing",
"=",
"{",
"}",
"ac",
"=",
"AuthnBroker",
"(",
")",
"for",
"authn_method",
"in",
"authn_config",
":",
"cls",
"=",
"make_cls_from_name",
"(",
"authn_method",
"[",... | Add all authentication methods specified in the configuration. | [
"Add",
"all",
"authentication",
"methods",
"specified",
"in",
"the",
"configuration",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/oidc-provider/simple_op/src/provider/server/server.py#L94-L104 | train |
ga4gh/ga4gh-server | oidc-provider/simple_op/src/provider/server/server.py | setup_endpoints | def setup_endpoints(provider):
"""Setup the OpenID Connect Provider endpoints."""
app_routing = {}
endpoints = [
AuthorizationEndpoint(
pyoidcMiddleware(provider.authorization_endpoint)),
TokenEndpoint(
pyoidcMiddleware(provider.token_endpoint)),
UserinfoEndpo... | python | def setup_endpoints(provider):
"""Setup the OpenID Connect Provider endpoints."""
app_routing = {}
endpoints = [
AuthorizationEndpoint(
pyoidcMiddleware(provider.authorization_endpoint)),
TokenEndpoint(
pyoidcMiddleware(provider.token_endpoint)),
UserinfoEndpo... | [
"def",
"setup_endpoints",
"(",
"provider",
")",
":",
"app_routing",
"=",
"{",
"}",
"endpoints",
"=",
"[",
"AuthorizationEndpoint",
"(",
"pyoidcMiddleware",
"(",
"provider",
".",
"authorization_endpoint",
")",
")",
",",
"TokenEndpoint",
"(",
"pyoidcMiddleware",
"("... | Setup the OpenID Connect Provider endpoints. | [
"Setup",
"the",
"OpenID",
"Connect",
"Provider",
"endpoints",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/oidc-provider/simple_op/src/provider/server/server.py#L107-L126 | train |
ga4gh/ga4gh-server | oidc-provider/simple_op/src/provider/server/server.py | _webfinger | def _webfinger(provider, request, **kwargs):
"""Handle webfinger requests."""
params = urlparse.parse_qs(request)
if params["rel"][0] == OIC_ISSUER:
wf = WebFinger()
return Response(wf.response(params["resource"][0], provider.baseurl),
headers=[("Content-Type", "appli... | python | def _webfinger(provider, request, **kwargs):
"""Handle webfinger requests."""
params = urlparse.parse_qs(request)
if params["rel"][0] == OIC_ISSUER:
wf = WebFinger()
return Response(wf.response(params["resource"][0], provider.baseurl),
headers=[("Content-Type", "appli... | [
"def",
"_webfinger",
"(",
"provider",
",",
"request",
",",
"*",
"*",
"kwargs",
")",
":",
"params",
"=",
"urlparse",
".",
"parse_qs",
"(",
"request",
")",
"if",
"params",
"[",
"\"rel\"",
"]",
"[",
"0",
"]",
"==",
"OIC_ISSUER",
":",
"wf",
"=",
"WebFing... | Handle webfinger requests. | [
"Handle",
"webfinger",
"requests",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/oidc-provider/simple_op/src/provider/server/server.py#L129-L137 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | Gff3DbBackend.featuresQuery | def featuresQuery(self, **kwargs):
"""
Converts a dictionary of keyword arguments into a tuple
of SQL select statements and the list of SQL arguments
"""
# TODO: Optimize by refactoring out string concatenation
sql = ""
sql_rows = "SELECT * FROM FEATURE WHERE id >... | python | def featuresQuery(self, **kwargs):
"""
Converts a dictionary of keyword arguments into a tuple
of SQL select statements and the list of SQL arguments
"""
# TODO: Optimize by refactoring out string concatenation
sql = ""
sql_rows = "SELECT * FROM FEATURE WHERE id >... | [
"def",
"featuresQuery",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# TODO: Optimize by refactoring out string concatenation",
"sql",
"=",
"\"\"",
"sql_rows",
"=",
"\"SELECT * FROM FEATURE WHERE id > 1 \"",
"sql_args",
"=",
"(",
")",
"if",
"'name'",
"in",
"kwargs... | Converts a dictionary of keyword arguments into a tuple
of SQL select statements and the list of SQL arguments | [
"Converts",
"a",
"dictionary",
"of",
"keyword",
"arguments",
"into",
"a",
"tuple",
"of",
"SQL",
"select",
"statements",
"and",
"the",
"list",
"of",
"SQL",
"arguments"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L79-L114 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | Gff3DbBackend.searchFeaturesInDb | def searchFeaturesInDb(
self, startIndex=0, maxResults=None,
referenceName=None, start=None, end=None,
parentId=None, featureTypes=None,
name=None, geneSymbol=None):
"""
Perform a full features query in database.
:param startIndex: int representin... | python | def searchFeaturesInDb(
self, startIndex=0, maxResults=None,
referenceName=None, start=None, end=None,
parentId=None, featureTypes=None,
name=None, geneSymbol=None):
"""
Perform a full features query in database.
:param startIndex: int representin... | [
"def",
"searchFeaturesInDb",
"(",
"self",
",",
"startIndex",
"=",
"0",
",",
"maxResults",
"=",
"None",
",",
"referenceName",
"=",
"None",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"parentId",
"=",
"None",
",",
"featureTypes",
"=",
"None",
... | Perform a full features query in database.
:param startIndex: int representing first record to return
:param maxResults: int representing number of records to return
:param referenceName: string representing reference name, ex 'chr1'
:param start: int position on reference to start sear... | [
"Perform",
"a",
"full",
"features",
"query",
"in",
"database",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L116-L142 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | Gff3DbBackend.getFeatureById | def getFeatureById(self, featureId):
"""
Fetch feature by featureID.
:param featureId: the FeatureID as found in GFF3 records
:return: dictionary representing a feature object,
or None if no match is found.
"""
sql = "SELECT * FROM FEATURE WHERE id = ?"
... | python | def getFeatureById(self, featureId):
"""
Fetch feature by featureID.
:param featureId: the FeatureID as found in GFF3 records
:return: dictionary representing a feature object,
or None if no match is found.
"""
sql = "SELECT * FROM FEATURE WHERE id = ?"
... | [
"def",
"getFeatureById",
"(",
"self",
",",
"featureId",
")",
":",
"sql",
"=",
"\"SELECT * FROM FEATURE WHERE id = ?\"",
"query",
"=",
"self",
".",
"_dbconn",
".",
"execute",
"(",
"sql",
",",
"(",
"featureId",
",",
")",
")",
"ret",
"=",
"query",
".",
"fetch... | Fetch feature by featureID.
:param featureId: the FeatureID as found in GFF3 records
:return: dictionary representing a feature object,
or None if no match is found. | [
"Fetch",
"feature",
"by",
"featureID",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L144-L157 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | AbstractFeatureSet.toProtocolElement | def toProtocolElement(self):
"""
Returns the representation of this FeatureSet as the corresponding
ProtocolElement.
"""
gaFeatureSet = protocol.FeatureSet()
gaFeatureSet.id = self.getId()
gaFeatureSet.dataset_id = self.getParentContainer().getId()
gaFeatu... | python | def toProtocolElement(self):
"""
Returns the representation of this FeatureSet as the corresponding
ProtocolElement.
"""
gaFeatureSet = protocol.FeatureSet()
gaFeatureSet.id = self.getId()
gaFeatureSet.dataset_id = self.getParentContainer().getId()
gaFeatu... | [
"def",
"toProtocolElement",
"(",
"self",
")",
":",
"gaFeatureSet",
"=",
"protocol",
".",
"FeatureSet",
"(",
")",
"gaFeatureSet",
".",
"id",
"=",
"self",
".",
"getId",
"(",
")",
"gaFeatureSet",
".",
"dataset_id",
"=",
"self",
".",
"getParentContainer",
"(",
... | Returns the representation of this FeatureSet as the corresponding
ProtocolElement. | [
"Returns",
"the",
"representation",
"of",
"this",
"FeatureSet",
"as",
"the",
"corresponding",
"ProtocolElement",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L185-L200 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | AbstractFeatureSet.getCompoundIdForFeatureId | def getCompoundIdForFeatureId(self, featureId):
"""
Returns server-style compound ID for an internal featureId.
:param long featureId: id of feature in database
:return: string representing ID for the specified GA4GH protocol
Feature object in this FeatureSet.
"""
... | python | def getCompoundIdForFeatureId(self, featureId):
"""
Returns server-style compound ID for an internal featureId.
:param long featureId: id of feature in database
:return: string representing ID for the specified GA4GH protocol
Feature object in this FeatureSet.
"""
... | [
"def",
"getCompoundIdForFeatureId",
"(",
"self",
",",
"featureId",
")",
":",
"if",
"featureId",
"is",
"not",
"None",
"and",
"featureId",
"!=",
"\"\"",
":",
"compoundId",
"=",
"datamodel",
".",
"FeatureCompoundId",
"(",
"self",
".",
"getCompoundId",
"(",
")",
... | Returns server-style compound ID for an internal featureId.
:param long featureId: id of feature in database
:return: string representing ID for the specified GA4GH protocol
Feature object in this FeatureSet. | [
"Returns",
"server",
"-",
"style",
"compound",
"ID",
"for",
"an",
"internal",
"featureId",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L202-L215 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | SimulatedFeatureSet.getFeature | def getFeature(self, compoundId):
"""
Fetches a simulated feature by ID.
:param compoundId: any non-null string
:return: A simulated feature with id set to the same value as the
passed-in compoundId.
":raises: exceptions.ObjectWithIdNotFoundException if None is passe... | python | def getFeature(self, compoundId):
"""
Fetches a simulated feature by ID.
:param compoundId: any non-null string
:return: A simulated feature with id set to the same value as the
passed-in compoundId.
":raises: exceptions.ObjectWithIdNotFoundException if None is passe... | [
"def",
"getFeature",
"(",
"self",
",",
"compoundId",
")",
":",
"if",
"compoundId",
"is",
"None",
":",
"raise",
"exceptions",
".",
"ObjectWithIdNotFoundException",
"(",
"compoundId",
")",
"randomNumberGenerator",
"=",
"random",
".",
"Random",
"(",
")",
"randomNum... | Fetches a simulated feature by ID.
:param compoundId: any non-null string
:return: A simulated feature with id set to the same value as the
passed-in compoundId.
":raises: exceptions.ObjectWithIdNotFoundException if None is passed
in for the compoundId. | [
"Fetches",
"a",
"simulated",
"feature",
"by",
"ID",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L254-L271 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | SimulatedFeatureSet.getFeatures | def getFeatures(self, referenceName=None, start=None, end=None,
startIndex=None, maxResults=None,
featureTypes=None, parentId=None,
name=None, geneSymbol=None, numFeatures=10):
"""
Returns a set number of simulated features.
:param ref... | python | def getFeatures(self, referenceName=None, start=None, end=None,
startIndex=None, maxResults=None,
featureTypes=None, parentId=None,
name=None, geneSymbol=None, numFeatures=10):
"""
Returns a set number of simulated features.
:param ref... | [
"def",
"getFeatures",
"(",
"self",
",",
"referenceName",
"=",
"None",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"startIndex",
"=",
"None",
",",
"maxResults",
"=",
"None",
",",
"featureTypes",
"=",
"None",
",",
"parentId",
"=",
"None",
",... | Returns a set number of simulated features.
:param referenceName: name of reference to "search" on
:param start: start coordinate of query
:param end: end coordinate of query
:param startIndex: None or int
:param maxResults: None or int
:param featureTypes: optional list... | [
"Returns",
"a",
"set",
"number",
"of",
"simulated",
"features",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L273-L306 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | Gff3DbFeatureSet.populateFromFile | def populateFromFile(self, dataUrl):
"""
Populates the instance variables of this FeatureSet from the specified
data URL.
"""
self._dbFilePath = dataUrl
self._db = Gff3DbBackend(self._dbFilePath) | python | def populateFromFile(self, dataUrl):
"""
Populates the instance variables of this FeatureSet from the specified
data URL.
"""
self._dbFilePath = dataUrl
self._db = Gff3DbBackend(self._dbFilePath) | [
"def",
"populateFromFile",
"(",
"self",
",",
"dataUrl",
")",
":",
"self",
".",
"_dbFilePath",
"=",
"dataUrl",
"self",
".",
"_db",
"=",
"Gff3DbBackend",
"(",
"self",
".",
"_dbFilePath",
")"
] | Populates the instance variables of this FeatureSet from the specified
data URL. | [
"Populates",
"the",
"instance",
"variables",
"of",
"this",
"FeatureSet",
"from",
"the",
"specified",
"data",
"URL",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L334-L340 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | Gff3DbFeatureSet.populateFromRow | def populateFromRow(self, featureSetRecord):
"""
Populates the instance variables of this FeatureSet from the specified
DB row.
"""
self._dbFilePath = featureSetRecord.dataurl
self.setAttributesJson(featureSetRecord.attributes)
self._db = Gff3DbBackend(self._dbFil... | python | def populateFromRow(self, featureSetRecord):
"""
Populates the instance variables of this FeatureSet from the specified
DB row.
"""
self._dbFilePath = featureSetRecord.dataurl
self.setAttributesJson(featureSetRecord.attributes)
self._db = Gff3DbBackend(self._dbFil... | [
"def",
"populateFromRow",
"(",
"self",
",",
"featureSetRecord",
")",
":",
"self",
".",
"_dbFilePath",
"=",
"featureSetRecord",
".",
"dataurl",
"self",
".",
"setAttributesJson",
"(",
"featureSetRecord",
".",
"attributes",
")",
"self",
".",
"_db",
"=",
"Gff3DbBack... | Populates the instance variables of this FeatureSet from the specified
DB row. | [
"Populates",
"the",
"instance",
"variables",
"of",
"this",
"FeatureSet",
"from",
"the",
"specified",
"DB",
"row",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L342-L349 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | Gff3DbFeatureSet.getFeature | def getFeature(self, compoundId):
"""
Returns a protocol.Feature object corresponding to a compoundId
:param compoundId: a datamodel.FeatureCompoundId object
:return: a Feature object.
:raises: exceptions.ObjectWithIdNotFoundException if invalid
compoundId is provided... | python | def getFeature(self, compoundId):
"""
Returns a protocol.Feature object corresponding to a compoundId
:param compoundId: a datamodel.FeatureCompoundId object
:return: a Feature object.
:raises: exceptions.ObjectWithIdNotFoundException if invalid
compoundId is provided... | [
"def",
"getFeature",
"(",
"self",
",",
"compoundId",
")",
":",
"featureId",
"=",
"long",
"(",
"compoundId",
".",
"featureId",
")",
"with",
"self",
".",
"_db",
"as",
"dataSource",
":",
"featureReturned",
"=",
"dataSource",
".",
"getFeatureById",
"(",
"feature... | Returns a protocol.Feature object corresponding to a compoundId
:param compoundId: a datamodel.FeatureCompoundId object
:return: a Feature object.
:raises: exceptions.ObjectWithIdNotFoundException if invalid
compoundId is provided. | [
"Returns",
"a",
"protocol",
".",
"Feature",
"object",
"corresponding",
"to",
"a",
"compoundId",
":",
"param",
"compoundId",
":",
"a",
"datamodel",
".",
"FeatureCompoundId",
"object",
":",
"return",
":",
"a",
"Feature",
"object",
".",
":",
"raises",
":",
"exc... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L357-L373 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | Gff3DbFeatureSet._gaFeatureForFeatureDbRecord | def _gaFeatureForFeatureDbRecord(self, feature):
"""
:param feature: The DB Row representing a feature
:return: the corresponding GA4GH protocol.Feature object
"""
gaFeature = protocol.Feature()
gaFeature.id = self.getCompoundIdForFeatureId(feature['id'])
if featu... | python | def _gaFeatureForFeatureDbRecord(self, feature):
"""
:param feature: The DB Row representing a feature
:return: the corresponding GA4GH protocol.Feature object
"""
gaFeature = protocol.Feature()
gaFeature.id = self.getCompoundIdForFeatureId(feature['id'])
if featu... | [
"def",
"_gaFeatureForFeatureDbRecord",
"(",
"self",
",",
"feature",
")",
":",
"gaFeature",
"=",
"protocol",
".",
"Feature",
"(",
")",
"gaFeature",
".",
"id",
"=",
"self",
".",
"getCompoundIdForFeatureId",
"(",
"feature",
"[",
"'id'",
"]",
")",
"if",
"feature... | :param feature: The DB Row representing a feature
:return: the corresponding GA4GH protocol.Feature object | [
":",
"param",
"feature",
":",
"The",
"DB",
"Row",
"representing",
"a",
"feature",
":",
"return",
":",
"the",
"corresponding",
"GA4GH",
"protocol",
".",
"Feature",
"object"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L375-L409 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/sequence_annotations.py | Gff3DbFeatureSet.getFeatures | def getFeatures(self, referenceName=None, start=None, end=None,
startIndex=None, maxResults=None,
featureTypes=None, parentId=None,
name=None, geneSymbol=None):
"""
method passed to runSearchRequest to fulfill the request
:param str ref... | python | def getFeatures(self, referenceName=None, start=None, end=None,
startIndex=None, maxResults=None,
featureTypes=None, parentId=None,
name=None, geneSymbol=None):
"""
method passed to runSearchRequest to fulfill the request
:param str ref... | [
"def",
"getFeatures",
"(",
"self",
",",
"referenceName",
"=",
"None",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"startIndex",
"=",
"None",
",",
"maxResults",
"=",
"None",
",",
"featureTypes",
"=",
"None",
",",
"parentId",
"=",
"None",
",... | method passed to runSearchRequest to fulfill the request
:param str referenceName: name of reference (ex: "chr1")
:param start: castable to int, start position on reference
:param end: castable to int, end position on reference
:param startIndex: none or castable to int
:param ma... | [
"method",
"passed",
"to",
"runSearchRequest",
"to",
"fulfill",
"the",
"request",
":",
"param",
"str",
"referenceName",
":",
"name",
"of",
"reference",
"(",
"ex",
":",
"chr1",
")",
":",
"param",
"start",
":",
"castable",
"to",
"int",
"start",
"position",
"o... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/sequence_annotations.py#L411-L437 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | AbstractRnaQuantificationSet.addRnaQuantification | def addRnaQuantification(self, rnaQuantification):
"""
Add an rnaQuantification to this rnaQuantificationSet
"""
id_ = rnaQuantification.getId()
self._rnaQuantificationIdMap[id_] = rnaQuantification
self._rnaQuantificationIds.append(id_) | python | def addRnaQuantification(self, rnaQuantification):
"""
Add an rnaQuantification to this rnaQuantificationSet
"""
id_ = rnaQuantification.getId()
self._rnaQuantificationIdMap[id_] = rnaQuantification
self._rnaQuantificationIds.append(id_) | [
"def",
"addRnaQuantification",
"(",
"self",
",",
"rnaQuantification",
")",
":",
"id_",
"=",
"rnaQuantification",
".",
"getId",
"(",
")",
"self",
".",
"_rnaQuantificationIdMap",
"[",
"id_",
"]",
"=",
"rnaQuantification",
"self",
".",
"_rnaQuantificationIds",
".",
... | Add an rnaQuantification to this rnaQuantificationSet | [
"Add",
"an",
"rnaQuantification",
"to",
"this",
"rnaQuantificationSet"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L130-L136 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | AbstractRnaQuantificationSet.toProtocolElement | def toProtocolElement(self):
"""
Converts this rnaQuant into its GA4GH protocol equivalent.
"""
protocolElement = protocol.RnaQuantificationSet()
protocolElement.id = self.getId()
protocolElement.dataset_id = self._parentContainer.getId()
protocolElement.name = se... | python | def toProtocolElement(self):
"""
Converts this rnaQuant into its GA4GH protocol equivalent.
"""
protocolElement = protocol.RnaQuantificationSet()
protocolElement.id = self.getId()
protocolElement.dataset_id = self._parentContainer.getId()
protocolElement.name = se... | [
"def",
"toProtocolElement",
"(",
"self",
")",
":",
"protocolElement",
"=",
"protocol",
".",
"RnaQuantificationSet",
"(",
")",
"protocolElement",
".",
"id",
"=",
"self",
".",
"getId",
"(",
")",
"protocolElement",
".",
"dataset_id",
"=",
"self",
".",
"_parentCon... | Converts this rnaQuant into its GA4GH protocol equivalent. | [
"Converts",
"this",
"rnaQuant",
"into",
"its",
"GA4GH",
"protocol",
"equivalent",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L138-L147 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | SqliteRnaQuantificationSet.populateFromFile | def populateFromFile(self, dataUrl):
"""
Populates the instance variables of this RnaQuantificationSet from the
specified data URL.
"""
self._dbFilePath = dataUrl
self._db = SqliteRnaBackend(self._dbFilePath)
self.addRnaQuants() | python | def populateFromFile(self, dataUrl):
"""
Populates the instance variables of this RnaQuantificationSet from the
specified data URL.
"""
self._dbFilePath = dataUrl
self._db = SqliteRnaBackend(self._dbFilePath)
self.addRnaQuants() | [
"def",
"populateFromFile",
"(",
"self",
",",
"dataUrl",
")",
":",
"self",
".",
"_dbFilePath",
"=",
"dataUrl",
"self",
".",
"_db",
"=",
"SqliteRnaBackend",
"(",
"self",
".",
"_dbFilePath",
")",
"self",
".",
"addRnaQuants",
"(",
")"
] | Populates the instance variables of this RnaQuantificationSet from the
specified data URL. | [
"Populates",
"the",
"instance",
"variables",
"of",
"this",
"RnaQuantificationSet",
"from",
"the",
"specified",
"data",
"URL",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L167-L174 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | SqliteRnaQuantificationSet.populateFromRow | def populateFromRow(self, quantificationSetRecord):
"""
Populates the instance variables of this RnaQuantificationSet from the
specified DB row.
"""
self._dbFilePath = quantificationSetRecord.dataurl
self.setAttributesJson(quantificationSetRecord.attributes)
self.... | python | def populateFromRow(self, quantificationSetRecord):
"""
Populates the instance variables of this RnaQuantificationSet from the
specified DB row.
"""
self._dbFilePath = quantificationSetRecord.dataurl
self.setAttributesJson(quantificationSetRecord.attributes)
self.... | [
"def",
"populateFromRow",
"(",
"self",
",",
"quantificationSetRecord",
")",
":",
"self",
".",
"_dbFilePath",
"=",
"quantificationSetRecord",
".",
"dataurl",
"self",
".",
"setAttributesJson",
"(",
"quantificationSetRecord",
".",
"attributes",
")",
"self",
".",
"_db",... | Populates the instance variables of this RnaQuantificationSet from the
specified DB row. | [
"Populates",
"the",
"instance",
"variables",
"of",
"this",
"RnaQuantificationSet",
"from",
"the",
"specified",
"DB",
"row",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L176-L184 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | AbstractRnaQuantification.toProtocolElement | def toProtocolElement(self):
"""
Converts this rnaQuant into its GA4GH protocol equivalent.
"""
protocolElement = protocol.RnaQuantification()
protocolElement.id = self.getId()
protocolElement.name = self._name
protocolElement.description = self._description
... | python | def toProtocolElement(self):
"""
Converts this rnaQuant into its GA4GH protocol equivalent.
"""
protocolElement = protocol.RnaQuantification()
protocolElement.id = self.getId()
protocolElement.name = self._name
protocolElement.description = self._description
... | [
"def",
"toProtocolElement",
"(",
"self",
")",
":",
"protocolElement",
"=",
"protocol",
".",
"RnaQuantification",
"(",
")",
"protocolElement",
".",
"id",
"=",
"self",
".",
"getId",
"(",
")",
"protocolElement",
".",
"name",
"=",
"self",
".",
"_name",
"protocol... | Converts this rnaQuant into its GA4GH protocol equivalent. | [
"Converts",
"this",
"rnaQuant",
"into",
"its",
"GA4GH",
"protocol",
"equivalent",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L213-L228 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | AbstractRnaQuantification.addRnaQuantMetadata | def addRnaQuantMetadata(self, fields):
"""
data elements are:
Id, annotations, description, name, readGroupId
where annotations is a comma separated list
"""
self._featureSetIds = fields["feature_set_ids"].split(',')
self._description = fields["description"]
... | python | def addRnaQuantMetadata(self, fields):
"""
data elements are:
Id, annotations, description, name, readGroupId
where annotations is a comma separated list
"""
self._featureSetIds = fields["feature_set_ids"].split(',')
self._description = fields["description"]
... | [
"def",
"addRnaQuantMetadata",
"(",
"self",
",",
"fields",
")",
":",
"self",
".",
"_featureSetIds",
"=",
"fields",
"[",
"\"feature_set_ids\"",
"]",
".",
"split",
"(",
"','",
")",
"self",
".",
"_description",
"=",
"fields",
"[",
"\"description\"",
"]",
"self",... | data elements are:
Id, annotations, description, name, readGroupId
where annotations is a comma separated list | [
"data",
"elements",
"are",
":",
"Id",
"annotations",
"description",
"name",
"readGroupId",
"where",
"annotations",
"is",
"a",
"comma",
"separated",
"list"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L230-L249 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | SqliteRnaQuantification.getRnaQuantMetadata | def getRnaQuantMetadata(self):
"""
input is tab file with no header. Columns are:
Id, annotations, description, name, readGroupId
where annotation is a comma separated list
"""
rnaQuantId = self.getLocalId()
with self._db as dataSource:
rnaQuantReturn... | python | def getRnaQuantMetadata(self):
"""
input is tab file with no header. Columns are:
Id, annotations, description, name, readGroupId
where annotation is a comma separated list
"""
rnaQuantId = self.getLocalId()
with self._db as dataSource:
rnaQuantReturn... | [
"def",
"getRnaQuantMetadata",
"(",
"self",
")",
":",
"rnaQuantId",
"=",
"self",
".",
"getLocalId",
"(",
")",
"with",
"self",
".",
"_db",
"as",
"dataSource",
":",
"rnaQuantReturned",
"=",
"dataSource",
".",
"getRnaQuantificationById",
"(",
"rnaQuantId",
")",
"s... | input is tab file with no header. Columns are:
Id, annotations, description, name, readGroupId
where annotation is a comma separated list | [
"input",
"is",
"tab",
"file",
"with",
"no",
"header",
".",
"Columns",
"are",
":",
"Id",
"annotations",
"description",
"name",
"readGroupId",
"where",
"annotation",
"is",
"a",
"comma",
"separated",
"list"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L283-L293 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | SqliteRnaQuantification.populateFromFile | def populateFromFile(self, dataUrl):
"""
Populates the instance variables of this FeatureSet from the specified
data URL.
"""
self._dbFilePath = dataUrl
self._db = SqliteRnaBackend(self._dbFilePath)
self.getRnaQuantMetadata() | python | def populateFromFile(self, dataUrl):
"""
Populates the instance variables of this FeatureSet from the specified
data URL.
"""
self._dbFilePath = dataUrl
self._db = SqliteRnaBackend(self._dbFilePath)
self.getRnaQuantMetadata() | [
"def",
"populateFromFile",
"(",
"self",
",",
"dataUrl",
")",
":",
"self",
".",
"_dbFilePath",
"=",
"dataUrl",
"self",
".",
"_db",
"=",
"SqliteRnaBackend",
"(",
"self",
".",
"_dbFilePath",
")",
"self",
".",
"getRnaQuantMetadata",
"(",
")"
] | Populates the instance variables of this FeatureSet from the specified
data URL. | [
"Populates",
"the",
"instance",
"variables",
"of",
"this",
"FeatureSet",
"from",
"the",
"specified",
"data",
"URL",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L295-L302 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | SqliteRnaQuantification.populateFromRow | def populateFromRow(self, row):
"""
Populates the instance variables of this FeatureSet from the specified
DB row.
"""
self._dbFilePath = row[b'dataUrl']
self._db = SqliteRnaBackend(self._dbFilePath)
self.getRnaQuantMetadata() | python | def populateFromRow(self, row):
"""
Populates the instance variables of this FeatureSet from the specified
DB row.
"""
self._dbFilePath = row[b'dataUrl']
self._db = SqliteRnaBackend(self._dbFilePath)
self.getRnaQuantMetadata() | [
"def",
"populateFromRow",
"(",
"self",
",",
"row",
")",
":",
"self",
".",
"_dbFilePath",
"=",
"row",
"[",
"b'dataUrl'",
"]",
"self",
".",
"_db",
"=",
"SqliteRnaBackend",
"(",
"self",
".",
"_dbFilePath",
")",
"self",
".",
"getRnaQuantMetadata",
"(",
")"
] | Populates the instance variables of this FeatureSet from the specified
DB row. | [
"Populates",
"the",
"instance",
"variables",
"of",
"this",
"FeatureSet",
"from",
"the",
"specified",
"DB",
"row",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L304-L311 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | SqliteRnaQuantification.getExpressionLevels | def getExpressionLevels(
self, threshold=0.0, names=[], startIndex=0, maxResults=0):
"""
Returns the list of ExpressionLevels in this RNA Quantification.
"""
rnaQuantificationId = self.getLocalId()
with self._db as dataSource:
expressionsReturned = dataSou... | python | def getExpressionLevels(
self, threshold=0.0, names=[], startIndex=0, maxResults=0):
"""
Returns the list of ExpressionLevels in this RNA Quantification.
"""
rnaQuantificationId = self.getLocalId()
with self._db as dataSource:
expressionsReturned = dataSou... | [
"def",
"getExpressionLevels",
"(",
"self",
",",
"threshold",
"=",
"0.0",
",",
"names",
"=",
"[",
"]",
",",
"startIndex",
"=",
"0",
",",
"maxResults",
"=",
"0",
")",
":",
"rnaQuantificationId",
"=",
"self",
".",
"getLocalId",
"(",
")",
"with",
"self",
"... | Returns the list of ExpressionLevels in this RNA Quantification. | [
"Returns",
"the",
"list",
"of",
"ExpressionLevels",
"in",
"this",
"RNA",
"Quantification",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L319-L335 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | SqliteRnaBackend.searchRnaQuantificationsInDb | def searchRnaQuantificationsInDb(
self, rnaQuantificationId=""):
"""
:param rnaQuantificationId: string restrict search by id
:return an array of dictionaries, representing the returned data.
"""
sql = ("SELECT * FROM RnaQuantification")
sql_args = ()
... | python | def searchRnaQuantificationsInDb(
self, rnaQuantificationId=""):
"""
:param rnaQuantificationId: string restrict search by id
:return an array of dictionaries, representing the returned data.
"""
sql = ("SELECT * FROM RnaQuantification")
sql_args = ()
... | [
"def",
"searchRnaQuantificationsInDb",
"(",
"self",
",",
"rnaQuantificationId",
"=",
"\"\"",
")",
":",
"sql",
"=",
"(",
"\"SELECT * FROM RnaQuantification\"",
")",
"sql_args",
"=",
"(",
")",
"if",
"len",
"(",
"rnaQuantificationId",
")",
">",
"0",
":",
"sql",
"... | :param rnaQuantificationId: string restrict search by id
:return an array of dictionaries, representing the returned data. | [
":",
"param",
"rnaQuantificationId",
":",
"string",
"restrict",
"search",
"by",
"id",
":",
"return",
"an",
"array",
"of",
"dictionaries",
"representing",
"the",
"returned",
"data",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L353-L369 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | SqliteRnaBackend.getRnaQuantificationById | def getRnaQuantificationById(self, rnaQuantificationId):
"""
:param rnaQuantificationId: the RNA Quantification ID
:return: dictionary representing an RnaQuantification object,
or None if no match is found.
"""
sql = ("SELECT * FROM RnaQuantification WHERE id = ?")
... | python | def getRnaQuantificationById(self, rnaQuantificationId):
"""
:param rnaQuantificationId: the RNA Quantification ID
:return: dictionary representing an RnaQuantification object,
or None if no match is found.
"""
sql = ("SELECT * FROM RnaQuantification WHERE id = ?")
... | [
"def",
"getRnaQuantificationById",
"(",
"self",
",",
"rnaQuantificationId",
")",
":",
"sql",
"=",
"(",
"\"SELECT * FROM RnaQuantification WHERE id = ?\"",
")",
"query",
"=",
"self",
".",
"_dbconn",
".",
"execute",
"(",
"sql",
",",
"(",
"rnaQuantificationId",
",",
... | :param rnaQuantificationId: the RNA Quantification ID
:return: dictionary representing an RnaQuantification object,
or None if no match is found. | [
":",
"param",
"rnaQuantificationId",
":",
"the",
"RNA",
"Quantification",
"ID",
":",
"return",
":",
"dictionary",
"representing",
"an",
"RnaQuantification",
"object",
"or",
"None",
"if",
"no",
"match",
"is",
"found",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L371-L383 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | SqliteRnaBackend.searchExpressionLevelsInDb | def searchExpressionLevelsInDb(
self, rnaQuantId, names=[], threshold=0.0, startIndex=0,
maxResults=0):
"""
:param rnaQuantId: string restrict search by quantification id
:param threshold: float minimum expression values to return
:return an array of dictionaries,... | python | def searchExpressionLevelsInDb(
self, rnaQuantId, names=[], threshold=0.0, startIndex=0,
maxResults=0):
"""
:param rnaQuantId: string restrict search by quantification id
:param threshold: float minimum expression values to return
:return an array of dictionaries,... | [
"def",
"searchExpressionLevelsInDb",
"(",
"self",
",",
"rnaQuantId",
",",
"names",
"=",
"[",
"]",
",",
"threshold",
"=",
"0.0",
",",
"startIndex",
"=",
"0",
",",
"maxResults",
"=",
"0",
")",
":",
"sql",
"=",
"(",
"\"SELECT * FROM Expression WHERE \"",
"\"rna... | :param rnaQuantId: string restrict search by quantification id
:param threshold: float minimum expression values to return
:return an array of dictionaries, representing the returned data. | [
":",
"param",
"rnaQuantId",
":",
"string",
"restrict",
"search",
"by",
"quantification",
"id",
":",
"param",
"threshold",
":",
"float",
"minimum",
"expression",
"values",
"to",
"return",
":",
"return",
"an",
"array",
"of",
"dictionaries",
"representing",
"the",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L385-L406 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/rna_quantification.py | SqliteRnaBackend.getExpressionLevelById | def getExpressionLevelById(self, expressionId):
"""
:param expressionId: the ExpressionLevel ID
:return: dictionary representing an ExpressionLevel object,
or None if no match is found.
"""
sql = ("SELECT * FROM Expression WHERE id = ?")
query = self._dbconn.e... | python | def getExpressionLevelById(self, expressionId):
"""
:param expressionId: the ExpressionLevel ID
:return: dictionary representing an ExpressionLevel object,
or None if no match is found.
"""
sql = ("SELECT * FROM Expression WHERE id = ?")
query = self._dbconn.e... | [
"def",
"getExpressionLevelById",
"(",
"self",
",",
"expressionId",
")",
":",
"sql",
"=",
"(",
"\"SELECT * FROM Expression WHERE id = ?\"",
")",
"query",
"=",
"self",
".",
"_dbconn",
".",
"execute",
"(",
"sql",
",",
"(",
"expressionId",
",",
")",
")",
"try",
... | :param expressionId: the ExpressionLevel ID
:return: dictionary representing an ExpressionLevel object,
or None if no match is found. | [
":",
"param",
"expressionId",
":",
"the",
"ExpressionLevel",
"ID",
":",
"return",
":",
"dictionary",
"representing",
"an",
"ExpressionLevel",
"object",
"or",
"None",
"if",
"no",
"match",
"is",
"found",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/rna_quantification.py#L408-L420 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | CallSet.populateFromRow | def populateFromRow(self, callSetRecord):
"""
Populates this CallSet from the specified DB row.
"""
self._biosampleId = callSetRecord.biosampleid
self.setAttributesJson(callSetRecord.attributes) | python | def populateFromRow(self, callSetRecord):
"""
Populates this CallSet from the specified DB row.
"""
self._biosampleId = callSetRecord.biosampleid
self.setAttributesJson(callSetRecord.attributes) | [
"def",
"populateFromRow",
"(",
"self",
",",
"callSetRecord",
")",
":",
"self",
".",
"_biosampleId",
"=",
"callSetRecord",
".",
"biosampleid",
"self",
".",
"setAttributesJson",
"(",
"callSetRecord",
".",
"attributes",
")"
] | Populates this CallSet from the specified DB row. | [
"Populates",
"this",
"CallSet",
"from",
"the",
"specified",
"DB",
"row",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L61-L66 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | CallSet.toProtocolElement | def toProtocolElement(self):
"""
Returns the representation of this CallSet as the corresponding
ProtocolElement.
"""
variantSet = self.getParentContainer()
gaCallSet = protocol.CallSet(
biosample_id=self.getBiosampleId())
if variantSet.getCreationTime... | python | def toProtocolElement(self):
"""
Returns the representation of this CallSet as the corresponding
ProtocolElement.
"""
variantSet = self.getParentContainer()
gaCallSet = protocol.CallSet(
biosample_id=self.getBiosampleId())
if variantSet.getCreationTime... | [
"def",
"toProtocolElement",
"(",
"self",
")",
":",
"variantSet",
"=",
"self",
".",
"getParentContainer",
"(",
")",
"gaCallSet",
"=",
"protocol",
".",
"CallSet",
"(",
"biosample_id",
"=",
"self",
".",
"getBiosampleId",
"(",
")",
")",
"if",
"variantSet",
".",
... | Returns the representation of this CallSet as the corresponding
ProtocolElement. | [
"Returns",
"the",
"representation",
"of",
"this",
"CallSet",
"as",
"the",
"corresponding",
"ProtocolElement",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L68-L84 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantSet.addVariantAnnotationSet | def addVariantAnnotationSet(self, variantAnnotationSet):
"""
Adds the specified variantAnnotationSet to this dataset.
"""
id_ = variantAnnotationSet.getId()
self._variantAnnotationSetIdMap[id_] = variantAnnotationSet
self._variantAnnotationSetIds.append(id_) | python | def addVariantAnnotationSet(self, variantAnnotationSet):
"""
Adds the specified variantAnnotationSet to this dataset.
"""
id_ = variantAnnotationSet.getId()
self._variantAnnotationSetIdMap[id_] = variantAnnotationSet
self._variantAnnotationSetIds.append(id_) | [
"def",
"addVariantAnnotationSet",
"(",
"self",
",",
"variantAnnotationSet",
")",
":",
"id_",
"=",
"variantAnnotationSet",
".",
"getId",
"(",
")",
"self",
".",
"_variantAnnotationSetIdMap",
"[",
"id_",
"]",
"=",
"variantAnnotationSet",
"self",
".",
"_variantAnnotatio... | Adds the specified variantAnnotationSet to this dataset. | [
"Adds",
"the",
"specified",
"variantAnnotationSet",
"to",
"this",
"dataset",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L130-L136 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantSet.getVariantAnnotationSet | def getVariantAnnotationSet(self, id_):
"""
Returns the AnnotationSet in this dataset with the specified 'id'
"""
if id_ not in self._variantAnnotationSetIdMap:
raise exceptions.AnnotationSetNotFoundException(id_)
return self._variantAnnotationSetIdMap[id_] | python | def getVariantAnnotationSet(self, id_):
"""
Returns the AnnotationSet in this dataset with the specified 'id'
"""
if id_ not in self._variantAnnotationSetIdMap:
raise exceptions.AnnotationSetNotFoundException(id_)
return self._variantAnnotationSetIdMap[id_] | [
"def",
"getVariantAnnotationSet",
"(",
"self",
",",
"id_",
")",
":",
"if",
"id_",
"not",
"in",
"self",
".",
"_variantAnnotationSetIdMap",
":",
"raise",
"exceptions",
".",
"AnnotationSetNotFoundException",
"(",
"id_",
")",
"return",
"self",
".",
"_variantAnnotation... | Returns the AnnotationSet in this dataset with the specified 'id' | [
"Returns",
"the",
"AnnotationSet",
"in",
"this",
"dataset",
"with",
"the",
"specified",
"id"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L146-L152 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantSet.addCallSet | def addCallSet(self, callSet):
"""
Adds the specfied CallSet to this VariantSet.
"""
callSetId = callSet.getId()
self._callSetIdMap[callSetId] = callSet
self._callSetNameMap[callSet.getLocalId()] = callSet
self._callSetIds.append(callSetId)
self._callSetId... | python | def addCallSet(self, callSet):
"""
Adds the specfied CallSet to this VariantSet.
"""
callSetId = callSet.getId()
self._callSetIdMap[callSetId] = callSet
self._callSetNameMap[callSet.getLocalId()] = callSet
self._callSetIds.append(callSetId)
self._callSetId... | [
"def",
"addCallSet",
"(",
"self",
",",
"callSet",
")",
":",
"callSetId",
"=",
"callSet",
".",
"getId",
"(",
")",
"self",
".",
"_callSetIdMap",
"[",
"callSetId",
"]",
"=",
"callSet",
"self",
".",
"_callSetNameMap",
"[",
"callSet",
".",
"getLocalId",
"(",
... | Adds the specfied CallSet to this VariantSet. | [
"Adds",
"the",
"specfied",
"CallSet",
"to",
"this",
"VariantSet",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L192-L200 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantSet.addCallSetFromName | def addCallSetFromName(self, sampleName):
"""
Adds a CallSet for the specified sample name.
"""
callSet = CallSet(self, sampleName)
self.addCallSet(callSet) | python | def addCallSetFromName(self, sampleName):
"""
Adds a CallSet for the specified sample name.
"""
callSet = CallSet(self, sampleName)
self.addCallSet(callSet) | [
"def",
"addCallSetFromName",
"(",
"self",
",",
"sampleName",
")",
":",
"callSet",
"=",
"CallSet",
"(",
"self",
",",
"sampleName",
")",
"self",
".",
"addCallSet",
"(",
"callSet",
")"
] | Adds a CallSet for the specified sample name. | [
"Adds",
"a",
"CallSet",
"for",
"the",
"specified",
"sample",
"name",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L202-L207 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantSet.getCallSetByName | def getCallSetByName(self, name):
"""
Returns a CallSet with the specified name, or raises a
CallSetNameNotFoundException if it does not exist.
"""
if name not in self._callSetNameMap:
raise exceptions.CallSetNameNotFoundException(name)
return self._callSetNam... | python | def getCallSetByName(self, name):
"""
Returns a CallSet with the specified name, or raises a
CallSetNameNotFoundException if it does not exist.
"""
if name not in self._callSetNameMap:
raise exceptions.CallSetNameNotFoundException(name)
return self._callSetNam... | [
"def",
"getCallSetByName",
"(",
"self",
",",
"name",
")",
":",
"if",
"name",
"not",
"in",
"self",
".",
"_callSetNameMap",
":",
"raise",
"exceptions",
".",
"CallSetNameNotFoundException",
"(",
"name",
")",
"return",
"self",
".",
"_callSetNameMap",
"[",
"name",
... | Returns a CallSet with the specified name, or raises a
CallSetNameNotFoundException if it does not exist. | [
"Returns",
"a",
"CallSet",
"with",
"the",
"specified",
"name",
"or",
"raises",
"a",
"CallSetNameNotFoundException",
"if",
"it",
"does",
"not",
"exist",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L221-L228 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantSet.getCallSet | def getCallSet(self, id_):
"""
Returns a CallSet with the specified id, or raises a
CallSetNotFoundException if it does not exist.
"""
if id_ not in self._callSetIdMap:
raise exceptions.CallSetNotFoundException(id_)
return self._callSetIdMap[id_] | python | def getCallSet(self, id_):
"""
Returns a CallSet with the specified id, or raises a
CallSetNotFoundException if it does not exist.
"""
if id_ not in self._callSetIdMap:
raise exceptions.CallSetNotFoundException(id_)
return self._callSetIdMap[id_] | [
"def",
"getCallSet",
"(",
"self",
",",
"id_",
")",
":",
"if",
"id_",
"not",
"in",
"self",
".",
"_callSetIdMap",
":",
"raise",
"exceptions",
".",
"CallSetNotFoundException",
"(",
"id_",
")",
"return",
"self",
".",
"_callSetIdMap",
"[",
"id_",
"]"
] | Returns a CallSet with the specified id, or raises a
CallSetNotFoundException if it does not exist. | [
"Returns",
"a",
"CallSet",
"with",
"the",
"specified",
"id",
"or",
"raises",
"a",
"CallSetNotFoundException",
"if",
"it",
"does",
"not",
"exist",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L236-L243 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantSet.toProtocolElement | def toProtocolElement(self):
"""
Converts this VariantSet into its GA4GH protocol equivalent.
"""
protocolElement = protocol.VariantSet()
protocolElement.id = self.getId()
protocolElement.dataset_id = self.getParentContainer().getId()
protocolElement.reference_set... | python | def toProtocolElement(self):
"""
Converts this VariantSet into its GA4GH protocol equivalent.
"""
protocolElement = protocol.VariantSet()
protocolElement.id = self.getId()
protocolElement.dataset_id = self.getParentContainer().getId()
protocolElement.reference_set... | [
"def",
"toProtocolElement",
"(",
"self",
")",
":",
"protocolElement",
"=",
"protocol",
".",
"VariantSet",
"(",
")",
"protocolElement",
".",
"id",
"=",
"self",
".",
"getId",
"(",
")",
"protocolElement",
".",
"dataset_id",
"=",
"self",
".",
"getParentContainer",... | Converts this VariantSet into its GA4GH protocol equivalent. | [
"Converts",
"this",
"VariantSet",
"into",
"its",
"GA4GH",
"protocol",
"equivalent",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L251-L264 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantSet._createGaVariant | def _createGaVariant(self):
"""
Convenience method to set the common fields in a GA Variant
object from this variant set.
"""
ret = protocol.Variant()
if self._creationTime:
ret.created = self._creationTime
if self._updatedTime:
ret.updated... | python | def _createGaVariant(self):
"""
Convenience method to set the common fields in a GA Variant
object from this variant set.
"""
ret = protocol.Variant()
if self._creationTime:
ret.created = self._creationTime
if self._updatedTime:
ret.updated... | [
"def",
"_createGaVariant",
"(",
"self",
")",
":",
"ret",
"=",
"protocol",
".",
"Variant",
"(",
")",
"if",
"self",
".",
"_creationTime",
":",
"ret",
".",
"created",
"=",
"self",
".",
"_creationTime",
"if",
"self",
".",
"_updatedTime",
":",
"ret",
".",
"... | Convenience method to set the common fields in a GA Variant
object from this variant set. | [
"Convenience",
"method",
"to",
"set",
"the",
"common",
"fields",
"in",
"a",
"GA",
"Variant",
"object",
"from",
"this",
"variant",
"set",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L272-L283 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantSet.getVariantId | def getVariantId(self, gaVariant):
"""
Returns an ID string suitable for the specified GA Variant
object in this variant set.
"""
md5 = self.hashVariant(gaVariant)
compoundId = datamodel.VariantCompoundId(
self.getCompoundId(), gaVariant.reference_name,
... | python | def getVariantId(self, gaVariant):
"""
Returns an ID string suitable for the specified GA Variant
object in this variant set.
"""
md5 = self.hashVariant(gaVariant)
compoundId = datamodel.VariantCompoundId(
self.getCompoundId(), gaVariant.reference_name,
... | [
"def",
"getVariantId",
"(",
"self",
",",
"gaVariant",
")",
":",
"md5",
"=",
"self",
".",
"hashVariant",
"(",
"gaVariant",
")",
"compoundId",
"=",
"datamodel",
".",
"VariantCompoundId",
"(",
"self",
".",
"getCompoundId",
"(",
")",
",",
"gaVariant",
".",
"re... | Returns an ID string suitable for the specified GA Variant
object in this variant set. | [
"Returns",
"an",
"ID",
"string",
"suitable",
"for",
"the",
"specified",
"GA",
"Variant",
"object",
"in",
"this",
"variant",
"set",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L285-L294 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantSet.getCallSetId | def getCallSetId(self, sampleName):
"""
Returns the callSetId for the specified sampleName in this
VariantSet.
"""
compoundId = datamodel.CallSetCompoundId(
self.getCompoundId(), sampleName)
return str(compoundId) | python | def getCallSetId(self, sampleName):
"""
Returns the callSetId for the specified sampleName in this
VariantSet.
"""
compoundId = datamodel.CallSetCompoundId(
self.getCompoundId(), sampleName)
return str(compoundId) | [
"def",
"getCallSetId",
"(",
"self",
",",
"sampleName",
")",
":",
"compoundId",
"=",
"datamodel",
".",
"CallSetCompoundId",
"(",
"self",
".",
"getCompoundId",
"(",
")",
",",
"sampleName",
")",
"return",
"str",
"(",
"compoundId",
")"
] | Returns the callSetId for the specified sampleName in this
VariantSet. | [
"Returns",
"the",
"callSetId",
"for",
"the",
"specified",
"sampleName",
"in",
"this",
"VariantSet",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L296-L303 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantSet.hashVariant | def hashVariant(cls, gaVariant):
"""
Produces an MD5 hash of the ga variant object to distinguish
it from other variants at the same genomic coordinate.
"""
hash_str = gaVariant.reference_bases + \
str(tuple(gaVariant.alternate_bases))
return hashlib.md5(hash_... | python | def hashVariant(cls, gaVariant):
"""
Produces an MD5 hash of the ga variant object to distinguish
it from other variants at the same genomic coordinate.
"""
hash_str = gaVariant.reference_bases + \
str(tuple(gaVariant.alternate_bases))
return hashlib.md5(hash_... | [
"def",
"hashVariant",
"(",
"cls",
",",
"gaVariant",
")",
":",
"hash_str",
"=",
"gaVariant",
".",
"reference_bases",
"+",
"str",
"(",
"tuple",
"(",
"gaVariant",
".",
"alternate_bases",
")",
")",
"return",
"hashlib",
".",
"md5",
"(",
"hash_str",
")",
".",
... | Produces an MD5 hash of the ga variant object to distinguish
it from other variants at the same genomic coordinate. | [
"Produces",
"an",
"MD5",
"hash",
"of",
"the",
"ga",
"variant",
"object",
"to",
"distinguish",
"it",
"from",
"other",
"variants",
"at",
"the",
"same",
"genomic",
"coordinate",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L306-L313 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | SimulatedVariantSet.generateVariant | def generateVariant(self, referenceName, position, randomNumberGenerator):
"""
Generate a random variant for the specified position using the
specified random number generator. This generator should be seeded
with a value that is unique to this position so that the same variant
w... | python | def generateVariant(self, referenceName, position, randomNumberGenerator):
"""
Generate a random variant for the specified position using the
specified random number generator. This generator should be seeded
with a value that is unique to this position so that the same variant
w... | [
"def",
"generateVariant",
"(",
"self",
",",
"referenceName",
",",
"position",
",",
"randomNumberGenerator",
")",
":",
"variant",
"=",
"self",
".",
"_createGaVariant",
"(",
")",
"variant",
".",
"reference_name",
"=",
"referenceName",
"variant",
".",
"start",
"=",... | Generate a random variant for the specified position using the
specified random number generator. This generator should be seeded
with a value that is unique to this position so that the same variant
will always be produced regardless of the order it is generated in. | [
"Generate",
"a",
"random",
"variant",
"for",
"the",
"specified",
"position",
"using",
"the",
"specified",
"random",
"number",
"generator",
".",
"This",
"generator",
"should",
"be",
"seeded",
"with",
"a",
"value",
"that",
"is",
"unique",
"to",
"this",
"position... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L394-L434 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet.populateFromRow | def populateFromRow(self, variantSetRecord):
"""
Populates this VariantSet from the specified DB row.
"""
self._created = variantSetRecord.created
self._updated = variantSetRecord.updated
self.setAttributesJson(variantSetRecord.attributes)
self._chromFileMap = {}
... | python | def populateFromRow(self, variantSetRecord):
"""
Populates this VariantSet from the specified DB row.
"""
self._created = variantSetRecord.created
self._updated = variantSetRecord.updated
self.setAttributesJson(variantSetRecord.attributes)
self._chromFileMap = {}
... | [
"def",
"populateFromRow",
"(",
"self",
",",
"variantSetRecord",
")",
":",
"self",
".",
"_created",
"=",
"variantSetRecord",
".",
"created",
"self",
".",
"_updated",
"=",
"variantSetRecord",
".",
"updated",
"self",
".",
"setAttributesJson",
"(",
"variantSetRecord",... | Populates this VariantSet from the specified DB row. | [
"Populates",
"this",
"VariantSet",
"from",
"the",
"specified",
"DB",
"row",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L466-L482 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet.populateFromFile | def populateFromFile(self, dataUrls, indexFiles):
"""
Populates this variant set using the specified lists of data
files and indexes. These must be in the same order, such that
the jth index file corresponds to the jth data file.
"""
assert len(dataUrls) == len(indexFiles... | python | def populateFromFile(self, dataUrls, indexFiles):
"""
Populates this variant set using the specified lists of data
files and indexes. These must be in the same order, such that
the jth index file corresponds to the jth data file.
"""
assert len(dataUrls) == len(indexFiles... | [
"def",
"populateFromFile",
"(",
"self",
",",
"dataUrls",
",",
"indexFiles",
")",
":",
"assert",
"len",
"(",
"dataUrls",
")",
"==",
"len",
"(",
"indexFiles",
")",
"for",
"dataUrl",
",",
"indexFile",
"in",
"zip",
"(",
"dataUrls",
",",
"indexFiles",
")",
":... | Populates this variant set using the specified lists of data
files and indexes. These must be in the same order, such that
the jth index file corresponds to the jth data file. | [
"Populates",
"this",
"variant",
"set",
"using",
"the",
"specified",
"lists",
"of",
"data",
"files",
"and",
"indexes",
".",
"These",
"must",
"be",
"in",
"the",
"same",
"order",
"such",
"that",
"the",
"jth",
"index",
"file",
"corresponds",
"to",
"the",
"jth"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L484-L496 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet.populateFromDirectory | def populateFromDirectory(self, vcfDirectory):
"""
Populates this VariantSet by examing all the VCF files in the
specified directory. This is mainly used for as a convenience
for testing purposes.
"""
pattern = os.path.join(vcfDirectory, "*.vcf.gz")
dataFiles = []... | python | def populateFromDirectory(self, vcfDirectory):
"""
Populates this VariantSet by examing all the VCF files in the
specified directory. This is mainly used for as a convenience
for testing purposes.
"""
pattern = os.path.join(vcfDirectory, "*.vcf.gz")
dataFiles = []... | [
"def",
"populateFromDirectory",
"(",
"self",
",",
"vcfDirectory",
")",
":",
"pattern",
"=",
"os",
".",
"path",
".",
"join",
"(",
"vcfDirectory",
",",
"\"*.vcf.gz\"",
")",
"dataFiles",
"=",
"[",
"]",
"indexFiles",
"=",
"[",
"]",
"for",
"vcfFile",
"in",
"g... | Populates this VariantSet by examing all the VCF files in the
specified directory. This is mainly used for as a convenience
for testing purposes. | [
"Populates",
"this",
"VariantSet",
"by",
"examing",
"all",
"the",
"VCF",
"files",
"in",
"the",
"specified",
"directory",
".",
"This",
"is",
"mainly",
"used",
"for",
"as",
"a",
"convenience",
"for",
"testing",
"purposes",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L498-L510 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet.checkConsistency | def checkConsistency(self):
"""
Perform consistency check on the variant set
"""
for referenceName, (dataUrl, indexFile) in self._chromFileMap.items():
varFile = pysam.VariantFile(dataUrl, index_filename=indexFile)
try:
for chrom in varFile.index:
... | python | def checkConsistency(self):
"""
Perform consistency check on the variant set
"""
for referenceName, (dataUrl, indexFile) in self._chromFileMap.items():
varFile = pysam.VariantFile(dataUrl, index_filename=indexFile)
try:
for chrom in varFile.index:
... | [
"def",
"checkConsistency",
"(",
"self",
")",
":",
"for",
"referenceName",
",",
"(",
"dataUrl",
",",
"indexFile",
")",
"in",
"self",
".",
"_chromFileMap",
".",
"items",
"(",
")",
":",
"varFile",
"=",
"pysam",
".",
"VariantFile",
"(",
"dataUrl",
",",
"inde... | Perform consistency check on the variant set | [
"Perform",
"consistency",
"check",
"on",
"the",
"variant",
"set"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L519-L532 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet._populateFromVariantFile | def _populateFromVariantFile(self, varFile, dataUrl, indexFile):
"""
Populates the instance variables of this VariantSet from the specified
pysam VariantFile object.
"""
if varFile.index is None:
raise exceptions.NotIndexedException(dataUrl)
for chrom in varFi... | python | def _populateFromVariantFile(self, varFile, dataUrl, indexFile):
"""
Populates the instance variables of this VariantSet from the specified
pysam VariantFile object.
"""
if varFile.index is None:
raise exceptions.NotIndexedException(dataUrl)
for chrom in varFi... | [
"def",
"_populateFromVariantFile",
"(",
"self",
",",
"varFile",
",",
"dataUrl",
",",
"indexFile",
")",
":",
"if",
"varFile",
".",
"index",
"is",
"None",
":",
"raise",
"exceptions",
".",
"NotIndexedException",
"(",
"dataUrl",
")",
"for",
"chrom",
"in",
"varFi... | Populates the instance variables of this VariantSet from the specified
pysam VariantFile object. | [
"Populates",
"the",
"instance",
"variables",
"of",
"this",
"VariantSet",
"from",
"the",
"specified",
"pysam",
"VariantFile",
"object",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L534-L553 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet._updateVariantAnnotationSets | def _updateVariantAnnotationSets(self, variantFile, dataUrl):
"""
Updates the variant annotation set associated with this variant using
information in the specified pysam variantFile.
"""
# TODO check the consistency of this between VCF files.
if not self.isAnnotated():
... | python | def _updateVariantAnnotationSets(self, variantFile, dataUrl):
"""
Updates the variant annotation set associated with this variant using
information in the specified pysam variantFile.
"""
# TODO check the consistency of this between VCF files.
if not self.isAnnotated():
... | [
"def",
"_updateVariantAnnotationSets",
"(",
"self",
",",
"variantFile",
",",
"dataUrl",
")",
":",
"# TODO check the consistency of this between VCF files.",
"if",
"not",
"self",
".",
"isAnnotated",
"(",
")",
":",
"annotationType",
"=",
"None",
"for",
"record",
"in",
... | Updates the variant annotation set associated with this variant using
information in the specified pysam variantFile. | [
"Updates",
"the",
"variant",
"annotation",
"set",
"associated",
"with",
"this",
"variant",
"using",
"information",
"in",
"the",
"specified",
"pysam",
"variantFile",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L555-L593 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet._updateMetadata | def _updateMetadata(self, variantFile):
"""
Updates the metadata for his variant set based on the specified
variant file
"""
metadata = self._getMetadataFromVcf(variantFile)
if self._metadata is None:
self._metadata = metadata | python | def _updateMetadata(self, variantFile):
"""
Updates the metadata for his variant set based on the specified
variant file
"""
metadata = self._getMetadataFromVcf(variantFile)
if self._metadata is None:
self._metadata = metadata | [
"def",
"_updateMetadata",
"(",
"self",
",",
"variantFile",
")",
":",
"metadata",
"=",
"self",
".",
"_getMetadataFromVcf",
"(",
"variantFile",
")",
"if",
"self",
".",
"_metadata",
"is",
"None",
":",
"self",
".",
"_metadata",
"=",
"metadata"
] | Updates the metadata for his variant set based on the specified
variant file | [
"Updates",
"the",
"metadata",
"for",
"his",
"variant",
"set",
"based",
"on",
"the",
"specified",
"variant",
"file"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L595-L602 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet._checkMetadata | def _checkMetadata(self, variantFile):
"""
Checks that metadata is consistent
"""
metadata = self._getMetadataFromVcf(variantFile)
if self._metadata is not None and self._metadata != metadata:
raise exceptions.InconsistentMetaDataException(
variantFile... | python | def _checkMetadata(self, variantFile):
"""
Checks that metadata is consistent
"""
metadata = self._getMetadataFromVcf(variantFile)
if self._metadata is not None and self._metadata != metadata:
raise exceptions.InconsistentMetaDataException(
variantFile... | [
"def",
"_checkMetadata",
"(",
"self",
",",
"variantFile",
")",
":",
"metadata",
"=",
"self",
".",
"_getMetadataFromVcf",
"(",
"variantFile",
")",
"if",
"self",
".",
"_metadata",
"is",
"not",
"None",
"and",
"self",
".",
"_metadata",
"!=",
"metadata",
":",
"... | Checks that metadata is consistent | [
"Checks",
"that",
"metadata",
"is",
"consistent"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L604-L611 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet._checkCallSetIds | def _checkCallSetIds(self, variantFile):
"""
Checks callSetIds for consistency
"""
if len(self._callSetIdMap) > 0:
callSetIds = set([
self.getCallSetId(sample)
for sample in variantFile.header.samples])
if callSetIds != set(self._ca... | python | def _checkCallSetIds(self, variantFile):
"""
Checks callSetIds for consistency
"""
if len(self._callSetIdMap) > 0:
callSetIds = set([
self.getCallSetId(sample)
for sample in variantFile.header.samples])
if callSetIds != set(self._ca... | [
"def",
"_checkCallSetIds",
"(",
"self",
",",
"variantFile",
")",
":",
"if",
"len",
"(",
"self",
".",
"_callSetIdMap",
")",
">",
"0",
":",
"callSetIds",
"=",
"set",
"(",
"[",
"self",
".",
"getCallSetId",
"(",
"sample",
")",
"for",
"sample",
"in",
"varia... | Checks callSetIds for consistency | [
"Checks",
"callSetIds",
"for",
"consistency"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L613-L623 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet._updateCallSetIds | def _updateCallSetIds(self, variantFile):
"""
Updates the call set IDs based on the specified variant file.
"""
if len(self._callSetIdMap) == 0:
for sample in variantFile.header.samples:
self.addCallSetFromName(sample) | python | def _updateCallSetIds(self, variantFile):
"""
Updates the call set IDs based on the specified variant file.
"""
if len(self._callSetIdMap) == 0:
for sample in variantFile.header.samples:
self.addCallSetFromName(sample) | [
"def",
"_updateCallSetIds",
"(",
"self",
",",
"variantFile",
")",
":",
"if",
"len",
"(",
"self",
".",
"_callSetIdMap",
")",
"==",
"0",
":",
"for",
"sample",
"in",
"variantFile",
".",
"header",
".",
"samples",
":",
"self",
".",
"addCallSetFromName",
"(",
... | Updates the call set IDs based on the specified variant file. | [
"Updates",
"the",
"call",
"set",
"IDs",
"based",
"on",
"the",
"specified",
"variant",
"file",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L632-L638 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet.convertVariant | def convertVariant(self, record, callSetIds):
"""
Converts the specified pysam variant record into a GA4GH Variant
object. Only calls for the specified list of callSetIds will
be included.
"""
variant = self._createGaVariant()
variant.reference_name = record.conti... | python | def convertVariant(self, record, callSetIds):
"""
Converts the specified pysam variant record into a GA4GH Variant
object. Only calls for the specified list of callSetIds will
be included.
"""
variant = self._createGaVariant()
variant.reference_name = record.conti... | [
"def",
"convertVariant",
"(",
"self",
",",
"record",
",",
"callSetIds",
")",
":",
"variant",
"=",
"self",
".",
"_createGaVariant",
"(",
")",
"variant",
".",
"reference_name",
"=",
"record",
".",
"contig",
"if",
"record",
".",
"id",
"is",
"not",
"None",
"... | Converts the specified pysam variant record into a GA4GH Variant
object. Only calls for the specified list of callSetIds will
be included. | [
"Converts",
"the",
"specified",
"pysam",
"variant",
"record",
"into",
"a",
"GA4GH",
"Variant",
"object",
".",
"Only",
"calls",
"for",
"the",
"specified",
"list",
"of",
"callSetIds",
"will",
"be",
"included",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L665-L712 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet.getPysamVariants | def getPysamVariants(self, referenceName, startPosition, endPosition):
"""
Returns an iterator over the pysam VCF records corresponding to the
specified query.
"""
if referenceName in self._chromFileMap:
varFileName = self._chromFileMap[referenceName]
refe... | python | def getPysamVariants(self, referenceName, startPosition, endPosition):
"""
Returns an iterator over the pysam VCF records corresponding to the
specified query.
"""
if referenceName in self._chromFileMap:
varFileName = self._chromFileMap[referenceName]
refe... | [
"def",
"getPysamVariants",
"(",
"self",
",",
"referenceName",
",",
"startPosition",
",",
"endPosition",
")",
":",
"if",
"referenceName",
"in",
"self",
".",
"_chromFileMap",
":",
"varFileName",
"=",
"self",
".",
"_chromFileMap",
"[",
"referenceName",
"]",
"refere... | Returns an iterator over the pysam VCF records corresponding to the
specified query. | [
"Returns",
"an",
"iterator",
"over",
"the",
"pysam",
"VCF",
"records",
"corresponding",
"to",
"the",
"specified",
"query",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L734-L747 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet.getVariants | def getVariants(self, referenceName, startPosition, endPosition,
callSetIds=[]):
"""
Returns an iterator over the specified variants. The parameters
correspond to the attributes of a GASearchVariantsRequest object.
"""
if callSetIds is None:
callSe... | python | def getVariants(self, referenceName, startPosition, endPosition,
callSetIds=[]):
"""
Returns an iterator over the specified variants. The parameters
correspond to the attributes of a GASearchVariantsRequest object.
"""
if callSetIds is None:
callSe... | [
"def",
"getVariants",
"(",
"self",
",",
"referenceName",
",",
"startPosition",
",",
"endPosition",
",",
"callSetIds",
"=",
"[",
"]",
")",
":",
"if",
"callSetIds",
"is",
"None",
":",
"callSetIds",
"=",
"self",
".",
"_callSetIds",
"else",
":",
"for",
"callSe... | Returns an iterator over the specified variants. The parameters
correspond to the attributes of a GASearchVariantsRequest object. | [
"Returns",
"an",
"iterator",
"over",
"the",
"specified",
"variants",
".",
"The",
"parameters",
"correspond",
"to",
"the",
"attributes",
"of",
"a",
"GASearchVariantsRequest",
"object",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L749-L764 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantSet.getMetadataId | def getMetadataId(self, metadata):
"""
Returns the id of a metadata
"""
return str(datamodel.VariantSetMetadataCompoundId(
self.getCompoundId(), 'metadata:' + metadata.key)) | python | def getMetadataId(self, metadata):
"""
Returns the id of a metadata
"""
return str(datamodel.VariantSetMetadataCompoundId(
self.getCompoundId(), 'metadata:' + metadata.key)) | [
"def",
"getMetadataId",
"(",
"self",
",",
"metadata",
")",
":",
"return",
"str",
"(",
"datamodel",
".",
"VariantSetMetadataCompoundId",
"(",
"self",
".",
"getCompoundId",
"(",
")",
",",
"'metadata:'",
"+",
"metadata",
".",
"key",
")",
")"
] | Returns the id of a metadata | [
"Returns",
"the",
"id",
"of",
"a",
"metadata"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L766-L771 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantAnnotationSet._createGaVariantAnnotation | def _createGaVariantAnnotation(self):
"""
Convenience method to set the common fields in a GA VariantAnnotation
object from this variant set.
"""
ret = protocol.VariantAnnotation()
ret.created = self._creationTime
ret.variant_annotation_set_id = self.getId()
... | python | def _createGaVariantAnnotation(self):
"""
Convenience method to set the common fields in a GA VariantAnnotation
object from this variant set.
"""
ret = protocol.VariantAnnotation()
ret.created = self._creationTime
ret.variant_annotation_set_id = self.getId()
... | [
"def",
"_createGaVariantAnnotation",
"(",
"self",
")",
":",
"ret",
"=",
"protocol",
".",
"VariantAnnotation",
"(",
")",
"ret",
".",
"created",
"=",
"self",
".",
"_creationTime",
"ret",
".",
"variant_annotation_set_id",
"=",
"self",
".",
"getId",
"(",
")",
"r... | Convenience method to set the common fields in a GA VariantAnnotation
object from this variant set. | [
"Convenience",
"method",
"to",
"set",
"the",
"common",
"fields",
"in",
"a",
"GA",
"VariantAnnotation",
"object",
"from",
"this",
"variant",
"set",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L882-L890 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantAnnotationSet.toProtocolElement | def toProtocolElement(self):
"""
Converts this VariantAnnotationSet into its GA4GH protocol equivalent.
"""
protocolElement = protocol.VariantAnnotationSet()
protocolElement.id = self.getId()
protocolElement.variant_set_id = self._variantSet.getId()
protocolElemen... | python | def toProtocolElement(self):
"""
Converts this VariantAnnotationSet into its GA4GH protocol equivalent.
"""
protocolElement = protocol.VariantAnnotationSet()
protocolElement.id = self.getId()
protocolElement.variant_set_id = self._variantSet.getId()
protocolElemen... | [
"def",
"toProtocolElement",
"(",
"self",
")",
":",
"protocolElement",
"=",
"protocol",
".",
"VariantAnnotationSet",
"(",
")",
"protocolElement",
".",
"id",
"=",
"self",
".",
"getId",
"(",
")",
"protocolElement",
".",
"variant_set_id",
"=",
"self",
".",
"_varia... | Converts this VariantAnnotationSet into its GA4GH protocol equivalent. | [
"Converts",
"this",
"VariantAnnotationSet",
"into",
"its",
"GA4GH",
"protocol",
"equivalent",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L908-L918 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantAnnotationSet.hashVariantAnnotation | def hashVariantAnnotation(cls, gaVariant, gaVariantAnnotation):
"""
Produces an MD5 hash of the gaVariant and gaVariantAnnotation objects
"""
treffs = [treff.id for treff in gaVariantAnnotation.transcript_effects]
return hashlib.md5(
"{}\t{}\t{}\t".format(
... | python | def hashVariantAnnotation(cls, gaVariant, gaVariantAnnotation):
"""
Produces an MD5 hash of the gaVariant and gaVariantAnnotation objects
"""
treffs = [treff.id for treff in gaVariantAnnotation.transcript_effects]
return hashlib.md5(
"{}\t{}\t{}\t".format(
... | [
"def",
"hashVariantAnnotation",
"(",
"cls",
",",
"gaVariant",
",",
"gaVariantAnnotation",
")",
":",
"treffs",
"=",
"[",
"treff",
".",
"id",
"for",
"treff",
"in",
"gaVariantAnnotation",
".",
"transcript_effects",
"]",
"return",
"hashlib",
".",
"md5",
"(",
"\"{}... | Produces an MD5 hash of the gaVariant and gaVariantAnnotation objects | [
"Produces",
"an",
"MD5",
"hash",
"of",
"the",
"gaVariant",
"and",
"gaVariantAnnotation",
"objects"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L929-L938 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | AbstractVariantAnnotationSet.getVariantAnnotationId | def getVariantAnnotationId(self, gaVariant, gaAnnotation):
"""
Produces a stringified compoundId representing a variant
annotation.
:param gaVariant: protocol.Variant
:param gaAnnotation: protocol.VariantAnnotation
:return: compoundId String
"""
md5 = s... | python | def getVariantAnnotationId(self, gaVariant, gaAnnotation):
"""
Produces a stringified compoundId representing a variant
annotation.
:param gaVariant: protocol.Variant
:param gaAnnotation: protocol.VariantAnnotation
:return: compoundId String
"""
md5 = s... | [
"def",
"getVariantAnnotationId",
"(",
"self",
",",
"gaVariant",
",",
"gaAnnotation",
")",
":",
"md5",
"=",
"self",
".",
"hashVariantAnnotation",
"(",
"gaVariant",
",",
"gaAnnotation",
")",
"compoundId",
"=",
"datamodel",
".",
"VariantAnnotationCompoundId",
"(",
"s... | Produces a stringified compoundId representing a variant
annotation.
:param gaVariant: protocol.Variant
:param gaAnnotation: protocol.VariantAnnotation
:return: compoundId String | [
"Produces",
"a",
"stringified",
"compoundId",
"representing",
"a",
"variant",
"annotation",
".",
":",
"param",
"gaVariant",
":",
"protocol",
".",
"Variant",
":",
"param",
"gaAnnotation",
":",
"protocol",
".",
"VariantAnnotation",
":",
"return",
":",
"compoundId",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L940-L952 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | SimulatedVariantAnnotationSet.generateVariantAnnotation | def generateVariantAnnotation(self, variant):
"""
Generate a random variant annotation based on a given variant.
This generator should be seeded with a value that is unique to the
variant so that the same annotation will always be produced regardless
of the order it is generated ... | python | def generateVariantAnnotation(self, variant):
"""
Generate a random variant annotation based on a given variant.
This generator should be seeded with a value that is unique to the
variant so that the same annotation will always be produced regardless
of the order it is generated ... | [
"def",
"generateVariantAnnotation",
"(",
"self",
",",
"variant",
")",
":",
"# To make this reproducible, make a seed based on this",
"# specific variant.",
"seed",
"=",
"self",
".",
"_randomSeed",
"+",
"variant",
".",
"start",
"+",
"variant",
".",
"end",
"randomNumberGe... | Generate a random variant annotation based on a given variant.
This generator should be seeded with a value that is unique to the
variant so that the same annotation will always be produced regardless
of the order it is generated in. | [
"Generate",
"a",
"random",
"variant",
"annotation",
"based",
"on",
"a",
"given",
"variant",
".",
"This",
"generator",
"should",
"be",
"seeded",
"with",
"a",
"value",
"that",
"is",
"unique",
"to",
"the",
"variant",
"so",
"that",
"the",
"same",
"annotation",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L985-L1008 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantAnnotationSet.populateFromRow | def populateFromRow(self, annotationSetRecord):
"""
Populates this VariantAnnotationSet from the specified DB row.
"""
self._annotationType = annotationSetRecord.annotationtype
self._analysis = protocol.fromJson(
annotationSetRecord.analysis, protocol.Analysis)
... | python | def populateFromRow(self, annotationSetRecord):
"""
Populates this VariantAnnotationSet from the specified DB row.
"""
self._annotationType = annotationSetRecord.annotationtype
self._analysis = protocol.fromJson(
annotationSetRecord.analysis, protocol.Analysis)
... | [
"def",
"populateFromRow",
"(",
"self",
",",
"annotationSetRecord",
")",
":",
"self",
".",
"_annotationType",
"=",
"annotationSetRecord",
".",
"annotationtype",
"self",
".",
"_analysis",
"=",
"protocol",
".",
"fromJson",
"(",
"annotationSetRecord",
".",
"analysis",
... | Populates this VariantAnnotationSet from the specified DB row. | [
"Populates",
"this",
"VariantAnnotationSet",
"from",
"the",
"specified",
"DB",
"row",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L1109-L1118 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantAnnotationSet._getAnnotationAnalysis | def _getAnnotationAnalysis(self, varFile):
"""
Assembles metadata within the VCF header into a GA4GH Analysis object.
:return: protocol.Analysis
"""
header = varFile.header
analysis = protocol.Analysis()
formats = header.formats.items()
infos = header.inf... | python | def _getAnnotationAnalysis(self, varFile):
"""
Assembles metadata within the VCF header into a GA4GH Analysis object.
:return: protocol.Analysis
"""
header = varFile.header
analysis = protocol.Analysis()
formats = header.formats.items()
infos = header.inf... | [
"def",
"_getAnnotationAnalysis",
"(",
"self",
",",
"varFile",
")",
":",
"header",
"=",
"varFile",
".",
"header",
"analysis",
"=",
"protocol",
".",
"Analysis",
"(",
")",
"formats",
"=",
"header",
".",
"formats",
".",
"items",
"(",
")",
"infos",
"=",
"head... | Assembles metadata within the VCF header into a GA4GH Analysis object.
:return: protocol.Analysis | [
"Assembles",
"metadata",
"within",
"the",
"VCF",
"header",
"into",
"a",
"GA4GH",
"Analysis",
"object",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L1127-L1177 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantAnnotationSet.getVariantAnnotations | def getVariantAnnotations(self, referenceName, startPosition, endPosition):
"""
Generator for iterating through variant annotations in this
variant annotation set.
:param referenceName:
:param startPosition:
:param endPosition:
:return: generator of protocol.Varia... | python | def getVariantAnnotations(self, referenceName, startPosition, endPosition):
"""
Generator for iterating through variant annotations in this
variant annotation set.
:param referenceName:
:param startPosition:
:param endPosition:
:return: generator of protocol.Varia... | [
"def",
"getVariantAnnotations",
"(",
"self",
",",
"referenceName",
",",
"startPosition",
",",
"endPosition",
")",
":",
"variantIter",
"=",
"self",
".",
"_variantSet",
".",
"getPysamVariants",
"(",
"referenceName",
",",
"startPosition",
",",
"endPosition",
")",
"fo... | Generator for iterating through variant annotations in this
variant annotation set.
:param referenceName:
:param startPosition:
:param endPosition:
:return: generator of protocol.VariantAnnotation | [
"Generator",
"for",
"iterating",
"through",
"variant",
"annotations",
"in",
"this",
"variant",
"annotation",
"set",
".",
":",
"param",
"referenceName",
":",
":",
"param",
"startPosition",
":",
":",
"param",
"endPosition",
":",
":",
"return",
":",
"generator",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L1179-L1191 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantAnnotationSet.convertLocation | def convertLocation(self, pos):
"""
Accepts a position string (start/length) and returns
a GA4GH AlleleLocation with populated fields.
:param pos:
:return: protocol.AlleleLocation
"""
if isUnspecified(pos):
return None
coordLen = pos.split('/')... | python | def convertLocation(self, pos):
"""
Accepts a position string (start/length) and returns
a GA4GH AlleleLocation with populated fields.
:param pos:
:return: protocol.AlleleLocation
"""
if isUnspecified(pos):
return None
coordLen = pos.split('/')... | [
"def",
"convertLocation",
"(",
"self",
",",
"pos",
")",
":",
"if",
"isUnspecified",
"(",
"pos",
")",
":",
"return",
"None",
"coordLen",
"=",
"pos",
".",
"split",
"(",
"'/'",
")",
"if",
"len",
"(",
"coordLen",
")",
">",
"1",
":",
"allLoc",
"=",
"sel... | Accepts a position string (start/length) and returns
a GA4GH AlleleLocation with populated fields.
:param pos:
:return: protocol.AlleleLocation | [
"Accepts",
"a",
"position",
"string",
"(",
"start",
"/",
"length",
")",
"and",
"returns",
"a",
"GA4GH",
"AlleleLocation",
"with",
"populated",
"fields",
".",
":",
"param",
"pos",
":",
":",
"return",
":",
"protocol",
".",
"AlleleLocation"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L1193-L1207 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantAnnotationSet.convertLocationHgvsC | def convertLocationHgvsC(self, hgvsc):
"""
Accepts an annotation in HGVS notation and returns
an AlleleLocation with populated fields.
:param hgvsc:
:return:
"""
if isUnspecified(hgvsc):
return None
match = re.match(".*c.(\d+)(\D+)>(\D+)", hgvs... | python | def convertLocationHgvsC(self, hgvsc):
"""
Accepts an annotation in HGVS notation and returns
an AlleleLocation with populated fields.
:param hgvsc:
:return:
"""
if isUnspecified(hgvsc):
return None
match = re.match(".*c.(\d+)(\D+)>(\D+)", hgvs... | [
"def",
"convertLocationHgvsC",
"(",
"self",
",",
"hgvsc",
")",
":",
"if",
"isUnspecified",
"(",
"hgvsc",
")",
":",
"return",
"None",
"match",
"=",
"re",
".",
"match",
"(",
"\".*c.(\\d+)(\\D+)>(\\D+)\"",
",",
"hgvsc",
")",
"if",
"match",
":",
"pos",
"=",
... | Accepts an annotation in HGVS notation and returns
an AlleleLocation with populated fields.
:param hgvsc:
:return: | [
"Accepts",
"an",
"annotation",
"in",
"HGVS",
"notation",
"and",
"returns",
"an",
"AlleleLocation",
"with",
"populated",
"fields",
".",
":",
"param",
"hgvsc",
":",
":",
"return",
":"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L1209-L1227 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantAnnotationSet.convertLocationHgvsP | def convertLocationHgvsP(self, hgvsp):
"""
Accepts an annotation in HGVS notation and returns
an AlleleLocation with populated fields.
:param hgvsp:
:return: protocol.AlleleLocation
"""
if isUnspecified(hgvsp):
return None
match = re.match(".*p... | python | def convertLocationHgvsP(self, hgvsp):
"""
Accepts an annotation in HGVS notation and returns
an AlleleLocation with populated fields.
:param hgvsp:
:return: protocol.AlleleLocation
"""
if isUnspecified(hgvsp):
return None
match = re.match(".*p... | [
"def",
"convertLocationHgvsP",
"(",
"self",
",",
"hgvsp",
")",
":",
"if",
"isUnspecified",
"(",
"hgvsp",
")",
":",
"return",
"None",
"match",
"=",
"re",
".",
"match",
"(",
"\".*p.(\\D+)(\\d+)(\\D+)\"",
",",
"hgvsp",
",",
"flags",
"=",
"re",
".",
"UNICODE",... | Accepts an annotation in HGVS notation and returns
an AlleleLocation with populated fields.
:param hgvsp:
:return: protocol.AlleleLocation | [
"Accepts",
"an",
"annotation",
"in",
"HGVS",
"notation",
"and",
"returns",
"an",
"AlleleLocation",
"with",
"populated",
"fields",
".",
":",
"param",
"hgvsp",
":",
":",
"return",
":",
"protocol",
".",
"AlleleLocation"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L1229-L1245 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantAnnotationSet.addLocations | def addLocations(self, effect, protPos, cdnaPos):
"""
Adds locations to a GA4GH transcript effect object
by parsing HGVS annotation fields in concert with
and supplied position values.
:param effect: protocol.TranscriptEffect
:param protPos: String representing protein po... | python | def addLocations(self, effect, protPos, cdnaPos):
"""
Adds locations to a GA4GH transcript effect object
by parsing HGVS annotation fields in concert with
and supplied position values.
:param effect: protocol.TranscriptEffect
:param protPos: String representing protein po... | [
"def",
"addLocations",
"(",
"self",
",",
"effect",
",",
"protPos",
",",
"cdnaPos",
")",
":",
"self",
".",
"addCDSLocation",
"(",
"effect",
",",
"cdnaPos",
")",
"self",
".",
"addCDNALocation",
"(",
"effect",
",",
"cdnaPos",
")",
"self",
".",
"addProteinLoca... | Adds locations to a GA4GH transcript effect object
by parsing HGVS annotation fields in concert with
and supplied position values.
:param effect: protocol.TranscriptEffect
:param protPos: String representing protein position from VCF
:param cdnaPos: String representing coding DNA... | [
"Adds",
"locations",
"to",
"a",
"GA4GH",
"transcript",
"effect",
"object",
"by",
"parsing",
"HGVS",
"annotation",
"fields",
"in",
"concert",
"with",
"and",
"supplied",
"position",
"values",
".",
":",
"param",
"effect",
":",
"protocol",
".",
"TranscriptEffect",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L1282-L1295 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantAnnotationSet.convertTranscriptEffect | def convertTranscriptEffect(self, annStr, hgvsG):
"""
Takes the ANN string of a SnpEff generated VCF, splits it
and returns a populated GA4GH transcript effect object.
:param annStr: String
:param hgvsG: String
:return: effect protocol.TranscriptEffect()
"""
... | python | def convertTranscriptEffect(self, annStr, hgvsG):
"""
Takes the ANN string of a SnpEff generated VCF, splits it
and returns a populated GA4GH transcript effect object.
:param annStr: String
:param hgvsG: String
:return: effect protocol.TranscriptEffect()
"""
... | [
"def",
"convertTranscriptEffect",
"(",
"self",
",",
"annStr",
",",
"hgvsG",
")",
":",
"effect",
"=",
"self",
".",
"_createGaTranscriptEffect",
"(",
")",
"effect",
".",
"hgvs_annotation",
".",
"CopyFrom",
"(",
"protocol",
".",
"HGVSAnnotation",
"(",
")",
")",
... | Takes the ANN string of a SnpEff generated VCF, splits it
and returns a populated GA4GH transcript effect object.
:param annStr: String
:param hgvsG: String
:return: effect protocol.TranscriptEffect() | [
"Takes",
"the",
"ANN",
"string",
"of",
"a",
"SnpEff",
"generated",
"VCF",
"splits",
"it",
"and",
"returns",
"a",
"populated",
"GA4GH",
"transcript",
"effect",
"object",
".",
":",
"param",
"annStr",
":",
"String",
":",
"param",
"hgvsG",
":",
"String",
":",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L1297-L1326 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantAnnotationSet.convertSeqOntology | def convertSeqOntology(self, seqOntStr):
"""
Splits a string of sequence ontology effects and creates
an ontology term record for each, which are built into
an array of return soTerms.
:param seqOntStr:
:return: [protocol.OntologyTerm]
"""
return [
... | python | def convertSeqOntology(self, seqOntStr):
"""
Splits a string of sequence ontology effects and creates
an ontology term record for each, which are built into
an array of return soTerms.
:param seqOntStr:
:return: [protocol.OntologyTerm]
"""
return [
... | [
"def",
"convertSeqOntology",
"(",
"self",
",",
"seqOntStr",
")",
":",
"return",
"[",
"self",
".",
"_ontology",
".",
"getGaTermByName",
"(",
"soName",
")",
"for",
"soName",
"in",
"seqOntStr",
".",
"split",
"(",
"'&'",
")",
"]"
] | Splits a string of sequence ontology effects and creates
an ontology term record for each, which are built into
an array of return soTerms.
:param seqOntStr:
:return: [protocol.OntologyTerm] | [
"Splits",
"a",
"string",
"of",
"sequence",
"ontology",
"effects",
"and",
"creates",
"an",
"ontology",
"term",
"record",
"for",
"each",
"which",
"are",
"built",
"into",
"an",
"array",
"of",
"return",
"soTerms",
".",
":",
"param",
"seqOntStr",
":",
":",
"ret... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L1328-L1338 | train |
ga4gh/ga4gh-server | ga4gh/server/datamodel/variants.py | HtslibVariantAnnotationSet.convertVariantAnnotation | def convertVariantAnnotation(self, record):
"""
Converts the specfied pysam variant record into a GA4GH variant
annotation object using the specified function to convert the
transcripts.
"""
variant = self._variantSet.convertVariant(record, [])
annotation = self._... | python | def convertVariantAnnotation(self, record):
"""
Converts the specfied pysam variant record into a GA4GH variant
annotation object using the specified function to convert the
transcripts.
"""
variant = self._variantSet.convertVariant(record, [])
annotation = self._... | [
"def",
"convertVariantAnnotation",
"(",
"self",
",",
"record",
")",
":",
"variant",
"=",
"self",
".",
"_variantSet",
".",
"convertVariant",
"(",
"record",
",",
"[",
"]",
")",
"annotation",
"=",
"self",
".",
"_createGaVariantAnnotation",
"(",
")",
"annotation",... | Converts the specfied pysam variant record into a GA4GH variant
annotation object using the specified function to convert the
transcripts. | [
"Converts",
"the",
"specfied",
"pysam",
"variant",
"record",
"into",
"a",
"GA4GH",
"variant",
"annotation",
"object",
"using",
"the",
"specified",
"function",
"to",
"convert",
"the",
"transcripts",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/variants.py#L1340-L1358 | train |
ga4gh/ga4gh-server | ga4gh/server/gff3.py | Feature._attributeStr | def _attributeStr(self, name):
"""
Return name=value for a single attribute
"""
return "{}={}".format(
_encodeAttr(name),
",".join([_encodeAttr(v) for v in self.attributes[name]])) | python | def _attributeStr(self, name):
"""
Return name=value for a single attribute
"""
return "{}={}".format(
_encodeAttr(name),
",".join([_encodeAttr(v) for v in self.attributes[name]])) | [
"def",
"_attributeStr",
"(",
"self",
",",
"name",
")",
":",
"return",
"\"{}={}\"",
".",
"format",
"(",
"_encodeAttr",
"(",
"name",
")",
",",
"\",\"",
".",
"join",
"(",
"[",
"_encodeAttr",
"(",
"v",
")",
"for",
"v",
"in",
"self",
".",
"attributes",
"[... | Return name=value for a single attribute | [
"Return",
"name",
"=",
"value",
"for",
"a",
"single",
"attribute"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/gff3.py#L98-L104 | train |
ga4gh/ga4gh-server | ga4gh/server/gff3.py | Feature._attributeStrs | def _attributeStrs(self):
"""
Return name=value, semi-colon-separated string for attributes,
including url-style quoting
"""
return ";".join([self._attributeStr(name)
for name in self.attributes.iterkeys()]) | python | def _attributeStrs(self):
"""
Return name=value, semi-colon-separated string for attributes,
including url-style quoting
"""
return ";".join([self._attributeStr(name)
for name in self.attributes.iterkeys()]) | [
"def",
"_attributeStrs",
"(",
"self",
")",
":",
"return",
"\";\"",
".",
"join",
"(",
"[",
"self",
".",
"_attributeStr",
"(",
"name",
")",
"for",
"name",
"in",
"self",
".",
"attributes",
".",
"iterkeys",
"(",
")",
"]",
")"
] | Return name=value, semi-colon-separated string for attributes,
including url-style quoting | [
"Return",
"name",
"=",
"value",
"semi",
"-",
"colon",
"-",
"separated",
"string",
"for",
"attributes",
"including",
"url",
"-",
"style",
"quoting"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/gff3.py#L106-L112 | train |
ga4gh/ga4gh-server | ga4gh/server/gff3.py | Feature.featureName | def featureName(self):
"""
ID attribute from GFF3 or None if record doesn't have it.
Called "Name" rather than "Id" within GA4GH, as there is
no guarantee of either uniqueness or existence.
"""
featId = self.attributes.get("ID")
if featId is not None:
... | python | def featureName(self):
"""
ID attribute from GFF3 or None if record doesn't have it.
Called "Name" rather than "Id" within GA4GH, as there is
no guarantee of either uniqueness or existence.
"""
featId = self.attributes.get("ID")
if featId is not None:
... | [
"def",
"featureName",
"(",
"self",
")",
":",
"featId",
"=",
"self",
".",
"attributes",
".",
"get",
"(",
"\"ID\"",
")",
"if",
"featId",
"is",
"not",
"None",
":",
"featId",
"=",
"featId",
"[",
"0",
"]",
"return",
"featId"
] | ID attribute from GFF3 or None if record doesn't have it.
Called "Name" rather than "Id" within GA4GH, as there is
no guarantee of either uniqueness or existence. | [
"ID",
"attribute",
"from",
"GFF3",
"or",
"None",
"if",
"record",
"doesn",
"t",
"have",
"it",
".",
"Called",
"Name",
"rather",
"than",
"Id",
"within",
"GA4GH",
"as",
"there",
"is",
"no",
"guarantee",
"of",
"either",
"uniqueness",
"or",
"existence",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/gff3.py#L126-L135 | train |
ga4gh/ga4gh-server | ga4gh/server/gff3.py | Gff3Set._linkFeature | def _linkFeature(self, feature):
"""
Link a feature with its parents.
"""
parentNames = feature.attributes.get("Parent")
if parentNames is None:
self.roots.add(feature)
else:
for parentName in parentNames:
self._linkToParent(feature... | python | def _linkFeature(self, feature):
"""
Link a feature with its parents.
"""
parentNames = feature.attributes.get("Parent")
if parentNames is None:
self.roots.add(feature)
else:
for parentName in parentNames:
self._linkToParent(feature... | [
"def",
"_linkFeature",
"(",
"self",
",",
"feature",
")",
":",
"parentNames",
"=",
"feature",
".",
"attributes",
".",
"get",
"(",
"\"Parent\"",
")",
"if",
"parentNames",
"is",
"None",
":",
"self",
".",
"roots",
".",
"add",
"(",
"feature",
")",
"else",
"... | Link a feature with its parents. | [
"Link",
"a",
"feature",
"with",
"its",
"parents",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/gff3.py#L165-L174 | train |
ga4gh/ga4gh-server | ga4gh/server/gff3.py | Gff3Set._linkToParent | def _linkToParent(self, feature, parentName):
"""
Link a feature with its children
"""
parentParts = self.byFeatureName.get(parentName)
if parentParts is None:
raise GFF3Exception(
"Parent feature does not exist: {}".format(parentName),
... | python | def _linkToParent(self, feature, parentName):
"""
Link a feature with its children
"""
parentParts = self.byFeatureName.get(parentName)
if parentParts is None:
raise GFF3Exception(
"Parent feature does not exist: {}".format(parentName),
... | [
"def",
"_linkToParent",
"(",
"self",
",",
"feature",
",",
"parentName",
")",
":",
"parentParts",
"=",
"self",
".",
"byFeatureName",
".",
"get",
"(",
"parentName",
")",
"if",
"parentParts",
"is",
"None",
":",
"raise",
"GFF3Exception",
"(",
"\"Parent feature doe... | Link a feature with its children | [
"Link",
"a",
"feature",
"with",
"its",
"children"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/gff3.py#L176-L188 | train |
ga4gh/ga4gh-server | ga4gh/server/gff3.py | Gff3Set.linkChildFeaturesToParents | def linkChildFeaturesToParents(self):
"""
finish loading the set, constructing the tree
"""
# features maybe disjoint
for featureParts in self.byFeatureName.itervalues():
for feature in featureParts:
self._linkFeature(feature) | python | def linkChildFeaturesToParents(self):
"""
finish loading the set, constructing the tree
"""
# features maybe disjoint
for featureParts in self.byFeatureName.itervalues():
for feature in featureParts:
self._linkFeature(feature) | [
"def",
"linkChildFeaturesToParents",
"(",
"self",
")",
":",
"# features maybe disjoint",
"for",
"featureParts",
"in",
"self",
".",
"byFeatureName",
".",
"itervalues",
"(",
")",
":",
"for",
"feature",
"in",
"featureParts",
":",
"self",
".",
"_linkFeature",
"(",
"... | finish loading the set, constructing the tree | [
"finish",
"loading",
"the",
"set",
"constructing",
"the",
"tree"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/gff3.py#L190-L197 | train |
ga4gh/ga4gh-server | ga4gh/server/gff3.py | Gff3Set._recSortKey | def _recSortKey(r):
"""
Sort order for Features, by genomic coordinate,
disambiguated by feature type (alphabetically).
"""
return r.seqname, r.start, -r.end, r.type | python | def _recSortKey(r):
"""
Sort order for Features, by genomic coordinate,
disambiguated by feature type (alphabetically).
"""
return r.seqname, r.start, -r.end, r.type | [
"def",
"_recSortKey",
"(",
"r",
")",
":",
"return",
"r",
".",
"seqname",
",",
"r",
".",
"start",
",",
"-",
"r",
".",
"end",
",",
"r",
".",
"type"
] | Sort order for Features, by genomic coordinate,
disambiguated by feature type (alphabetically). | [
"Sort",
"order",
"for",
"Features",
"by",
"genomic",
"coordinate",
"disambiguated",
"by",
"feature",
"type",
"(",
"alphabetically",
")",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/gff3.py#L200-L205 | train |
ga4gh/ga4gh-server | ga4gh/server/gff3.py | Gff3Set._writeRec | def _writeRec(self, fh, rec):
"""
Writes a single record to a file provided by the filehandle fh.
"""
fh.write(str(rec) + "\n")
for child in sorted(rec.children, key=self._recSortKey):
self._writeRec(fh, child) | python | def _writeRec(self, fh, rec):
"""
Writes a single record to a file provided by the filehandle fh.
"""
fh.write(str(rec) + "\n")
for child in sorted(rec.children, key=self._recSortKey):
self._writeRec(fh, child) | [
"def",
"_writeRec",
"(",
"self",
",",
"fh",
",",
"rec",
")",
":",
"fh",
".",
"write",
"(",
"str",
"(",
"rec",
")",
"+",
"\"\\n\"",
")",
"for",
"child",
"in",
"sorted",
"(",
"rec",
".",
"children",
",",
"key",
"=",
"self",
".",
"_recSortKey",
")",... | Writes a single record to a file provided by the filehandle fh. | [
"Writes",
"a",
"single",
"record",
"to",
"a",
"file",
"provided",
"by",
"the",
"filehandle",
"fh",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/gff3.py#L207-L213 | train |
ga4gh/ga4gh-server | ga4gh/server/gff3.py | Gff3Set.write | def write(self, fh):
"""
Write set to a GFF3 format file.
:param file fh: file handle for file to write to
"""
fh.write(GFF3_HEADER+"\n")
for root in sorted(self.roots, key=self._recSortKey):
self._writeRec(fh, root) | python | def write(self, fh):
"""
Write set to a GFF3 format file.
:param file fh: file handle for file to write to
"""
fh.write(GFF3_HEADER+"\n")
for root in sorted(self.roots, key=self._recSortKey):
self._writeRec(fh, root) | [
"def",
"write",
"(",
"self",
",",
"fh",
")",
":",
"fh",
".",
"write",
"(",
"GFF3_HEADER",
"+",
"\"\\n\"",
")",
"for",
"root",
"in",
"sorted",
"(",
"self",
".",
"roots",
",",
"key",
"=",
"self",
".",
"_recSortKey",
")",
":",
"self",
".",
"_writeRec"... | Write set to a GFF3 format file.
:param file fh: file handle for file to write to | [
"Write",
"set",
"to",
"a",
"GFF3",
"format",
"file",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/gff3.py#L215-L223 | train |
ga4gh/ga4gh-server | ga4gh/server/gff3.py | Gff3Parser._open | def _open(self):
"""
open input file, optionally with decompression
"""
if self.fileName.endswith(".gz"):
return gzip.open(self.fileName)
elif self.fileName.endswith(".bz2"):
return bz2.BZ2File(self.fileName)
else:
return open(self.file... | python | def _open(self):
"""
open input file, optionally with decompression
"""
if self.fileName.endswith(".gz"):
return gzip.open(self.fileName)
elif self.fileName.endswith(".bz2"):
return bz2.BZ2File(self.fileName)
else:
return open(self.file... | [
"def",
"_open",
"(",
"self",
")",
":",
"if",
"self",
".",
"fileName",
".",
"endswith",
"(",
"\".gz\"",
")",
":",
"return",
"gzip",
".",
"open",
"(",
"self",
".",
"fileName",
")",
"elif",
"self",
".",
"fileName",
".",
"endswith",
"(",
"\".bz2\"",
")",... | open input file, optionally with decompression | [
"open",
"input",
"file",
"optionally",
"with",
"decompression"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/gff3.py#L240-L249 | train |
ga4gh/ga4gh-server | ga4gh/server/gff3.py | Gff3Parser._parseAttrVal | def _parseAttrVal(self, attrStr):
"""
Returns tuple of tuple of (attr, value), multiple are returned to
handle multi-value attributes.
"""
m = self.SPLIT_ATTR_RE.match(attrStr)
if m is None:
raise GFF3Exception(
"can't parse attribute/value: '"... | python | def _parseAttrVal(self, attrStr):
"""
Returns tuple of tuple of (attr, value), multiple are returned to
handle multi-value attributes.
"""
m = self.SPLIT_ATTR_RE.match(attrStr)
if m is None:
raise GFF3Exception(
"can't parse attribute/value: '"... | [
"def",
"_parseAttrVal",
"(",
"self",
",",
"attrStr",
")",
":",
"m",
"=",
"self",
".",
"SPLIT_ATTR_RE",
".",
"match",
"(",
"attrStr",
")",
"if",
"m",
"is",
"None",
":",
"raise",
"GFF3Exception",
"(",
"\"can't parse attribute/value: '\"",
"+",
"attrStr",
"+",
... | Returns tuple of tuple of (attr, value), multiple are returned to
handle multi-value attributes. | [
"Returns",
"tuple",
"of",
"tuple",
"of",
"(",
"attr",
"value",
")",
"multiple",
"are",
"returned",
"to",
"handle",
"multi",
"-",
"value",
"attributes",
"."
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/gff3.py#L254-L268 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.