Mysql Models

class NetExplorer.models.mysql_models.CellPlotPosition(*args, **kwargs)

Table with Cell position in a 2-dimensional space, usually computed with t-SNE.

experiment

Foreign Key to Experiment.

sample

Foreign Key to Sample.

dataset

Foreign Key to Dataset.

x_position

Float with x-axis coordinate.

y_position

Float with y-axis coordinate.

exception DoesNotExist
exception MultipleObjectsReturned
dataset

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

dataset_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
sample

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

sample_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

x_position

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

y_position

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class NetExplorer.models.mysql_models.ClusterMarkers(*args, **kwargs)

Class for cluster marker genes.

experiment

Foreign Key to Experiment.

dataset

Foreign Key to Dataset.

condition

Foreign Key to Condition.

gene_symbol

String with gene symbol.

auc

Area under the curve of the marker used as a classifier.

avg_diff

Average difference in expression of the marker between this condition and all the others.

exception DoesNotExist
exception MultipleObjectsReturned
auc

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

avg_diff

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

condition

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

condition_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

dataset

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

dataset_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gene_symbol

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
class NetExplorer.models.mysql_models.Condition(*args, **kwargs)

Table with PlanExp experiment conditions. Technical conditions, Experimental conditions, Clusters, etc. will be stored here.

name

Name of condition.

experiment

Foreign Key to Experiment.

cond_type

Foreign Key to ConditionType.

defines_cell_type

Boolean field indicating if condition defines cell types (e.g.: cluster).

cell_type

If defines_cell_type is True, then cell_type stores the name of the cell type this condition defines.

description

Description of the Condition.

max_expression

Maximum expression value in this condition (defaults to None).

min_expression

Minimum expression value in this condition (default to 0).

exception DoesNotExist
exception MultipleObjectsReturned
_Condition__get_max_expression()

Gets max expression of samples in this particular condition. Assigns it to self.max_expression and returns it.

cell_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

clustermarkers_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

cond_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

cond_type_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

condition1_expressionrelative_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

condition1_expressionrelative_setsubcondition

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

defines_cell_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

expressioncondition_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_color(dataset, value, profile='red', max_v=None)

Returns expression color for a given expression value. Will use one of the saved color profiles ‘red’, ‘green’ or ‘blue’.

If max_v is provided, the color will be determined using a scale from 0 to max_v. Otherwise, max_v will be computed as the maximum expression value for a particular experiment + condition.

get_color_legend(profile='red', units=None)

Returns html of color gradient generated for expression in Condition

classmethod get_samples_per_condition(experiment, ctype)

Method for getting the number of samples per condition of ctype.

Parameters
  • experiment (str) – Experiment name.

  • ctype (str) – Condition type.

Returns

Dictionary with conditions and samples mapping.

Keys are condition ids (int) values are number of samples (int) in that condition.

Return type

sc_dict (dict)

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

max_expression = None
min_expression = 0
name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
samplecondition_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class NetExplorer.models.mysql_models.ConditionType(*args, **kwargs)

Types of conditions for a PlanExp experiment. 1 Batch (technical condition). 2 Experimental condition. 3 Cluster.

name

Condition Type name.

description

Description for condition type.

is_interaction

Bool to define if it results from an interaction of other condition types.

exception DoesNotExist
exception MultipleObjectsReturned
condition_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

expressionrelative_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_interaction

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
class NetExplorer.models.mysql_models.Dataset(*args, **kwargs)

Model that describes the table for storing information about the transcriptome Datasets available in PlanExp and PlanNET.

name

Name of the dataset.

year

Year of publication (if available).

citation

Citation string to be shown on the website.

url

Url to the publication.

n_contigs

Number of contigs (transcripts) in this dataset.

n_ints

Number of predicted interactions for this dataset.

identifier_regex

Regular expression of the identifiers used for this dataset.

public

Boolean to define if it is a public dataset (True) or private (False).

exception DoesNotExist
exception MultipleObjectsReturned
cellplotposition_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

citation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

clustermarkers_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

experimentdataset_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

expressionabsolute_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

expressionrelative_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

classmethod get_allowed_datasets(user)

Classmethod that returns QuerySet of allowed datasets for a given user.

Parameters

user (User) – User object.

Returns

List of Dataset objects sorted by year

to which user has permissions to.

Return type

list of Dataset

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier_regex

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_symbol_valid(symbol)

Checks if a given symbol belongs to Dataset based on the symbol naming convention.

Parameters

symbol (str) – String of an identifier to check if it matches the regex for this dataset.

Returns

True if symbol belongs to this Dataset,

otherwise False.

Return type

bool

n_contigs

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

n_ints

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
public

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

userdatasetpermission_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

year

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class NetExplorer.models.mysql_models.Experiment(*args, **kwargs)

