本文整理汇总了Python中dipper.utils.GraphUtils.GraphUtils.addMember方法的典型用法代码示例。如果您正苦于以下问题:Python GraphUtils.addMember方法的具体用法?Python GraphUtils.addMember怎么用?Python GraphUtils.addMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dipper.utils.GraphUtils.GraphUtils
的用法示例。
在下文中一共展示了GraphUtils.addMember方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _process_data
# 需要导入模块: from dipper.utils.GraphUtils import GraphUtils [as 别名]
# 或者: from dipper.utils.GraphUtils.GraphUtils import addMember [as 别名]
#.........这里部分代码省略.........
patient_label = ' '.join((affected, gender, relprob))
if relprob == 'proband':
patient_label = \
' '.join(
(patient_label.strip(), 'with', short_desc))
else:
patient_label = \
' '.join(
(patient_label.strip(), 'of proband with',
short_desc))
# ############# BUILD THE CELL LINE #############
# Adding the cell line as a typed individual.
cell_line_reagent_id = 'CLO:0000031'
gu.addIndividualToGraph(
g, cell_line_id, line_label, cell_line_reagent_id)
# add the equivalent id == dna_ref
if dna_ref != '' and dna_ref != catalog_id:
equiv_cell_line = 'Coriell:'+dna_ref
# some of the equivalent ids are not defined
# in the source data; so add them
gu.addIndividualToGraph(
g, equiv_cell_line, None, cell_line_reagent_id)
gu.addSameIndividual(g, cell_line_id, equiv_cell_line)
# Cell line derives from patient
geno.addDerivesFrom(cell_line_id, patient_id)
geno.addDerivesFrom(cell_line_id, cell_type)
# Cell line a member of repository
gu.addMember(g, repository, cell_line_id)
if cat_remark != '':
gu.addDescription(g, cell_line_id, cat_remark)
# Cell age_at_sampling
# TODO add the age nodes when modeled properly in #78
# if (age != ''):
# this would give a BNode that is an instance of Age.
# but i don't know how to connect
# the age node to the cell line? we need to ask @mbrush
# age_id = '_'+re.sub('\s+','_',age)
# gu.addIndividualToGraph(
# g,age_id,age,self.terms['age'])
# gu.addTriple(
# g,age_id,self.properties['has_measurement'],age,
# True)
# ############# BUILD THE PATIENT #############
# Add the patient ID as an individual.
gu.addPerson(g, patient_id, patient_label)
# TODO map relationship to proband as a class
# (what ontology?)
# Add race of patient
# FIXME: Adjust for subcategories based on ethnicity field
# EDIT: There are 743 different entries for ethnicity...
# Too many to map?
# Add ethnicity as literal in addition to the mapped race?
# Adjust the ethnicity txt (if using)
# to initial capitalization to remove ALLCAPS
示例2: Genotype
# 需要导入模块: from dipper.utils.GraphUtils import GraphUtils [as 别名]
# 或者: from dipper.utils.GraphUtils.GraphUtils import addMember [as 别名]
#.........这里部分代码省略.........
This will create the instance of a gene that is targeted by a molecular reagent (such as a morpholino or rnai).
If an instance id is not supplied, we will create it as an anonymous individual which is of the
type GENO:reagent_targeted_gene. We will also add the targets relationship between the reagent and gene class.
<targeted_gene_id> a GENO:reagent_targeted_gene
rdf:label targeted_gene_label
dc:description description
<reagent_id> GENO:targets_instance_of <gene_id>
:param reagent_id:
:param gene_id:
:param targeted_gene_id:
:return:
"""
# akin to a variant locus
if (targeted_gene_id is None):
targeted_gene_id = '_' + gene_id + '-' + reagent_id
self.gu.addIndividualToGraph(self.graph, targeted_gene_id, targeted_gene_label,
self.genoparts['reagent_targeted_gene'], description)
self.gu.addTriple(self.graph, targeted_gene_id,
self.object_properties['is_targeted_expression_variant_of'], gene_id)
self.gu.addTriple(self.graph, targeted_gene_id, self.object_properties['targeted_by'], reagent_id)
return
def addTargetedGeneSubregion(self, tgs_id, tgs_label, tgs_type=None, tgs_description=None):
if tgs_type is None:
tgs_type = self.genoparts['targeted_gene_subregion']
self.gu.addIndividualToGraph(self.graph, tgs_id, tgs_label, tgs_type, tgs_description)
def addMemberOfPopulation(self, member_id, population_id):
self.gu.addTriple(self.graph, population_id,
self.properties['has_member_with_allelotype'], member_id)
return
def addTargetedGeneComplement(self, tgc_id, tgc_label, tgc_type=None, tgc_description=None):
if tgc_type is None:
tgc_type = self.genoparts['targeted_gene_complement']
self.gu.addIndividualToGraph(self.graph, tgc_id, tgc_label, tgc_type, tgc_description)
return
def addGenome(self, taxon_id, taxon_label=None):
if taxon_label is None:
taxon_label = taxon_id
genome_label = taxon_label+' genome'
genome_id = self.makeGenomeID(taxon_id)
self.gu.addClassToGraph(self.graph, genome_id, genome_label, Feature.types['genome'])
return
def addReferenceGenome(self, build_id, build_label, taxon_id):
genome_id = self.makeGenomeID(taxon_id)
self.gu.addIndividualToGraph(self.graph, build_id, build_label, Feature.types['reference_genome'])
self.gu.addType(self.graph, build_id, genome_id)
self.addTaxon(taxon_id, build_id)
return
def makeGenomeID(self, taxon_id):