MCPcopy Create free account
hub / github.com/CamaraLab/scTDA / get_gene

Method get_gene

scTDA/main.py:1734–1751  ·  view source on GitHub ↗

Returns a dictionary that asigns to each node id the average value of the column 'genin' in the raw table. 'genin' can be also a list of columns, on which case the average of all columns. The output is normalized such that the sum over all nodes is equal to 1. It also provid

(self, genin, ignore_log=False, con=True)

Source from the content-addressed store, hash-verified

1732 return [None, None]
1733
1734 def get_gene(self, genin, ignore_log=False, con=True):
1735 """
1736 Returns a dictionary that asigns to each node id the average value of the column 'genin' in the raw table.
1737 'genin' can be also a list of columns, on which case the average of all columns. The output is normalized
1738 such that the sum over all nodes is equal to 1. It also provides as an output the normalization factor, to
1739 convert the dictionary to log_2(1+TPM) units (or TPM units). When 'ignore_log' is True it treat entries as
1740 being in natural scale, even if self.log2 is True (used internally). When 'con' is False, it uses all
1741 nodes, not only the ones in the first connected component of the topological representation (used internally).
1742 Argument 'genin' may also be equal to the special keyword '_dist_root', on which case it returns the graph
1743 distance funtion to the root node. It can be also equal to 'timepoint_xxx', on which case it returns a
1744 dictionary with the fraction of cells belonging to timepoint xxx in each node.
1745 """
1746 if genin == '_dist_root':
1747 return self.get_distroot(self.root), 1.0
1748 elif genin is not None and 'timepoint_' in genin:
1749 return self.count_gene(self.rootlane, float(genin[genin.index('_')+1:]))
1750 else:
1751 return UnrootedGraph.get_gene(self, genin, ignore_log, con)
1752
1753 def draw_expr_timeline(self, genin, ignore_log=False, path=False, save='', axis=[], smooth=False):
1754 """

Callers 4

get_dendriteMethod · 0.95
__init__Method · 0.95
centroidMethod · 0.95
plot_CDR_correlationMethod · 0.95

Calls 2

get_distrootMethod · 0.95
count_geneMethod · 0.80

Tested by

no test coverage detected