partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | SqlDataRepository.tableToTsv | Takes a model class and attempts to create a table in TSV format
that can be imported into a spreadsheet program. | ga4gh/server/datarepo.py | def tableToTsv(self, model):
"""
Takes a model class and attempts to create a table in TSV format
that can be imported into a spreadsheet program.
"""
first = True
for item in model.select():
if first:
header = "".join(
["{}... | def tableToTsv(self, model):
"""
Takes a model class and attempts to create a table in TSV format
that can be imported into a spreadsheet program.
"""
first = True
for item in model.select():
if first:
header = "".join(
["{}... | [
"Takes",
"a",
"model",
"class",
"and",
"attempts",
"to",
"create",
"a",
"table",
"in",
"TSV",
"format",
"that",
"can",
"be",
"imported",
"into",
"a",
"spreadsheet",
"program",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L546-L561 | [
"def",
"tableToTsv",
"(",
"self",
",",
"model",
")",
":",
"first",
"=",
"True",
"for",
"item",
"in",
"model",
".",
"select",
"(",
")",
":",
"if",
"first",
":",
"header",
"=",
"\"\"",
".",
"join",
"(",
"[",
"\"{}\\t\"",
".",
"format",
"(",
"x",
")... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.clearAnnouncements | Flushes the announcement table. | ga4gh/server/datarepo.py | def clearAnnouncements(self):
"""
Flushes the announcement table.
"""
try:
q = models.Announcement.delete().where(
models.Announcement.id > 0)
q.execute()
except Exception as e:
raise exceptions.RepoManagerException(e) | def clearAnnouncements(self):
"""
Flushes the announcement table.
"""
try:
q = models.Announcement.delete().where(
models.Announcement.id > 0)
q.execute()
except Exception as e:
raise exceptions.RepoManagerException(e) | [
"Flushes",
"the",
"announcement",
"table",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L569-L578 | [
"def",
"clearAnnouncements",
"(",
"self",
")",
":",
"try",
":",
"q",
"=",
"models",
".",
"Announcement",
".",
"delete",
"(",
")",
".",
"where",
"(",
"models",
".",
"Announcement",
".",
"id",
">",
"0",
")",
"q",
".",
"execute",
"(",
")",
"except",
"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertAnnouncement | Adds an announcement to the registry for later analysis. | ga4gh/server/datarepo.py | def insertAnnouncement(self, announcement):
"""
Adds an announcement to the registry for later analysis.
"""
url = announcement.get('url', None)
try:
peers.Peer(url)
except:
raise exceptions.BadUrlException(url)
try:
# TODO get ... | def insertAnnouncement(self, announcement):
"""
Adds an announcement to the registry for later analysis.
"""
url = announcement.get('url', None)
try:
peers.Peer(url)
except:
raise exceptions.BadUrlException(url)
try:
# TODO get ... | [
"Adds",
"an",
"announcement",
"to",
"the",
"registry",
"for",
"later",
"analysis",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L580-L597 | [
"def",
"insertAnnouncement",
"(",
"self",
",",
"announcement",
")",
":",
"url",
"=",
"announcement",
".",
"get",
"(",
"'url'",
",",
"None",
")",
"try",
":",
"peers",
".",
"Peer",
"(",
"url",
")",
"except",
":",
"raise",
"exceptions",
".",
"BadUrlExceptio... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.open | Opens this repo in the specified mode.
TODO: figure out the correct semantics of this and document
the intended future behaviour as well as the current
transitional behaviour. | ga4gh/server/datarepo.py | def open(self, mode=MODE_READ):
"""
Opens this repo in the specified mode.
TODO: figure out the correct semantics of this and document
the intended future behaviour as well as the current
transitional behaviour.
"""
if mode not in [MODE_READ, MODE_WRITE]:
... | def open(self, mode=MODE_READ):
"""
Opens this repo in the specified mode.
TODO: figure out the correct semantics of this and document
the intended future behaviour as well as the current
transitional behaviour.
"""
if mode not in [MODE_READ, MODE_WRITE]:
... | [
"Opens",
"this",
"repo",
"in",
"the",
"specified",
"mode",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L599-L618 | [
"def",
"open",
"(",
"self",
",",
"mode",
"=",
"MODE_READ",
")",
":",
"if",
"mode",
"not",
"in",
"[",
"MODE_READ",
",",
"MODE_WRITE",
"]",
":",
"error",
"=",
"\"Open mode must be '{}' or '{}'\"",
".",
"format",
"(",
"MODE_READ",
",",
"MODE_WRITE",
")",
"rai... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.verify | Verifies that the data in the repository is consistent. | ga4gh/server/datarepo.py | def verify(self):
"""
Verifies that the data in the repository is consistent.
"""
# TODO this should emit to a log that we can configure so we can
# have verbosity levels. We should provide a way to configure
# where we look at various chromosomes and so on. This will be
... | def verify(self):
"""
Verifies that the data in the repository is consistent.
"""
# TODO this should emit to a log that we can configure so we can
# have verbosity levels. We should provide a way to configure
# where we look at various chromosomes and so on. This will be
... | [
"Verifies",
"that",
"the",
"data",
"in",
"the",
"repository",
"is",
"consistent",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L635-L725 | [
"def",
"verify",
"(",
"self",
")",
":",
"# TODO this should emit to a log that we can configure so we can",
"# have verbosity levels. We should provide a way to configure",
"# where we look at various chromosomes and so on. This will be",
"# an important debug tool for administrators.",
"for",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertOntology | Inserts the specified ontology into this repository. | ga4gh/server/datarepo.py | def insertOntology(self, ontology):
"""
Inserts the specified ontology into this repository.
"""
try:
models.Ontology.create(
id=ontology.getName(),
name=ontology.getName(),
dataurl=ontology.getDataUrl(),
... | def insertOntology(self, ontology):
"""
Inserts the specified ontology into this repository.
"""
try:
models.Ontology.create(
id=ontology.getName(),
name=ontology.getName(),
dataurl=ontology.getDataUrl(),
... | [
"Inserts",
"the",
"specified",
"ontology",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L753-L765 | [
"def",
"insertOntology",
"(",
"self",
",",
"ontology",
")",
":",
"try",
":",
"models",
".",
"Ontology",
".",
"create",
"(",
"id",
"=",
"ontology",
".",
"getName",
"(",
")",
",",
"name",
"=",
"ontology",
".",
"getName",
"(",
")",
",",
"dataurl",
"=",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removeOntology | Removes the specified ontology term map from this repository. | ga4gh/server/datarepo.py | def removeOntology(self, ontology):
"""
Removes the specified ontology term map from this repository.
"""
q = models.Ontology.delete().where(id == ontology.getId())
q.execute() | def removeOntology(self, ontology):
"""
Removes the specified ontology term map from this repository.
"""
q = models.Ontology.delete().where(id == ontology.getId())
q.execute() | [
"Removes",
"the",
"specified",
"ontology",
"term",
"map",
"from",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L775-L780 | [
"def",
"removeOntology",
"(",
"self",
",",
"ontology",
")",
":",
"q",
"=",
"models",
".",
"Ontology",
".",
"delete",
"(",
")",
".",
"where",
"(",
"id",
"==",
"ontology",
".",
"getId",
"(",
")",
")",
"q",
".",
"execute",
"(",
")"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertReference | Inserts the specified reference into this repository. | ga4gh/server/datarepo.py | def insertReference(self, reference):
"""
Inserts the specified reference into this repository.
"""
models.Reference.create(
id=reference.getId(),
referencesetid=reference.getParentContainer().getId(),
name=reference.getLocalId(),
length=re... | def insertReference(self, reference):
"""
Inserts the specified reference into this repository.
"""
models.Reference.create(
id=reference.getId(),
referencesetid=reference.getParentContainer().getId(),
name=reference.getLocalId(),
length=re... | [
"Inserts",
"the",
"specified",
"reference",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L785-L798 | [
"def",
"insertReference",
"(",
"self",
",",
"reference",
")",
":",
"models",
".",
"Reference",
".",
"create",
"(",
"id",
"=",
"reference",
".",
"getId",
"(",
")",
",",
"referencesetid",
"=",
"reference",
".",
"getParentContainer",
"(",
")",
".",
"getId",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertReferenceSet | Inserts the specified referenceSet into this repository. | ga4gh/server/datarepo.py | def insertReferenceSet(self, referenceSet):
"""
Inserts the specified referenceSet into this repository.
"""
try:
models.Referenceset.create(
id=referenceSet.getId(),
name=referenceSet.getLocalId(),
description=referenceSet.getD... | def insertReferenceSet(self, referenceSet):
"""
Inserts the specified referenceSet into this repository.
"""
try:
models.Referenceset.create(
id=referenceSet.getId(),
name=referenceSet.getLocalId(),
description=referenceSet.getD... | [
"Inserts",
"the",
"specified",
"referenceSet",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L813-L834 | [
"def",
"insertReferenceSet",
"(",
"self",
",",
"referenceSet",
")",
":",
"try",
":",
"models",
".",
"Referenceset",
".",
"create",
"(",
"id",
"=",
"referenceSet",
".",
"getId",
"(",
")",
",",
"name",
"=",
"referenceSet",
".",
"getLocalId",
"(",
")",
",",... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertDataset | Inserts the specified dataset into this repository. | ga4gh/server/datarepo.py | def insertDataset(self, dataset):
"""
Inserts the specified dataset into this repository.
"""
try:
models.Dataset.create(
id=dataset.getId(),
name=dataset.getLocalId(),
description=dataset.getDescription(),
attri... | def insertDataset(self, dataset):
"""
Inserts the specified dataset into this repository.
"""
try:
models.Dataset.create(
id=dataset.getId(),
name=dataset.getLocalId(),
description=dataset.getDescription(),
attri... | [
"Inserts",
"the",
"specified",
"dataset",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L848-L860 | [
"def",
"insertDataset",
"(",
"self",
",",
"dataset",
")",
":",
"try",
":",
"models",
".",
"Dataset",
".",
"create",
"(",
"id",
"=",
"dataset",
".",
"getId",
"(",
")",
",",
"name",
"=",
"dataset",
".",
"getLocalId",
"(",
")",
",",
"description",
"=",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removeDataset | Removes the specified dataset from this repository. This performs
a cascading removal of all items within this dataset. | ga4gh/server/datarepo.py | def removeDataset(self, dataset):
"""
Removes the specified dataset from this repository. This performs
a cascading removal of all items within this dataset.
"""
for datasetRecord in models.Dataset.select().where(
models.Dataset.id == dataset.getId()):
... | def removeDataset(self, dataset):
"""
Removes the specified dataset from this repository. This performs
a cascading removal of all items within this dataset.
"""
for datasetRecord in models.Dataset.select().where(
models.Dataset.id == dataset.getId()):
... | [
"Removes",
"the",
"specified",
"dataset",
"from",
"this",
"repository",
".",
"This",
"performs",
"a",
"cascading",
"removal",
"of",
"all",
"items",
"within",
"this",
"dataset",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L862-L869 | [
"def",
"removeDataset",
"(",
"self",
",",
"dataset",
")",
":",
"for",
"datasetRecord",
"in",
"models",
".",
"Dataset",
".",
"select",
"(",
")",
".",
"where",
"(",
"models",
".",
"Dataset",
".",
"id",
"==",
"dataset",
".",
"getId",
"(",
")",
")",
":",... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removePhenotypeAssociationSet | Remove a phenotype association set from the repo | ga4gh/server/datarepo.py | def removePhenotypeAssociationSet(self, phenotypeAssociationSet):
"""
Remove a phenotype association set from the repo
"""
q = models.Phenotypeassociationset.delete().where(
models.Phenotypeassociationset.id ==
phenotypeAssociationSet.getId())
q.execute() | def removePhenotypeAssociationSet(self, phenotypeAssociationSet):
"""
Remove a phenotype association set from the repo
"""
q = models.Phenotypeassociationset.delete().where(
models.Phenotypeassociationset.id ==
phenotypeAssociationSet.getId())
q.execute() | [
"Remove",
"a",
"phenotype",
"association",
"set",
"from",
"the",
"repo"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L871-L878 | [
"def",
"removePhenotypeAssociationSet",
"(",
"self",
",",
"phenotypeAssociationSet",
")",
":",
"q",
"=",
"models",
".",
"Phenotypeassociationset",
".",
"delete",
"(",
")",
".",
"where",
"(",
"models",
".",
"Phenotypeassociationset",
".",
"id",
"==",
"phenotypeAsso... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removeFeatureSet | Removes the specified featureSet from this repository. | ga4gh/server/datarepo.py | def removeFeatureSet(self, featureSet):
"""
Removes the specified featureSet from this repository.
"""
q = models.Featureset.delete().where(
models.Featureset.id == featureSet.getId())
q.execute() | def removeFeatureSet(self, featureSet):
"""
Removes the specified featureSet from this repository.
"""
q = models.Featureset.delete().where(
models.Featureset.id == featureSet.getId())
q.execute() | [
"Removes",
"the",
"specified",
"featureSet",
"from",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L880-L886 | [
"def",
"removeFeatureSet",
"(",
"self",
",",
"featureSet",
")",
":",
"q",
"=",
"models",
".",
"Featureset",
".",
"delete",
"(",
")",
".",
"where",
"(",
"models",
".",
"Featureset",
".",
"id",
"==",
"featureSet",
".",
"getId",
"(",
")",
")",
"q",
".",... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removeContinuousSet | Removes the specified continuousSet from this repository. | ga4gh/server/datarepo.py | def removeContinuousSet(self, continuousSet):
"""
Removes the specified continuousSet from this repository.
"""
q = models.ContinuousSet.delete().where(
models.ContinuousSet.id == continuousSet.getId())
q.execute() | def removeContinuousSet(self, continuousSet):
"""
Removes the specified continuousSet from this repository.
"""
q = models.ContinuousSet.delete().where(
models.ContinuousSet.id == continuousSet.getId())
q.execute() | [
"Removes",
"the",
"specified",
"continuousSet",
"from",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L888-L894 | [
"def",
"removeContinuousSet",
"(",
"self",
",",
"continuousSet",
")",
":",
"q",
"=",
"models",
".",
"ContinuousSet",
".",
"delete",
"(",
")",
".",
"where",
"(",
"models",
".",
"ContinuousSet",
".",
"id",
"==",
"continuousSet",
".",
"getId",
"(",
")",
")"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertReadGroup | Inserts the specified readGroup into the DB. | ga4gh/server/datarepo.py | def insertReadGroup(self, readGroup):
"""
Inserts the specified readGroup into the DB.
"""
statsJson = json.dumps(protocol.toJsonDict(readGroup.getStats()))
experimentJson = json.dumps(
protocol.toJsonDict(readGroup.getExperiment()))
try:
models.Re... | def insertReadGroup(self, readGroup):
"""
Inserts the specified readGroup into the DB.
"""
statsJson = json.dumps(protocol.toJsonDict(readGroup.getStats()))
experimentJson = json.dumps(
protocol.toJsonDict(readGroup.getExperiment()))
try:
models.Re... | [
"Inserts",
"the",
"specified",
"readGroup",
"into",
"the",
"DB",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L907-L927 | [
"def",
"insertReadGroup",
"(",
"self",
",",
"readGroup",
")",
":",
"statsJson",
"=",
"json",
".",
"dumps",
"(",
"protocol",
".",
"toJsonDict",
"(",
"readGroup",
".",
"getStats",
"(",
")",
")",
")",
"experimentJson",
"=",
"json",
".",
"dumps",
"(",
"proto... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removeReadGroupSet | Removes the specified readGroupSet from this repository. This performs
a cascading removal of all items within this readGroupSet. | ga4gh/server/datarepo.py | def removeReadGroupSet(self, readGroupSet):
"""
Removes the specified readGroupSet from this repository. This performs
a cascading removal of all items within this readGroupSet.
"""
for readGroupSetRecord in models.Readgroupset.select().where(
models.Readg... | def removeReadGroupSet(self, readGroupSet):
"""
Removes the specified readGroupSet from this repository. This performs
a cascading removal of all items within this readGroupSet.
"""
for readGroupSetRecord in models.Readgroupset.select().where(
models.Readg... | [
"Removes",
"the",
"specified",
"readGroupSet",
"from",
"this",
"repository",
".",
"This",
"performs",
"a",
"cascading",
"removal",
"of",
"all",
"items",
"within",
"this",
"readGroupSet",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L929-L936 | [
"def",
"removeReadGroupSet",
"(",
"self",
",",
"readGroupSet",
")",
":",
"for",
"readGroupSetRecord",
"in",
"models",
".",
"Readgroupset",
".",
"select",
"(",
")",
".",
"where",
"(",
"models",
".",
"Readgroupset",
".",
"id",
"==",
"readGroupSet",
".",
"getId... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removeVariantSet | Removes the specified variantSet from this repository. This performs
a cascading removal of all items within this variantSet. | ga4gh/server/datarepo.py | def removeVariantSet(self, variantSet):
"""
Removes the specified variantSet from this repository. This performs
a cascading removal of all items within this variantSet.
"""
for variantSetRecord in models.Variantset.select().where(
models.Variantset.id == ... | def removeVariantSet(self, variantSet):
"""
Removes the specified variantSet from this repository. This performs
a cascading removal of all items within this variantSet.
"""
for variantSetRecord in models.Variantset.select().where(
models.Variantset.id == ... | [
"Removes",
"the",
"specified",
"variantSet",
"from",
"this",
"repository",
".",
"This",
"performs",
"a",
"cascading",
"removal",
"of",
"all",
"items",
"within",
"this",
"variantSet",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L938-L945 | [
"def",
"removeVariantSet",
"(",
"self",
",",
"variantSet",
")",
":",
"for",
"variantSetRecord",
"in",
"models",
".",
"Variantset",
".",
"select",
"(",
")",
".",
"where",
"(",
"models",
".",
"Variantset",
".",
"id",
"==",
"variantSet",
".",
"getId",
"(",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removeBiosample | Removes the specified biosample from this repository. | ga4gh/server/datarepo.py | def removeBiosample(self, biosample):
"""
Removes the specified biosample from this repository.
"""
q = models.Biosample.delete().where(
models.Biosample.id == biosample.getId())
q.execute() | def removeBiosample(self, biosample):
"""
Removes the specified biosample from this repository.
"""
q = models.Biosample.delete().where(
models.Biosample.id == biosample.getId())
q.execute() | [
"Removes",
"the",
"specified",
"biosample",
"from",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L947-L953 | [
"def",
"removeBiosample",
"(",
"self",
",",
"biosample",
")",
":",
"q",
"=",
"models",
".",
"Biosample",
".",
"delete",
"(",
")",
".",
"where",
"(",
"models",
".",
"Biosample",
".",
"id",
"==",
"biosample",
".",
"getId",
"(",
")",
")",
"q",
".",
"e... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removeIndividual | Removes the specified individual from this repository. | ga4gh/server/datarepo.py | def removeIndividual(self, individual):
"""
Removes the specified individual from this repository.
"""
q = models.Individual.delete().where(
models.Individual.id == individual.getId())
q.execute() | def removeIndividual(self, individual):
"""
Removes the specified individual from this repository.
"""
q = models.Individual.delete().where(
models.Individual.id == individual.getId())
q.execute() | [
"Removes",
"the",
"specified",
"individual",
"from",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L955-L961 | [
"def",
"removeIndividual",
"(",
"self",
",",
"individual",
")",
":",
"q",
"=",
"models",
".",
"Individual",
".",
"delete",
"(",
")",
".",
"where",
"(",
"models",
".",
"Individual",
".",
"id",
"==",
"individual",
".",
"getId",
"(",
")",
")",
"q",
".",... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertReadGroupSet | Inserts a the specified readGroupSet into this repository. | ga4gh/server/datarepo.py | def insertReadGroupSet(self, readGroupSet):
"""
Inserts a the specified readGroupSet into this repository.
"""
programsJson = json.dumps(
[protocol.toJsonDict(program) for program in
readGroupSet.getPrograms()])
statsJson = json.dumps(protocol.toJsonDict(... | def insertReadGroupSet(self, readGroupSet):
"""
Inserts a the specified readGroupSet into this repository.
"""
programsJson = json.dumps(
[protocol.toJsonDict(program) for program in
readGroupSet.getPrograms()])
statsJson = json.dumps(protocol.toJsonDict(... | [
"Inserts",
"a",
"the",
"specified",
"readGroupSet",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L978-L1000 | [
"def",
"insertReadGroupSet",
"(",
"self",
",",
"readGroupSet",
")",
":",
"programsJson",
"=",
"json",
".",
"dumps",
"(",
"[",
"protocol",
".",
"toJsonDict",
"(",
"program",
")",
"for",
"program",
"in",
"readGroupSet",
".",
"getPrograms",
"(",
")",
"]",
")"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removeReferenceSet | Removes the specified referenceSet from this repository. This performs
a cascading removal of all references within this referenceSet.
However, it does not remove any of the ReadGroupSets or items that
refer to this ReferenceSet. These must be deleted before the
referenceSet can be remov... | ga4gh/server/datarepo.py | def removeReferenceSet(self, referenceSet):
"""
Removes the specified referenceSet from this repository. This performs
a cascading removal of all references within this referenceSet.
However, it does not remove any of the ReadGroupSets or items that
refer to this ReferenceSet. Th... | def removeReferenceSet(self, referenceSet):
"""
Removes the specified referenceSet from this repository. This performs
a cascading removal of all references within this referenceSet.
However, it does not remove any of the ReadGroupSets or items that
refer to this ReferenceSet. Th... | [
"Removes",
"the",
"specified",
"referenceSet",
"from",
"this",
"repository",
".",
"This",
"performs",
"a",
"cascading",
"removal",
"of",
"all",
"references",
"within",
"this",
"referenceSet",
".",
"However",
"it",
"does",
"not",
"remove",
"any",
"of",
"the",
"... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1002-L1022 | [
"def",
"removeReferenceSet",
"(",
"self",
",",
"referenceSet",
")",
":",
"try",
":",
"q",
"=",
"models",
".",
"Reference",
".",
"delete",
"(",
")",
".",
"where",
"(",
"models",
".",
"Reference",
".",
"referencesetid",
"==",
"referenceSet",
".",
"getId",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertVariantAnnotationSet | Inserts a the specified variantAnnotationSet into this repository. | ga4gh/server/datarepo.py | def insertVariantAnnotationSet(self, variantAnnotationSet):
"""
Inserts a the specified variantAnnotationSet into this repository.
"""
analysisJson = json.dumps(
protocol.toJsonDict(variantAnnotationSet.getAnalysis()))
try:
models.Variantannotationset.crea... | def insertVariantAnnotationSet(self, variantAnnotationSet):
"""
Inserts a the specified variantAnnotationSet into this repository.
"""
analysisJson = json.dumps(
protocol.toJsonDict(variantAnnotationSet.getAnalysis()))
try:
models.Variantannotationset.crea... | [
"Inserts",
"a",
"the",
"specified",
"variantAnnotationSet",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1040-L1058 | [
"def",
"insertVariantAnnotationSet",
"(",
"self",
",",
"variantAnnotationSet",
")",
":",
"analysisJson",
"=",
"json",
".",
"dumps",
"(",
"protocol",
".",
"toJsonDict",
"(",
"variantAnnotationSet",
".",
"getAnalysis",
"(",
")",
")",
")",
"try",
":",
"models",
"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertCallSet | Inserts a the specified callSet into this repository. | ga4gh/server/datarepo.py | def insertCallSet(self, callSet):
"""
Inserts a the specified callSet into this repository.
"""
try:
models.Callset.create(
id=callSet.getId(),
name=callSet.getLocalId(),
variantsetid=callSet.getParentContainer().getId(),
... | def insertCallSet(self, callSet):
"""
Inserts a the specified callSet into this repository.
"""
try:
models.Callset.create(
id=callSet.getId(),
name=callSet.getLocalId(),
variantsetid=callSet.getParentContainer().getId(),
... | [
"Inserts",
"a",
"the",
"specified",
"callSet",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1076-L1088 | [
"def",
"insertCallSet",
"(",
"self",
",",
"callSet",
")",
":",
"try",
":",
"models",
".",
"Callset",
".",
"create",
"(",
"id",
"=",
"callSet",
".",
"getId",
"(",
")",
",",
"name",
"=",
"callSet",
".",
"getLocalId",
"(",
")",
",",
"variantsetid",
"=",... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertVariantSet | Inserts a the specified variantSet into this repository. | ga4gh/server/datarepo.py | def insertVariantSet(self, variantSet):
"""
Inserts a the specified variantSet into this repository.
"""
# We cheat a little here with the VariantSetMetadata, and encode these
# within the table as a JSON dump. These should really be stored in
# their own table
me... | def insertVariantSet(self, variantSet):
"""
Inserts a the specified variantSet into this repository.
"""
# We cheat a little here with the VariantSetMetadata, and encode these
# within the table as a JSON dump. These should really be stored in
# their own table
me... | [
"Inserts",
"a",
"the",
"specified",
"variantSet",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1102-L1127 | [
"def",
"insertVariantSet",
"(",
"self",
",",
"variantSet",
")",
":",
"# We cheat a little here with the VariantSetMetadata, and encode these",
"# within the table as a JSON dump. These should really be stored in",
"# their own table",
"metadataJson",
"=",
"json",
".",
"dumps",
"(",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertFeatureSet | Inserts a the specified featureSet into this repository. | ga4gh/server/datarepo.py | def insertFeatureSet(self, featureSet):
"""
Inserts a the specified featureSet into this repository.
"""
# TODO add support for info and sourceUri fields.
try:
models.Featureset.create(
id=featureSet.getId(),
datasetid=featureSet.getPar... | def insertFeatureSet(self, featureSet):
"""
Inserts a the specified featureSet into this repository.
"""
# TODO add support for info and sourceUri fields.
try:
models.Featureset.create(
id=featureSet.getId(),
datasetid=featureSet.getPar... | [
"Inserts",
"a",
"the",
"specified",
"featureSet",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1145-L1160 | [
"def",
"insertFeatureSet",
"(",
"self",
",",
"featureSet",
")",
":",
"# TODO add support for info and sourceUri fields.",
"try",
":",
"models",
".",
"Featureset",
".",
"create",
"(",
"id",
"=",
"featureSet",
".",
"getId",
"(",
")",
",",
"datasetid",
"=",
"featur... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertContinuousSet | Inserts a the specified continuousSet into this repository. | ga4gh/server/datarepo.py | def insertContinuousSet(self, continuousSet):
"""
Inserts a the specified continuousSet into this repository.
"""
# TODO add support for info and sourceUri fields.
try:
models.ContinuousSet.create(
id=continuousSet.getId(),
datasetid=co... | def insertContinuousSet(self, continuousSet):
"""
Inserts a the specified continuousSet into this repository.
"""
# TODO add support for info and sourceUri fields.
try:
models.ContinuousSet.create(
id=continuousSet.getId(),
datasetid=co... | [
"Inserts",
"a",
"the",
"specified",
"continuousSet",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1186-L1200 | [
"def",
"insertContinuousSet",
"(",
"self",
",",
"continuousSet",
")",
":",
"# TODO add support for info and sourceUri fields.",
"try",
":",
"models",
".",
"ContinuousSet",
".",
"create",
"(",
"id",
"=",
"continuousSet",
".",
"getId",
"(",
")",
",",
"datasetid",
"=... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertBiosample | Inserts the specified Biosample into this repository. | ga4gh/server/datarepo.py | def insertBiosample(self, biosample):
"""
Inserts the specified Biosample into this repository.
"""
try:
models.Biosample.create(
id=biosample.getId(),
datasetid=biosample.getParentContainer().getId(),
name=biosample.getLocalId(... | def insertBiosample(self, biosample):
"""
Inserts the specified Biosample into this repository.
"""
try:
models.Biosample.create(
id=biosample.getId(),
datasetid=biosample.getParentContainer().getId(),
name=biosample.getLocalId(... | [
"Inserts",
"the",
"specified",
"Biosample",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1217-L1237 | [
"def",
"insertBiosample",
"(",
"self",
",",
"biosample",
")",
":",
"try",
":",
"models",
".",
"Biosample",
".",
"create",
"(",
"id",
"=",
"biosample",
".",
"getId",
"(",
")",
",",
"datasetid",
"=",
"biosample",
".",
"getParentContainer",
"(",
")",
".",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertIndividual | Inserts the specified individual into this repository. | ga4gh/server/datarepo.py | def insertIndividual(self, individual):
"""
Inserts the specified individual into this repository.
"""
try:
models.Individual.create(
id=individual.getId(),
datasetId=individual.getParentContainer().getId(),
name=individual.getL... | def insertIndividual(self, individual):
"""
Inserts the specified individual into this repository.
"""
try:
models.Individual.create(
id=individual.getId(),
datasetId=individual.getParentContainer().getId(),
name=individual.getL... | [
"Inserts",
"the",
"specified",
"individual",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1251-L1269 | [
"def",
"insertIndividual",
"(",
"self",
",",
"individual",
")",
":",
"try",
":",
"models",
".",
"Individual",
".",
"create",
"(",
"id",
"=",
"individual",
".",
"getId",
"(",
")",
",",
"datasetId",
"=",
"individual",
".",
"getParentContainer",
"(",
")",
"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertPhenotypeAssociationSet | Inserts the specified phenotype annotation set into this repository. | ga4gh/server/datarepo.py | def insertPhenotypeAssociationSet(self, phenotypeAssociationSet):
"""
Inserts the specified phenotype annotation set into this repository.
"""
datasetId = phenotypeAssociationSet.getParentContainer().getId()
attributes = json.dumps(phenotypeAssociationSet.getAttributes())
... | def insertPhenotypeAssociationSet(self, phenotypeAssociationSet):
"""
Inserts the specified phenotype annotation set into this repository.
"""
datasetId = phenotypeAssociationSet.getParentContainer().getId()
attributes = json.dumps(phenotypeAssociationSet.getAttributes())
... | [
"Inserts",
"the",
"specified",
"phenotype",
"annotation",
"set",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1286-L1301 | [
"def",
"insertPhenotypeAssociationSet",
"(",
"self",
",",
"phenotypeAssociationSet",
")",
":",
"datasetId",
"=",
"phenotypeAssociationSet",
".",
"getParentContainer",
"(",
")",
".",
"getId",
"(",
")",
"attributes",
"=",
"json",
".",
"dumps",
"(",
"phenotypeAssociati... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertRnaQuantificationSet | Inserts a the specified rnaQuantificationSet into this repository. | ga4gh/server/datarepo.py | def insertRnaQuantificationSet(self, rnaQuantificationSet):
"""
Inserts a the specified rnaQuantificationSet into this repository.
"""
try:
models.Rnaquantificationset.create(
id=rnaQuantificationSet.getId(),
datasetid=rnaQuantificationSet.getP... | def insertRnaQuantificationSet(self, rnaQuantificationSet):
"""
Inserts a the specified rnaQuantificationSet into this repository.
"""
try:
models.Rnaquantificationset.create(
id=rnaQuantificationSet.getId(),
datasetid=rnaQuantificationSet.getP... | [
"Inserts",
"a",
"the",
"specified",
"rnaQuantificationSet",
"into",
"this",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1313-L1328 | [
"def",
"insertRnaQuantificationSet",
"(",
"self",
",",
"rnaQuantificationSet",
")",
":",
"try",
":",
"models",
".",
"Rnaquantificationset",
".",
"create",
"(",
"id",
"=",
"rnaQuantificationSet",
".",
"getId",
"(",
")",
",",
"datasetid",
"=",
"rnaQuantificationSet"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removeRnaQuantificationSet | Removes the specified rnaQuantificationSet from this repository. This
performs a cascading removal of all items within this
rnaQuantificationSet. | ga4gh/server/datarepo.py | def removeRnaQuantificationSet(self, rnaQuantificationSet):
"""
Removes the specified rnaQuantificationSet from this repository. This
performs a cascading removal of all items within this
rnaQuantificationSet.
"""
q = models.Rnaquantificationset.delete().where(
... | def removeRnaQuantificationSet(self, rnaQuantificationSet):
"""
Removes the specified rnaQuantificationSet from this repository. This
performs a cascading removal of all items within this
rnaQuantificationSet.
"""
q = models.Rnaquantificationset.delete().where(
... | [
"Removes",
"the",
"specified",
"rnaQuantificationSet",
"from",
"this",
"repository",
".",
"This",
"performs",
"a",
"cascading",
"removal",
"of",
"all",
"items",
"within",
"this",
"rnaQuantificationSet",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1343-L1351 | [
"def",
"removeRnaQuantificationSet",
"(",
"self",
",",
"rnaQuantificationSet",
")",
":",
"q",
"=",
"models",
".",
"Rnaquantificationset",
".",
"delete",
"(",
")",
".",
"where",
"(",
"models",
".",
"Rnaquantificationset",
".",
"id",
"==",
"rnaQuantificationSet",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.insertPeer | Accepts a peer datamodel object and adds it to the registry. | ga4gh/server/datarepo.py | def insertPeer(self, peer):
"""
Accepts a peer datamodel object and adds it to the registry.
"""
try:
models.Peer.create(
url=peer.getUrl(),
attributes=json.dumps(peer.getAttributes()))
except Exception as e:
raise exception... | def insertPeer(self, peer):
"""
Accepts a peer datamodel object and adds it to the registry.
"""
try:
models.Peer.create(
url=peer.getUrl(),
attributes=json.dumps(peer.getAttributes()))
except Exception as e:
raise exception... | [
"Accepts",
"a",
"peer",
"datamodel",
"object",
"and",
"adds",
"it",
"to",
"the",
"registry",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1353-L1362 | [
"def",
"insertPeer",
"(",
"self",
",",
"peer",
")",
":",
"try",
":",
"models",
".",
"Peer",
".",
"create",
"(",
"url",
"=",
"peer",
".",
"getUrl",
"(",
")",
",",
"attributes",
"=",
"json",
".",
"dumps",
"(",
"peer",
".",
"getAttributes",
"(",
")",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.removePeer | Remove peers by URL. | ga4gh/server/datarepo.py | def removePeer(self, url):
"""
Remove peers by URL.
"""
q = models.Peer.delete().where(
models.Peer.url == url)
q.execute() | def removePeer(self, url):
"""
Remove peers by URL.
"""
q = models.Peer.delete().where(
models.Peer.url == url)
q.execute() | [
"Remove",
"peers",
"by",
"URL",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1364-L1370 | [
"def",
"removePeer",
"(",
"self",
",",
"url",
")",
":",
"q",
"=",
"models",
".",
"Peer",
".",
"delete",
"(",
")",
".",
"where",
"(",
"models",
".",
"Peer",
".",
"url",
"==",
"url",
")",
"q",
".",
"execute",
"(",
")"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.initialise | Initialise this data repository, creating any necessary directories
and file paths. | ga4gh/server/datarepo.py | def initialise(self):
"""
Initialise this data repository, creating any necessary directories
and file paths.
"""
self._checkWriteMode()
self._createSystemTable()
self._createNetworkTables()
self._createOntologyTable()
self._createReferenceSetTable... | def initialise(self):
"""
Initialise this data repository, creating any necessary directories
and file paths.
"""
self._checkWriteMode()
self._createSystemTable()
self._createNetworkTables()
self._createOntologyTable()
self._createReferenceSetTable... | [
"Initialise",
"this",
"data",
"repository",
"creating",
"any",
"necessary",
"directories",
"and",
"file",
"paths",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1377-L1399 | [
"def",
"initialise",
"(",
"self",
")",
":",
"self",
".",
"_checkWriteMode",
"(",
")",
"self",
".",
"_createSystemTable",
"(",
")",
"self",
".",
"_createNetworkTables",
"(",
")",
"self",
".",
"_createOntologyTable",
"(",
")",
"self",
".",
"_createReferenceSetTa... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SqlDataRepository.load | Loads this data repository into memory. | ga4gh/server/datarepo.py | def load(self):
"""
Loads this data repository into memory.
"""
self._readSystemTable()
self._readOntologyTable()
self._readReferenceSetTable()
self._readReferenceTable()
self._readDatasetTable()
self._readReadGroupSetTable()
self._readRead... | def load(self):
"""
Loads this data repository into memory.
"""
self._readSystemTable()
self._readOntologyTable()
self._readReferenceSetTable()
self._readReferenceTable()
self._readDatasetTable()
self._readReadGroupSetTable()
self._readRead... | [
"Loads",
"this",
"data",
"repository",
"into",
"memory",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datarepo.py#L1421-L1440 | [
"def",
"load",
"(",
"self",
")",
":",
"self",
".",
"_readSystemTable",
"(",
")",
"self",
".",
"_readOntologyTable",
"(",
")",
"self",
".",
"_readReferenceSetTable",
"(",
")",
"self",
".",
"_readReferenceTable",
"(",
")",
"self",
".",
"_readDatasetTable",
"("... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | PhenotypeAssociationFeatureSet.populateFromRow | Populates the instance variables of this FeatureSet from the specified
DB row. | ga4gh/server/datamodel/genotype_phenotype_featureset.py | 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.populateFromFile(self._dbFilePa... | 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.populateFromFile(self._dbFilePa... | [
"Populates",
"the",
"instance",
"variables",
"of",
"this",
"FeatureSet",
"from",
"the",
"specified",
"DB",
"row",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/genotype_phenotype_featureset.py#L48-L55 | [
"def",
"populateFromRow",
"(",
"self",
",",
"featureSetRecord",
")",
":",
"self",
".",
"_dbFilePath",
"=",
"featureSetRecord",
".",
"dataurl",
"self",
".",
"setAttributesJson",
"(",
"featureSetRecord",
".",
"attributes",
")",
"self",
".",
"populateFromFile",
"(",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | PhenotypeAssociationFeatureSet.populateFromFile | Populates the instance variables of this FeatureSet from the specified
data URL.
Initialize dataset, using the passed dict of sources
[{source,format}] see rdflib.parse() for more
If path is set, this backend will load itself | ga4gh/server/datamodel/genotype_phenotype_featureset.py | def populateFromFile(self, dataUrl):
"""
Populates the instance variables of this FeatureSet from the specified
data URL.
Initialize dataset, using the passed dict of sources
[{source,format}] see rdflib.parse() for more
If path is set, this backend will load itself
... | def populateFromFile(self, dataUrl):
"""
Populates the instance variables of this FeatureSet from the specified
data URL.
Initialize dataset, using the passed dict of sources
[{source,format}] see rdflib.parse() for more
If path is set, this backend will load itself
... | [
"Populates",
"the",
"instance",
"variables",
"of",
"this",
"FeatureSet",
"from",
"the",
"specified",
"data",
"URL",
".",
"Initialize",
"dataset",
"using",
"the",
"passed",
"dict",
"of",
"sources",
"[",
"{",
"source",
"format",
"}",
"]",
"see",
"rdflib",
".",... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/genotype_phenotype_featureset.py#L57-L81 | [
"def",
"populateFromFile",
"(",
"self",
",",
"dataUrl",
")",
":",
"self",
".",
"_dbFilePath",
"=",
"dataUrl",
"# initialize graph",
"self",
".",
"_rdfGraph",
"=",
"rdflib",
".",
"ConjunctiveGraph",
"(",
")",
"# save the path",
"self",
".",
"_dataUrl",
"=",
"da... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | PhenotypeAssociationFeatureSet.getFeature | find a feature and return ga4gh representation, use compoundId as
featureId | ga4gh/server/datamodel/genotype_phenotype_featureset.py | def getFeature(self, compoundId):
"""
find a feature and return ga4gh representation, use compoundId as
featureId
"""
feature = self._getFeatureById(compoundId.featureId)
feature.id = str(compoundId)
return feature | def getFeature(self, compoundId):
"""
find a feature and return ga4gh representation, use compoundId as
featureId
"""
feature = self._getFeatureById(compoundId.featureId)
feature.id = str(compoundId)
return feature | [
"find",
"a",
"feature",
"and",
"return",
"ga4gh",
"representation",
"use",
"compoundId",
"as",
"featureId"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/genotype_phenotype_featureset.py#L84-L91 | [
"def",
"getFeature",
"(",
"self",
",",
"compoundId",
")",
":",
"feature",
"=",
"self",
".",
"_getFeatureById",
"(",
"compoundId",
".",
"featureId",
")",
"feature",
".",
"id",
"=",
"str",
"(",
"compoundId",
")",
"return",
"feature"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | PhenotypeAssociationFeatureSet._getFeatureById | find a feature and return ga4gh representation, use 'native' id as
featureId | ga4gh/server/datamodel/genotype_phenotype_featureset.py | def _getFeatureById(self, featureId):
"""
find a feature and return ga4gh representation, use 'native' id as
featureId
"""
featureRef = rdflib.URIRef(featureId)
featureDetails = self._detailTuples([featureRef])
feature = {}
for detail in featureDetails:
... | def _getFeatureById(self, featureId):
"""
find a feature and return ga4gh representation, use 'native' id as
featureId
"""
featureRef = rdflib.URIRef(featureId)
featureDetails = self._detailTuples([featureRef])
feature = {}
for detail in featureDetails:
... | [
"find",
"a",
"feature",
"and",
"return",
"ga4gh",
"representation",
"use",
"native",
"id",
"as",
"featureId"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/genotype_phenotype_featureset.py#L93-L137 | [
"def",
"_getFeatureById",
"(",
"self",
",",
"featureId",
")",
":",
"featureRef",
"=",
"rdflib",
".",
"URIRef",
"(",
"featureId",
")",
"featureDetails",
"=",
"self",
".",
"_detailTuples",
"(",
"[",
"featureRef",
"]",
")",
"feature",
"=",
"{",
"}",
"for",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | PhenotypeAssociationFeatureSet._filterSearchFeaturesRequest | formulate a sparql query string based on parameters | ga4gh/server/datamodel/genotype_phenotype_featureset.py | def _filterSearchFeaturesRequest(self, reference_name, gene_symbol, name,
start, end):
"""
formulate a sparql query string based on parameters
"""
filters = []
query = self._baseQuery()
filters = []
location = self._findLocatio... | def _filterSearchFeaturesRequest(self, reference_name, gene_symbol, name,
start, end):
"""
formulate a sparql query string based on parameters
"""
filters = []
query = self._baseQuery()
filters = []
location = self._findLocatio... | [
"formulate",
"a",
"sparql",
"query",
"string",
"based",
"on",
"parameters"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/genotype_phenotype_featureset.py#L184-L205 | [
"def",
"_filterSearchFeaturesRequest",
"(",
"self",
",",
"reference_name",
",",
"gene_symbol",
",",
"name",
",",
"start",
",",
"end",
")",
":",
"filters",
"=",
"[",
"]",
"query",
"=",
"self",
".",
"_baseQuery",
"(",
")",
"filters",
"=",
"[",
"]",
"locati... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | PhenotypeAssociationFeatureSet._findLocation | return a location key form the locationMap | ga4gh/server/datamodel/genotype_phenotype_featureset.py | def _findLocation(self, reference_name, start, end):
"""
return a location key form the locationMap
"""
try:
# TODO - sequence_annotations does not have build?
return self._locationMap['hg19'][reference_name][start][end]
except:
return None | def _findLocation(self, reference_name, start, end):
"""
return a location key form the locationMap
"""
try:
# TODO - sequence_annotations does not have build?
return self._locationMap['hg19'][reference_name][start][end]
except:
return None | [
"return",
"a",
"location",
"key",
"form",
"the",
"locationMap"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/genotype_phenotype_featureset.py#L207-L215 | [
"def",
"_findLocation",
"(",
"self",
",",
"reference_name",
",",
"start",
",",
"end",
")",
":",
"try",
":",
"# TODO - sequence_annotations does not have build?",
"return",
"self",
".",
"_locationMap",
"[",
"'hg19'",
"]",
"[",
"reference_name",
"]",
"[",
"start",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | PhenotypeAssociationFeatureSet._initializeLocationCache | CGD uses Faldo ontology for locations, it's a bit complicated.
This function sets up an in memory cache of all locations, which
can be queried via:
locationMap[build][chromosome][begin][end] = location["_id"] | ga4gh/server/datamodel/genotype_phenotype_featureset.py | def _initializeLocationCache(self):
"""
CGD uses Faldo ontology for locations, it's a bit complicated.
This function sets up an in memory cache of all locations, which
can be queried via:
locationMap[build][chromosome][begin][end] = location["_id"]
"""
# cache of ... | def _initializeLocationCache(self):
"""
CGD uses Faldo ontology for locations, it's a bit complicated.
This function sets up an in memory cache of all locations, which
can be queried via:
locationMap[build][chromosome][begin][end] = location["_id"]
"""
# cache of ... | [
"CGD",
"uses",
"Faldo",
"ontology",
"for",
"locations",
"it",
"s",
"a",
"bit",
"complicated",
".",
"This",
"function",
"sets",
"up",
"an",
"in",
"memory",
"cache",
"of",
"all",
"locations",
"which",
"can",
"be",
"queried",
"via",
":",
"locationMap",
"[",
... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/genotype_phenotype_featureset.py#L217-L315 | [
"def",
"_initializeLocationCache",
"(",
"self",
")",
":",
"# cache of locations",
"self",
".",
"_locationMap",
"=",
"{",
"}",
"locationMap",
"=",
"self",
".",
"_locationMap",
"triples",
"=",
"self",
".",
"_rdfGraph",
".",
"triples",
"Ref",
"=",
"rdflib",
".",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SearchResponseBuilder.addValue | Appends the specified protocolElement to the value list for this
response. | ga4gh/server/response_builder.py | def addValue(self, protocolElement):
"""
Appends the specified protocolElement to the value list for this
response.
"""
self._numElements += 1
self._bufferSize += protocolElement.ByteSize()
attr = getattr(self._protoObject, self._valueListName)
obj = attr.... | def addValue(self, protocolElement):
"""
Appends the specified protocolElement to the value list for this
response.
"""
self._numElements += 1
self._bufferSize += protocolElement.ByteSize()
attr = getattr(self._protoObject, self._valueListName)
obj = attr.... | [
"Appends",
"the",
"specified",
"protocolElement",
"to",
"the",
"value",
"list",
"for",
"this",
"response",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/response_builder.py#L61-L70 | [
"def",
"addValue",
"(",
"self",
",",
"protocolElement",
")",
":",
"self",
".",
"_numElements",
"+=",
"1",
"self",
".",
"_bufferSize",
"+=",
"protocolElement",
".",
"ByteSize",
"(",
")",
"attr",
"=",
"getattr",
"(",
"self",
".",
"_protoObject",
",",
"self",... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SearchResponseBuilder.isFull | Returns True if the response buffer is full, and False otherwise.
The buffer is full if either (1) the number of items in the value
list is >= pageSize or (2) the total length of the serialised
elements in the page is >= maxBufferSize.
If page_size or max_response_length were not set in... | ga4gh/server/response_builder.py | def isFull(self):
"""
Returns True if the response buffer is full, and False otherwise.
The buffer is full if either (1) the number of items in the value
list is >= pageSize or (2) the total length of the serialised
elements in the page is >= maxBufferSize.
If page_size ... | def isFull(self):
"""
Returns True if the response buffer is full, and False otherwise.
The buffer is full if either (1) the number of items in the value
list is >= pageSize or (2) the total length of the serialised
elements in the page is >= maxBufferSize.
If page_size ... | [
"Returns",
"True",
"if",
"the",
"response",
"buffer",
"is",
"full",
"and",
"False",
"otherwise",
".",
"The",
"buffer",
"is",
"full",
"if",
"either",
"(",
"1",
")",
"the",
"number",
"of",
"items",
"in",
"the",
"value",
"list",
"is",
">",
"=",
"pageSize"... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/response_builder.py#L72-L85 | [
"def",
"isFull",
"(",
"self",
")",
":",
"return",
"(",
"(",
"self",
".",
"_pageSize",
">",
"0",
"and",
"self",
".",
"_numElements",
">=",
"self",
".",
"_pageSize",
")",
"or",
"(",
"self",
".",
"_bufferSize",
">=",
"self",
".",
"_maxBufferSize",
")",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | SearchResponseBuilder.getSerializedResponse | Returns a string version of the SearchResponse that has
been built by this SearchResponseBuilder. | ga4gh/server/response_builder.py | def getSerializedResponse(self):
"""
Returns a string version of the SearchResponse that has
been built by this SearchResponseBuilder.
"""
self._protoObject.next_page_token = pb.string(self._nextPageToken)
s = protocol.toJson(self._protoObject)
return s | def getSerializedResponse(self):
"""
Returns a string version of the SearchResponse that has
been built by this SearchResponseBuilder.
"""
self._protoObject.next_page_token = pb.string(self._nextPageToken)
s = protocol.toJson(self._protoObject)
return s | [
"Returns",
"a",
"string",
"version",
"of",
"the",
"SearchResponse",
"that",
"has",
"been",
"built",
"by",
"this",
"SearchResponseBuilder",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/response_builder.py#L87-L94 | [
"def",
"getSerializedResponse",
"(",
"self",
")",
":",
"self",
".",
"_protoObject",
".",
"next_page_token",
"=",
"pb",
".",
"string",
"(",
"self",
".",
"_nextPageToken",
")",
"s",
"=",
"protocol",
".",
"toJson",
"(",
"self",
".",
"_protoObject",
")",
"retu... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Ontology.populateFromRow | Populates this Ontology using values in the specified DB row. | ga4gh/server/datamodel/ontologies.py | def populateFromRow(self, ontologyRecord):
"""
Populates this Ontology using values in the specified DB row.
"""
self._id = ontologyRecord.id
self._dataUrl = ontologyRecord.dataurl
self._readFile() | def populateFromRow(self, ontologyRecord):
"""
Populates this Ontology using values in the specified DB row.
"""
self._id = ontologyRecord.id
self._dataUrl = ontologyRecord.dataurl
self._readFile() | [
"Populates",
"this",
"Ontology",
"using",
"values",
"in",
"the",
"specified",
"DB",
"row",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/ontologies.py#L75-L81 | [
"def",
"populateFromRow",
"(",
"self",
",",
"ontologyRecord",
")",
":",
"self",
".",
"_id",
"=",
"ontologyRecord",
".",
"id",
"self",
".",
"_dataUrl",
"=",
"ontologyRecord",
".",
"dataurl",
"self",
".",
"_readFile",
"(",
")"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Ontology.getGaTermByName | Returns a GA4GH OntologyTerm object by name.
:param name: name of the ontology term, ex. "gene".
:return: GA4GH OntologyTerm object. | ga4gh/server/datamodel/ontologies.py | def getGaTermByName(self, name):
"""
Returns a GA4GH OntologyTerm object by name.
:param name: name of the ontology term, ex. "gene".
:return: GA4GH OntologyTerm object.
"""
# TODO what is the correct value when we have no mapping??
termIds = self.getTermIds(name... | def getGaTermByName(self, name):
"""
Returns a GA4GH OntologyTerm object by name.
:param name: name of the ontology term, ex. "gene".
:return: GA4GH OntologyTerm object.
"""
# TODO what is the correct value when we have no mapping??
termIds = self.getTermIds(name... | [
"Returns",
"a",
"GA4GH",
"OntologyTerm",
"object",
"by",
"name",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/ontologies.py#L114-L133 | [
"def",
"getGaTermByName",
"(",
"self",
",",
"name",
")",
":",
"# TODO what is the correct value when we have no mapping??",
"termIds",
"=",
"self",
".",
"getTermIds",
"(",
"name",
")",
"if",
"len",
"(",
"termIds",
")",
"==",
"0",
":",
"termId",
"=",
"\"\"",
"#... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | _heavyQuery | Very heavy query: calls for the specified list of callSetIds
on chromosome 2 (11 pages, 90 seconds to fetch the entire thing
on a high-end desktop machine) | scripts/server_benchmark.py | def _heavyQuery(variantSetId, callSetIds):
"""
Very heavy query: calls for the specified list of callSetIds
on chromosome 2 (11 pages, 90 seconds to fetch the entire thing
on a high-end desktop machine)
"""
request = protocol.SearchVariantsRequest()
request.reference_name = '2'
request.v... | def _heavyQuery(variantSetId, callSetIds):
"""
Very heavy query: calls for the specified list of callSetIds
on chromosome 2 (11 pages, 90 seconds to fetch the entire thing
on a high-end desktop machine)
"""
request = protocol.SearchVariantsRequest()
request.reference_name = '2'
request.v... | [
"Very",
"heavy",
"query",
":",
"calls",
"for",
"the",
"specified",
"list",
"of",
"callSetIds",
"on",
"chromosome",
"2",
"(",
"11",
"pages",
"90",
"seconds",
"to",
"fetch",
"the",
"entire",
"thing",
"on",
"a",
"high",
"-",
"end",
"desktop",
"machine",
")"... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/scripts/server_benchmark.py#L53-L66 | [
"def",
"_heavyQuery",
"(",
"variantSetId",
",",
"callSetIds",
")",
":",
"request",
"=",
"protocol",
".",
"SearchVariantsRequest",
"(",
")",
"request",
".",
"reference_name",
"=",
"'2'",
"request",
".",
"variant_set_id",
"=",
"variantSetId",
"for",
"callSetId",
"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | timeOneSearch | Returns (search result as JSON string, time elapsed during search) | scripts/server_benchmark.py | def timeOneSearch(queryString):
"""
Returns (search result as JSON string, time elapsed during search)
"""
startTime = time.clock()
resultString = backend.runSearchVariants(queryString)
endTime = time.clock()
elapsedTime = endTime - startTime
return resultString, elapsedTime | def timeOneSearch(queryString):
"""
Returns (search result as JSON string, time elapsed during search)
"""
startTime = time.clock()
resultString = backend.runSearchVariants(queryString)
endTime = time.clock()
elapsedTime = endTime - startTime
return resultString, elapsedTime | [
"Returns",
"(",
"search",
"result",
"as",
"JSON",
"string",
"time",
"elapsed",
"during",
"search",
")"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/scripts/server_benchmark.py#L69-L77 | [
"def",
"timeOneSearch",
"(",
"queryString",
")",
":",
"startTime",
"=",
"time",
".",
"clock",
"(",
")",
"resultString",
"=",
"backend",
".",
"runSearchVariants",
"(",
"queryString",
")",
"endTime",
"=",
"time",
".",
"clock",
"(",
")",
"elapsedTime",
"=",
"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | benchmarkOneQuery | Repeat the query several times; perhaps don't go through *all* the
pages. Returns minimum time to run backend.searchVariants() to execute
the query (as far as pageLimit allows), *not* including JSON
processing to prepare queries or parse responses. | scripts/server_benchmark.py | def benchmarkOneQuery(request, repeatLimit=3, pageLimit=3):
"""
Repeat the query several times; perhaps don't go through *all* the
pages. Returns minimum time to run backend.searchVariants() to execute
the query (as far as pageLimit allows), *not* including JSON
processing to prepare queries or par... | def benchmarkOneQuery(request, repeatLimit=3, pageLimit=3):
"""
Repeat the query several times; perhaps don't go through *all* the
pages. Returns minimum time to run backend.searchVariants() to execute
the query (as far as pageLimit allows), *not* including JSON
processing to prepare queries or par... | [
"Repeat",
"the",
"query",
"several",
"times",
";",
"perhaps",
"don",
"t",
"go",
"through",
"*",
"all",
"*",
"the",
"pages",
".",
"Returns",
"minimum",
"time",
"to",
"run",
"backend",
".",
"searchVariants",
"()",
"to",
"execute",
"the",
"query",
"(",
"as"... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/scripts/server_benchmark.py#L93-L124 | [
"def",
"benchmarkOneQuery",
"(",
"request",
",",
"repeatLimit",
"=",
"3",
",",
"pageLimit",
"=",
"3",
")",
":",
"times",
"=",
"[",
"]",
"queryString",
"=",
"protocol",
".",
"toJson",
"(",
"request",
")",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"rep... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | getExceptionClass | Converts the specified error code into the corresponding class object.
Raises a KeyError if the errorCode is not found. | ga4gh/server/exceptions.py | def getExceptionClass(errorCode):
"""
Converts the specified error code into the corresponding class object.
Raises a KeyError if the errorCode is not found.
"""
classMap = {}
for name, class_ in inspect.getmembers(sys.modules[__name__]):
if inspect.isclass(class_) and issubclass(class_,... | def getExceptionClass(errorCode):
"""
Converts the specified error code into the corresponding class object.
Raises a KeyError if the errorCode is not found.
"""
classMap = {}
for name, class_ in inspect.getmembers(sys.modules[__name__]):
if inspect.isclass(class_) and issubclass(class_,... | [
"Converts",
"the",
"specified",
"error",
"code",
"into",
"the",
"corresponding",
"class",
"object",
".",
"Raises",
"a",
"KeyError",
"if",
"the",
"errorCode",
"is",
"not",
"found",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/exceptions.py#L17-L26 | [
"def",
"getExceptionClass",
"(",
"errorCode",
")",
":",
"classMap",
"=",
"{",
"}",
"for",
"name",
",",
"class_",
"in",
"inspect",
".",
"getmembers",
"(",
"sys",
".",
"modules",
"[",
"__name__",
"]",
")",
":",
"if",
"inspect",
".",
"isclass",
"(",
"clas... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | RuntimeException.toProtocolElement | Converts this exception into the GA4GH protocol type so that
it can be communicated back to the client. | ga4gh/server/exceptions.py | def toProtocolElement(self):
"""
Converts this exception into the GA4GH protocol type so that
it can be communicated back to the client.
"""
error = protocol.GAException()
error.error_code = self.getErrorCode()
error.message = self.getMessage()
return erro... | def toProtocolElement(self):
"""
Converts this exception into the GA4GH protocol type so that
it can be communicated back to the client.
"""
error = protocol.GAException()
error.error_code = self.getErrorCode()
error.message = self.getMessage()
return erro... | [
"Converts",
"this",
"exception",
"into",
"the",
"GA4GH",
"protocol",
"type",
"so",
"that",
"it",
"can",
"be",
"communicated",
"back",
"to",
"the",
"client",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/exceptions.py#L94-L102 | [
"def",
"toProtocolElement",
"(",
"self",
")",
":",
"error",
"=",
"protocol",
".",
"GAException",
"(",
")",
"error",
".",
"error_code",
"=",
"self",
".",
"getErrorCode",
"(",
")",
"error",
".",
"message",
"=",
"self",
".",
"getMessage",
"(",
")",
"return"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | OBOReader._init_goterm_ref | Initialize new reference and perform checks. | ga4gh/server/datamodel/obo_parser.py | def _init_goterm_ref(self, rec_curr, name, lnum):
"""Initialize new reference and perform checks."""
if rec_curr is None:
return GOTerm()
msg = "PREVIOUS {REC} WAS NOT TERMINATED AS EXPECTED".format(REC=name)
self._die(msg, lnum) | def _init_goterm_ref(self, rec_curr, name, lnum):
"""Initialize new reference and perform checks."""
if rec_curr is None:
return GOTerm()
msg = "PREVIOUS {REC} WAS NOT TERMINATED AS EXPECTED".format(REC=name)
self._die(msg, lnum) | [
"Initialize",
"new",
"reference",
"and",
"perform",
"checks",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L116-L121 | [
"def",
"_init_goterm_ref",
"(",
"self",
",",
"rec_curr",
",",
"name",
",",
"lnum",
")",
":",
"if",
"rec_curr",
"is",
"None",
":",
"return",
"GOTerm",
"(",
")",
"msg",
"=",
"\"PREVIOUS {REC} WAS NOT TERMINATED AS EXPECTED\"",
".",
"format",
"(",
"REC",
"=",
"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | OBOReader._init_typedef | Initialize new typedef and perform checks. | ga4gh/server/datamodel/obo_parser.py | def _init_typedef(self, typedef_curr, name, lnum):
"""Initialize new typedef and perform checks."""
if typedef_curr is None:
return TypeDef()
msg = "PREVIOUS {REC} WAS NOT TERMINATED AS EXPECTED".format(REC=name)
self._die(msg, lnum) | def _init_typedef(self, typedef_curr, name, lnum):
"""Initialize new typedef and perform checks."""
if typedef_curr is None:
return TypeDef()
msg = "PREVIOUS {REC} WAS NOT TERMINATED AS EXPECTED".format(REC=name)
self._die(msg, lnum) | [
"Initialize",
"new",
"typedef",
"and",
"perform",
"checks",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L123-L128 | [
"def",
"_init_typedef",
"(",
"self",
",",
"typedef_curr",
",",
"name",
",",
"lnum",
")",
":",
"if",
"typedef_curr",
"is",
"None",
":",
"return",
"TypeDef",
"(",
")",
"msg",
"=",
"\"PREVIOUS {REC} WAS NOT TERMINATED AS EXPECTED\"",
".",
"format",
"(",
"REC",
"=... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | OBOReader._add_to_ref | Add new fields to the current reference. | ga4gh/server/datamodel/obo_parser.py | def _add_to_ref(self, rec_curr, line, lnum):
"""Add new fields to the current reference."""
# Written by DV Klopfenstein
# Examples of record lines containing ':' include:
# id: GO:0000002
# name: mitochondrial genome maintenance
# namespace: biological_process
... | def _add_to_ref(self, rec_curr, line, lnum):
"""Add new fields to the current reference."""
# Written by DV Klopfenstein
# Examples of record lines containing ':' include:
# id: GO:0000002
# name: mitochondrial genome maintenance
# namespace: biological_process
... | [
"Add",
"new",
"fields",
"to",
"the",
"current",
"reference",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L130-L161 | [
"def",
"_add_to_ref",
"(",
"self",
",",
"rec_curr",
",",
"line",
",",
"lnum",
")",
":",
"# Written by DV Klopfenstein",
"# Examples of record lines containing ':' include:",
"# id: GO:0000002",
"# name: mitochondrial genome maintenance",
"# namespace: biological_process",
"# ... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | OBOReader.update_rec | Update current GOTerm with optional record. | ga4gh/server/datamodel/obo_parser.py | def update_rec(self, rec, name, value):
"""Update current GOTerm with optional record."""
# 'def' is a reserved word in python, do not use it as a Class attr.
if name == "def":
name = "defn"
# If we have a relationship, then we will split this into a further
# dictio... | def update_rec(self, rec, name, value):
"""Update current GOTerm with optional record."""
# 'def' is a reserved word in python, do not use it as a Class attr.
if name == "def":
name = "defn"
# If we have a relationship, then we will split this into a further
# dictio... | [
"Update",
"current",
"GOTerm",
"with",
"optional",
"record",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L163-L189 | [
"def",
"update_rec",
"(",
"self",
",",
"rec",
",",
"name",
",",
"value",
")",
":",
"# 'def' is a reserved word in python, do not use it as a Class attr.",
"if",
"name",
"==",
"\"def\"",
":",
"name",
"=",
"\"defn\"",
"# If we have a relationship, then we will split this into... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | OBOReader._add_to_typedef | Add new fields to the current typedef. | ga4gh/server/datamodel/obo_parser.py | def _add_to_typedef(self, typedef_curr, line, lnum):
"""Add new fields to the current typedef."""
mtch = re.match(r'^(\S+):\s*(\S.*)$', line)
if mtch:
field_name = mtch.group(1)
field_value = mtch.group(2).split('!')[0].rstrip()
if field_name == "id":
... | def _add_to_typedef(self, typedef_curr, line, lnum):
"""Add new fields to the current typedef."""
mtch = re.match(r'^(\S+):\s*(\S.*)$', line)
if mtch:
field_name = mtch.group(1)
field_value = mtch.group(2).split('!')[0].rstrip()
if field_name == "id":
... | [
"Add",
"new",
"fields",
"to",
"the",
"current",
"typedef",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L191-L211 | [
"def",
"_add_to_typedef",
"(",
"self",
",",
"typedef_curr",
",",
"line",
",",
"lnum",
")",
":",
"mtch",
"=",
"re",
".",
"match",
"(",
"r'^(\\S+):\\s*(\\S.*)$'",
",",
"line",
")",
"if",
"mtch",
":",
"field_name",
"=",
"mtch",
".",
"group",
"(",
"1",
")"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | OBOReader._add_nested | Adds a term's nested attributes. | ga4gh/server/datamodel/obo_parser.py | def _add_nested(self, rec, name, value):
"""Adds a term's nested attributes."""
# Remove comments and split term into typedef / target term.
(typedef, target_term) = value.split('!')[0].rstrip().split(' ')
# Save the nested term.
getattr(rec, name)[typedef].append(target_term) | def _add_nested(self, rec, name, value):
"""Adds a term's nested attributes."""
# Remove comments and split term into typedef / target term.
(typedef, target_term) = value.split('!')[0].rstrip().split(' ')
# Save the nested term.
getattr(rec, name)[typedef].append(target_term) | [
"Adds",
"a",
"term",
"s",
"nested",
"attributes",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L213-L219 | [
"def",
"_add_nested",
"(",
"self",
",",
"rec",
",",
"name",
",",
"value",
")",
":",
"# Remove comments and split term into typedef / target term.",
"(",
"typedef",
",",
"target_term",
")",
"=",
"value",
".",
"split",
"(",
"'!'",
")",
"[",
"0",
"]",
".",
"rst... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | OBOReader._init_optional_attrs | Prepare to store data from user-desired optional fields.
Not loading these optional fields by default saves in space and speed.
But allow the possibility for saving these fields, if the user desires,
Including:
comment consider def is_class_level is_metadata_tag is_transit... | ga4gh/server/datamodel/obo_parser.py | def _init_optional_attrs(self, optional_attrs):
"""Prepare to store data from user-desired optional fields.
Not loading these optional fields by default saves in space and speed.
But allow the possibility for saving these fields, if the user desires,
Including:
com... | def _init_optional_attrs(self, optional_attrs):
"""Prepare to store data from user-desired optional fields.
Not loading these optional fields by default saves in space and speed.
But allow the possibility for saving these fields, if the user desires,
Including:
com... | [
"Prepare",
"to",
"store",
"data",
"from",
"user",
"-",
"desired",
"optional",
"fields",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L221-L248 | [
"def",
"_init_optional_attrs",
"(",
"self",
",",
"optional_attrs",
")",
":",
"# Written by DV Klopfenstein",
"# Required attributes are always loaded. All others are optionally loaded.",
"self",
".",
"attrs_req",
"=",
"[",
"'id'",
",",
"'alt_id'",
",",
"'name'",
",",
"'name... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | OBOReader._die | Raise an Exception if file read is unexpected. | ga4gh/server/datamodel/obo_parser.py | def _die(self, msg, lnum):
"""Raise an Exception if file read is unexpected."""
raise Exception("**FATAL {FILE}({LNUM}): {MSG}\n".format(
FILE=self.obo_file, LNUM=lnum, MSG=msg)) | def _die(self, msg, lnum):
"""Raise an Exception if file read is unexpected."""
raise Exception("**FATAL {FILE}({LNUM}): {MSG}\n".format(
FILE=self.obo_file, LNUM=lnum, MSG=msg)) | [
"Raise",
"an",
"Exception",
"if",
"file",
"read",
"is",
"unexpected",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L251-L254 | [
"def",
"_die",
"(",
"self",
",",
"msg",
",",
"lnum",
")",
":",
"raise",
"Exception",
"(",
"\"**FATAL {FILE}({LNUM}): {MSG}\\n\"",
".",
"format",
"(",
"FILE",
"=",
"self",
".",
"obo_file",
",",
"LNUM",
"=",
"lnum",
",",
"MSG",
"=",
"msg",
")",
")"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | GOTerm.write_hier_rec | Write hierarchy for a GO Term record. | ga4gh/server/datamodel/obo_parser.py | def write_hier_rec(self, gos_printed, out=sys.stdout,
len_dash=1, max_depth=None, num_child=None, short_prt=False,
include_only=None, go_marks=None,
depth=1, dp="-"):
"""Write hierarchy for a GO Term record."""
# Added by DV Klopfenstein
... | def write_hier_rec(self, gos_printed, out=sys.stdout,
len_dash=1, max_depth=None, num_child=None, short_prt=False,
include_only=None, go_marks=None,
depth=1, dp="-"):
"""Write hierarchy for a GO Term record."""
# Added by DV Klopfenstein
... | [
"Write",
"hierarchy",
"for",
"a",
"GO",
"Term",
"record",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L349-L385 | [
"def",
"write_hier_rec",
"(",
"self",
",",
"gos_printed",
",",
"out",
"=",
"sys",
".",
"stdout",
",",
"len_dash",
"=",
"1",
",",
"max_depth",
"=",
"None",
",",
"num_child",
"=",
"None",
",",
"short_prt",
"=",
"False",
",",
"include_only",
"=",
"None",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | GODag.write_hier_all | Write hierarchy for all GO Terms in obo file. | ga4gh/server/datamodel/obo_parser.py | def write_hier_all(self, out=sys.stdout,
len_dash=1, max_depth=None, num_child=None, short_prt=False):
"""Write hierarchy for all GO Terms in obo file."""
# Print: [biological_process, molecular_function, and cellular_component]
for go_id in ['GO:0008150', 'GO:0003674', 'GO... | def write_hier_all(self, out=sys.stdout,
len_dash=1, max_depth=None, num_child=None, short_prt=False):
"""Write hierarchy for all GO Terms in obo file."""
# Print: [biological_process, molecular_function, and cellular_component]
for go_id in ['GO:0008150', 'GO:0003674', 'GO... | [
"Write",
"hierarchy",
"for",
"all",
"GO",
"Terms",
"in",
"obo",
"file",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L492-L497 | [
"def",
"write_hier_all",
"(",
"self",
",",
"out",
"=",
"sys",
".",
"stdout",
",",
"len_dash",
"=",
"1",
",",
"max_depth",
"=",
"None",
",",
"num_child",
"=",
"None",
",",
"short_prt",
"=",
"False",
")",
":",
"# Print: [biological_process, molecular_function, a... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | GODag.write_hier | Write hierarchy for a GO Term. | ga4gh/server/datamodel/obo_parser.py | def write_hier(self, GO_id, out=sys.stdout,
len_dash=1, max_depth=None, num_child=None, short_prt=False,
include_only=None, go_marks=None):
"""Write hierarchy for a GO Term."""
gos_printed = set()
self[GO_id].write_hier_rec(gos_printed, out, len_dash... | def write_hier(self, GO_id, out=sys.stdout,
len_dash=1, max_depth=None, num_child=None, short_prt=False,
include_only=None, go_marks=None):
"""Write hierarchy for a GO Term."""
gos_printed = set()
self[GO_id].write_hier_rec(gos_printed, out, len_dash... | [
"Write",
"hierarchy",
"for",
"a",
"GO",
"Term",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L499-L505 | [
"def",
"write_hier",
"(",
"self",
",",
"GO_id",
",",
"out",
"=",
"sys",
".",
"stdout",
",",
"len_dash",
"=",
"1",
",",
"max_depth",
"=",
"None",
",",
"num_child",
"=",
"None",
",",
"short_prt",
"=",
"False",
",",
"include_only",
"=",
"None",
",",
"go... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | GODag.paths_to_top | Returns all possible paths to the root node
Each path includes the term given. The order of the path is
top -> bottom, i.e. it starts with the root and ends with the
given term (inclusively).
Parameters:
-----------
- term:
the id... | ga4gh/server/datamodel/obo_parser.py | def paths_to_top(self, term):
""" Returns all possible paths to the root node
Each path includes the term given. The order of the path is
top -> bottom, i.e. it starts with the root and ends with the
given term (inclusively).
Parameters:
-----------
... | def paths_to_top(self, term):
""" Returns all possible paths to the root node
Each path includes the term given. The order of the path is
top -> bottom, i.e. it starts with the root and ends with the
given term (inclusively).
Parameters:
-----------
... | [
"Returns",
"all",
"possible",
"paths",
"to",
"the",
"root",
"node"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L522-L556 | [
"def",
"paths_to_top",
"(",
"self",
",",
"term",
")",
":",
"# error handling consistent with original authors",
"if",
"term",
"not",
"in",
"self",
":",
"print",
"(",
"\"Term %s not found!\"",
"%",
"term",
",",
"file",
"=",
"sys",
".",
"stderr",
")",
"return",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | GODag.make_graph_pydot | draw AMIGO style network, lineage containing one query record. | ga4gh/server/datamodel/obo_parser.py | def make_graph_pydot(self, recs, nodecolor,
edgecolor, dpi,
draw_parents=True, draw_children=True):
"""draw AMIGO style network, lineage containing one query record."""
import pydot
G = pydot.Dot(graph_type='digraph', dpi="{}".format(dpi)) # Directed Gra... | def make_graph_pydot(self, recs, nodecolor,
edgecolor, dpi,
draw_parents=True, draw_children=True):
"""draw AMIGO style network, lineage containing one query record."""
import pydot
G = pydot.Dot(graph_type='digraph', dpi="{}".format(dpi)) # Directed Gra... | [
"draw",
"AMIGO",
"style",
"network",
"lineage",
"containing",
"one",
"query",
"record",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/obo_parser.py#L563-L601 | [
"def",
"make_graph_pydot",
"(",
"self",
",",
"recs",
",",
"nodecolor",
",",
"edgecolor",
",",
"dpi",
",",
"draw_parents",
"=",
"True",
",",
"draw_children",
"=",
"True",
")",
":",
"import",
"pydot",
"G",
"=",
"pydot",
".",
"Dot",
"(",
"graph_type",
"=",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | sqliteRowsToDicts | Unpacks sqlite rows as returned by fetchall
into an array of simple dicts.
:param sqliteRows: array of rows returned from fetchall DB call
:return: array of dicts, keyed by the column names. | ga4gh/server/sqlite_backend.py | def sqliteRowsToDicts(sqliteRows):
"""
Unpacks sqlite rows as returned by fetchall
into an array of simple dicts.
:param sqliteRows: array of rows returned from fetchall DB call
:return: array of dicts, keyed by the column names.
"""
return map(lambda r: dict(zip(r.keys(), r)), sqliteRows) | def sqliteRowsToDicts(sqliteRows):
"""
Unpacks sqlite rows as returned by fetchall
into an array of simple dicts.
:param sqliteRows: array of rows returned from fetchall DB call
:return: array of dicts, keyed by the column names.
"""
return map(lambda r: dict(zip(r.keys(), r)), sqliteRows) | [
"Unpacks",
"sqlite",
"rows",
"as",
"returned",
"by",
"fetchall",
"into",
"an",
"array",
"of",
"simple",
"dicts",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/sqlite_backend.py#L13-L21 | [
"def",
"sqliteRowsToDicts",
"(",
"sqliteRows",
")",
":",
"return",
"map",
"(",
"lambda",
"r",
":",
"dict",
"(",
"zip",
"(",
"r",
".",
"keys",
"(",
")",
",",
"r",
")",
")",
",",
"sqliteRows",
")"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | limitsSql | Construct a SQL LIMIT clause | ga4gh/server/sqlite_backend.py | def limitsSql(startIndex=0, maxResults=0):
"""
Construct a SQL LIMIT clause
"""
if startIndex and maxResults:
return " LIMIT {}, {}".format(startIndex, maxResults)
elif startIndex:
raise Exception("startIndex was provided, but maxResults was not")
elif maxResults:
return ... | def limitsSql(startIndex=0, maxResults=0):
"""
Construct a SQL LIMIT clause
"""
if startIndex and maxResults:
return " LIMIT {}, {}".format(startIndex, maxResults)
elif startIndex:
raise Exception("startIndex was provided, but maxResults was not")
elif maxResults:
return ... | [
"Construct",
"a",
"SQL",
"LIMIT",
"clause"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/sqlite_backend.py#L35-L46 | [
"def",
"limitsSql",
"(",
"startIndex",
"=",
"0",
",",
"maxResults",
"=",
"0",
")",
":",
"if",
"startIndex",
"and",
"maxResults",
":",
"return",
"\" LIMIT {}, {}\"",
".",
"format",
"(",
"startIndex",
",",
"maxResults",
")",
"elif",
"startIndex",
":",
"raise",... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | iterativeFetch | Returns rows of a sql fetch query on demand | ga4gh/server/sqlite_backend.py | def iterativeFetch(query, batchSize=default_batch_size):
"""
Returns rows of a sql fetch query on demand
"""
while True:
rows = query.fetchmany(batchSize)
if not rows:
break
rowDicts = sqliteRowsToDicts(rows)
for rowDict in rowDicts:
yield rowDict | def iterativeFetch(query, batchSize=default_batch_size):
"""
Returns rows of a sql fetch query on demand
"""
while True:
rows = query.fetchmany(batchSize)
if not rows:
break
rowDicts = sqliteRowsToDicts(rows)
for rowDict in rowDicts:
yield rowDict | [
"Returns",
"rows",
"of",
"a",
"sql",
"fetch",
"query",
"on",
"demand"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/sqlite_backend.py#L52-L62 | [
"def",
"iterativeFetch",
"(",
"query",
",",
"batchSize",
"=",
"default_batch_size",
")",
":",
"while",
"True",
":",
"rows",
"=",
"query",
".",
"fetchmany",
"(",
"batchSize",
")",
"if",
"not",
"rows",
":",
"break",
"rowDicts",
"=",
"sqliteRowsToDicts",
"(",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | _parsePageToken | Parses the specified pageToken and returns a list of the specified
number of values. Page tokens are assumed to consist of a fixed
number of integers seperated by colons. If the page token does
not conform to this specification, raise a InvalidPageToken
exception. | ga4gh/server/paging.py | def _parsePageToken(pageToken, numValues):
"""
Parses the specified pageToken and returns a list of the specified
number of values. Page tokens are assumed to consist of a fixed
number of integers seperated by colons. If the page token does
not conform to this specification, raise a InvalidPageToken... | def _parsePageToken(pageToken, numValues):
"""
Parses the specified pageToken and returns a list of the specified
number of values. Page tokens are assumed to consist of a fixed
number of integers seperated by colons. If the page token does
not conform to this specification, raise a InvalidPageToken... | [
"Parses",
"the",
"specified",
"pageToken",
"and",
"returns",
"a",
"list",
"of",
"the",
"specified",
"number",
"of",
"values",
".",
"Page",
"tokens",
"are",
"assumed",
"to",
"consist",
"of",
"a",
"fixed",
"number",
"of",
"integers",
"seperated",
"by",
"colons... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/paging.py#L13-L30 | [
"def",
"_parsePageToken",
"(",
"pageToken",
",",
"numValues",
")",
":",
"tokens",
"=",
"pageToken",
".",
"split",
"(",
"\":\"",
")",
"if",
"len",
"(",
"tokens",
")",
"!=",
"numValues",
":",
"msg",
"=",
"\"Invalid number of values in page token\"",
"raise",
"ex... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | _parseIntegerArgument | Attempts to parse the specified key in the specified argument
dictionary into an integer. If the argument cannot be parsed,
raises a BadRequestIntegerException. If the key is not present,
return the specified default value. | ga4gh/server/paging.py | def _parseIntegerArgument(args, key, defaultValue):
"""
Attempts to parse the specified key in the specified argument
dictionary into an integer. If the argument cannot be parsed,
raises a BadRequestIntegerException. If the key is not present,
return the specified default value.
"""
ret = de... | def _parseIntegerArgument(args, key, defaultValue):
"""
Attempts to parse the specified key in the specified argument
dictionary into an integer. If the argument cannot be parsed,
raises a BadRequestIntegerException. If the key is not present,
return the specified default value.
"""
ret = de... | [
"Attempts",
"to",
"parse",
"the",
"specified",
"key",
"in",
"the",
"specified",
"argument",
"dictionary",
"into",
"an",
"integer",
".",
"If",
"the",
"argument",
"cannot",
"be",
"parsed",
"raises",
"a",
"BadRequestIntegerException",
".",
"If",
"the",
"key",
"is... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/paging.py#L33-L49 | [
"def",
"_parseIntegerArgument",
"(",
"args",
",",
"key",
",",
"defaultValue",
")",
":",
"ret",
"=",
"defaultValue",
"try",
":",
"if",
"key",
"in",
"args",
":",
"try",
":",
"ret",
"=",
"int",
"(",
"args",
"[",
"key",
"]",
")",
"except",
"ValueError",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | IntervalIterator._initialiseIteration | Starts a new iteration. | ga4gh/server/paging.py | def _initialiseIteration(self):
"""
Starts a new iteration.
"""
self._searchIterator = self._search(
self._request.start,
self._request.end if self._request.end != 0 else None)
self._currentObject = next(self._searchIterator, None)
if self._current... | def _initialiseIteration(self):
"""
Starts a new iteration.
"""
self._searchIterator = self._search(
self._request.start,
self._request.end if self._request.end != 0 else None)
self._currentObject = next(self._searchIterator, None)
if self._current... | [
"Starts",
"a",
"new",
"iteration",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/paging.py#L83-L97 | [
"def",
"_initialiseIteration",
"(",
"self",
")",
":",
"self",
".",
"_searchIterator",
"=",
"self",
".",
"_search",
"(",
"self",
".",
"_request",
".",
"start",
",",
"self",
".",
"_request",
".",
"end",
"if",
"self",
".",
"_request",
".",
"end",
"!=",
"0... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | IntervalIterator._pickUpIteration | Picks up iteration from a previously provided page token. There are two
different phases here:
1) We are iterating over the initial set of intervals in which start
is < the search start coorindate.
2) We are iterating over the remaining intervals in which start >= to
the search s... | ga4gh/server/paging.py | def _pickUpIteration(self, searchAnchor, objectsToSkip):
"""
Picks up iteration from a previously provided page token. There are two
different phases here:
1) We are iterating over the initial set of intervals in which start
is < the search start coorindate.
2) We are ite... | def _pickUpIteration(self, searchAnchor, objectsToSkip):
"""
Picks up iteration from a previously provided page token. There are two
different phases here:
1) We are iterating over the initial set of intervals in which start
is < the search start coorindate.
2) We are ite... | [
"Picks",
"up",
"iteration",
"from",
"a",
"previously",
"provided",
"page",
"token",
".",
"There",
"are",
"two",
"different",
"phases",
"here",
":",
"1",
")",
"We",
"are",
"iterating",
"over",
"the",
"initial",
"set",
"of",
"intervals",
"in",
"which",
"star... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/paging.py#L99-L132 | [
"def",
"_pickUpIteration",
"(",
"self",
",",
"searchAnchor",
",",
"objectsToSkip",
")",
":",
"self",
".",
"_searchAnchor",
"=",
"searchAnchor",
"self",
".",
"_distanceFromAnchor",
"=",
"objectsToSkip",
"self",
".",
"_searchIterator",
"=",
"self",
".",
"_search",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | IntervalIterator.next | Returns the next (object, nextPageToken) pair. | ga4gh/server/paging.py | def next(self):
"""
Returns the next (object, nextPageToken) pair.
"""
if self._currentObject is None:
raise StopIteration()
nextPageToken = None
if self._nextObject is not None:
start = self._getStart(self._nextObject)
# If start > the... | def next(self):
"""
Returns the next (object, nextPageToken) pair.
"""
if self._currentObject is None:
raise StopIteration()
nextPageToken = None
if self._nextObject is not None:
start = self._getStart(self._nextObject)
# If start > the... | [
"Returns",
"the",
"next",
"(",
"object",
"nextPageToken",
")",
"pair",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/paging.py#L134-L155 | [
"def",
"next",
"(",
"self",
")",
":",
"if",
"self",
".",
"_currentObject",
"is",
"None",
":",
"raise",
"StopIteration",
"(",
")",
"nextPageToken",
"=",
"None",
"if",
"self",
".",
"_nextObject",
"is",
"not",
"None",
":",
"start",
"=",
"self",
".",
"_get... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | VariantAnnotationsIntervalIterator.filterVariantAnnotation | Returns true when an annotation should be included. | ga4gh/server/paging.py | def filterVariantAnnotation(self, vann):
"""
Returns true when an annotation should be included.
"""
# TODO reintroduce feature ID search
ret = False
if len(self._effects) != 0 and not vann.transcript_effects:
return False
elif len(self._effects) == 0:... | def filterVariantAnnotation(self, vann):
"""
Returns true when an annotation should be included.
"""
# TODO reintroduce feature ID search
ret = False
if len(self._effects) != 0 and not vann.transcript_effects:
return False
elif len(self._effects) == 0:... | [
"Returns",
"true",
"when",
"an",
"annotation",
"should",
"be",
"included",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/paging.py#L246-L259 | [
"def",
"filterVariantAnnotation",
"(",
"self",
",",
"vann",
")",
":",
"# TODO reintroduce feature ID search",
"ret",
"=",
"False",
"if",
"len",
"(",
"self",
".",
"_effects",
")",
"!=",
"0",
"and",
"not",
"vann",
".",
"transcript_effects",
":",
"return",
"False... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | VariantAnnotationsIntervalIterator.filterEffect | Returns true when any of the transcript effects
are present in the request. | ga4gh/server/paging.py | def filterEffect(self, teff):
"""
Returns true when any of the transcript effects
are present in the request.
"""
ret = False
for effect in teff.effects:
ret = self._matchAnyEffects(effect) or ret
return ret | def filterEffect(self, teff):
"""
Returns true when any of the transcript effects
are present in the request.
"""
ret = False
for effect in teff.effects:
ret = self._matchAnyEffects(effect) or ret
return ret | [
"Returns",
"true",
"when",
"any",
"of",
"the",
"transcript",
"effects",
"are",
"present",
"in",
"the",
"request",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/paging.py#L261-L269 | [
"def",
"filterEffect",
"(",
"self",
",",
"teff",
")",
":",
"ret",
"=",
"False",
"for",
"effect",
"in",
"teff",
".",
"effects",
":",
"ret",
"=",
"self",
".",
"_matchAnyEffects",
"(",
"effect",
")",
"or",
"ret",
"return",
"ret"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | VariantAnnotationsIntervalIterator._checkIdEquality | Tests whether a requested effect and an effect
present in an annotation are equal. | ga4gh/server/paging.py | def _checkIdEquality(self, requestedEffect, effect):
"""
Tests whether a requested effect and an effect
present in an annotation are equal.
"""
return self._idPresent(requestedEffect) and (
effect.term_id == requestedEffect.term_id) | def _checkIdEquality(self, requestedEffect, effect):
"""
Tests whether a requested effect and an effect
present in an annotation are equal.
"""
return self._idPresent(requestedEffect) and (
effect.term_id == requestedEffect.term_id) | [
"Tests",
"whether",
"a",
"requested",
"effect",
"and",
"an",
"effect",
"present",
"in",
"an",
"annotation",
"are",
"equal",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/paging.py#L271-L277 | [
"def",
"_checkIdEquality",
"(",
"self",
",",
"requestedEffect",
",",
"effect",
")",
":",
"return",
"self",
".",
"_idPresent",
"(",
"requestedEffect",
")",
"and",
"(",
"effect",
".",
"term_id",
"==",
"requestedEffect",
".",
"term_id",
")"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | ga4ghImportGlue | Call this method before importing a ga4gh module in the scripts dir.
Otherwise, you will be using the installed package instead of
the development package.
Assumes a certain directory structure. | scripts/glue.py | def ga4ghImportGlue():
"""
Call this method before importing a ga4gh module in the scripts dir.
Otherwise, you will be using the installed package instead of
the development package.
Assumes a certain directory structure.
"""
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))... | def ga4ghImportGlue():
"""
Call this method before importing a ga4gh module in the scripts dir.
Otherwise, you will be using the installed package instead of
the development package.
Assumes a certain directory structure.
"""
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))... | [
"Call",
"this",
"method",
"before",
"importing",
"a",
"ga4gh",
"module",
"in",
"the",
"scripts",
"dir",
".",
"Otherwise",
"you",
"will",
"be",
"using",
"the",
"installed",
"package",
"instead",
"of",
"the",
"development",
"package",
".",
"Assumes",
"a",
"cer... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/scripts/glue.py#L16-L24 | [
"def",
"ga4ghImportGlue",
"(",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"__file__",
")",
")",
")",
"sys",
".",
"path",
".",
"append",
"(",
"path... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | PysamFileHandleCache._update | Update the priority of the file handle. The element is first
removed and then added to the left of the deque. | ga4gh/server/datamodel/__init__.py | def _update(self, dataFile, handle):
"""
Update the priority of the file handle. The element is first
removed and then added to the left of the deque.
"""
self._cache.remove((dataFile, handle))
self._add(dataFile, handle) | def _update(self, dataFile, handle):
"""
Update the priority of the file handle. The element is first
removed and then added to the left of the deque.
"""
self._cache.remove((dataFile, handle))
self._add(dataFile, handle) | [
"Update",
"the",
"priority",
"of",
"the",
"file",
"handle",
".",
"The",
"element",
"is",
"first",
"removed",
"and",
"then",
"added",
"to",
"the",
"left",
"of",
"the",
"deque",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/__init__.py#L50-L56 | [
"def",
"_update",
"(",
"self",
",",
"dataFile",
",",
"handle",
")",
":",
"self",
".",
"_cache",
".",
"remove",
"(",
"(",
"dataFile",
",",
"handle",
")",
")",
"self",
".",
"_add",
"(",
"dataFile",
",",
"handle",
")"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | PysamFileHandleCache._removeLru | Remove the least recently used file handle from the cache.
The pop method removes an element from the right of the deque.
Returns the name of the file that has been removed. | ga4gh/server/datamodel/__init__.py | def _removeLru(self):
"""
Remove the least recently used file handle from the cache.
The pop method removes an element from the right of the deque.
Returns the name of the file that has been removed.
"""
(dataFile, handle) = self._cache.pop()
handle.close()
... | def _removeLru(self):
"""
Remove the least recently used file handle from the cache.
The pop method removes an element from the right of the deque.
Returns the name of the file that has been removed.
"""
(dataFile, handle) = self._cache.pop()
handle.close()
... | [
"Remove",
"the",
"least",
"recently",
"used",
"file",
"handle",
"from",
"the",
"cache",
".",
"The",
"pop",
"method",
"removes",
"an",
"element",
"from",
"the",
"right",
"of",
"the",
"deque",
".",
"Returns",
"the",
"name",
"of",
"the",
"file",
"that",
"ha... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/__init__.py#L58-L66 | [
"def",
"_removeLru",
"(",
"self",
")",
":",
"(",
"dataFile",
",",
"handle",
")",
"=",
"self",
".",
"_cache",
".",
"pop",
"(",
")",
"handle",
".",
"close",
"(",
")",
"return",
"dataFile"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | PysamFileHandleCache.getFileHandle | Returns handle associated to the filename. If the file is
already opened, update its priority in the cache and return
its handle. Otherwise, open the file using openMethod, store
it in the cache and return the corresponding handle. | ga4gh/server/datamodel/__init__.py | def getFileHandle(self, dataFile, openMethod):
"""
Returns handle associated to the filename. If the file is
already opened, update its priority in the cache and return
its handle. Otherwise, open the file using openMethod, store
it in the cache and return the corresponding handl... | def getFileHandle(self, dataFile, openMethod):
"""
Returns handle associated to the filename. If the file is
already opened, update its priority in the cache and return
its handle. Otherwise, open the file using openMethod, store
it in the cache and return the corresponding handl... | [
"Returns",
"handle",
"associated",
"to",
"the",
"filename",
".",
"If",
"the",
"file",
"is",
"already",
"opened",
"update",
"its",
"priority",
"in",
"the",
"cache",
"and",
"return",
"its",
"handle",
".",
"Otherwise",
"open",
"the",
"file",
"using",
"openMetho... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/__init__.py#L68-L90 | [
"def",
"getFileHandle",
"(",
"self",
",",
"dataFile",
",",
"openMethod",
")",
":",
"if",
"dataFile",
"in",
"self",
".",
"_memoTable",
":",
"handle",
"=",
"self",
".",
"_memoTable",
"[",
"dataFile",
"]",
"self",
".",
"_update",
"(",
"dataFile",
",",
"hand... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | CompoundId.join | Join an array of ids into a compound id string | ga4gh/server/datamodel/__init__.py | def join(cls, splits):
"""
Join an array of ids into a compound id string
"""
segments = []
for split in splits:
segments.append('"{}",'.format(split))
if len(segments) > 0:
segments[-1] = segments[-1][:-1]
jsonString = '[{}]'.format(''.joi... | def join(cls, splits):
"""
Join an array of ids into a compound id string
"""
segments = []
for split in splits:
segments.append('"{}",'.format(split))
if len(segments) > 0:
segments[-1] = segments[-1][:-1]
jsonString = '[{}]'.format(''.joi... | [
"Join",
"an",
"array",
"of",
"ids",
"into",
"a",
"compound",
"id",
"string"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/__init__.py#L172-L182 | [
"def",
"join",
"(",
"cls",
",",
"splits",
")",
":",
"segments",
"=",
"[",
"]",
"for",
"split",
"in",
"splits",
":",
"segments",
".",
"append",
"(",
"'\"{}\",'",
".",
"format",
"(",
"split",
")",
")",
"if",
"len",
"(",
"segments",
")",
">",
"0",
"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | CompoundId.parse | Parses the specified compoundId string and returns an instance
of this CompoundId class.
:raises: An ObjectWithIdNotFoundException if parsing fails. This is
because this method is a client-facing method, and if a malformed
identifier (under our internal rules) is provided, the response ... | ga4gh/server/datamodel/__init__.py | def parse(cls, compoundIdStr):
"""
Parses the specified compoundId string and returns an instance
of this CompoundId class.
:raises: An ObjectWithIdNotFoundException if parsing fails. This is
because this method is a client-facing method, and if a malformed
identifier (u... | def parse(cls, compoundIdStr):
"""
Parses the specified compoundId string and returns an instance
of this CompoundId class.
:raises: An ObjectWithIdNotFoundException if parsing fails. This is
because this method is a client-facing method, and if a malformed
identifier (u... | [
"Parses",
"the",
"specified",
"compoundId",
"string",
"and",
"returns",
"an",
"instance",
"of",
"this",
"CompoundId",
"class",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/__init__.py#L207-L247 | [
"def",
"parse",
"(",
"cls",
",",
"compoundIdStr",
")",
":",
"if",
"not",
"isinstance",
"(",
"compoundIdStr",
",",
"basestring",
")",
":",
"raise",
"exceptions",
".",
"BadIdentifierException",
"(",
"compoundIdStr",
")",
"try",
":",
"deobfuscated",
"=",
"cls",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | CompoundId.obfuscate | Mildly obfuscates the specified ID string in an easily reversible
fashion. This is not intended for security purposes, but rather to
dissuade users from depending on our internal ID structures. | ga4gh/server/datamodel/__init__.py | def obfuscate(cls, idStr):
"""
Mildly obfuscates the specified ID string in an easily reversible
fashion. This is not intended for security purposes, but rather to
dissuade users from depending on our internal ID structures.
"""
return unicode(base64.urlsafe_b64encode(
... | def obfuscate(cls, idStr):
"""
Mildly obfuscates the specified ID string in an easily reversible
fashion. This is not intended for security purposes, but rather to
dissuade users from depending on our internal ID structures.
"""
return unicode(base64.urlsafe_b64encode(
... | [
"Mildly",
"obfuscates",
"the",
"specified",
"ID",
"string",
"in",
"an",
"easily",
"reversible",
"fashion",
".",
"This",
"is",
"not",
"intended",
"for",
"security",
"purposes",
"but",
"rather",
"to",
"dissuade",
"users",
"from",
"depending",
"on",
"our",
"inter... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/__init__.py#L250-L257 | [
"def",
"obfuscate",
"(",
"cls",
",",
"idStr",
")",
":",
"return",
"unicode",
"(",
"base64",
".",
"urlsafe_b64encode",
"(",
"idStr",
".",
"encode",
"(",
"'utf-8'",
")",
")",
".",
"replace",
"(",
"b'='",
",",
"b''",
")",
")"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | CompoundId.deobfuscate | Reverses the obfuscation done by the :meth:`obfuscate` method.
If an identifier arrives without correct base64 padding this
function will append it to the end. | ga4gh/server/datamodel/__init__.py | def deobfuscate(cls, data):
"""
Reverses the obfuscation done by the :meth:`obfuscate` method.
If an identifier arrives without correct base64 padding this
function will append it to the end.
"""
# the str() call is necessary to convert the unicode string
# to an ... | def deobfuscate(cls, data):
"""
Reverses the obfuscation done by the :meth:`obfuscate` method.
If an identifier arrives without correct base64 padding this
function will append it to the end.
"""
# the str() call is necessary to convert the unicode string
# to an ... | [
"Reverses",
"the",
"obfuscation",
"done",
"by",
"the",
":",
"meth",
":",
"obfuscate",
"method",
".",
"If",
"an",
"identifier",
"arrives",
"without",
"correct",
"base64",
"padding",
"this",
"function",
"will",
"append",
"it",
"to",
"the",
"end",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/__init__.py#L260-L270 | [
"def",
"deobfuscate",
"(",
"cls",
",",
"data",
")",
":",
"# the str() call is necessary to convert the unicode string",
"# to an ascii string since the urlsafe_b64decode method",
"# sometimes chokes on unicode strings",
"return",
"base64",
".",
"urlsafe_b64decode",
"(",
"str",
"(",... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | DatamodelObject.serializeAttributes | Sets the attrbutes of a message during serialization. | ga4gh/server/datamodel/__init__.py | def serializeAttributes(self, msg):
"""
Sets the attrbutes of a message during serialization.
"""
attributes = self.getAttributes()
for key in attributes:
protocol.setAttribute(
msg.attributes.attr[key].values, attributes[key])
return msg | def serializeAttributes(self, msg):
"""
Sets the attrbutes of a message during serialization.
"""
attributes = self.getAttributes()
for key in attributes:
protocol.setAttribute(
msg.attributes.attr[key].values, attributes[key])
return msg | [
"Sets",
"the",
"attrbutes",
"of",
"a",
"message",
"during",
"serialization",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/__init__.py#L539-L547 | [
"def",
"serializeAttributes",
"(",
"self",
",",
"msg",
")",
":",
"attributes",
"=",
"self",
".",
"getAttributes",
"(",
")",
"for",
"key",
"in",
"attributes",
":",
"protocol",
".",
"setAttribute",
"(",
"msg",
".",
"attributes",
".",
"attr",
"[",
"key",
"]... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | DatamodelObject._scanDataFiles | Scans the specified directory for files with the specified globbing
pattern and calls self._addDataFile for each. Raises an
EmptyDirException if no data files are found. | ga4gh/server/datamodel/__init__.py | def _scanDataFiles(self, dataDir, patterns):
"""
Scans the specified directory for files with the specified globbing
pattern and calls self._addDataFile for each. Raises an
EmptyDirException if no data files are found.
"""
numDataFiles = 0
for pattern in patterns:... | def _scanDataFiles(self, dataDir, patterns):
"""
Scans the specified directory for files with the specified globbing
pattern and calls self._addDataFile for each. Raises an
EmptyDirException if no data files are found.
"""
numDataFiles = 0
for pattern in patterns:... | [
"Scans",
"the",
"specified",
"directory",
"for",
"files",
"with",
"the",
"specified",
"globbing",
"pattern",
"and",
"calls",
"self",
".",
"_addDataFile",
"for",
"each",
".",
"Raises",
"an",
"EmptyDirException",
"if",
"no",
"data",
"files",
"are",
"found",
"."
... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/__init__.py#L555-L568 | [
"def",
"_scanDataFiles",
"(",
"self",
",",
"dataDir",
",",
"patterns",
")",
":",
"numDataFiles",
"=",
"0",
"for",
"pattern",
"in",
"patterns",
":",
"scanPath",
"=",
"os",
".",
"path",
".",
"join",
"(",
"dataDir",
",",
"pattern",
")",
"for",
"filename",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | getInitialPeerList | Attempts to get a list of peers from a file specified in configuration.
This file has one URL per line and can contain newlines and comments.
# Main ga4gh node
http://1kgenomes.ga4gh.org
# Local intranet peer
https://192.168.1.1
The server will attempt to add URLs in this file... | ga4gh/server/network/__init__.py | def getInitialPeerList(filePath, logger=None):
"""
Attempts to get a list of peers from a file specified in configuration.
This file has one URL per line and can contain newlines and comments.
# Main ga4gh node
http://1kgenomes.ga4gh.org
# Local intranet peer
https://192.16... | def getInitialPeerList(filePath, logger=None):
"""
Attempts to get a list of peers from a file specified in configuration.
This file has one URL per line and can contain newlines and comments.
# Main ga4gh node
http://1kgenomes.ga4gh.org
# Local intranet peer
https://192.16... | [
"Attempts",
"to",
"get",
"a",
"list",
"of",
"peers",
"from",
"a",
"file",
"specified",
"in",
"configuration",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/network/__init__.py#L15-L39 | [
"def",
"getInitialPeerList",
"(",
"filePath",
",",
"logger",
"=",
"None",
")",
":",
"ret",
"=",
"[",
"]",
"with",
"open",
"(",
"filePath",
")",
"as",
"textFile",
":",
"ret",
"=",
"textFile",
".",
"readlines",
"(",
")",
"if",
"len",
"(",
"ret",
")",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | insertInitialPeer | Takes the datarepository, a url, and an optional logger and attempts
to add the peer into the repository. | ga4gh/server/network/__init__.py | def insertInitialPeer(dataRepository, url, logger=None):
"""
Takes the datarepository, a url, and an optional logger and attempts
to add the peer into the repository.
"""
insertPeer = dataRepository.insertPeer
try:
peer = datamodel.peers.Peer(url)
insertPeer(peer)
except exce... | def insertInitialPeer(dataRepository, url, logger=None):
"""
Takes the datarepository, a url, and an optional logger and attempts
to add the peer into the repository.
"""
insertPeer = dataRepository.insertPeer
try:
peer = datamodel.peers.Peer(url)
insertPeer(peer)
except exce... | [
"Takes",
"the",
"datarepository",
"a",
"url",
"and",
"an",
"optional",
"logger",
"and",
"attempts",
"to",
"add",
"the",
"peer",
"into",
"the",
"repository",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/network/__init__.py#L42-L58 | [
"def",
"insertInitialPeer",
"(",
"dataRepository",
",",
"url",
",",
"logger",
"=",
"None",
")",
":",
"insertPeer",
"=",
"dataRepository",
".",
"insertPeer",
"try",
":",
"peer",
"=",
"datamodel",
".",
"peers",
".",
"Peer",
"(",
"url",
")",
"insertPeer",
"("... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | isUrl | Attempts to return whether a given URL string is valid by checking
for the presence of the URL scheme and netloc using the urlparse
module, and then using a regex.
From http://stackoverflow.com/questions/7160737/ | ga4gh/server/datamodel/peers.py | def isUrl(urlString):
"""
Attempts to return whether a given URL string is valid by checking
for the presence of the URL scheme and netloc using the urlparse
module, and then using a regex.
From http://stackoverflow.com/questions/7160737/
"""
parsed = urlparse.urlparse(urlString)
urlpar... | def isUrl(urlString):
"""
Attempts to return whether a given URL string is valid by checking
for the presence of the URL scheme and netloc using the urlparse
module, and then using a regex.
From http://stackoverflow.com/questions/7160737/
"""
parsed = urlparse.urlparse(urlString)
urlpar... | [
"Attempts",
"to",
"return",
"whether",
"a",
"given",
"URL",
"string",
"is",
"valid",
"by",
"checking",
"for",
"the",
"presence",
"of",
"the",
"URL",
"scheme",
"and",
"netloc",
"using",
"the",
"urlparse",
"module",
"and",
"then",
"using",
"a",
"regex",
"."
... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/peers.py#L17-L36 | [
"def",
"isUrl",
"(",
"urlString",
")",
":",
"parsed",
"=",
"urlparse",
".",
"urlparse",
"(",
"urlString",
")",
"urlparseValid",
"=",
"parsed",
".",
"netloc",
"!=",
"''",
"and",
"parsed",
".",
"scheme",
"!=",
"''",
"regex",
"=",
"re",
".",
"compile",
"(... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Peer.setUrl | Attempt to safely set the URL by string. | ga4gh/server/datamodel/peers.py | def setUrl(self, url):
"""
Attempt to safely set the URL by string.
"""
if isUrl(url):
self._url = url
else:
raise exceptions.BadUrlException(url)
return self | def setUrl(self, url):
"""
Attempt to safely set the URL by string.
"""
if isUrl(url):
self._url = url
else:
raise exceptions.BadUrlException(url)
return self | [
"Attempt",
"to",
"safely",
"set",
"the",
"URL",
"by",
"string",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/peers.py#L53-L61 | [
"def",
"setUrl",
"(",
"self",
",",
"url",
")",
":",
"if",
"isUrl",
"(",
"url",
")",
":",
"self",
".",
"_url",
"=",
"url",
"else",
":",
"raise",
"exceptions",
".",
"BadUrlException",
"(",
"url",
")",
"return",
"self"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Peer.setAttributesJson | Sets the attributes dictionary from a JSON string. | ga4gh/server/datamodel/peers.py | def setAttributesJson(self, attributesJson):
"""
Sets the attributes dictionary from a JSON string.
"""
try:
self._attributes = json.loads(attributesJson)
except:
raise exceptions.InvalidJsonException(attributesJson)
return self | def setAttributesJson(self, attributesJson):
"""
Sets the attributes dictionary from a JSON string.
"""
try:
self._attributes = json.loads(attributesJson)
except:
raise exceptions.InvalidJsonException(attributesJson)
return self | [
"Sets",
"the",
"attributes",
"dictionary",
"from",
"a",
"JSON",
"string",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/peers.py#L73-L81 | [
"def",
"setAttributesJson",
"(",
"self",
",",
"attributesJson",
")",
":",
"try",
":",
"self",
".",
"_attributes",
"=",
"json",
".",
"loads",
"(",
"attributesJson",
")",
"except",
":",
"raise",
"exceptions",
".",
"InvalidJsonException",
"(",
"attributesJson",
"... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Peer.populateFromRow | This method accepts a model record and sets class variables. | ga4gh/server/datamodel/peers.py | def populateFromRow(self, peerRecord):
"""
This method accepts a model record and sets class variables.
"""
self.setUrl(peerRecord.url) \
.setAttributesJson(peerRecord.attributes)
return self | def populateFromRow(self, peerRecord):
"""
This method accepts a model record and sets class variables.
"""
self.setUrl(peerRecord.url) \
.setAttributesJson(peerRecord.attributes)
return self | [
"This",
"method",
"accepts",
"a",
"model",
"record",
"and",
"sets",
"class",
"variables",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/datamodel/peers.py#L105-L111 | [
"def",
"populateFromRow",
"(",
"self",
",",
"peerRecord",
")",
":",
"self",
".",
"setUrl",
"(",
"peerRecord",
".",
"url",
")",
".",
"setAttributesJson",
"(",
"peerRecord",
".",
"attributes",
")",
"return",
"self"
] | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Backend._topLevelObjectGenerator | Returns a generator over the results for the specified request, which
is over a set of objects of the specified size. The objects are
returned by call to the specified method, which must take a single
integer as an argument. The returned generator yields a sequence of
(object, nextPageTo... | ga4gh/server/backend.py | def _topLevelObjectGenerator(self, request, numObjects, getByIndexMethod):
"""
Returns a generator over the results for the specified request, which
is over a set of objects of the specified size. The objects are
returned by call to the specified method, which must take a single
... | def _topLevelObjectGenerator(self, request, numObjects, getByIndexMethod):
"""
Returns a generator over the results for the specified request, which
is over a set of objects of the specified size. The objects are
returned by call to the specified method, which must take a single
... | [
"Returns",
"a",
"generator",
"over",
"the",
"results",
"for",
"the",
"specified",
"request",
"which",
"is",
"over",
"a",
"set",
"of",
"objects",
"of",
"the",
"specified",
"size",
".",
"The",
"objects",
"are",
"returned",
"by",
"call",
"to",
"the",
"specifi... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/backend.py#L74-L93 | [
"def",
"_topLevelObjectGenerator",
"(",
"self",
",",
"request",
",",
"numObjects",
",",
"getByIndexMethod",
")",
":",
"currentIndex",
"=",
"0",
"if",
"request",
".",
"page_token",
":",
"currentIndex",
",",
"=",
"paging",
".",
"_parsePageToken",
"(",
"request",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Backend._protocolObjectGenerator | Returns a generator over the results for the specified request, from
a set of protocol objects of the specified size. The objects are
returned by call to the specified method, which must take a single
integer as an argument. The returned generator yields a sequence of
(object, nextPageTo... | ga4gh/server/backend.py | def _protocolObjectGenerator(self, request, numObjects, getByIndexMethod):
"""
Returns a generator over the results for the specified request, from
a set of protocol objects of the specified size. The objects are
returned by call to the specified method, which must take a single
... | def _protocolObjectGenerator(self, request, numObjects, getByIndexMethod):
"""
Returns a generator over the results for the specified request, from
a set of protocol objects of the specified size. The objects are
returned by call to the specified method, which must take a single
... | [
"Returns",
"a",
"generator",
"over",
"the",
"results",
"for",
"the",
"specified",
"request",
"from",
"a",
"set",
"of",
"protocol",
"objects",
"of",
"the",
"specified",
"size",
".",
"The",
"objects",
"are",
"returned",
"by",
"call",
"to",
"the",
"specified",
... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/backend.py#L95-L114 | [
"def",
"_protocolObjectGenerator",
"(",
"self",
",",
"request",
",",
"numObjects",
",",
"getByIndexMethod",
")",
":",
"currentIndex",
"=",
"0",
"if",
"request",
".",
"page_token",
":",
"currentIndex",
",",
"=",
"paging",
".",
"_parsePageToken",
"(",
"request",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Backend._protocolListGenerator | Returns a generator over the objects in the specified list using
_protocolObjectGenerator to generate page tokens. | ga4gh/server/backend.py | def _protocolListGenerator(self, request, objectList):
"""
Returns a generator over the objects in the specified list using
_protocolObjectGenerator to generate page tokens.
"""
return self._protocolObjectGenerator(
request, len(objectList), lambda index: objectList[i... | def _protocolListGenerator(self, request, objectList):
"""
Returns a generator over the objects in the specified list using
_protocolObjectGenerator to generate page tokens.
"""
return self._protocolObjectGenerator(
request, len(objectList), lambda index: objectList[i... | [
"Returns",
"a",
"generator",
"over",
"the",
"objects",
"in",
"the",
"specified",
"list",
"using",
"_protocolObjectGenerator",
"to",
"generate",
"page",
"tokens",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/backend.py#L116-L122 | [
"def",
"_protocolListGenerator",
"(",
"self",
",",
"request",
",",
"objectList",
")",
":",
"return",
"self",
".",
"_protocolObjectGenerator",
"(",
"request",
",",
"len",
"(",
"objectList",
")",
",",
"lambda",
"index",
":",
"objectList",
"[",
"index",
"]",
")... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Backend._objectListGenerator | Returns a generator over the objects in the specified list using
_topLevelObjectGenerator to generate page tokens. | ga4gh/server/backend.py | def _objectListGenerator(self, request, objectList):
"""
Returns a generator over the objects in the specified list using
_topLevelObjectGenerator to generate page tokens.
"""
return self._topLevelObjectGenerator(
request, len(objectList), lambda index: objectList[ind... | def _objectListGenerator(self, request, objectList):
"""
Returns a generator over the objects in the specified list using
_topLevelObjectGenerator to generate page tokens.
"""
return self._topLevelObjectGenerator(
request, len(objectList), lambda index: objectList[ind... | [
"Returns",
"a",
"generator",
"over",
"the",
"objects",
"in",
"the",
"specified",
"list",
"using",
"_topLevelObjectGenerator",
"to",
"generate",
"page",
"tokens",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/backend.py#L124-L130 | [
"def",
"_objectListGenerator",
"(",
"self",
",",
"request",
",",
"objectList",
")",
":",
"return",
"self",
".",
"_topLevelObjectGenerator",
"(",
"request",
",",
"len",
"(",
"objectList",
")",
",",
"lambda",
"index",
":",
"objectList",
"[",
"index",
"]",
")"
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Backend.datasetsGenerator | Returns a generator over the (dataset, nextPageToken) pairs
defined by the specified request | ga4gh/server/backend.py | def datasetsGenerator(self, request):
"""
Returns a generator over the (dataset, nextPageToken) pairs
defined by the specified request
"""
return self._topLevelObjectGenerator(
request, self.getDataRepository().getNumDatasets(),
self.getDataRepository().ge... | def datasetsGenerator(self, request):
"""
Returns a generator over the (dataset, nextPageToken) pairs
defined by the specified request
"""
return self._topLevelObjectGenerator(
request, self.getDataRepository().getNumDatasets(),
self.getDataRepository().ge... | [
"Returns",
"a",
"generator",
"over",
"the",
"(",
"dataset",
"nextPageToken",
")",
"pairs",
"defined",
"by",
"the",
"specified",
"request"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/backend.py#L132-L139 | [
"def",
"datasetsGenerator",
"(",
"self",
",",
"request",
")",
":",
"return",
"self",
".",
"_topLevelObjectGenerator",
"(",
"request",
",",
"self",
".",
"getDataRepository",
"(",
")",
".",
"getNumDatasets",
"(",
")",
",",
"self",
".",
"getDataRepository",
"(",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Backend.phenotypeAssociationSetsGenerator | Returns a generator over the (phenotypeAssociationSet, nextPageToken)
pairs defined by the specified request | ga4gh/server/backend.py | def phenotypeAssociationSetsGenerator(self, request):
"""
Returns a generator over the (phenotypeAssociationSet, nextPageToken)
pairs defined by the specified request
"""
dataset = self.getDataRepository().getDataset(request.dataset_id)
return self._topLevelObjectGenerato... | def phenotypeAssociationSetsGenerator(self, request):
"""
Returns a generator over the (phenotypeAssociationSet, nextPageToken)
pairs defined by the specified request
"""
dataset = self.getDataRepository().getDataset(request.dataset_id)
return self._topLevelObjectGenerato... | [
"Returns",
"a",
"generator",
"over",
"the",
"(",
"phenotypeAssociationSet",
"nextPageToken",
")",
"pairs",
"defined",
"by",
"the",
"specified",
"request"
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/backend.py#L168-L176 | [
"def",
"phenotypeAssociationSetsGenerator",
"(",
"self",
",",
"request",
")",
":",
"dataset",
"=",
"self",
".",
"getDataRepository",
"(",
")",
".",
"getDataset",
"(",
"request",
".",
"dataset_id",
")",
"return",
"self",
".",
"_topLevelObjectGenerator",
"(",
"req... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Backend.readGroupSetsGenerator | Returns a generator over the (readGroupSet, nextPageToken) pairs
defined by the specified request. | ga4gh/server/backend.py | def readGroupSetsGenerator(self, request):
"""
Returns a generator over the (readGroupSet, nextPageToken) pairs
defined by the specified request.
"""
dataset = self.getDataRepository().getDataset(request.dataset_id)
return self._readGroupSetsGenerator(
request... | def readGroupSetsGenerator(self, request):
"""
Returns a generator over the (readGroupSet, nextPageToken) pairs
defined by the specified request.
"""
dataset = self.getDataRepository().getDataset(request.dataset_id)
return self._readGroupSetsGenerator(
request... | [
"Returns",
"a",
"generator",
"over",
"the",
"(",
"readGroupSet",
"nextPageToken",
")",
"pairs",
"defined",
"by",
"the",
"specified",
"request",
"."
] | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/backend.py#L178-L186 | [
"def",
"readGroupSetsGenerator",
"(",
"self",
",",
"request",
")",
":",
"dataset",
"=",
"self",
".",
"getDataRepository",
"(",
")",
".",
"getDataset",
"(",
"request",
".",
"dataset_id",
")",
"return",
"self",
".",
"_readGroupSetsGenerator",
"(",
"request",
","... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
train | Backend._readGroupSetsGenerator | Returns a generator over the results for the specified request, which
is over a set of objects of the specified size. The objects are
returned by call to the specified method, which must take a single
integer as an argument. The returned generator yields a sequence of
(object, nextPageTo... | ga4gh/server/backend.py | def _readGroupSetsGenerator(self, request, numObjects, getByIndexMethod):
"""
Returns a generator over the results for the specified request, which
is over a set of objects of the specified size. The objects are
returned by call to the specified method, which must take a single
i... | def _readGroupSetsGenerator(self, request, numObjects, getByIndexMethod):
"""
Returns a generator over the results for the specified request, which
is over a set of objects of the specified size. The objects are
returned by call to the specified method, which must take a single
i... | [
"Returns",
"a",
"generator",
"over",
"the",
"results",
"for",
"the",
"specified",
"request",
"which",
"is",
"over",
"a",
"set",
"of",
"objects",
"of",
"the",
"specified",
"size",
".",
"The",
"objects",
"are",
"returned",
"by",
"call",
"to",
"the",
"specifi... | ga4gh/ga4gh-server | python | https://github.com/ga4gh/ga4gh-server/blob/1aa18922ef136db8604f6f098cb1732cba6f2a76/ga4gh/server/backend.py#L188-L223 | [
"def",
"_readGroupSetsGenerator",
"(",
"self",
",",
"request",
",",
"numObjects",
",",
"getByIndexMethod",
")",
":",
"currentIndex",
"=",
"0",
"if",
"request",
".",
"page_token",
":",
"currentIndex",
",",
"=",
"paging",
".",
"_parsePageToken",
"(",
"request",
... | 1aa18922ef136db8604f6f098cb1732cba6f2a76 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.