Table with RNA-seq and scRNA-seq Experiment information.

name

Name of the experiment.

description

Description of the experiment.

citation

Citation string of experiment publication.

url

Url of the publication.

exp_type

Foreign Key to the corresponding ExperimentType.

public

Boolean to define if it is a public experiment (True) or private (False).

exception DoesNotExist
exception MultipleObjectsReturned
cellplotposition_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

citation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

clustermarkers_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

condition_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exp_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

exp_type_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

experimentdataset_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

experimentgene_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

expressionabsolute_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

expressioncondition_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

expressionrelative_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

classmethod get_allowed_experiments(user)

Returns QuerySet of allowed experiments for a given user.

Parameters

user (User) – User for which to retrieve allowed experiments.

Returns

QuerySet of allowed experiments to which user has

permission to.

Return type

QuerySet

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_one_sample(ctype=None, conditions=None)

Checks if there is only one sample per condition in experiment.

Parameters
  • ctype (str) – ConditionType name.

  • conditions (list of Condition) – List of conditions for Experiment.

Returns

True if experiment has only one sample per condition. False otherwise.

Return type

bool

Raises

ValueError – If neither ‘ctype’ nor ‘conditions’ is provided.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
public

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

sample_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

samplecondition_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

to_json()

Returns json string with info about experiment.

Returns

JSON string of serialized Experiment. Contains:
  • ’name’

  • ’description’

  • ’citation’

  • ’url’

  • ’type’

Return type

str

url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

userexperimentpermission_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class NetExplorer.models.mysql_models.ExperimentDataset(*args, **kwargs)

Table with Datasets available for a particular experiment.

dataset

Foreign Key to Dataset.

experiment

Foreign Key to Experiment.

exception DoesNotExist
exception MultipleObjectsReturned
dataset

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

dataset_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
class NetExplorer.models.mysql_models.ExperimentGene(*args, **kwargs)

Table with genes that appear in a particular experiment. Useful for deciding if a gene has expression == 0.

If gene is in ExperimentGene but not in ExpressionAbsolute: expression == 0. If gene is not in ExperimentGene: expression == “NA”

experiment

Foreign Key to Experiment.

gene_symbol

String with gene symbol.

exception DoesNotExist
exception MultipleObjectsReturned
experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gene_symbol

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
class NetExplorer.models.mysql_models.ExperimentType(*args, **kwargs)

Table with experiment types in PlanExp.

exp_type

Name of the experiment type.

description

Description of the experiment type.

exception DoesNotExist
exception MultipleObjectsReturned
description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exp_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

experiment_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
class NetExplorer.models.mysql_models.ExpressionAbsolute(*args, **kwargs)

Stores expression for a particular gene in a particular sample. Only stores NON-ZERO values.

experiment

Foreign Key to Experiment to which sample belongs to.

sample

Foreign Key to Sample.

dataset

Foreign Key to Dataset to which gene_symbol belongs to.

gene_symbol

String with gene symbol.

expression_value

Float with the expression value for gene_symbol in sample.

units

Units in which expression_value are stored (usually logCPM).

exception DoesNotExist
exception MultipleObjectsReturned
dataset

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

dataset_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

expression_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gene_symbol

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod get_mean_expression(experiment, dataset, conditions, genes)

Returns mean gene expression for samples with expression > 0 for all provided genes.

Example

For genes A and B, will get a value for each cell in experiment where both genes are expressed > 0. Each value will be the mean expression (A + B) / 2 for each sample.

Parameters
  • experiment (str) – Experiment in PlanExp.

  • dataset (str) – Dataset in PlanExp.

  • conditions (list of Condition) – Conditions (previously sorted) to use for the plot.

  • genes (list of str) – Genes to plot. Can be empty depending on the plot.

Returns

Dictionary with mean expession for condition.

Key is sample name (str), value is mean expression (float) for each gene in genes. Only samples with expression for all genes in genes.

Return type

dict

classmethod get_sample_expression(experiment, dataset, conditions, genes, only_expressed=False)

Method for getting gene expression in all samples.

Parameters
  • experiment (str) – Experiment in PlanExp.

  • dataset (str) – Dataset in PlanExp.

  • conditions (list of Condition) – Conditions (previously sorted) to use for the plot.

  • genes (list of str) – Genes to plot. Can be empty depending on the plot.

  • only_expressed (bool) – Flag, return only expression for samples with expression > 0?

Returns

Two dictionaries.

  • 1st: Key is gene symbol (str), value is vector of expression in each sample (list of float), sorted by condition.

  • 2nd: Key is gene_symbol (str), value is vector with conditions for each sample (list of int), same order as list in 1st dictionary.

