dipper.models.Genotype module¶
-
class
dipper.models.Genotype.
Genotype
(graph)¶ Bases:
object
These methods provide convenient methods to add items related to a genotype and it’s parts to a supplied graph. They follow the patterns set out in GENO https://github.com/monarch-initiative/GENO-ontology. For specific sequence features, we use the GenomicFeature class to create them.
-
addAffectedLocus
(allele_id, gene_id, rel_id=None)¶ We make the assumption here that if the relationship is not provided, it is a GENO:has_affected_feature.
Here, the allele should be a variant_locus, not a sequence alteration. :param allele_id: :param gene_id: :param rel_id: :return:
-
addAllele
(allele_id, allele_label, allele_type=None, allele_description=None)¶ Make an allele object. If no allele_type is added, it will default to a geno:allele :param allele_id: curie for allele (required) :param allele_label: label for allele (required) :param allele_type: id for an allele type (optional, recommended SO or GENO class) :param allele_description: a free-text description of the allele :return:
-
addAlleleOfGene
(allele_id, gene_id, rel_id=None)¶ We make the assumption here that if the relationship is not provided, it is a GENO:is_allele_of.
Here, the allele should be a variant_locus, not a sequence alteration. :param allele_id: :param gene_id: :param rel_id: :return:
-
addChromosome
(chrom, tax_id, tax_label=None, build_id=None, build_label=None)¶ if it’s just the chromosome, add it as an instance of a SO:chromosome, and add it to the genome. If a build is included, punn the chromosome as a subclass of SO:chromsome, and make the build-specific chromosome an instance of the supplied chr. The chr then becomes part of the build or genome.
-
addChromosomeClass
(chrom_num, taxon_id, taxon_label)¶
-
addChromosomeInstance
(chr_num, reference_id, reference_label, chr_type=None)¶ Add the supplied chromosome as an instance within the given reference :param chr_num: :param reference_id: for example, a build id like UCSC:hg19 :param reference_label: :param chr_type: this is the class that this is an instance of. typically a genome-specific chr
Returns:
-
addConstruct
(construct_id, construct_label, construct_type=None, construct_description=None, construct_category=None, construct_type_category=None)¶ Parameters: - construct_id –
- construct_label –
- construct_type –
- construct_description –
- construct_category – a biolink category CURIE for construct_id
- construct_type_category – a biolink category CURIE for construct_type
Returns:
-
addDerivesFrom
(child_id, parent_id, child_category=None, parent_category=None)¶ We add a derives_from relationship between the child and parent id. Examples of uses include between: an allele and a construct or strain here, a cell line and it’s parent genotype. Adding the parent and child to the graph should happen outside of this function call to ensure graph integrity. :param child_id: :param parent_id: :return:
-
addGene
(gene_id, gene_label=None, gene_type=None, gene_description=None)¶ genes are classes
-
addGeneProduct
(sequence_id, product_id, product_label=None, product_type=None, sequence_category=None, product_category=None)¶ Add gene/variant/allele has_gene_product relationship Can be used to either describe a gene to transcript relationship or gene to protein :param sequence_id: :param product_id: :param product_label: :param product_type: :param sequence_category: bl category CURIE for seq_id [blv.terms.Gene].value :param product_category: biolink category CURIE for product_id :return:
-
addGeneTargetingReagent
(reagent_id, reagent_label, reagent_type, gene_id, description=None, reagent_category=None)¶ Here, a gene-targeting reagent is added. The actual targets of this reagent should be added separately. :param reagent_id: :param reagent_label: :param reagent_type:
Returns:
-
addGeneTargetingReagentToGenotype
(reagent_id, genotype_id)¶ Add genotype has_variant_part reagent_id. For example, add a morphant reagent thingy to the genotype, assuming it’s a extrinsic_genotype Also a triple to assign biolink categories to genotype and reagent. :param reagent_id :param genotype_id :return:
-
addGenome
(taxon_num, taxon_label=None, genome_id=None)¶
-
addGenomicBackground
(background_id, background_label, background_type=None, background_description=None)¶
-
addGenomicBackgroundToGenotype
(background_id, genotype_id, background_type=None)¶
-
addGenotype
(genotype_id, genotype_label, genotype_type=None, genotype_description=None)¶ If a genotype_type is not supplied, we will default to ‘intrinsic genotype’ :param genotype_id: :param genotype_label: :param genotype_type: :param genotype_description: :return:
-
addMemberOfPopulation
(member_id, population_id)¶
-
addParts
(part_id, parent_id, part_relationship=None, part_category=None, parent_category=None)¶ This will add a has_part (or subproperty) relationship between a parent_id and the supplied part. By default the relationship will be BFO:has_part, but any relationship could be given here. :param part_id: :param parent_id: :param part_relationship: :param part_category: a biolink vocab curie for part_id :param parent_category: a biolink vocab curie for parent_id :return:
-
addPartsToVSLC
(vslc_id, allele1_id, allele2_id, zygosity_id=None, allele1_rel=None, allele2_rel=None)¶ Here we add the parts to the VSLC. While traditionally alleles (reference or variant loci) are traditionally added, you can add any node (such as sequence_alterations for unlocated variations) to a vslc if they are known to be paired. However, if a sequence_alteration’s loci is unknown, it probably should be added directly to the GVC. :param vslc_id: :param allele1_id: :param allele2_id: :param zygosity_id: :param allele1_rel: :param allele2_rel: :return:
-
addPolypeptide
(polypeptide_id, polypeptide_label=None, transcript_id=None, polypeptide_type=None)¶ Parameters: - polypeptide_id –
- polypeptide_label –
- polypeptide_type –
- transcript_id –
Returns:
-
addReagentTargetedGene
(reagent_id, gene_id, targeted_gene_id=None, targeted_gene_label=None, description=None, reagent_category=None)¶ 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 rdfs:label targeted_gene_label dc:description description <reagent_id> GENO:targets_gene <gene_id>
Parameters: - reagent_id –
- gene_id –
- targeted_gene_id –
- reagent_category – a biolink category CURIE for reagent_id
Returns:
-
addReferenceGenome
(build_id, build_label, taxon_id)¶
-
addSequenceAlteration
(sa_id, sa_label, sa_type=None, sa_description=None)¶
-
addSequenceAlterationToVariantLocus
(sa_id, vl_id)¶
-
addSequenceDerivesFrom
(child_id, parent_id, child_category=None, parent_category=None)¶
-
addTargetedGeneComplement
(tgc_id, tgc_label, tgc_type=None, tgc_description=None)¶
-
addTargetedGeneSubregion
(tgs_id, tgs_label, tgs_type=None, tgs_description=None)¶
-
addTaxon
(taxon_id, genopart_id, genopart_category=None)¶ The supplied geno part will have the specified taxon added with RO:in_taxon relation. Generally the taxon is associated with a genomic_background, but could be added to any genotype part (including a gene, regulatory element, or sequence alteration). :param taxon_id: :param genopart_id: :param genopart_category: a biolink term for genopart_id :return:
-
addVSLCtoParent
(vslc_id, parent_id, part_category=None, parent_category=None)¶ The VSLC can either be added to a genotype or to a GVC. The vslc is added as a part of the parent. :param vslc_id: :param parent_id: :param part_category: a biolink category CURIE for part :param parent_category: a biolink category CURIE for parent :return:
-
static
makeGenomeID
(taxon_id)¶
-
make_experimental_model_with_genotype
(genotype_id, genotype_label, taxon_id, taxon_label)¶
-
static
make_variant_locus_label
(gene_label, allele_label)¶
-
make_vslc_label
(gene_label, allele1_label, allele2_label)¶ Make a Variant Single Locus Complement (VSLC) in monarch-style. :param gene_label: :param allele1_label: :param allele2_label: :return:
-