File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ """Load a HDX-MS dataset with both a FD and ND control"""
2+
3+ from pathlib import Path
4+
5+ import numpy as np
6+
7+ from pyhdx import read_dynamx
8+ from pyhdx .process import apply_control , filter_peptides
9+
10+ # %%
11+
12+ root_dir = Path (__file__ ).parent .parent
13+ np .random .seed (43 )
14+
15+ fpath = root_dir / "tests" / "test_data" / "input" / "PpiA_folding.csv"
16+
17+ # Load the full .csv file
18+ df = read_dynamx (fpath )
19+ df
20+ # %%
21+
22+ fd_spec = {"state" : "Native" , "exposure" : {"value" : 86400 , "unit" : "s" }}
23+ nd_spec = {"state" : "FD" , "exposure" : {"value" : 0.6 , "unit" : "s" }}
24+
25+ # Filter out peptides for the full deuteration control
26+ fd_df = filter_peptides (df , ** fd_spec )
27+
28+ # Filter out peptides for the non-deuterated control
29+ nd_df = filter_peptides (df , ** nd_spec )
30+
31+ # Filter out peptides for the experiment with state "Folding"
32+ peptides = filter_peptides (df , state = "Folding" )
33+
34+ # %%
35+ # Apply the FD and ND controls. This adds the columns 'rfu' and 'rfu_sd' (Relative Fractional Uptake)
36+ # as well as 'fd_uptake' and 'nd_uptake', and their standard deviations.
37+ peptides_control = apply_control (peptides , fd_control = fd_df , nd_control = nd_df )
38+ peptides_control .columns
39+
40+ # %%
You can’t perform that action at this time.
0 commit comments