dict1 = {
    'gene1': [ float, float, float, ...],
    ...
}
dict2 = {
    'gene1': [ int, int, int, ...],
    ...
}

Return type

(dict, dict)

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

sample

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

sample_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

units

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class NetExplorer.models.mysql_models.ExpressionCondition(*args, **kwargs)

Table that stores the sum of expression values in a particular condition. Note that we store the sum, and not the mean, because the 0 values of expression are not stored in ExpressionAbsolute, and thus can’t be computed without taking into account the number of samples in each condition separately.

experiment

Foreign Key to Experiment.

gene_symbol

Gene symbol.

condition

Foreign Key to Condition.

sum_expression

The sum of expression values for gene_symbol in all samples that belong to condition.

To create it:

CREATE TABLE NetExplorer_expressioncondition
SELECT `NetExplorer_expressionabsolute`.`experiment_id`,
    `NetExplorer_samplecondition`.`condition_id`,
    `NetExplorer_expressionabsolute`.`gene_symbol`,
        SUM(`NetExplorer_expressionabsolute`.`expression_value`) AS sum_expression
FROM  `NetExplorer_expressionabsolute`
INNER JOIN NetExplorer_samplecondition ON NetExplorer_expressionabsolute.sample_id = NetExplorer_samplecondition.sample_id
GROUP BY `NetExplorer_samplecondition`.`condition_id`,
        `NetExplorer_expressionabsolute`.`gene_symbol`,
        `NetExplorer_expressionabsolute`.`experiment_id`;
exception DoesNotExist
exception MultipleObjectsReturned
condition

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

condition_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gene_symbol

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod get_condition_expression(experiment, dataset, conditions, ctype, genes)

Method for getting gene expression in a set of conditions.

Parameters
  • experiment (str) – Experiment in PlanExp.

  • dataset (str) – Dataset in PlanExp.

  • conditions (list of Condition) – Conditions (previously sorted) to use for the plot.

  • genes (list of str) – Genes to plot. Can be empty depending on the plot.

Returns

Dictionary with expression for each condition.

Key is gene symbol (str), value is vector of expression in each condition (list of float), in the same order as conditions.

Return type

dict

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
sum_expression

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class NetExplorer.models.mysql_models.ExpressionRelative(*args, **kwargs)

Table for storing comparisons of expression between two conditions. Only stores significant results.

experiment

Foreign Key to Experiment.

condition1

Foreign Key to Condition.

condition2

Foreign Key to Condition.

cond_type

Foreign Key to ConditionType.

dataset

Foreign Key to Dataset.

gene_symbol

String with gene symbol.

fold_change

Float with log2(Fold Change).

pvalue

Float with adjusted p-value.

exception DoesNotExist
exception MultipleObjectsReturned
cond_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

cond_type_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

condition1

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

condition1_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

condition2

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

condition2_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

dataset

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

dataset_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

fold_change

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gene_symbol

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
pvalue

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Class for regulatory links predicted for a SingleCell Experiment.

experiment

Foreign Key to Experiment.

dataset

Foreign Key to Dataset.

group

Integer from 1 to 10 that indicates to which group of links it belongs to, ordered from best (1) to worse (10). Each group has 100 links.

regulator

Gene symbol of the regulator gene.

target

Gene symbol of the target gene.

source

String indicating if the regulator was selected by PFAM domain or by GO term.

score

Score of the regulatory link as reported by GENIE3.

exception DoesNotExist
exception MultipleObjectsReturned
dataset

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

dataset_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

group

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
regulator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

score

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

source

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

target

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class NetExplorer.models.mysql_models.Sample(*args, **kwargs)

Table for storing samples.

experiment

Foreign Key to experiment to which sample belongs to.

sample_name

Sample name.

exception DoesNotExist
exception MultipleObjectsReturned
cellplotposition_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

expressionabsolute_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
sample_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

samplecondition_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class NetExplorer.models.mysql_models.SampleCondition(*args, **kwargs)

Table with Conditions to which each sample belongs.

experiment

Foreign Key to Experiment.

sample

Foreign Key to Sample.

condition

Foreign Key to Condition.

exception DoesNotExist
exception MultipleObjectsReturned
condition

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

condition_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
sample

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

sample_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class NetExplorer.models.mysql_models.UserDatasetPermission(*args, **kwargs)

Table with user permissions to Datasets.

user

ForeignKey to User.

dataset

ForeignKey to Dataset.

exception DoesNotExist
exception MultipleObjectsReturned
dataset

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

dataset_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class NetExplorer.models.mysql_models.UserExperimentPermission(*args, **kwargs)

Table with user permissions to experiments in PlanExp.

user

Foreign Key to User.

experiment

Foreign Key to Experiment.

exception DoesNotExist
exception MultipleObjectsReturned
experiment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

experiment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.