pyfraglib 0.0.1__tar.gz → 0.6.2__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.
Files changed (112) hide show
  1. pyfraglib-0.6.2/.gitignore +27 -0
  2. pyfraglib-0.6.2/PKG-INFO +129 -0
  3. pyfraglib-0.6.2/README.md +84 -0
  4. pyfraglib-0.6.2/configs/gmm_1.json +10 -0
  5. pyfraglib-0.6.2/configs/gmm_2.json +10 -0
  6. pyfraglib-0.6.2/configs/gmm_3.json +10 -0
  7. pyfraglib-0.6.2/configs/simulation_basic.json +25 -0
  8. pyfraglib-0.6.2/configs/simulation_cancer_progression.json +10 -0
  9. pyfraglib-0.6.2/configs/simulation_tissue_mixture.json +10 -0
  10. pyfraglib-0.6.2/docs/Makefile +22 -0
  11. pyfraglib-0.6.2/docs/imgs/api_classes.dot +27 -0
  12. pyfraglib-0.6.2/docs/imgs/api_classes.png +0 -0
  13. pyfraglib-0.6.2/docs/imgs/cfdna_cleavage_biology.dot +147 -0
  14. pyfraglib-0.6.2/docs/imgs/cfdna_cleavage_biology.png +0 -0
  15. pyfraglib-0.6.2/docs/imgs/nf_pipeline.dot +62 -0
  16. pyfraglib-0.6.2/docs/imgs/nf_pipeline.png +0 -0
  17. pyfraglib-0.6.2/docs/imgs/pyfraglib_logo.jpg +0 -0
  18. pyfraglib-0.6.2/docs/imgs/pyfraglib_logo.png +0 -0
  19. pyfraglib-0.6.2/docs/imgs/pyfraglib_logo_old.jpg +0 -0
  20. pyfraglib-0.6.2/docs/imgs/simulation_architecture.dot +116 -0
  21. pyfraglib-0.6.2/docs/imgs/simulation_architecture.png +0 -0
  22. pyfraglib-0.6.2/docs/imgs/simulation_architecture_simplified.dot +48 -0
  23. pyfraglib-0.6.2/docs/imgs/simulation_architecture_simplified.png +0 -0
  24. pyfraglib-0.6.2/docs/imgs/workflow.dot +100 -0
  25. pyfraglib-0.6.2/docs/imgs/workflow.png +0 -0
  26. pyfraglib-0.6.2/docs/pyfraglib_documentation.pdf +0 -0
  27. pyfraglib-0.6.2/docs/requirements.txt +4 -0
  28. pyfraglib-0.6.2/docs/source/_static/custom.css +39 -0
  29. pyfraglib-0.6.2/docs/source/_templates/autosummary/class.rst +28 -0
  30. pyfraglib-0.6.2/docs/source/api/index.rst +52 -0
  31. pyfraglib-0.6.2/docs/source/changelog.rst +23 -0
  32. pyfraglib-0.6.2/docs/source/cli/extract.rst +52 -0
  33. pyfraglib-0.6.2/docs/source/cli/index.rst +59 -0
  34. pyfraglib-0.6.2/docs/source/cli/lengths.rst +53 -0
  35. pyfraglib-0.6.2/docs/source/cli/scores.rst +148 -0
  36. pyfraglib-0.6.2/docs/source/cli/scripts.rst +239 -0
  37. pyfraglib-0.6.2/docs/source/cli/simulate.rst +77 -0
  38. pyfraglib-0.6.2/docs/source/cli/stats.rst +37 -0
  39. pyfraglib-0.6.2/docs/source/conf.py +244 -0
  40. pyfraglib-0.6.2/docs/source/contributing.rst +44 -0
  41. pyfraglib-0.6.2/docs/source/index.rst +21 -0
  42. pyfraglib-0.6.2/docs/source/installation.rst +49 -0
  43. pyfraglib-0.6.2/docs/source/quickstart.rst +161 -0
  44. pyfraglib-0.6.2/docs/source/simulation/index.rst +210 -0
  45. pyfraglib-0.6.2/notebooks/gmm_demo.py +88 -0
  46. pyfraglib-0.6.2/notebooks/pcnsl_gmm.py +559 -0
  47. pyfraglib-0.6.2/notebooks/pcnsl_visualize_vcf.py +154 -0
  48. pyfraglib-0.6.2/notebooks/pcnsl_visualize_wps_MYD88.py +72 -0
  49. pyfraglib-0.6.2/notebooks/pcnsl_wpr_predictor.py +430 -0
  50. pyfraglib-0.6.2/notebooks/pcnsl_wps_predictor.py +227 -0
  51. pyfraglib-0.6.2/notebooks/start_marimo_server.sh +10 -0
  52. pyfraglib-0.6.2/pyfraglib/__init__.py +206 -0
  53. pyfraglib-0.6.2/pyfraglib/core.py +352 -0
  54. pyfraglib-0.6.2/pyfraglib/fragfile.py +342 -0
  55. pyfraglib-0.6.2/pyfraglib/fragment.py +1323 -0
  56. pyfraglib-0.6.2/pyfraglib/lengths.py +249 -0
  57. pyfraglib-0.6.2/pyfraglib/math.py +350 -0
  58. pyfraglib-0.6.2/pyfraglib/scores.py +1083 -0
  59. pyfraglib-0.6.2/pyfraglib/simulator/__init__.py +32 -0
  60. pyfraglib-0.6.2/pyfraglib/simulator/fragment_simulator.py +1182 -0
  61. pyfraglib-0.6.2/pyfraglib/simulator/tissue_mixture_simulator.py +535 -0
  62. pyfraglib-0.6.2/pyfraglib/stats.py +379 -0
  63. pyfraglib-0.6.2/pyfraglib.egg-info/PKG-INFO +129 -0
  64. pyfraglib-0.6.2/pyfraglib.egg-info/SOURCES.txt +99 -0
  65. pyfraglib-0.6.2/pyfraglib.egg-info/requires.txt +19 -0
  66. {pyfraglib-0.0.1 → pyfraglib-0.6.2}/pyfraglib.egg-info/top_level.txt +1 -0
  67. pyfraglib-0.6.2/pyfraglib.yml +45 -0
  68. pyfraglib-0.0.1/pyfraglib/__init__.py → pyfraglib-0.6.2/pyproject.toml +22 -13
  69. pyfraglib-0.6.2/scripts/__init__.py +18 -0
  70. pyfraglib-0.6.2/scripts/differential_end_motifs.py +496 -0
  71. pyfraglib-0.6.2/scripts/differential_wps.py +466 -0
  72. pyfraglib-0.6.2/scripts/download_tss_annos.py +266 -0
  73. pyfraglib-0.6.2/scripts/extract_mutated_reads.py +276 -0
  74. pyfraglib-0.6.2/scripts/learn_nuclease_params.py +586 -0
  75. pyfraglib-0.6.2/scripts/nmf_fragment_lengths.py +631 -0
  76. pyfraglib-0.6.2/scripts/pyfrag.py +938 -0
  77. pyfraglib-0.6.2/scripts/txt_to_vcf.py +266 -0
  78. pyfraglib-0.6.2/setup.py +76 -0
  79. pyfraglib-0.0.1/pyfraglib/core.py → pyfraglib-0.6.2/tests/__init__.py +0 -20
  80. pyfraglib-0.6.2/tests/test_core.py +187 -0
  81. pyfraglib-0.6.2/tests/test_differential_wps.py +226 -0
  82. pyfraglib-0.6.2/tests/test_fixtures.py +171 -0
  83. pyfraglib-0.6.2/tests/test_fragfile.py +244 -0
  84. pyfraglib-0.6.2/tests/test_fragment.py +893 -0
  85. pyfraglib-0.6.2/tests/test_math.py +465 -0
  86. pyfraglib-0.6.2/tests/test_nmf.py +334 -0
  87. pyfraglib-0.6.2/tests/test_runner.py +195 -0
  88. pyfraglib-0.6.2/tests/test_scores.py +365 -0
  89. pyfraglib-0.6.2/tools/annotate.sh +44 -0
  90. pyfraglib-0.6.2/tools/build_docs.sh +116 -0
  91. pyfraglib-0.0.1/setup.py → pyfraglib-0.6.2/tools/clean.sh +14 -20
  92. pyfraglib-0.6.2/tools/dev_install.sh +22 -0
  93. pyfraglib-0.6.2/tools/example.config +71 -0
  94. pyfraglib-0.6.2/tools/example_sample_sheet.tsv +2 -0
  95. pyfraglib-0.6.2/tools/pipeline.nf +226 -0
  96. pyfraglib-0.6.2/tools/publish.sh +19 -0
  97. pyfraglib-0.6.2/tools/workflow.sh +32 -0
  98. pyfraglib-0.0.1/PKG-INFO +0 -46
  99. pyfraglib-0.0.1/README.md +0 -31
  100. pyfraglib-0.0.1/pyfraglib/frag_fileformat.py +0 -0
  101. pyfraglib-0.0.1/pyfraglib/fragment.py +0 -248
  102. pyfraglib-0.0.1/pyfraglib/lengths.py +0 -86
  103. pyfraglib-0.0.1/pyfraglib/scores.py +0 -0
  104. pyfraglib-0.0.1/pyfraglib/stats.py +0 -121
  105. pyfraglib-0.0.1/pyfraglib.egg-info/PKG-INFO +0 -46
  106. pyfraglib-0.0.1/pyfraglib.egg-info/SOURCES.txt +0 -17
  107. pyfraglib-0.0.1/pyfraglib.egg-info/requires.txt +0 -4
  108. pyfraglib-0.0.1/scripts/pyfrag.py +0 -193
  109. {pyfraglib-0.0.1 → pyfraglib-0.6.2}/LICENSE.md +0 -0
  110. {pyfraglib-0.0.1 → pyfraglib-0.6.2}/pyfraglib/py.typed +0 -0
  111. {pyfraglib-0.0.1 → pyfraglib-0.6.2}/pyfraglib.egg-info/dependency_links.txt +0 -0
  112. {pyfraglib-0.0.1 → pyfraglib-0.6.2}/setup.cfg +0 -0
