Prepare your own inputs
A run reads these files. You name them in config.toml.
| file | needed? | what it says |
|---|---|---|
| kinase network (CSV) | yes | which kinase can phosphorylate which site |
| TF network (CSV) | yes (may be only a header line) | which TF regulates which gene |
| MS table (CSV) | yes | protein and phosphosite time series |
| RNA table (CSV) | no | mRNA time series |
| KinOpt workbook (xlsx) | no | weights of the kinase network |
| TFOpt workbook (xlsx) | no | weights of the TF network |
config.toml |
yes | file paths, time points, settings |
| priors file (toml) | yes (supplied) | assumptions on parameter values |
Unpublished data
Run folders, bundles and exports contain your measurements. Keep them where your raw data may be.
Names
Gene, kinase and TF names are matched as text. PhosKinTime strips spaces and turns names into upper case, so egfr
and EGFR are the same. EGFR and ERBB1 are not. Use one naming system, for example current gene symbols, in every
file. Sites are written as residue, underscore, position: Y_1172, T_185. Write a site exactly the same way in
the network and in the MS table.
Kinase network
GeneID,Psite,Kinase
A,S_1,{K1}
A,S_2,"{K1, K2}"
| column | meaning |
|---|---|
GeneID |
the substrate protein |
Psite |
the phosphorylated site on it |
Kinase |
one kinase in braces, or a list in braces. A list needs double quotes because of the comma |
Rows with an empty cell are dropped and counted.
TF network
Source,Target
T1,A
| column | meaning |
|---|---|
Source |
the transcription factor |
Target |
the gene it regulates |
No TF regulation? Give a file with only the line Source,Target. An empty path is not accepted.
MS table: proteins and phosphosites
One row per time series. Time values go into the columns x1, x2, x3, ...
GeneID,Psite,x1,x2,x3,x4,x5,x6
KINA,,1.0,1.8,2.2,1.9,1.4,1.1
SUB,S_10,1.0,2.4,3.0,2.5,1.7,1.2
| column | meaning |
|---|---|
GeneID |
the protein |
Psite |
empty: this row is the protein level. A site name: this row is that phosphosite |
x1 ... xn |
the values at the 1st ... n-th time of [networkmodel.timepoints] |
Rules for the values:
- Linear scale, not logarithms. If your table holds log2 ratios, convert them first (
2 ** value). - With the default
scaling_method = "fc_start", every row is divided by its own first value. Sox1is the baseline (usually the unstimulated time 0). A row whose first value is zero or missing is skipped, with a warning. - Give every kinase a protein row. The kinase's activity curve is made from it. Without it the kinase is a flat line at 1, and no warning tells you.
- Phosphosite rows for sites that are not in the kinase network are dropped (
Mechanistic site filter). - Give exactly as many
xcolumns as there are time points. More is an error. Fewer is accepted without a warning, so count them yourself.
RNA table
GeneID,x1,x2,x3,x4
SUB,1.0,1.4,1.9,1.7
Same idea; the x columns follow the rna time points. It has its own list of times. No mRNA data: set rna = ""
and lambda_rna = 0.0 in config.toml.
KinOpt and TFOpt workbooks (optional)
When a site has two kinases, how much does each count? KinOpt estimates this from data; TFOpt does the same for TFs. They are separate tools. PhosKinTime only reads their result workbooks.
Without them set kinopt = "" and tfopt = "". Then every edge has weight 1, and validation prints two warnings.
That is a legitimate starting point; say so when you report results.
| workbook | sheet | columns |
|---|---|---|
| KinOpt | Alpha Values |
Gene, Psite, Kinase, Alpha (weight of each kinase on each site) |
| KinOpt | Beta Values |
Kinase, Psite, Beta (rows with empty Psite are read) |
| TFOpt | Alpha Values |
mRNA, TF, Value (weight of each TF on each gene) |
| TFOpt | Beta Values |
TF, PSite, Value (rows with empty PSite are read; the sign says activation or repression) |
Column names are case sensitive (Psite in KinOpt, PSite in TFOpt). Full contract and known pitfalls:
External tools. Use KinOpt 0.11.0 or later and TFOpt 0.2.0 or later (see
KNOWN_ISSUES N38).
Which proteins end up in the model?
Every substrate in the kinase network, and every source and target in the TF network. A kinase that appears only in
the Kinase column is an input curve, not a modelled protein. A TF without any site in the kinase network (an
"orphan" TF) follows its own measured mRNA instead of being simulated for the TF input; its data then count as input,
not as something to fit. See Global network model.
Walkthrough: a small model of your own
Two kinases (KINA, KINB), a substrate SUB with two sites, and a transcription factor TFA with one site that
regulates SUB. The numbers are made up.
Start from a copy of the example, so you get a working config.toml:
pixi run phoskintime example mymodel
Replace the four CSV files. Copy and paste each block:
cat > mymodel/data/kinase_net.csv <<'END'
GeneID,Psite,Kinase
SUB,S_10,{KINA}
SUB,Y_20,"{KINA, KINB}"
TFA,S_5,{KINB}
END
cat > mymodel/data/tf_net.csv <<'END'
Source,Target
TFA,SUB
END
cat > mymodel/data/ms.csv <<'END'
GeneID,Psite,x1,x2,x3,x4,x5,x6
KINA,,1.0,1.8,2.2,1.9,1.4,1.1
KINB,,1.0,1.1,1.4,1.8,1.6,1.3
SUB,,1.0,1.0,1.05,1.1,1.2,1.25
TFA,,1.0,1.0,1.0,0.98,0.97,0.96
SUB,S_10,1.0,2.4,3.0,2.5,1.7,1.2
SUB,Y_20,1.0,1.6,2.3,2.6,2.1,1.5
TFA,S_5,1.0,1.2,1.5,1.9,1.7,1.4
END
cat > mymodel/data/rna.csv <<'END'
GeneID,x1,x2,x3,x4
SUB,1.0,1.4,1.9,1.7
END
Now edit mymodel/config.toml in any text editor. Change these lines (they exist already):
kinopt = ""
tfopt = ""
and, near the end of the file:
[networkmodel.timepoints]
protein = [0.0, 5.0, 15.0, 30.0, 60.0, 120.0]
phospho_protein = [0.0, 5.0, 15.0, 30.0, 60.0, 120.0]
rna = [0.0, 30.0, 60.0, 120.0]
Times are in minutes. Or make the same five changes with one command:
sed -i.bak -e 's/^kinopt = .*/kinopt = ""/' -e 's/^tfopt = .*/tfopt = ""/' \
-e 's/^protein = \[.*/protein = [0.0, 5.0, 15.0, 30.0, 60.0, 120.0]/' \
-e 's/^phospho_protein = \[.*/phospho_protein = [0.0, 5.0, 15.0, 30.0, 60.0, 120.0]/' \
-e 's/^rna = \[.*/rna = [0.0, 30.0, 60.0, 120.0]/' mymodel/config.toml
The other file paths already point at mymodel/data/. The two unused .xlsx files may stay.
Check and fit:
pixi run phoskintime validate --conf mymodel/config.toml
pixi run phoskintime run --conf mymodel/config.toml
[Model] 2 proteins, 2 kinases, 7 state variables.
...
warning: kinopt: KinOpt result file not found: ''. ... (a run uses alpha = 1.0 and no priors for these edges)
warning: tfopt: TFOpt result file not found: ''. ... (a run uses alpha = 1.0 and no priors for these edges)
ok
...
[Fit] sbmlsim: 4/4 repeats succeeded in 1.9 s; best start 0, objective 0.1405202649.
[Identifiability] labels: {'not assessed': 15, 'at optimizer bound (upper; not a design bound)': 1}
That is your own model. Pages 5 to 9 work on it just as on the example.
Where config.toml is explained
Every key: Configuration reference. The keys you will touch first:
| key | what it does |
|---|---|
kinase_net, tf_net, ms, rna, kinopt, tfopt |
the input files |
output_dir |
the run folder; use a new one for each run |
n_starts |
how many times the fit is tried (example: 4; the repository default is 20) |
cores |
processor cores; 0 means all but one |
seed |
makes the random starting guesses repeatable |
lambda_protein, lambda_rna, lambda_phospho |
weight of each data type; 0 leaves it out |
default_model (in [networkmodel.models]) |
distributive, sequential, combinatorial or saturation |
[networkmodel.timepoints] |
measurement times in minutes |
Starting from raw proteomics and transcriptomics tables? The project's own preprocessing is described under Processing and mapping. It is written for particular input formats; writing the four CSV files yourself is often simpler.
Next: Build the model.