pyLoopSage 1.0.20__tar.gz → 1.0.22__tar.gz
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.
- {pyloopsage-1.0.20/pyLoopSage.egg-info → pyloopsage-1.0.22}/PKG-INFO +1 -1
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/__init__.py +1 -1
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/run.py +35 -23
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/stochastic_simulation.py +1 -1
- {pyloopsage-1.0.20 → pyloopsage-1.0.22/pyLoopSage.egg-info}/PKG-INFO +1 -1
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/setup.py +1 -1
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/LICENSE +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/README.md +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/args_definition.py +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/em.py +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/forcefields/classic_sm_ff.xml +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/initial_structures.py +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/knots.py +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/md.py +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/plots.py +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/preproc.py +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/utils.py +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/loopsage/vizualization_tools.py +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/pyLoopSage.egg-info/SOURCES.txt +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/pyLoopSage.egg-info/dependency_links.txt +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/pyLoopSage.egg-info/entry_points.txt +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/pyLoopSage.egg-info/requires.txt +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/pyLoopSage.egg-info/top_level.txt +0 -0
- {pyloopsage-1.0.20 → pyloopsage-1.0.22}/setup.cfg +0 -0
|
@@ -17,36 +17,48 @@ def my_config_parser(config_parser: configparser.ConfigParser) -> List[tuple[str
|
|
|
17
17
|
args_cp.append((name, value))
|
|
18
18
|
return args_cp
|
|
19
19
|
|
|
20
|
-
def get_config()
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
Then
|
|
24
|
-
|
|
20
|
+
def get_config():
|
|
21
|
+
"""Prepare list of arguments.
|
|
22
|
+
First, defaults are set.
|
|
23
|
+
Then, optionally config file values.
|
|
24
|
+
Finally, CLI arguments overwrite everything."""
|
|
25
|
+
|
|
26
|
+
print("Reading config...")
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
# Step 1: Setup argparse
|
|
27
29
|
arg_parser = argparse.ArgumentParser()
|
|
28
|
-
|
|
29
30
|
arg_parser.add_argument('-c', '--config_file', help="Specify config file (ini format)", metavar="FILE")
|
|
31
|
+
|
|
30
32
|
for arg in args:
|
|
31
33
|
arg_parser.add_argument(f"--{arg.name.lower()}", help=arg.help)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
#
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
name, value =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
|
|
35
|
+
args_ap = arg_parser.parse_args() # parse command-line arguments
|
|
36
|
+
args_dict = vars(args_ap)
|
|
37
|
+
|
|
38
|
+
# Step 2: If config file provided, parse it
|
|
39
|
+
if args_ap.config_file:
|
|
40
|
+
config_parser = configparser.ConfigParser()
|
|
41
|
+
config_parser.read(args_ap.config_file)
|
|
42
|
+
args_cp = my_config_parser(config_parser)
|
|
43
|
+
|
|
44
|
+
# Override default args with values from config file
|
|
45
|
+
for cp_arg in args_cp:
|
|
46
|
+
name, value = cp_arg
|
|
47
|
+
arg = args.get_arg(name)
|
|
48
|
+
arg.val = value
|
|
49
|
+
|
|
50
|
+
# Step 3: Override again with CLI arguments (if present)
|
|
51
|
+
for name, value in args_dict.items():
|
|
52
|
+
if name == "config_file":
|
|
53
|
+
continue
|
|
54
|
+
if value is not None:
|
|
55
|
+
arg = args.get_arg(name.upper())
|
|
56
|
+
arg.val = value
|
|
57
|
+
|
|
58
|
+
# Step 4: Finalize
|
|
48
59
|
args.to_python()
|
|
49
60
|
args.write_config_file()
|
|
61
|
+
|
|
50
62
|
return args
|
|
51
63
|
|
|
52
64
|
def main():
|
|
@@ -254,7 +254,7 @@ class StochasticSimulation:
|
|
|
254
254
|
|
|
255
255
|
# Save simulation info
|
|
256
256
|
if save:
|
|
257
|
-
save_dir = os.path.join(self.path, 'other')
|
|
257
|
+
save_dir = os.path.join(self.path, 'other') + '/'
|
|
258
258
|
with open(save_dir + 'info.txt', "w") as f:
|
|
259
259
|
f.write(f'Number of beads {self.N_beads}.\n')
|
|
260
260
|
f.write(f'Number of cohesins {self.N_lef}. Number of cohesins in second family {self.N_lef2}. Number of CTCFs {self.N_CTCF}. \n')
|
|
@@ -6,7 +6,7 @@ with open('README.md', 'r', encoding='utf-8') as f:
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name='pyLoopSage', # Package name
|
|
9
|
-
version='1.0.
|
|
9
|
+
version='1.0.22', # Version of the software
|
|
10
10
|
description='An energy-based stochastic model of loop extrusion in chromatin.',
|
|
11
11
|
long_description=long_description,
|
|
12
12
|
long_description_content_type='text/markdown',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|