@@ -0,0 +1,27 @@
1
+ tools/nextflow.config
2
+ pyfrag_out
3
+ frag_out
4
+ plot_out
5
+ scores_out
6
+ pcnsl_cohort
7
+ .mypy_cache/
8
+ __pycache__/
9
+ *egg-info/
10
+ build/
11
+ dist/
12
+ data/
13
+ plots/
14
+ project-lymphoma-cfdna-old/
15
+ *.out
16
+ job.sh
17
+ tags
18
+ .ipynb_checkpoints/
19
+ notebooks/*.png
20
+ notebooks/*/
21
+ .nextflow
22
+ *.log*
23
+ *.md
24
+ *.pdf
25
+ docs/source/api/generated/
26
+ presentations
27
+ paper
@@ -0,0 +1,129 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyfraglib
3
+ Version: 0.6.2
4
+ Summary: Software suite to calculate fragmentomics features from cfDNA and perform downstream analyses.
5
+ Home-page: https://bitbucket.org/schwarzlab/project-lymphoma-cfdna/
6
+ Author: Daniel Schütte
7
+ Author-email: daniel.schuette@iccb-cologne.org
8
+ License: GPL-v3
9
+ Keywords: cfDNA,fragmentomics
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE.md
15
+ Requires-Dist: pysam>=0.22.1
16
+ Requires-Dist: matplotlib>=3.9.0
17
+ Requires-Dist: numpy>=2.4.0
18
+ Requires-Dist: seaborn>=0.13.2
19
+ Requires-Dist: matplotlib-stubs>=0.2.0
20
+ Requires-Dist: types-seaborn>=0.13.2.20240820
21
+ Requires-Dist: pandas>=2.2.2
22
+ Requires-Dist: intervaltree>=3.1.0
23
+ Requires-Dist: scipy>=1.14.1
24
+ Requires-Dist: scipy-stubs>=1.14.1.4
25
+ Requires-Dist: tqdm>=4.67.0
26
+ Requires-Dist: types-tqdm>=4.67.0.20241119
27
+ Requires-Dist: mypy>=1.13.0
28
+ Requires-Dist: flake8>=7.1.1
29
+ Requires-Dist: statsmodels>=0.14.4
30
+ Requires-Dist: scikit-learn>=1.5.2
31
+ Requires-Dist: pyabc>=0.12.16
32
+ Requires-Dist: pyarrow>=15.0.0
33
+ Requires-Dist: pyarrow-stubs>=20.0.0
34
+ Dynamic: author
35
+ Dynamic: author-email
36
+ Dynamic: classifier
37
+ Dynamic: description
38
+ Dynamic: description-content-type
39
+ Dynamic: home-page
40
+ Dynamic: keywords
41
+ Dynamic: license
42
+ Dynamic: license-file
43
+ Dynamic: requires-dist
44
+ Dynamic: summary
45
+
46
+ # pyfraglib
47
+
48
+ ![pyfraglib Logo](docs/imgs/pyfraglib_logo.jpg)
49
+
50
+ ## Overview
51
+
52
+ `pyfraglib` is a Python library to analyze high-throughput sequencing data of
53
+ cell-free DNA (cfDNA). More specifically, it facilitates the investigation of
54
+ fragmentomics features of which a list can be found below.
55
+
56
+ Because fragmentation of cfDNA is non-random, tissue- and disease-specific
57
+ patterns emerge in e.g. fragment length or end motif distributions. To date,
58
+ no comprehensive tool exists to implement a "fragmentomics workflow".
59
+ `pyfraglib` aims at being such at tool.
60
+
61
+ ## Installation
62
+
63
+ It is recommended that `pyfraglib` is installed into a dedicated conda
64
+ environment using `pip`, the Python package manager:
65
+
66
+ ```bash
67
+ git clone git@bitbucket.org:schwarzlab/pyfraglib.git
68
+ cd pyfraglib
69
+ conda env create -f pyfraglib.yml
70
+ conda activate pyfraglib
71
+ python3 -m pip install .
72
+ ```
73
+
74
+ During development, all code in `pyfraglib` is thoroughly type-checked using
75
+ `mypy`. After an initial installation as described above, do:
76
+
77
+ ```bash
78
+ ./tools/dev_install.sh # typing & linting errors are reported
79
+ ```
80
+
81
+ ## Usage
82
+
83
+ `pyfraglib` comes with a command line utility. After successful installation,
84
+ it can be used as follows:
85
+
86
+ ```bash
87
+ pyfrag.py version # show currently installed version
88
+ pyfrag.py --help # show available subcommands and flags
89
+ ```
90
+
91
+ `tools/workflow.sh` gives an example of a commonly used sequence of commands.
92
+
93
+ ## Pipeline
94
+
95
+ `pyfraglib` offers a simple batch mode for most operations, i.e. it can take
96
+ a directory of BAM or FRAG files and perform analyses on them. Some operations
97
+ (i.e. the `extract` subcommand) are even parallelized. We explicitly do not
98
+ recommend using this functionality for the analysis of large cohorts. Even 10
99
+ BAM files cannot be extracted at once without exceeding most workstation's
100
+ memory. Thus, we include a convenient Nextflow pipeline in `tools/pipeline.nf`.
101
+ It reads the input data from a TSV file and Nextflow parallelizes `pyfraglib`s
102
+ operations as much as possible. See `tools/nextflow.config` for all paths and
103
+ variables that must be set by the user. Currently, only `slurm` is supported as
104
+ a scheduler (via the `ramses` profile).
105
+
106
+ ## Available fragmentomics features
107
+
108
+ Please refer to the project's documentation for a list of currently supported
109
+ features (see below for instructions on how to build documentation using
110
+ Sphinx).
111
+
112
+ ## Documentation
113
+
114
+ Sphinx is used to create documentation. The easiest way to create repository-wide
115
+ documentation in HTML or PDF format, run:
116
+
117
+ ```bash
118
+ ./tools/build_docs.sh pdf # or:
119
+ ./tools/build_docs.sh html
120
+ ```
121
+
122
+ ## Citation
123
+
124
+ As long as `pyfraglib` is not published, please cite this repository if you use it in your scientific work.
125
+
126
+ ## License
127
+ `pyfraglib` is licensed under the GPL-v3 as indicated in the source files.
128
+ Please direct requests to <daniel.schuette@iccb-cologne.org>.
129
+
@@ -0,0 +1,84 @@
1
+ # pyfraglib
2
+
3
+ ![pyfraglib Logo](docs/imgs/pyfraglib_logo.jpg)
4
+
5
+ ## Overview
6
+
7
+ `pyfraglib` is a Python library to analyze high-throughput sequencing data of
8
+ cell-free DNA (cfDNA). More specifically, it facilitates the investigation of
9
+ fragmentomics features of which a list can be found below.
10
+
11
+ Because fragmentation of cfDNA is non-random, tissue- and disease-specific
12
+ patterns emerge in e.g. fragment length or end motif distributions. To date,
13
+ no comprehensive tool exists to implement a "fragmentomics workflow".
14
+ `pyfraglib` aims at being such at tool.
15
+
16
+ ## Installation
17
+
18
+ It is recommended that `pyfraglib` is installed into a dedicated conda
19
+ environment using `pip`, the Python package manager:
20
+
21
+ ```bash
22
+ git clone git@bitbucket.org:schwarzlab/pyfraglib.git
23
+ cd pyfraglib
24
+ conda env create -f pyfraglib.yml
25
+ conda activate pyfraglib
26
+ python3 -m pip install .
27
+ ```
28
+
29
+ During development, all code in `pyfraglib` is thoroughly type-checked using
30
+ `mypy`. After an initial installation as described above, do:
31
+
32
+ ```bash
33
+ ./tools/dev_install.sh # typing & linting errors are reported
34
+ ```
35
+
36
+ ## Usage
37
+
38
+ `pyfraglib` comes with a command line utility. After successful installation,
39
+ it can be used as follows:
40
+
41
+ ```bash
42
+ pyfrag.py version # show currently installed version
43
+ pyfrag.py --help # show available subcommands and flags
44
+ ```
45
+
46
+ `tools/workflow.sh` gives an example of a commonly used sequence of commands.
47
+
48
+ ## Pipeline
49
+
50
+ `pyfraglib` offers a simple batch mode for most operations, i.e. it can take
51
+ a directory of BAM or FRAG files and perform analyses on them. Some operations
52
+ (i.e. the `extract` subcommand) are even parallelized. We explicitly do not
53
+ recommend using this functionality for the analysis of large cohorts. Even 10
54
+ BAM files cannot be extracted at once without exceeding most workstation's
55
+ memory. Thus, we include a convenient Nextflow pipeline in `tools/pipeline.nf`.
56
+ It reads the input data from a TSV file and Nextflow parallelizes `pyfraglib`s
57
+ operations as much as possible. See `tools/nextflow.config` for all paths and
58
+ variables that must be set by the user. Currently, only `slurm` is supported as
59
+ a scheduler (via the `ramses` profile).
60
+
61
+ ## Available fragmentomics features
62
+
63
+ Please refer to the project's documentation for a list of currently supported
64
+ features (see below for instructions on how to build documentation using
65
+ Sphinx).
66
+
67
+ ## Documentation
68
+
69
+ Sphinx is used to create documentation. The easiest way to create repository-wide
70
+ documentation in HTML or PDF format, run:
71
+
72
+ ```bash
73
+ ./tools/build_docs.sh pdf # or:
74
+ ./tools/build_docs.sh html
75
+ ```
76
+
77
+ ## Citation
78
+
79
+ As long as `pyfraglib` is not published, please cite this repository if you use it in your scientific work.
80
+
81
+ ## License
82
+ `pyfraglib` is licensed under the GPL-v3 as indicated in the source files.
83
+ Please direct requests to <daniel.schuette@iccb-cologne.org>.
84
+
@@ -0,0 +1,10 @@
1
+ {
2
+ "number_of_gaussians": 1,
3
+ "subsample_percentage": 0.80,
4
+ "means_lower_bounds": [50],
5
+ "means_upper_bounds": [250],
6
+ "std_lower_bounds": [1],
7
+ "std_upper_bounds": [150],
8
+ "initial_means": [167],
9
+ "initial_pis": [1.0]
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "number_of_gaussians": 2,
3
+ "subsample_percentage": 0.10,
4
+ "means_lower_bounds": [50, 250],
5
+ "means_upper_bounds": [250, 450],
6
+ "std_lower_bounds": [1, 1],
7
+ "std_upper_bounds": [100, 100],
8
+ "initial_means": [160, 320],
9
+ "initial_pis": [0.70, 0.30]
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "number_of_gaussians": 3,
3
+ "subsample_percentage": 0.10,
4
+ "means_lower_bounds": [50, 250, 450],
5
+ "means_upper_bounds": [250, 450, 650],
6
+ "std_lower_bounds": [1, 1, 1],
7
+ "std_upper_bounds": [30, 60, 90],
8
+ "initial_means": [160, 320, 480],
9
+ "initial_pis": [0.70, 0.20, 0.10]
10
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "simulation_mode": "basic",
3
+ "output_name": "simulated_sample",
4
+ "fasta_path": "./data/ref/Homo_sapiens.GRCh37.dna.primary_assembly.fa",
5
+ "tissue_type": "healthy",
6
+ "bed_file": "data/ref/example_loci.bed",
7
+ "total_fragments": 500000,
8
+ "fragment_params": {
9
+ "mean": 167,
10
+ "std": 25,
11
+ "di_mean": 333,
12
+ "di_std": 45,
13
+ "tri_mean": 500,
14
+ "tri_std": 65,
15
+ "mono_fraction": 0.85,
16
+ "di_fraction": 0.10,
17
+ "mono_skew": -2,
18
+ "periodicity_amplitude": 0.3
19
+ },
20
+ "nuclease_params": {
21
+ "dnase1_activity": 0.5,
22
+ "dnase1l3_activity": 8.0,
23
+ "dffb_activity": 0.5
24
+ }
25
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "simulation_mode": "cancer_progression",
3
+ "output_name": "cancer_progression",
4
+ "fasta_path": "data/ref/Homo_sapiens.GRCh37.dna.primary_assembly.fa",
5
+ "normal_profile": "hematopoietic",
6
+ "tumor_fractions": [0.0, 0.05, 0.15, 0.30, 0.50],
7
+ "time_points": ["baseline", "3months", "6months", "12months", "18months"],
8
+ "fragments_per_timepoint": 100000,
9
+ "bed_file": "data/ref/example_loci.bed"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "simulation_mode": "tissue_mixture",
3
+ "output_name": "tissue_mixture_sample",
4
+ "fasta_path": "data/ref/Homo_sapiens.GRCh37.dna.primary_assembly.fa",
5
+ "tissue_types": ["hematopoietic", "liver"],
6
+ "tissue_fractions": [0.7, 0.3],
7
+ "total_fragments": 1000000,
8
+ "add_noise": false,
9
+ "bed_file": "data/ref/example_loci.bed"
10
+ }
@@ -0,0 +1,22 @@
1
+ # Minimal Makefile for Sphinx documentation
2
+ SPHINXOPTS ?=
3
+ SPHINXBUILD ?= sphinx-build
4
+ SOURCEDIR = source
5
+ BUILDDIR = build
6
+
7
+ # @NOTE(ds): Put it first so that "make" without argument is like "make help".
8
+ help:
9
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
10
+
11
+ .PHONY: help latexpdf Makefile
12
+
13
+ # latexpdf: run Sphinx latexpdf then a second pdflatex pass so that the
14
+ # List of Figures is populated (lof entries are written on pass 1, read on pass 2).
15
+ latexpdf:
16
+ @$(SPHINXBUILD) -M latexpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
17
+ @cd "$(BUILDDIR)/latex" && pdflatex -interaction=nonstopmode pyfraglib_documentation.tex > /dev/null
18
+ @echo "latexpdf: second pdflatex pass done — List of Figures populated."
19
+
20
+ # Catch-all target: route all unknown targets to Sphinx-Makefile
21
+ %: Makefile
22
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,27 @@
1
+ digraph pyfraglib_api {
2
+ rankdir=TB;
3
+ bgcolor="white";
4
+ node [shape=box, style=filled, fontname="Arial", fontsize=12];
5
+ edge [fontname="Arial", fontsize=10, color=black];
6
+
7
+ Fragment [fillcolor=lightcyan, shape=record,
8
+ label="Fragment|• chrom: str\l• start_pos: int\l• end_pos: int\l• length: int\l• end5p: str\l• end3p: str\l• is_mutated: bool\l• is_bogus: bool\l|\l• from_bam() [static]\l• utility methods\l"];
9
+
10
+ FragmentList [fillcolor=lightgreen, shape=record,
11
+ label="FragmentList|• fragments: List[Fragment]\l• sample_name: str\l|• to_frag_file()\l• __iter__()\l• utility methods\l"];
12
+
13
+ FragmentCollection [fillcolor=lightpink, shape=record,
14
+ label="FragmentCollection|• fragment_lists: Dict[str, FragmentList]\l• sample_names: List[str]\l|• add_fragment_list()\l• __iter__()\l• utility methods\l"];
15
+
16
+ FragFile [fillcolor=lightyellow, shape=record,
17
+ label="FragFile|• file_path: str\l|• load()\l• save()\l• __iter__()\l• get_fragment_list()\l"];
18
+
19
+ FragmentList -> Fragment [label="composes", penwidth=2];
20
+ FragmentCollection -> FragmentList [label="composes", penwidth=2];
21
+ FragFile -> Fragment [label="deserializes", style=dashed, penwidth=2];
22
+ FragFile -> FragmentList [label="deserializes", style=dashed, penwidth=2];
23
+
24
+ Fragment -> FragmentList [label="from_bam()", style=bold, penwidth=2];
25
+ Fragment -> FragFile [label="serializes", style=dotted, penwidth=2];
26
+ FragmentList -> FragFile [label="serializes", style=dotted, penwidth=2];
27
+ }
@@ -0,0 +1,147 @@
1
+ // This file is part of `pyfraglib`, a software suite to calculate fragmentomics
2
+ // features from cfDNA and perform downstream analyses.
3
+ //
4
+ // Copyright (C) 2024 Daniel Schütte, daniel.schuette@iccb-cologne.org
5
+ //
6
+ // This program is free software: you can redistribute it and/or modify it under
7
+ // the terms of the GNU General Public License as published by the Free Software
8
+ // Foundation, either version 3 of the License, or (at your option) any later
9
+ // version. This program is distributed in the hope that it will be useful, but
10
+ // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
+ // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
+ // more details. You should have received a copy of the GNU General Public
13
+ // License along with this program. If not, see <https://www.gnu.org/licenses/>.
14
+
15
+ digraph cfDNA_Cleavage {
16
+ graph [
17
+ rankdir=LR,
18
+ bgcolor="white", // transparent
19
+ fontname="Arial",
20
+ fontsize=14,
21
+ margin=0.0,
22
+ compound=true,
23
+ penwidth=0,
24
+ style="invis"
25
+ ];
26
+
27
+ node [
28
+ fontname="Arial",
29
+ fontsize=11,
30
+ shape=box,
31
+ style=filled
32
+ ];
33
+
34
+ edge [
35
+ fontname="Arial",
36
+ fontsize=10
37
+ ];
38
+
39
+ subgraph cluster_intracellular {
40
+ label="INTRACELLULAR";
41
+ fontsize=16;
42
+ fontname="Arial Bold";
43
+ style=filled;
44
+ fillcolor="#e8f4f8";
45
+ color="#2c5aa0";
46
+ penwidth=3;
47
+ margin=15;
48
+
49
+ subgraph cluster_nucleus {
50
+ label="NUCLEUS";
51
+ fontsize=12;
52
+ style=filled;
53
+ fillcolor="#4169e1";
54
+ color="#4169e1";
55
+ margin=10;
56
+
57
+ chromatin [
58
+ label="Chromatin",
59
+ fontsize=18,
60
+ fillcolor="#ffffff"
61
+ ];
62
+ }
63
+
64
+ apoptosis [
65
+ label="Apoptosis",
66
+ fillcolor="#ffffff",
67
+ shape=ellipse
68
+ ];
69
+
70
+ necrosis [
71
+ label="Necrosis",
72
+ fillcolor="#ffffff",
73
+ shape=ellipse
74
+ ];
75
+
76
+ dffb_nuclease [
77
+ label="DFFB\n• Linker preference\n• A-rich ends",
78
+ fillcolor="#ffd700"
79
+ ];
80
+ }
81
+
82
+ subgraph cluster_extracellular {
83
+ label="EXTRACELLULAR";
84
+ fontsize=16;
85
+ fontname="Arial Bold";
86
+ style=filled;
87
+ fillcolor="#f0fff0";
88
+ color="#228b22";
89
+ penwidth=3;
90
+ margin=15;
91
+
92
+ extracellular_cfdna1 [
93
+ label="cfDNA",
94
+ fontsize=18,
95
+ fillcolor="#ffffff"
96
+ ];
97
+
98
+ dnase1_nuclease [
99
+ label="DNase I\n• Secreted enzyme\n• AT-rich preference\n• T-rich ends",
100
+ fillcolor="#98fb98"
101
+ ];
102
+
103
+ extracellular_cfdna2 [
104
+ label="cfDNA",
105
+ fontsize=18,
106
+ fillcolor="#ffffff"
107
+ ];
108
+ }
109
+
110
+ subgraph cluster_bloodstream {
111
+ label="BLOODSTREAM";
112
+ fontsize=16;
113
+ fontname="Arial Bold";
114
+ style=filled;
115
+ fillcolor="#fff0f5";
116
+ color="#dc143c";
117
+ penwidth=3;
118
+ margin=15;
119
+
120
+ plasma_cfdna [
121
+ label="cfDNA",
122
+ fontsize=18,
123
+ fillcolor="#ffffff"
124
+ ];
125
+
126
+ dnase1l3_nuclease [
127
+ label="DNase1L3\n• Primary plasma nuclease\n• CC preference\n• Major cfDNA processor",
128
+ fillcolor="#ff69b4"
129
+ ];
130
+
131
+ final_fragments [
132
+ label="Final cfDNA",
133
+ fontsize=18,
134
+ fillcolor="#ffffff"
135
+ ];
136
+ }
137
+
138
+ apoptosis -> dffb_nuclease [label="activates"];
139
+ necrosis -> extracellular_cfdna1 [label="uncontrolled release"];
140
+ dffb_nuclease -> chromatin [label="cleaves"];
141
+ chromatin -> extracellular_cfdna1 [label="controlled release"];
142
+ extracellular_cfdna1 -> dnase1_nuclease;
143
+ dnase1_nuclease -> extracellular_cfdna2 [label="cleaves"];
144
+ extracellular_cfdna2 -> plasma_cfdna [label="enters circulation"];
145
+ plasma_cfdna -> dnase1l3_nuclease;
146
+ dnase1l3_nuclease -> final_fragments [label="cleaves"];
147
+ }
@@ -0,0 +1,62 @@
1
+ // This file is part of `pyfraglib`, a software suite to calculate fragmentomics
2
+ // features from cfDNA and perform downstream analyses.
3
+ //
4
+ // Copyright (C) 2024 Daniel Schütte, daniel.schuette@iccb-cologne.org
5
+ //
6
+ // This program is free software: you can redistribute it and/or modify it under
7
+ // the terms of the GNU General Public License as published by the Free Software
8
+ // Foundation, either version 3 of the License, or (at your option) any later
9
+ // version. This program is distributed in the hope that it will be useful, but
10
+ // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
+ // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
+ // more details. You should have received a copy of the GNU General Public
13
+ // License along with this program. If not, see <https://www.gnu.org/licenses/>.
14
+
15
+ digraph Nextflow_Pipeline {
16
+ rankdir=LR;
17
+ // > bgcolor="transparent";
18
+
19
+ subgraph cluster_individual {
20
+ label="Parallel Processing";
21
+ style=solid;
22
+ fontsize=14;
23
+
24
+ C1 [label=<extract BAM<SUB>1</SUB>>];
25
+ C2 [label=<extract BAM<SUB>2</SUB>>];
26
+ Ci [label=<extract BAM<SUB>i</SUB>>,fontcolor=gray,color=gray,style=dashed];
27
+ Cn [label=<extract BAM<SUB>n</SUB>>];
28
+
29
+ D1 [label=<process FRAG<SUB>1</SUB>>];
30
+ D2 [label=<process FRAG<SUB>2</SUB>>];
31
+ Di [label=<process FRAG<SUB>i</SUB>>,fontcolor=gray,color=gray,style=dashed];
32
+ Dn [label=<process FRAG<SUB>n</SUB>>];
33
+
34
+ E1 [label=<save results<SUB>1</SUB>>];
35
+ E2 [label=<save results<SUB>2</SUB>>];
36
+ Ei [label=<save results<SUB>i</SUB>>,fontcolor=gray,color=gray,style=dashed];
37
+ En [label=<save results<SUB>n</SUB>>];
38
+
39
+ C1 -> D1 -> E1;
40
+ C2 -> D2 -> E2;
41
+ Ci -> Di -> Ei [fontcolor=gray,color=gray,style=dashed];
42
+ Cn -> Dn -> En;
43
+ }
44
+
45
+ F [label="NMF (fit + projection),\nDifferential End Motifs,\nDifferential WPS",shape=box,fontsize=12];
46
+ G [label="Cohort\nWide\nResults",shape=box,fontsize=12];
47
+
48
+ A -> B [label="nextflow run",fontcolor=darkred,style=bold];
49
+ B -> C1;
50
+ B -> C2;
51
+ B -> Ci [color=gray,style=dashed];
52
+ B -> Cn;
53
+
54
+ E1 -> F [style=bold];
55
+ E2 -> F [style=bold];
56
+ Ei -> F [fontcolor=gray,color=gray,style=dashed];
57
+ En -> F [style=bold];
58
+ F -> G [style=bold];
59
+
60
+ A [label=<Sample Sheet<BR/>(<I>n</I> samples)>,shape=box,fontsize=14];
61
+ B [label="Nextflow\nOrchestrator",shape=circle,fontsize=12];
62
+ }