draft-grn 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- draft_grn-0.1.0.dist-info/METADATA +127 -0
- draft_grn-0.1.0.dist-info/RECORD +100 -0
- draft_grn-0.1.0.dist-info/WHEEL +5 -0
- draft_grn-0.1.0.dist-info/entry_points.txt +4 -0
- draft_grn-0.1.0.dist-info/licenses/LICENSE +21 -0
- draft_grn-0.1.0.dist-info/top_level.txt +2 -0
- draft_paired/R/check_simulator.R +140 -0
- draft_paired/R/positive_kinetics.R +44 -0
- draft_paired/R/prior_trial_context.R +24 -0
- draft_paired/R/simulate_prior.R +197 -0
- draft_paired/__init__.py +3 -0
- draft_paired/analysis/__init__.py +43 -0
- draft_paired/analysis/ccc.py +1567 -0
- draft_paired/analysis/ccc_alignment.py +235 -0
- draft_paired/analysis/ccc_config.py +95 -0
- draft_paired/analysis/ccc_networks.py +209 -0
- draft_paired/analysis/ccc_timing.py +1030 -0
- draft_paired/analysis/consensus.py +384 -0
- draft_paired/analysis/continuous_activity.py +443 -0
- draft_paired/analysis/edge_cluster.py +546 -0
- draft_paired/analysis/gene_keys.py +122 -0
- draft_paired/analysis/network.py +1353 -0
- draft_paired/analysis/repro.py +513 -0
- draft_paired/analysis/single_tf.py +897 -0
- draft_paired/analysis/topic.py +662 -0
- draft_paired/ccc_inputs.py +129 -0
- draft_paired/ccc_workflow.py +20 -0
- draft_paired/checkpoint.py +35 -0
- draft_paired/cli.py +338 -0
- draft_paired/cli_options.py +202 -0
- draft_paired/config_init.py +136 -0
- draft_paired/config_profiles.py +38 -0
- draft_paired/directory_inputs.py +249 -0
- draft_paired/examples/simulation_9plus3/inputs_101.npz +0 -0
- draft_paired/examples/simulation_9plus3/inputs_102.npz +0 -0
- draft_paired/examples/simulation_9plus3/inputs_103.npz +0 -0
- draft_paired/examples/simulation_9plus3/manifest.json +120 -0
- draft_paired/examples/simulation_9plus3/prior.tsv +1801 -0
- draft_paired/examples/simulation_9plus3/prior_provenance.json +6 -0
- draft_paired/examples/simulation_9plus3/truth_101.npz +0 -0
- draft_paired/examples/simulation_9plus3/truth_102.npz +0 -0
- draft_paired/examples/simulation_9plus3/truth_103.npz +0 -0
- draft_paired/graph_builder.py +293 -0
- draft_paired/graph_input.py +143 -0
- draft_paired/infer.py +286 -0
- draft_paired/input_schema.py +143 -0
- draft_paired/io.py +101 -0
- draft_paired/lineage.py +152 -0
- draft_paired/models/__init__.py +23 -0
- draft_paired/models/gnn.py +267 -0
- draft_paired/pipeline.py +85 -0
- draft_paired/preprocess.py +336 -0
- draft_paired/prior_preparation.py +765 -0
- draft_paired/prior_resources.py +215 -0
- draft_paired/reproduce.py +394 -0
- draft_paired/simulation.py +563 -0
- draft_paired/simulation_generate.py +646 -0
- draft_paired/simulation_training.py +196 -0
- draft_paired/templates/draft_ccc_template.yaml +39 -0
- draft_paired/templates/draft_example_fly_ccc.yaml +77 -0
- draft_paired/templates/draft_example_fly_germ.yaml +125 -0
- draft_paired/templates/draft_example_fly_soma.yaml +125 -0
- draft_paired/templates/draft_example_mouse_development.yaml +129 -0
- draft_paired/templates/draft_example_mouse_motifs.yaml +141 -0
- draft_paired/templates/draft_lineage_template.yaml +122 -0
- draft_paired/templates/draft_simulation_prior_template.yaml +44 -0
- draft_paired/templates/draft_simulation_template.yaml +29 -0
- draft_paired/templates/method_profiles.yaml +29 -0
- draft_paired/train.py +1027 -0
- draft_paired/tutorial_data.py +240 -0
- draft_paired/utils.py +141 -0
- draft_paired/workflow.py +167 -0
- draft_paired/workflow_cli.py +282 -0
- draft_unpaired/__init__.py +3 -0
- draft_unpaired/analysis/__init__.py +3 -0
- draft_unpaired/analysis/continuous_activity.py +8 -0
- draft_unpaired/analysis/edge_cluster.py +71 -0
- draft_unpaired/analysis/network.py +743 -0
- draft_unpaired/analysis/repro.py +23 -0
- draft_unpaired/analysis/single_tf.py +431 -0
- draft_unpaired/analysis/topic.py +77 -0
- draft_unpaired/checkpoint.py +13 -0
- draft_unpaired/cli.py +200 -0
- draft_unpaired/config_init.py +81 -0
- draft_unpaired/graph_builder.py +220 -0
- draft_unpaired/infer.py +128 -0
- draft_unpaired/io.py +101 -0
- draft_unpaired/lineage.py +5 -0
- draft_unpaired/models/__init__.py +5 -0
- draft_unpaired/models/gnn.py +187 -0
- draft_unpaired/pipeline.py +88 -0
- draft_unpaired/preprocess.py +319 -0
- draft_unpaired/prior.py +301 -0
- draft_unpaired/reproduce.py +152 -0
- draft_unpaired/scmtni_prior.py +482 -0
- draft_unpaired/templates/draft_motif_template.yaml +136 -0
- draft_unpaired/templates/draft_staged_prior_template.yaml +123 -0
- draft_unpaired/templates/draft_unpaired_template.yaml +128 -0
- draft_unpaired/train.py +568 -0
- draft_unpaired/utils.py +19 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Native scMultiSim generation from a user-supplied candidate GRN.
|
|
2
|
+
args <- commandArgs(trailingOnly=TRUE)
|
|
3
|
+
if (length(args) != 11) stop('Expected folder plus ten binary trajectory parameters')
|
|
4
|
+
folder <- args[[1]]
|
|
5
|
+
seed <- as.integer(args[[2]])
|
|
6
|
+
ntf <- as.integer(args[[3]])
|
|
7
|
+
ngene <- as.integer(args[[4]])
|
|
8
|
+
cells <- as.integer(args[[5]])
|
|
9
|
+
times <- as.integer(args[[6]])
|
|
10
|
+
intrinsic <- as.numeric(args[[7]])
|
|
11
|
+
depth <- as.numeric(args[[8]])
|
|
12
|
+
diff_cif <- as.numeric(args[[9]])
|
|
13
|
+
atac_effect <- as.numeric(args[[10]])
|
|
14
|
+
cif_sigma <- as.numeric(args[[11]])
|
|
15
|
+
suppressPackageStartupMessages({library(scMultiSim); library(ape)})
|
|
16
|
+
if (as.character(packageVersion('scMultiSim')) != '1.2.0') stop('Requires scMultiSim 1.2.0')
|
|
17
|
+
script_path <- sub('^--file=', '', grep('^--file=', commandArgs(), value=TRUE)[1])
|
|
18
|
+
source(file.path(dirname(script_path), 'prior_trial_context.R'))
|
|
19
|
+
source(file.path(dirname(script_path), 'positive_kinetics.R'))
|
|
20
|
+
source(file.path(dirname(script_path), 'check_simulator.R'))
|
|
21
|
+
audit <- file.path(folder, 'generator_only')
|
|
22
|
+
implementation <- verify_scmultisim_implementation(audit)
|
|
23
|
+
install_positive_kinetic_rates(audit)
|
|
24
|
+
read_matrix <- function(name) as.matrix(read.csv(file.path(audit, name), row.names=1, check.names=FALSE))
|
|
25
|
+
motif <- read_matrix('potential_motif.csv')
|
|
26
|
+
distance <- read_matrix('potential_distance.csv')
|
|
27
|
+
events <- read.delim(file.path(audit, 'transitions.tsv'))
|
|
28
|
+
planned <- lapply(0:(times-1), function(t) {
|
|
29
|
+
as.matrix(read.csv(file.path(folder, sprintf('grn_time_%d.csv', t)), row.names=1, check.names=FALSE))[(ntf+1):ngene, 1:ntf, drop=FALSE]
|
|
30
|
+
})
|
|
31
|
+
initial <- planned[[1]]
|
|
32
|
+
# Each cell uses the binary graph of its declared segment.
|
|
33
|
+
# The kinetic RNA simulator carries expression between segments.
|
|
34
|
+
weights_at <- function(position) {
|
|
35
|
+
stage <- min(times-1L, max(0L, as.integer(floor(position+.5))))
|
|
36
|
+
planned[[stage+1L]]
|
|
37
|
+
}
|
|
38
|
+
potential <- (t(distance) %*% motif) > 0
|
|
39
|
+
if (any(initial > potential) || times < 2L) stop('Invalid potential graph/stage count')
|
|
40
|
+
context <- new.env()
|
|
41
|
+
|
|
42
|
+
# Supply an equal-size cell grid per segment to the native Brownian sampler.
|
|
43
|
+
# Equal stage sizes give the encoder consistent feature widths.
|
|
44
|
+
native_sample_edge <- get('SampleEdge', asNamespace('scMultiSim'))
|
|
45
|
+
assignInNamespace('SampleEdge', function(edge, depth, anc_state, edges, ncells, step_size, t_sample=NA) {
|
|
46
|
+
if (is.na(t_sample[1])) {
|
|
47
|
+
count <- edge[4]*ncells/sum(edges[,4])
|
|
48
|
+
if (abs(count-round(count)) > 1e-10 || count < 2) stop('Trajectory requires an integral grid per segment')
|
|
49
|
+
t_sample <- depth + seq_len(as.integer(round(count))) * edge[4]/count
|
|
50
|
+
}
|
|
51
|
+
native_sample_edge(edge, depth, anc_state, edges, ncells, step_size, t_sample)
|
|
52
|
+
}, ns='scMultiSim')
|
|
53
|
+
|
|
54
|
+
# Use the declared graph schedule with native GRN normalization.
|
|
55
|
+
# .rnaSimEdge calls update immediately before simulating each cell.
|
|
56
|
+
assignInNamespace('.CreateDynGRN', function(grn, opts) {
|
|
57
|
+
if (!identical(as.integer(grn$regulators), seq_len(ntf)) ||
|
|
58
|
+
!identical(as.integer(grn$targets), (ntf+1L):ngene)) stop('Native TF/TG reindexing changed')
|
|
59
|
+
dyngrn <- get('.dynGRN', asNamespace('scMultiSim'))$new(
|
|
60
|
+
randseed=seed, involved_genes=seq_len(ngene), geff=grn$geff,
|
|
61
|
+
params=grn$params, regulators=grn$regulators, targets=grn$targets,
|
|
62
|
+
n_tgt=grn$n_tgt, n_reg=grn$n_reg, name_map=grn$name_map,
|
|
63
|
+
del_edges=NULL, gen_edges=NULL, has_tf_edges=FALSE,
|
|
64
|
+
max_steps=1L, remaining_steps=1L, remaining_cells=cells,
|
|
65
|
+
cell_per_step=cells, n_edges=sum(initial), n_changing_edges=nrow(events)/(times-1),
|
|
66
|
+
weight_mean=1, weight_sd=0, history=list(), version=1L)
|
|
67
|
+
env <- as.environment(dyngrn)
|
|
68
|
+
update <- function() {
|
|
69
|
+
rank <- as.integer(env$version)
|
|
70
|
+
if (rank > cells*times) stop('Unexpected extra native GRN update')
|
|
71
|
+
w <- weights_at(context$position[context$order[rank]])
|
|
72
|
+
g <- env$geff
|
|
73
|
+
g[(ntf+1):ngene, 1:ntf] <- w
|
|
74
|
+
env$geff <- g
|
|
75
|
+
h <- env$history
|
|
76
|
+
h[[rank]] <- g
|
|
77
|
+
env$history <- h
|
|
78
|
+
env$version <- rank+1L
|
|
79
|
+
rank
|
|
80
|
+
}
|
|
81
|
+
if (exists('update', env, inherits=FALSE) && bindingIsLocked('update', env)) unlockBinding('update', env)
|
|
82
|
+
assign('update', update, envir=env)
|
|
83
|
+
dyngrn
|
|
84
|
+
}, ns='scMultiSim')
|
|
85
|
+
numbers <- get('.getNumbers', asNamespace('scMultiSim'))
|
|
86
|
+
assignInNamespace('.getNumbers', function(GRN, options) {
|
|
87
|
+
n <- numbers(GRN, options); n$region <- nrow(motif); n
|
|
88
|
+
}, ns='scMultiSim')
|
|
89
|
+
assignInNamespace('.regionToGeneMatrix', function(seed, N, options) {
|
|
90
|
+
result <- matrix(0, nrow(motif), N$gene)
|
|
91
|
+
result[, (ntf+1):ngene] <- distance
|
|
92
|
+
result
|
|
93
|
+
}, ns='scMultiSim')
|
|
94
|
+
assignInNamespace('.regionToTFMatrix', function(GRN, region_to_gene) {
|
|
95
|
+
motif[, as.character(GRN$regulators), drop=FALSE]
|
|
96
|
+
}, ns='scMultiSim')
|
|
97
|
+
native_atac <- get('.atacSeq', asNamespace('scMultiSim'))
|
|
98
|
+
assignInNamespace('.atacSeq', function(seed, sim) {
|
|
99
|
+
native_atac(seed, sim)
|
|
100
|
+
# Group cells by the native .rnaSeq tree traversal.
|
|
101
|
+
edges <- get('.tree_info', asNamespace('scMultiSim'))(sim$options$tree)$edges
|
|
102
|
+
neutral <- sim$CIF_all$neutral[seq_len(sim$N$cell), , drop=FALSE]
|
|
103
|
+
groups <- lapply(seq_len(nrow(edges)), function(i) {
|
|
104
|
+
which(neutral[, 'from'] == edges[i,'from'] & neutral[, 'to'] == edges[i,'to'])
|
|
105
|
+
})
|
|
106
|
+
if (length(groups) != times || any(lengths(groups) != cells)) stop('Unexpected balanced tree segment sizes')
|
|
107
|
+
order <- unlist(groups, use.names=FALSE)
|
|
108
|
+
if (!identical(sort(order), seq_len(cells*times))) stop('Native traversal is not a cell partition')
|
|
109
|
+
context$order <- order
|
|
110
|
+
context$time <- integer(length(order))
|
|
111
|
+
context$time[order] <- rep(0:(times-1), lengths(groups))
|
|
112
|
+
context$position <- numeric(length(order))
|
|
113
|
+
context$position[order] <- unlist(lapply(seq_along(groups), function(t) {
|
|
114
|
+
(t-1L) + (seq_along(groups[[t]])-.5)/length(groups[[t]])-.5
|
|
115
|
+
}), use.names=FALSE)
|
|
116
|
+
# Evaluate potential RE groups with each cell's stage-specific binary GRN.
|
|
117
|
+
# This also contributes to the native RNA kon calculation.
|
|
118
|
+
activity <- t(vapply(context$position, function(position) {
|
|
119
|
+
rowSums((distance %*% weights_at(position)) * motif) / rowSums(motif)
|
|
120
|
+
}, numeric(nrow(motif))))
|
|
121
|
+
sim$atac_data <- sim$atac_data * (.2 + .8*activity)
|
|
122
|
+
stage_seeds <- get('seed', envir=parent.frame(), inherits=FALSE)
|
|
123
|
+
write.table(data.frame(stage=seq_along(stage_seeds), seed=stage_seeds),
|
|
124
|
+
file.path(audit,'stage_seeds.tsv'), sep='\t', row.names=FALSE, quote=FALSE)
|
|
125
|
+
}, ns='scMultiSim')
|
|
126
|
+
|
|
127
|
+
idx <- which(potential, arr.ind=TRUE)
|
|
128
|
+
w0 <- weights_at(-.5)
|
|
129
|
+
grn <- data.frame(regulated.gene=idx[,1]+ntf, regulator.gene=idx[,2], regulator.effect=w0[idx])
|
|
130
|
+
node <- paste0('S', times-1L, ':1')
|
|
131
|
+
for (i in rev(seq_len(times-1L))) node <- paste0('(', node, ')S', i-1L, ':1')
|
|
132
|
+
tree <- read.tree(text=paste0('(', node, ');'))
|
|
133
|
+
# Define the stage tree for the five-stage simulation design.
|
|
134
|
+
if (times == 5L) tree <- read.tree(text='(((((A:1)B:1)C:1)D:1)E:1);')
|
|
135
|
+
options <- list(rand.seed=seed, GRN=grn, num.cells=cells*times, num.cifs=55,
|
|
136
|
+
tree=tree, diff.cif.fraction=diff_cif, cif.sigma=cif_sigma,
|
|
137
|
+
intrinsic.noise=intrinsic, do.velocity=TRUE, grn.effect=1,
|
|
138
|
+
atac.effect=atac_effect, atac.p_zero=.3,
|
|
139
|
+
dynamic.GRN=list(cell.per.step=cells, num.changing.edges=1, num.steps=1,
|
|
140
|
+
weight.mean=1, weight.sd=0, create.tf.edges=FALSE))
|
|
141
|
+
runner <- make_pinned_snapshot_runner(get('sim_true_counts', asNamespace('scMultiSim')), seed, RNGkind())
|
|
142
|
+
set.seed(seed)
|
|
143
|
+
result <- runner$run(options)
|
|
144
|
+
order <- context$order
|
|
145
|
+
if (length(result$cell_specific_grn) != cells*times || any(!is.finite(result$cell_time))) stop('Missing native kinetic GRNs/time')
|
|
146
|
+
rows <- lapply(seq_along(order), function(rank) {
|
|
147
|
+
i <- order[rank]
|
|
148
|
+
position <- context$position[i]
|
|
149
|
+
actual <- as.matrix(result$cell_specific_grn[[i]])
|
|
150
|
+
expected <- weights_at(position)
|
|
151
|
+
observed <- actual[(ntf+1):ngene, 1:ntf, drop=FALSE]
|
|
152
|
+
state <- context$time[i]
|
|
153
|
+
outside <- actual
|
|
154
|
+
outside[(ntf+1):ngene, 1:ntf] <- 0
|
|
155
|
+
if (any(outside != 0)) stop('Native GRN acquired non-TF-TG effects')
|
|
156
|
+
data.frame(cell=paste0('cell', i), time=state, traversal_rank=rank,
|
|
157
|
+
trajectory_position=position, max_weight_error=max(abs(observed-expected)),
|
|
158
|
+
matches_planned_strong_state=all((observed>.5) == planned[[state+1]]),
|
|
159
|
+
nonbinary_weights=sum(!observed %in% c(0,1)),
|
|
160
|
+
native_grn_sha256=digest::digest(actual, algo='sha256'))
|
|
161
|
+
})
|
|
162
|
+
checks <- do.call(rbind, rows)
|
|
163
|
+
if (any(checks$max_weight_error > 1e-12) || any(checks$nonbinary_weights != 0) || !all(checks$matches_planned_strong_state)) stop('Native generating GRNs differ from planned trajectory')
|
|
164
|
+
write.table(checks, file.path(audit,'per_cell_network_audit.tsv'), sep='\t', row.names=FALSE, quote=FALSE)
|
|
165
|
+
metadata <- data.frame(cell=paste0('cell',order), time=context$time[order],
|
|
166
|
+
traversal_rank=seq_along(order), trajectory_position=context$position[order],
|
|
167
|
+
native_pop=as.character(result$cell_meta$pop[order]), cell_time=result$cell_time[order])
|
|
168
|
+
if (any(diff(metadata$cell_time) <= 0) || length(unique(metadata$native_pop)) != times) stop('Native developmental time/populations are not sequential')
|
|
169
|
+
write.table(metadata, file.path(folder,'cell_metadata.tsv'), sep='\t', row.names=FALSE, quote=FALSE)
|
|
170
|
+
clean_rna <- as.matrix(result$counts)
|
|
171
|
+
clean_atac <- as.matrix(result$atac_counts)
|
|
172
|
+
if (nrow(clean_rna) < ngene || nrow(clean_atac) != nrow(motif) ||
|
|
173
|
+
ncol(clean_rna) != cells*times || ncol(clean_atac) != cells*times) stop('Unexpected native assay axes')
|
|
174
|
+
set.seed(seed+10000L)
|
|
175
|
+
rna <- matrix(rpois(length(clean_rna), clean_rna*depth), nrow=nrow(clean_rna))
|
|
176
|
+
atac <- matrix(rpois(length(clean_atac), clean_atac*depth), nrow=nrow(clean_atac))
|
|
177
|
+
rownames(rna) <- c(as.character(seq_len(ngene)), paste0('background_', seq_len(nrow(rna)-ngene)))
|
|
178
|
+
rownames(atac) <- rownames(motif)
|
|
179
|
+
colnames(rna) <- colnames(atac) <- paste0('cell', seq_len(cells*times))
|
|
180
|
+
summary <- list()
|
|
181
|
+
for (t in 0:(times-1)) {
|
|
182
|
+
take <- order[context$time[order] == t]
|
|
183
|
+
write.csv(rna[,take,drop=FALSE], file.path(folder,sprintf('counts_time_%d.csv',t)), quote=FALSE)
|
|
184
|
+
write.csv(atac[,take,drop=FALSE], file.path(folder,'multiome',sprintf('atac_time_%d.csv',t)), quote=FALSE)
|
|
185
|
+
summary[[t+1]] <- data.frame(time=t, cells=length(take), native_pop=unique(metadata$native_pop[metadata$time==t]),
|
|
186
|
+
RNA_mean=mean(rna[,take]), ATAC_mean=mean(atac[,take]), strong_edges=sum(planned[[t+1]]),
|
|
187
|
+
kept_from_previous=if (t == 0) NA_real_ else sum(planned[[t+1]] & planned[[t]])/sum(planned[[t]]))
|
|
188
|
+
cat(sprintf('[GENERATED] T%d RNA=%dx%d ATAC=%dx%d developmental_population=%s\n',
|
|
189
|
+
t,nrow(rna),length(take),nrow(atac),length(take),summary[[t+1]]$native_pop))
|
|
190
|
+
}
|
|
191
|
+
write.table(do.call(rbind,summary),file.path(audit,'assay_summary.tsv'),sep='\t',row.names=FALSE,quote=FALSE)
|
|
192
|
+
writeLines(c('RNA/ATAC counts generated with native scMultiSim kinetic samplers.',
|
|
193
|
+
'Stage-specific candidate networks and region activities follow the configured trajectory.',
|
|
194
|
+
'Training inputs contain observed counts and candidate regulatory relations.'), file.path(audit,'PROVENANCE.txt'))
|
|
195
|
+
writeLines(capture.output(sessionInfo()),file.path(audit,'session_info.txt'))
|
|
196
|
+
|
|
197
|
+
write.table(rbind(data.frame(package=c('scMultiSim','R'), version=c(as.character(packageVersion('scMultiSim')), as.character(getRversion()))), implementation), file.path(audit,'versions.tsv'), sep='\t', row.names=FALSE, quote=FALSE)
|
draft_paired/__init__.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""Downstream analysis modules.
|
|
2
|
+
|
|
3
|
+
Lazy imports keep optional analysis dependencies separate from training,
|
|
4
|
+
embedding export and network export.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from importlib import import_module
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
_LAZY_EXPORTS = {
|
|
13
|
+
"build_fbgn_to_name": (".single_tf", "build_fbgn_to_name"),
|
|
14
|
+
"build_germ_labels": (".repro", "build_germ_labels"),
|
|
15
|
+
"build_soma_labels": (".repro", "build_soma_labels"),
|
|
16
|
+
"centrality_from_prob": (".single_tf", "centrality_from_prob"),
|
|
17
|
+
"export_lineage_networks": (".network", "export_lineage_networks"),
|
|
18
|
+
"f1_at_threshold_over_time": (".repro", "f1_at_threshold_over_time"),
|
|
19
|
+
"infer_ec_specificity_topmix": (".edge_cluster", "infer_ec_specificity_topmix"),
|
|
20
|
+
"infer_topic_celltype_pref": (".topic", "infer_topic_celltype_pref"),
|
|
21
|
+
"plot_smoothness_heatmap": (".repro", "plot_smoothness_heatmap"),
|
|
22
|
+
"run_ccc_analysis": (".ccc", "run_ccc_analysis"),
|
|
23
|
+
"run_continuous_activity": (".continuous_activity", "run_continuous_activity"),
|
|
24
|
+
"run_edge_cluster": (".edge_cluster", "run_edge_cluster"),
|
|
25
|
+
"run_single_tf_analysis": (".single_tf", "run_single_tf_analysis"),
|
|
26
|
+
"run_topic_analysis": (".topic", "run_topic_analysis"),
|
|
27
|
+
"save_embeddings_by_label": (".repro", "save_embeddings_by_label"),
|
|
28
|
+
"summarize_smoothness": (".repro", "summarize_smoothness"),
|
|
29
|
+
"tf_tg_prob_frobenius_dist_matrix": (".repro", "tf_tg_prob_frobenius_dist_matrix"),
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
__all__ = sorted(_LAZY_EXPORTS)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def __getattr__(name: str) -> Any:
|
|
36
|
+
if name not in _LAZY_EXPORTS:
|
|
37
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
38
|
+
|
|
39
|
+
module_name, attr_name = _LAZY_EXPORTS[name]
|
|
40
|
+
module = import_module(module_name, __name__)
|
|
41
|
+
value = getattr(module, attr_name)
|
|
42
|
+
globals()[name] = value
|
|
43
|
+
return value
|