smftools 0.2.4__tar.gz → 0.2.5__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 (300) hide show
  1. smftools-0.2.5/.github/workflows/ci.yml +115 -0
  2. {smftools-0.2.4 → smftools-0.2.5}/.gitignore +3 -1
  3. smftools-0.2.5/.pre-commit-config.yaml +7 -0
  4. {smftools-0.2.4 → smftools-0.2.5}/.readthedocs.yaml +2 -3
  5. smftools-0.2.5/AGENTS.md +59 -0
  6. {smftools-0.2.4 → smftools-0.2.5}/PKG-INFO +15 -43
  7. smftools-0.2.5/README.md +14 -0
  8. smftools-0.2.5/docs/source/api/datasets.md +14 -0
  9. smftools-0.2.5/docs/source/api/informatics.md +44 -0
  10. smftools-0.2.5/docs/source/api/preprocessing.md +43 -0
  11. smftools-0.2.5/docs/source/api/tools.md +20 -0
  12. {smftools-0.2.4 → smftools-0.2.5}/docs/source/basic_usage.md +36 -1
  13. smftools-0.2.5/docs/source/cli.md +6 -0
  14. smftools-0.2.5/docs/source/conf.py +233 -0
  15. {smftools-0.2.4 → smftools-0.2.5}/docs/source/contributors.md +1 -1
  16. {smftools-0.2.4 → smftools-0.2.5}/docs/source/index.md +3 -1
  17. smftools-0.2.5/docs/source/release-notes/0.1.0.md +6 -0
  18. smftools-0.2.5/docs/source/release-notes/0.1.1.md +4 -0
  19. smftools-0.2.5/docs/source/release-notes/0.1.6.md +4 -0
  20. smftools-0.2.5/docs/source/release-notes/0.2.1.md +4 -0
  21. smftools-0.2.5/docs/source/release-notes/0.2.3.md +4 -0
  22. smftools-0.2.5/docs/source/release-notes/index.md +30 -0
  23. {smftools-0.2.4 → smftools-0.2.5}/docs/source/requirements.txt +2 -0
  24. smftools-0.2.5/docs/source/schema/anndata_schema.md +13 -0
  25. smftools-0.2.5/docs/source/tutorials/cli_usage.md +91 -0
  26. smftools-0.2.5/docs/source/tutorials/experiment_config.md +51 -0
  27. smftools-0.2.5/docs/source/tutorials/index.md +13 -0
  28. {smftools-0.2.4 → smftools-0.2.5}/pyproject.toml +35 -8
  29. {smftools-0.2.4 → smftools-0.2.5}/smftools/__init__.py +6 -8
  30. {smftools-0.2.4 → smftools-0.2.5}/smftools/_settings.py +4 -6
  31. smftools-0.2.5/smftools/_version.py +1 -0
  32. {smftools-0.2.4 → smftools-0.2.5}/smftools/cli/helpers.py +7 -1
  33. smftools-0.2.5/smftools/cli/hmm_adata.py +1019 -0
  34. {smftools-0.2.4 → smftools-0.2.5}/smftools/cli/load_adata.py +318 -198
  35. {smftools-0.2.4 → smftools-0.2.5}/smftools/cli/preprocess_adata.py +285 -171
  36. {smftools-0.2.4 → smftools-0.2.5}/smftools/cli/spatial_adata.py +137 -53
  37. {smftools-0.2.4 → smftools-0.2.5}/smftools/cli_entry.py +94 -178
  38. smftools-0.2.5/smftools/config/__init__.py +1 -0
  39. {smftools-0.2.4 → smftools-0.2.5}/smftools/config/conversion.yaml +5 -1
  40. {smftools-0.2.4 → smftools-0.2.5}/smftools/config/deaminase.yaml +1 -1
  41. {smftools-0.2.4 → smftools-0.2.5}/smftools/config/default.yaml +22 -17
  42. {smftools-0.2.4 → smftools-0.2.5}/smftools/config/direct.yaml +8 -3
  43. {smftools-0.2.4 → smftools-0.2.5}/smftools/config/discover_input_files.py +19 -5
  44. {smftools-0.2.4 → smftools-0.2.5}/smftools/config/experiment_config.py +505 -276
  45. smftools-0.2.5/smftools/constants.py +37 -0
  46. smftools-0.2.5/smftools/datasets/__init__.py +3 -0
  47. smftools-0.2.5/smftools/datasets/datasets.py +42 -0
  48. smftools-0.2.5/smftools/hmm/HMM.py +2286 -0
  49. {smftools-0.2.4 → smftools-0.2.5}/smftools/hmm/__init__.py +2 -3
  50. {smftools-0.2.4 → smftools-0.2.5}/smftools/hmm/archived/call_hmm_peaks.py +16 -1
  51. smftools-0.2.5/smftools/hmm/call_hmm_peaks.py +314 -0
  52. {smftools-0.2.4 → smftools-0.2.5}/smftools/hmm/display_hmm.py +19 -6
  53. {smftools-0.2.4 → smftools-0.2.5}/smftools/hmm/hmm_readwrite.py +13 -4
  54. smftools-0.2.5/smftools/hmm/nucleosome_hmm_refinement.py +192 -0
  55. smftools-0.2.5/smftools/informatics/__init__.py +43 -0
  56. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/align_and_sort_BAM.py +14 -1
  57. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/bam_qc.py +14 -1
  58. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/concatenate_fastqs_to_bam.py +8 -1
  59. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/load_adata.py +3 -3
  60. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/plot_bed_histograms.py +3 -1
  61. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/print_bam_query_seq.py +7 -1
  62. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/bam_functions.py +379 -156
  63. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/basecalling.py +51 -9
  64. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/bed_functions.py +90 -57
  65. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/binarize_converted_base_identities.py +18 -7
  66. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/complement_base_list.py +7 -6
  67. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/converted_BAM_to_adata.py +265 -122
  68. smftools-0.2.5/smftools/informatics/fasta_functions.py +333 -0
  69. smftools-0.2.5/smftools/informatics/h5ad_functions.py +363 -0
  70. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/modkit_extract_to_adata.py +609 -270
  71. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/modkit_functions.py +85 -44
  72. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/ohe.py +44 -21
  73. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/pod5_functions.py +112 -73
  74. smftools-0.2.5/smftools/informatics/run_multiqc.py +37 -0
  75. smftools-0.2.5/smftools/logging_utils.py +51 -0
  76. smftools-0.2.5/smftools/machine_learning/__init__.py +7 -0
  77. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/data/anndata_data_module.py +143 -50
  78. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/data/preprocessing.py +2 -1
  79. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/evaluation/__init__.py +1 -1
  80. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/evaluation/eval_utils.py +11 -14
  81. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/evaluation/evaluators.py +46 -33
  82. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/inference/__init__.py +1 -1
  83. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/inference/inference_utils.py +7 -4
  84. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/inference/lightning_inference.py +9 -13
  85. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/inference/sklearn_inference.py +6 -8
  86. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/inference/sliding_window_inference.py +35 -25
  87. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/models/__init__.py +10 -5
  88. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/models/base.py +28 -42
  89. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/models/cnn.py +15 -11
  90. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/models/lightning_base.py +71 -40
  91. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/models/mlp.py +13 -4
  92. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/models/positional.py +3 -2
  93. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/models/rnn.py +3 -2
  94. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/models/sklearn_models.py +39 -22
  95. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/models/transformer.py +68 -53
  96. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/models/wrappers.py +2 -1
  97. smftools-0.2.5/smftools/machine_learning/training/__init__.py +2 -0
  98. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/training/train_lightning_model.py +29 -20
  99. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/training/train_sklearn_model.py +9 -15
  100. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/utils/__init__.py +1 -1
  101. smftools-0.2.5/smftools/machine_learning/utils/device.py +13 -0
  102. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/utils/grl.py +3 -1
  103. smftools-0.2.5/smftools/metadata.py +443 -0
  104. smftools-0.2.5/smftools/plotting/__init__.py +32 -0
  105. {smftools-0.2.4 → smftools-0.2.5}/smftools/plotting/autocorrelation_plotting.py +145 -44
  106. {smftools-0.2.4 → smftools-0.2.5}/smftools/plotting/classifiers.py +162 -72
  107. {smftools-0.2.4 → smftools-0.2.5}/smftools/plotting/general_plotting.py +347 -168
  108. {smftools-0.2.4 → smftools-0.2.5}/smftools/plotting/hmm_plotting.py +42 -13
  109. {smftools-0.2.4 → smftools-0.2.5}/smftools/plotting/position_stats.py +145 -85
  110. {smftools-0.2.4 → smftools-0.2.5}/smftools/plotting/qc_plotting.py +20 -12
  111. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/__init__.py +8 -8
  112. smftools-0.2.5/smftools/preprocessing/append_base_context.py +157 -0
  113. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/append_binary_layer_by_base_context.py +75 -37
  114. {smftools-0.2.4/smftools/preprocessing/archives → smftools-0.2.5/smftools/preprocessing/archived}/calculate_complexity.py +3 -1
  115. {smftools-0.2.4/smftools/preprocessing/archives → smftools-0.2.5/smftools/preprocessing/archived}/preprocessing.py +8 -6
  116. smftools-0.2.5/smftools/preprocessing/binarize.py +34 -0
  117. smftools-0.2.5/smftools/preprocessing/binarize_on_Youden.py +143 -0
  118. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/binary_layers_to_ohe.py +17 -11
  119. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/calculate_complexity_II.py +86 -59
  120. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/calculate_consensus.py +28 -19
  121. smftools-0.2.5/smftools/preprocessing/calculate_coverage.py +76 -0
  122. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/calculate_pairwise_differences.py +2 -1
  123. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/calculate_pairwise_hamming_distances.py +4 -3
  124. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/calculate_position_Youden.py +103 -55
  125. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/calculate_read_length_stats.py +52 -23
  126. smftools-0.2.5/smftools/preprocessing/calculate_read_modification_stats.py +135 -0
  127. smftools-0.2.5/smftools/preprocessing/clean_NaN.py +72 -0
  128. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/filter_adata_by_nan_proportion.py +24 -12
  129. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/filter_reads_on_length_quality_mapping.py +70 -37
  130. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/filter_reads_on_modification_thresholds.py +181 -73
  131. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/flag_duplicate_reads.py +688 -271
  132. smftools-0.2.5/smftools/preprocessing/invert_adata.py +52 -0
  133. smftools-0.2.5/smftools/preprocessing/load_sample_sheet.py +71 -0
  134. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/make_dirs.py +8 -3
  135. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/min_non_diagonal.py +2 -1
  136. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/recipes.py +56 -23
  137. smftools-0.2.5/smftools/preprocessing/reindex_references_adata.py +103 -0
  138. {smftools-0.2.4 → smftools-0.2.5}/smftools/preprocessing/subsample_adata.py +33 -16
  139. {smftools-0.2.4 → smftools-0.2.5}/smftools/readwrite.py +264 -109
  140. smftools-0.2.5/smftools/schema/__init__.py +11 -0
  141. smftools-0.2.5/smftools/schema/anndata_schema_v1.yaml +227 -0
  142. {smftools-0.2.4 → smftools-0.2.5}/smftools/tools/__init__.py +3 -4
  143. {smftools-0.2.4 → smftools-0.2.5}/smftools/tools/archived/classifiers.py +163 -0
  144. {smftools-0.2.4 → smftools-0.2.5}/smftools/tools/archived/subset_adata_v1.py +10 -1
  145. {smftools-0.2.4 → smftools-0.2.5}/smftools/tools/archived/subset_adata_v2.py +12 -1
  146. {smftools-0.2.4 → smftools-0.2.5}/smftools/tools/calculate_umap.py +54 -15
  147. smftools-0.2.5/smftools/tools/cluster_adata_on_methylation.py +174 -0
  148. smftools-0.2.5/smftools/tools/general_tools.py +114 -0
  149. {smftools-0.2.4 → smftools-0.2.5}/smftools/tools/position_stats.py +229 -98
  150. {smftools-0.2.4 → smftools-0.2.5}/smftools/tools/read_stats.py +50 -29
  151. {smftools-0.2.4 → smftools-0.2.5}/smftools/tools/spatial_autocorrelation.py +365 -192
  152. smftools-0.2.5/smftools/tools/subset_adata.py +30 -0
  153. smftools-0.2.5/tests/__init__.py +8 -0
  154. smftools-0.2.5/tests/_test_inputs/_test_bed_I.bed +2 -0
  155. smftools-0.2.5/tests/_test_inputs/_test_fasta_I.fa +78 -0
  156. smftools-0.2.5/tests/_test_inputs/_test_fasta_I.fa.fai +2 -0
  157. smftools-0.2.5/tests/_test_inputs/_test_pod5_I.pod5 +0 -0
  158. smftools-0.2.5/tests/_test_inputs/test_experiment_config_conversion_I.csv +13 -0
  159. smftools-0.2.5/tests/_test_inputs/test_experiment_config_deaminase_I.csv +13 -0
  160. smftools-0.2.5/tests/_test_inputs/test_experiment_config_direct_I.csv +15 -0
  161. smftools-0.2.5/tests/e2e/__init__.py +0 -0
  162. smftools-0.2.5/tests/e2e/cli/test_load_adata.py +29 -0
  163. smftools-0.2.5/tests/e2e/cli/test_spatial_adata.py +29 -0
  164. smftools-0.2.5/tests/integration/__init__.py +0 -0
  165. smftools-0.2.5/tests/smoke/__init__.py +0 -0
  166. smftools-0.2.5/tests/smoke/cli/test_cli_imports.py +20 -0
  167. smftools-0.2.5/tests/smoke/config/test_config_imports.py +17 -0
  168. smftools-0.2.5/tests/smoke/datasets/test_datasets_imports.py +16 -0
  169. smftools-0.2.5/tests/smoke/hmm/test_hmm_imports.py +20 -0
  170. smftools-0.2.5/tests/smoke/import_helpers.py +16 -0
  171. smftools-0.2.5/tests/smoke/informatics/test_informatics_imports.py +28 -0
  172. smftools-0.2.5/tests/smoke/machine_learning/data/test_data_imports.py +17 -0
  173. smftools-0.2.5/tests/smoke/machine_learning/evaluation/test_evaluation_imports.py +17 -0
  174. smftools-0.2.5/tests/smoke/machine_learning/inference/test_inference_imports.py +19 -0
  175. smftools-0.2.5/tests/smoke/machine_learning/models/test_models_imports.py +24 -0
  176. smftools-0.2.5/tests/smoke/machine_learning/training/test_training_imports.py +17 -0
  177. smftools-0.2.5/tests/smoke/machine_learning/utils/test_utils_imports.py +17 -0
  178. smftools-0.2.5/tests/smoke/plotting/test_plotting_imports.py +21 -0
  179. smftools-0.2.5/tests/smoke/preprocessing/test_preprocessing_imports.py +40 -0
  180. smftools-0.2.5/tests/smoke/test_smftools_imports.py +21 -0
  181. smftools-0.2.5/tests/smoke/tools/test_tools_imports.py +22 -0
  182. smftools-0.2.5/tests/unit/__init__.py +0 -0
  183. smftools-0.2.5/tests/unit/config/test_LoadExperimentConfig.py +20 -0
  184. smftools-0.2.5/tests/unit/test_metadata.py +53 -0
  185. smftools-0.2.5/tests/unit/test_readwrite.py +7 -0
  186. smftools-0.2.4/README.md +0 -47
  187. smftools-0.2.4/docs/source/api/datasets.md +0 -9
  188. smftools-0.2.4/docs/source/api/informatics.md +0 -27
  189. smftools-0.2.4/docs/source/api/preprocessing.md +0 -14
  190. smftools-0.2.4/docs/source/api/tools.md +0 -9
  191. smftools-0.2.4/docs/source/conf.py +0 -117
  192. smftools-0.2.4/docs/source/release-notes/0.1.0.md +0 -4
  193. smftools-0.2.4/docs/source/release-notes/index.md +0 -8
  194. smftools-0.2.4/docs/source/tutorials/index.md +0 -3
  195. smftools-0.2.4/smftools/_version.py +0 -1
  196. smftools-0.2.4/smftools/cli/hmm_adata.py +0 -361
  197. smftools-0.2.4/smftools/config/__init__.py +0 -1
  198. smftools-0.2.4/smftools/datasets/__init__.py +0 -9
  199. smftools-0.2.4/smftools/datasets/datasets.py +0 -28
  200. smftools-0.2.4/smftools/hmm/HMM.py +0 -1587
  201. smftools-0.2.4/smftools/hmm/call_hmm_peaks.py +0 -334
  202. smftools-0.2.4/smftools/hmm/nucleosome_hmm_refinement.py +0 -104
  203. smftools-0.2.4/smftools/informatics/__init__.py +0 -20
  204. smftools-0.2.4/smftools/informatics/fasta_functions.py +0 -255
  205. smftools-0.2.4/smftools/informatics/h5ad_functions.py +0 -197
  206. smftools-0.2.4/smftools/informatics/run_multiqc.py +0 -31
  207. smftools-0.2.4/smftools/machine_learning/__init__.py +0 -12
  208. smftools-0.2.4/smftools/machine_learning/training/__init__.py +0 -2
  209. smftools-0.2.4/smftools/machine_learning/utils/device.py +0 -10
  210. smftools-0.2.4/smftools/plotting/__init__.py +0 -18
  211. smftools-0.2.4/smftools/preprocessing/append_base_context.py +0 -131
  212. smftools-0.2.4/smftools/preprocessing/binarize.py +0 -17
  213. smftools-0.2.4/smftools/preprocessing/binarize_on_Youden.py +0 -47
  214. smftools-0.2.4/smftools/preprocessing/calculate_coverage.py +0 -54
  215. smftools-0.2.4/smftools/preprocessing/calculate_read_modification_stats.py +0 -101
  216. smftools-0.2.4/smftools/preprocessing/clean_NaN.py +0 -62
  217. smftools-0.2.4/smftools/preprocessing/invert_adata.py +0 -37
  218. smftools-0.2.4/smftools/preprocessing/load_sample_sheet.py +0 -53
  219. smftools-0.2.4/smftools/preprocessing/reindex_references_adata.py +0 -37
  220. smftools-0.2.4/smftools/tools/cluster_adata_on_methylation.py +0 -105
  221. smftools-0.2.4/smftools/tools/general_tools.py +0 -69
  222. smftools-0.2.4/smftools/tools/subset_adata.py +0 -28
  223. smftools-0.2.4/tests/informatics/helpers/test_LoadExperimentConfig.py +0 -17
  224. smftools-0.2.4/tests/test_readwrite.py +0 -12
  225. {smftools-0.2.4 → smftools-0.2.5}/.gitattributes +0 -0
  226. {smftools-0.2.4 → smftools-0.2.5}/CONTRIBUTING.md +0 -0
  227. {smftools-0.2.4 → smftools-0.2.5}/LICENSE +0 -0
  228. {smftools-0.2.4 → smftools-0.2.5}/docs/Makefile +0 -0
  229. {smftools-0.2.4 → smftools-0.2.5}/docs/make.bat +0 -0
  230. {smftools-0.2.4 → smftools-0.2.5}/docs/source/_static/converted_BAM_to_adata.png +0 -0
  231. {smftools-0.2.4 → smftools-0.2.5}/docs/source/_static/modkit_extract_to_adata.png +0 -0
  232. {smftools-0.2.4 → smftools-0.2.5}/docs/source/_static/smftools-1.svg +0 -0
  233. {smftools-0.2.4 → smftools-0.2.5}/docs/source/_static/smftools-1.tif +0 -0
  234. {smftools-0.2.4 → smftools-0.2.5}/docs/source/_static/smftools_informatics_diagram.pdf +0 -0
  235. {smftools-0.2.4 → smftools-0.2.5}/docs/source/_static/smftools_informatics_diagram.png +0 -0
  236. {smftools-0.2.4 → smftools-0.2.5}/docs/source/_static/smftools_preprocessing_diagram.png +0 -0
  237. {smftools-0.2.4 → smftools-0.2.5}/docs/source/_templates/tmp +0 -0
  238. {smftools-0.2.4 → smftools-0.2.5}/docs/source/api/index.md +0 -0
  239. {smftools-0.2.4 → smftools-0.2.5}/docs/source/dev/index.md +0 -0
  240. {smftools-0.2.4 → smftools-0.2.5}/docs/source/installation.md +0 -0
  241. {smftools-0.2.4 → smftools-0.2.5}/docs/source/references.bib +0 -0
  242. {smftools-0.2.4 → smftools-0.2.5}/docs/source/references.rst +0 -0
  243. {smftools-0.2.4 → smftools-0.2.5}/experiment_config.csv +0 -0
  244. {smftools-0.2.4 → smftools-0.2.5}/notebooks/Kissiov_and_McKenna_2025_example_notebook.ipynb +0 -0
  245. {smftools-0.2.4 → smftools-0.2.5}/notebooks/Kissiov_and_McKenna_2025_sample_sheet.csv +0 -0
  246. {smftools-0.2.4 → smftools-0.2.5}/requirements.txt +0 -0
  247. {smftools-0.2.4 → smftools-0.2.5}/sample_sheet.csv +0 -0
  248. {smftools-0.2.4 → smftools-0.2.5}/smftools/cli/__init__.py +0 -0
  249. {smftools-0.2.4 → smftools-0.2.5}/smftools/cli/archived/cli_flows.py +0 -0
  250. {smftools-0.2.4 → smftools-0.2.5}/smftools/datasets/F1_hybrid_NKG2A_enhander_promoter_GpC_conversion_SMF.h5ad.gz +0 -0
  251. {smftools-0.2.4 → smftools-0.2.5}/smftools/datasets/F1_sample_sheet.csv +0 -0
  252. {smftools-0.2.4 → smftools-0.2.5}/smftools/datasets/dCas9_m6A_invitro_kinetics.h5ad.gz +0 -0
  253. {smftools-0.2.4 → smftools-0.2.5}/smftools/hmm/archived/apply_hmm_batched.py +0 -0
  254. {smftools-0.2.4 → smftools-0.2.5}/smftools/hmm/archived/calculate_distances.py +0 -0
  255. {smftools-0.2.4 → smftools-0.2.5}/smftools/hmm/archived/train_hmm.py +0 -0
  256. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/bam_conversion.py +0 -0
  257. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/bam_direct.py +0 -0
  258. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/basecall_pod5s.py +0 -0
  259. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/basecalls_to_adata.py +0 -0
  260. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/conversion_smf.py +0 -0
  261. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/deaminase_smf.py +0 -0
  262. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/direct_smf.py +0 -0
  263. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/fast5_to_pod5.py +0 -0
  264. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/__init__.py +0 -0
  265. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/aligned_BAM_to_bed.py +0 -0
  266. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/bed_to_bigwig.py +0 -0
  267. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/canoncall.py +0 -0
  268. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/converted_BAM_to_adata.py +0 -0
  269. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/count_aligned_reads.py +0 -0
  270. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/demux_and_index_BAM.py +0 -0
  271. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/extract_base_identities.py +0 -0
  272. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/extract_mods.py +0 -0
  273. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/extract_read_features_from_bam.py +0 -0
  274. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/extract_read_lengths_from_bed.py +0 -0
  275. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/extract_readnames_from_BAM.py +0 -0
  276. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/find_conversion_sites.py +0 -0
  277. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/generate_converted_FASTA.py +0 -0
  278. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/get_chromosome_lengths.py +0 -0
  279. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/get_native_references.py +0 -0
  280. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/index_fasta.py +0 -0
  281. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/informatics.py +0 -0
  282. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/make_modbed.py +0 -0
  283. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/modQC.py +0 -0
  284. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/modcall.py +0 -0
  285. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/ohe_batching.py +0 -0
  286. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/ohe_layers_decode.py +0 -0
  287. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/one_hot_decode.py +0 -0
  288. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/one_hot_encode.py +0 -0
  289. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/separate_bam_by_bc.py +0 -0
  290. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/helpers/archived/split_and_index_BAM.py +0 -0
  291. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/subsample_fasta_from_bed.py +0 -0
  292. {smftools-0.2.4 → smftools-0.2.5}/smftools/informatics/archived/subsample_pod5.py +0 -0
  293. {smftools-0.2.4 → smftools-0.2.5}/smftools/machine_learning/data/__init__.py +0 -0
  294. {smftools-0.2.4/smftools/preprocessing/archives → smftools-0.2.5/smftools/preprocessing/archived}/add_read_length_and_mapping_qc.py +0 -0
  295. {smftools-0.2.4/smftools/preprocessing/archives → smftools-0.2.5/smftools/preprocessing/archived}/mark_duplicates.py +0 -0
  296. {smftools-0.2.4/smftools/preprocessing/archives → smftools-0.2.5/smftools/preprocessing/archived}/remove_duplicates.py +0 -0
  297. {smftools-0.2.4 → smftools-0.2.5}/smftools/tools/archived/apply_hmm.py +0 -0
  298. {smftools-0.2.4 → smftools-0.2.5}/smftools/tools/archived/classify_methylated_features.py +0 -0
  299. {smftools-0.2.4 → smftools-0.2.5}/smftools/tools/archived/classify_non_methylated_features.py +0 -0
  300. {smftools-0.2.4/tests → smftools-0.2.5/tests/unit}/datasets/test_datasets.py +0 -0
@@ -0,0 +1,115 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["main"]
8
+
9
+ jobs:
10
+ format:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ python-version: ["3.12"]
16
+
17
+ steps:
18
+ - name: Check out repository
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ python -m pip install ruff
30
+
31
+ - name: Check formatting with ruff
32
+ run: ruff format --check .
33
+
34
+ lint:
35
+ runs-on: ubuntu-latest
36
+ strategy:
37
+ fail-fast: false
38
+ matrix:
39
+ python-version: ["3.12"]
40
+
41
+ steps:
42
+ - name: Check out repository
43
+ uses: actions/checkout@v4
44
+
45
+ - name: Set up Python ${{ matrix.python-version }}
46
+ uses: actions/setup-python@v5
47
+ with:
48
+ python-version: ${{ matrix.python-version }}
49
+
50
+ - name: Install dependencies
51
+ run: |
52
+ python -m pip install --upgrade pip
53
+ python -m pip install ruff
54
+
55
+ - name: Lint with ruff
56
+ run: ruff check .
57
+
58
+ smoke:
59
+ runs-on: ubuntu-latest
60
+ strategy:
61
+ fail-fast: false
62
+ matrix:
63
+ python-version: ["3.10"]
64
+
65
+ steps:
66
+ - name: Check out repository
67
+ uses: actions/checkout@v4
68
+
69
+ - name: Set up Python ${{ matrix.python-version }}
70
+ uses: actions/setup-python@v5
71
+ with:
72
+ python-version: ${{ matrix.python-version }}
73
+
74
+ - name: Install system deps for pysam
75
+ run: |
76
+ sudo apt-get update
77
+ sudo apt-get install -y \
78
+ build-essential \
79
+ zlib1g-dev \
80
+ libbz2-dev \
81
+ liblzma-dev \
82
+ libcurl4-openssl-dev \
83
+ pkg-config
84
+
85
+ - name: Install dependencies
86
+ run: |
87
+ python -m pip install --upgrade pip
88
+ python -m pip install .[dev]
89
+
90
+ - name: Run smoke tests
91
+ run: pytest -m smoke -q
92
+
93
+ build:
94
+ runs-on: ubuntu-latest
95
+ strategy:
96
+ fail-fast: false
97
+ matrix:
98
+ python-version: ["3.10", "3.11", "3.12"]
99
+
100
+ steps:
101
+ - name: Check out repository
102
+ uses: actions/checkout@v4
103
+
104
+ - name: Set up Python ${{ matrix.python-version }}
105
+ uses: actions/setup-python@v5
106
+ with:
107
+ python-version: ${{ matrix.python-version }}
108
+
109
+ - name: Install build tooling
110
+ run: |
111
+ python -m pip install --upgrade pip
112
+ python -m pip install build
113
+
114
+ - name: Build package
115
+ run: python -m build
@@ -20,8 +20,10 @@ venvs/
20
20
  /environment.yml
21
21
 
22
22
  # Tests
23
- /tests/_test_inputs/
23
+ /tests/_test_inputs/dorado_models
24
24
  /tests/_test_outputs/
25
+ /tests/_test_outputs*/
26
+
25
27
 
26
28
  # OS
27
29
  .DS_Store
@@ -0,0 +1,7 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.6.8
4
+ hooks:
5
+ - id: ruff
6
+ args: ["--fix"]
7
+ - id: ruff-format
@@ -1,6 +1,6 @@
1
1
  version: 2
2
2
  build:
3
- os: ubuntu-20.04
3
+ os: ubuntu-22.04
4
4
  tools:
5
5
  python: "3.12"
6
6
  sphinx:
@@ -10,8 +10,7 @@ python:
10
10
  install:
11
11
  - method: pip
12
12
  path: .
13
- extra_requirements:
14
- - docs
13
+ - requirements: docs/source/requirements.txt
15
14
  submodules:
16
15
  include: all
17
16
  recursive: true
@@ -0,0 +1,59 @@
1
+ # AGENTS.md
2
+
3
+ This file tells coding agents (including OpenAI Codex) how to work in this repo.
4
+
5
+ ## Goals
6
+ - Make minimal, correct changes.
7
+ - Prefer small PRs / diffs.
8
+ - Keep behavior stable unless the task explicitly requests changes.
9
+
10
+ ## Repo orientation
11
+ - Read existing patterns before inventing new ones.
12
+ - Don’t refactor broadly unless asked.
13
+ - If you’re unsure about intended behavior, look for tests/docs first.
14
+
15
+ ## Setup
16
+ - Create env (pick one):
17
+ - `python -m venv .venv && source .venv/bin/activate`
18
+ - or `conda env create -f environment.yml && conda activate <env>`
19
+ - Install:
20
+ - `pip install -e ".[dev]"`
21
+
22
+ ## How to run checks
23
+ - Smoke tests: `pytest -m smoke -q`
24
+ - Unit tests: `pytest -m unit -q`
25
+ - Integration tests: `pytest -m integration -q`
26
+ - E2E tests: `pytest -m e2e -q`
27
+ - Coverage (if configured): `pytest --cov`
28
+ - Lint: `ruff check .`
29
+ - Format: `ruff format .`
30
+ - Type-check (if configured): `mypy .`
31
+
32
+ ## Coding conventions
33
+ - Follow existing style and module layout.
34
+ - Prefer clear, explicit code over cleverness.
35
+ - Add/adjust tests for bug fixes and new behavior.
36
+ - Keep public APIs backward compatible unless explicitly changing them.
37
+ - Python:
38
+ - Use type hints for new/modified functions where reasonable.
39
+ - Use Google style docstring format.
40
+ - Avoid heavy dependencies unless necessary.
41
+
42
+ ## Testing expectations
43
+ - New functionality must include tests.
44
+ - Bug fix PRs should include a regression test.
45
+ - If tests are flaky or slow, note it and scope the change.
46
+
47
+ ## Logging & secrets
48
+ - Don’t log secrets, tokens, or PII.
49
+ - Never hardcode credentials.
50
+ - If sample keys are needed, use obvious placeholders like `YOUR_API_KEY_HERE`.
51
+
52
+ ## Git / PR hygiene
53
+ - Keep commits focused.
54
+ - Update docs/changelog if behavior or user-facing CLI changes.
55
+ - If you change a CLI flag or config schema, add a migration note.
56
+
57
+ ## If something fails
58
+ - If a command fails, paste the full error and summarize likely causes.
59
+ - Don’t “fix” by deleting tests or weakening assertions unless explicitly instructed.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: smftools
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Single Molecule Footprinting Analysis in Python.
5
5
  Project-URL: Source, https://github.com/jkmckenna/smftools
6
6
  Project-URL: Documentation, https://smftools.readthedocs.io/
@@ -37,13 +37,14 @@ Classifier: License :: OSI Approved :: MIT License
37
37
  Classifier: Natural Language :: English
38
38
  Classifier: Operating System :: MacOS :: MacOS X
39
39
  Classifier: Programming Language :: Python :: 3
40
- Classifier: Programming Language :: Python :: 3.9
41
40
  Classifier: Programming Language :: Python :: 3.10
42
41
  Classifier: Programming Language :: Python :: 3.11
43
42
  Classifier: Programming Language :: Python :: 3.12
43
+ Classifier: Programming Language :: Python :: 3.13
44
+ Classifier: Programming Language :: Python :: 3.14
44
45
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
45
46
  Classifier: Topic :: Scientific/Engineering :: Visualization
46
- Requires-Python: <3.13,>=3.9
47
+ Requires-Python: >=3.10
47
48
  Requires-Dist: anndata>=0.10.0
48
49
  Requires-Dist: biopython>=1.79
49
50
  Requires-Dist: captum
@@ -72,24 +73,28 @@ Requires-Dist: torch>=1.9.0
72
73
  Requires-Dist: tqdm
73
74
  Requires-Dist: upsetplot
74
75
  Requires-Dist: wandb
76
+ Provides-Extra: dev
77
+ Requires-Dist: pre-commit; extra == 'dev'
78
+ Requires-Dist: pytest; extra == 'dev'
79
+ Requires-Dist: pytest-cov; extra == 'dev'
80
+ Requires-Dist: ruff; extra == 'dev'
75
81
  Provides-Extra: docs
76
82
  Requires-Dist: ipython>=7.20; extra == 'docs'
77
83
  Requires-Dist: matplotlib!=3.6.1; extra == 'docs'
78
84
  Requires-Dist: myst-nb>=1; extra == 'docs'
79
85
  Requires-Dist: myst-parser>=2; extra == 'docs'
80
86
  Requires-Dist: nbsphinx>=0.9; extra == 'docs'
87
+ Requires-Dist: pyyaml; extra == 'docs'
81
88
  Requires-Dist: readthedocs-sphinx-search; extra == 'docs'
82
89
  Requires-Dist: setuptools; extra == 'docs'
83
90
  Requires-Dist: sphinx-autodoc-typehints>=1.25.2; extra == 'docs'
84
91
  Requires-Dist: sphinx-book-theme>=1.1.0; extra == 'docs'
92
+ Requires-Dist: sphinx-click; extra == 'docs'
85
93
  Requires-Dist: sphinx-copybutton; extra == 'docs'
86
94
  Requires-Dist: sphinx-design; extra == 'docs'
87
95
  Requires-Dist: sphinx>=7; extra == 'docs'
88
96
  Requires-Dist: sphinxcontrib-bibtex; extra == 'docs'
89
97
  Requires-Dist: sphinxext-opengraph; extra == 'docs'
90
- Provides-Extra: tests
91
- Requires-Dist: pytest; extra == 'tests'
92
- Requires-Dist: pytest-cov; extra == 'tests'
93
98
  Description-Content-Type: text/markdown
94
99
 
95
100
  [![PyPI](https://img.shields.io/pypi/v/smftools.svg)](https://pypi.org/project/smftools)
@@ -102,40 +107,7 @@ A Python tool for processing raw sequencing data derived from single molecule fo
102
107
  While genomic data structures (SAM/BAM) were built to handle low-coverage data (<1000X) along large references, smftools prioritizes high-coverage data (scalable to >1,000,000X coverage) of a few genomic loci at a time. This enables efficient data storage, rapid data operations, hierarchical metadata handling, seamless integration with various machine-learning packages, and ease of visualization. Furthermore, functionality is modularized, enabling analysis sessions to be saved, reloaded, and easily shared with collaborators. Analyses are centered around the [anndata](https://anndata.readthedocs.io/en/latest/) object, and are heavily inspired by the work conducted within the single-cell genomics community.
103
108
 
104
109
  ## Dependencies
105
- The following CLI tools need to be installed and configured before using the informatics (smftools.inform) module of smftools:
106
- 1) [Dorado](https://github.com/nanoporetech/dorado) -> Basecalling, alignment, demultiplexing.
107
- 2) [Minimap2](https://github.com/lh3/minimap2) -> Alignment if not using dorado.
108
- 3) [Modkit](https://github.com/nanoporetech/modkit) -> Extracting read level methylation metrics from modified BAM files. Only required for direct modification detection (ie methylation).
109
-
110
- ## Main Commands
111
- ### smftools load: Processes raw Nanopore/Illumina data from SMF experiments into an AnnData object.
112
- ![](docs/source/_static/smftools_informatics_diagram.png)
113
- ### smftools preprocess: Appends QC metrics to the AnnData object and performs filtering.
114
- ![](docs/source/_static/smftools_preprocessing_diagram.png)
115
- ### smftools spatial: Appends spatial analyses to the AnnData object.
116
- - Currently Includes: Position X Position correlation matrices, clustering, dimensionality reduction, spatial autocorrelation.
117
- ### smftools hmm: Fits a basic HMM to each sample and appends HMM feature layers
118
- - Main outputs wills be stored in adata.layers
119
- ### smftools batch <command>: Performs batch processing on a csv of config file pathes for any of the above commands.
120
- - Nice when analyzing multiple experiments
121
- ### smftools concatenate: Concatenates a list or directory of anndata objects.
122
- - Mainly used for combining multiple experiments into a single anndata object.
123
-
124
- ## Announcements
125
-
126
- ### 12/02/25 - Version 0.2.3 is available through PyPI
127
- Version 0.2.3 provides the core smftools functionality through several command line commands (load, preprocess, spatial, hmm).
128
-
129
- ### 11/05/25 - Version 0.2.1 is available through PyPI
130
- Version 0.2.1 makes the core workflow (smftools load) a command line tool that takes in an experiment_config.csv file for input/output and parameter management.
131
-
132
- ### 05/29/25 - Version 0.1.6 is available through PyPI.
133
- Informatics, preprocessing, tools, plotting modules have core functionality that is approaching stability on MacOS(Intel/Silicon) and Linux(Ubuntu). I will work on improving documentation/tutorials shortly. The base PyTorch/Scikit-Learn ML-infrastructure is going through some organizational changes to work with PyTorch Lightning, Hydra, and WanDB to facilitate organizational scaling, multi-device usage, and logging.
134
-
135
- ### 10/01/24 - More recent versions are being updated frequently. Installation from source over PyPI is recommended!
136
-
137
- ### 09/09/24 - The version 0.1.1 package ([smftools-0.1.1](https://pypi.org/project/smftools/)) is installable through pypi!
138
- The informatics module has been bumped to alpha-phase status. This module can deal with POD5s and unaligned BAMS from nanopore conversion and direct SMF experiments, as well as FASTQs from Illumina conversion SMF experiments. Primary output from this module is an AnnData object containing all relevant SMF data, which is compatible with all downstream smftools modules. The other modules are still in pre-alpha phase. Preprocessing, Tools, and Plotting modules should be promoted to alpha-phase within the next month or so.
139
-
140
- ### 08/30/24 - The version 0.1.0 package ([smftools-0.1.0](https://pypi.org/project/smftools/)) is installable through pypi!
141
- Currently, this package (smftools-0.1.0) is going through rapid improvement (dependency handling accross Linux and Mac OS, testing, documentation, debugging) and is still too early in development for widespread use. The underlying functionality was originally developed as a collection of scripts for single molecule footprinting (SMF) experiments in our lab, but is being packaged/developed to facilitate the expansion of SMF to any lab that is interested in performing these styles of experiments/analyses. The alpha-phase package is expected to be available within a couple months, so stay tuned!
110
+ The following CLI tools need to be installed and configured before using the informatics (smftools.inform) module of smftools, which is used by the smftools load CLI command:
111
+ 1) [Dorado](https://github.com/nanoporetech/dorado) -> Basecalling, alignment, demultiplexing. Required for Nanopore SMF experiments, but not Illumina SMF experiments.
112
+ 2) [Minimap2](https://github.com/lh3/minimap2) -> Aligner if not using dorado. Support for other aligners could eventually be added if needed.
113
+ 3) [Modkit](https://github.com/nanoporetech/modkit) -> Extracting read level methylation metrics from the MM/ML tags in BAM files. Only required for direct modification detection SMF protocols.
@@ -0,0 +1,14 @@
1
+ [![PyPI](https://img.shields.io/pypi/v/smftools.svg)](https://pypi.org/project/smftools)
2
+ [![Docs](https://readthedocs.org/projects/smftools/badge/?version=latest)](https://smftools.readthedocs.io/en/latest/?badge=latest)
3
+
4
+ # smftools
5
+ A Python tool for processing raw sequencing data derived from single molecule footprinting experiments into [anndata](https://anndata.readthedocs.io/en/latest/) objects. Additional functionality for preprocessing, spatial analyses, and HMM based feature annotation.
6
+
7
+ ## Philosophy
8
+ While genomic data structures (SAM/BAM) were built to handle low-coverage data (<1000X) along large references, smftools prioritizes high-coverage data (scalable to >1,000,000X coverage) of a few genomic loci at a time. This enables efficient data storage, rapid data operations, hierarchical metadata handling, seamless integration with various machine-learning packages, and ease of visualization. Furthermore, functionality is modularized, enabling analysis sessions to be saved, reloaded, and easily shared with collaborators. Analyses are centered around the [anndata](https://anndata.readthedocs.io/en/latest/) object, and are heavily inspired by the work conducted within the single-cell genomics community.
9
+
10
+ ## Dependencies
11
+ The following CLI tools need to be installed and configured before using the informatics (smftools.inform) module of smftools, which is used by the smftools load CLI command:
12
+ 1) [Dorado](https://github.com/nanoporetech/dorado) -> Basecalling, alignment, demultiplexing. Required for Nanopore SMF experiments, but not Illumina SMF experiments.
13
+ 2) [Minimap2](https://github.com/lh3/minimap2) -> Aligner if not using dorado. Support for other aligners could eventually be added if needed.
14
+ 3) [Modkit](https://github.com/nanoporetech/modkit) -> Extracting read level methylation metrics from the MM/ML tags in BAM files. Only required for direct modification detection SMF protocols.
@@ -0,0 +1,14 @@
1
+ ## Datasets:
2
+
3
+ ```{eval-rst}
4
+ .. autosummary::
5
+ :toctree: generated/datasets
6
+
7
+ smftools.datasets.datasets
8
+ ```
9
+
10
+ ```{eval-rst}
11
+ .. automodule:: smftools.datasets
12
+ :no-members:
13
+ :show-inheritance:
14
+ ```
@@ -0,0 +1,44 @@
1
+ ## Informatics: `inform`
2
+
3
+ ## Informatics module diagram
4
+ ```{image} ../_static/smftools_informatics_diagram.png
5
+ :width: 1000px
6
+ ```
7
+
8
+ Processes raw sequencing data to load an adata object.
9
+
10
+ ```{eval-rst}
11
+ .. autosummary::
12
+ :toctree: generated/informatics
13
+
14
+ smftools.informatics.bam_functions
15
+ smftools.informatics.basecalling
16
+ smftools.informatics.bed_functions
17
+ smftools.informatics.binarize_converted_base_identities
18
+ smftools.informatics.complement_base_list
19
+ smftools.informatics.converted_BAM_to_adata
20
+ smftools.informatics.fasta_functions
21
+ smftools.informatics.h5ad_functions
22
+ smftools.informatics.modkit_extract_to_adata
23
+ smftools.informatics.modkit_functions
24
+ smftools.informatics.ohe
25
+ smftools.informatics.pod5_functions
26
+ smftools.informatics.run_multiqc
27
+ ```
28
+
29
+ ```{eval-rst}
30
+ .. automodule:: smftools.informatics
31
+ :no-members:
32
+ :show-inheritance:
33
+ ```
34
+
35
+
36
+ ### Diagram of final steps of Direct SMF workflow
37
+ ```{image} ../_static/modkit_extract_to_adata.png
38
+ :width: 1000px
39
+ ```
40
+
41
+ ### Diagram of final steps of Conversion SMF workflow
42
+ ```{image} ../_static/converted_BAM_to_adata.png
43
+ :width: 1000px
44
+ ```
@@ -0,0 +1,43 @@
1
+ ## Preprocessing: `pp`
2
+
3
+ ## Preprocessing module diagram
4
+ ```{image} ../_static/smftools_preprocessing_diagram.png
5
+ :width: 1000px
6
+ ```
7
+
8
+ ```{eval-rst}
9
+ .. autosummary::
10
+ :toctree: generated/preprocessing
11
+
12
+ smftools.preprocessing.append_base_context
13
+ smftools.preprocessing.append_binary_layer_by_base_context
14
+ smftools.preprocessing.binarize
15
+ smftools.preprocessing.binarize_on_Youden
16
+ smftools.preprocessing.binary_layers_to_ohe
17
+ smftools.preprocessing.calculate_complexity_II
18
+ smftools.preprocessing.calculate_consensus
19
+ smftools.preprocessing.calculate_coverage
20
+ smftools.preprocessing.calculate_pairwise_differences
21
+ smftools.preprocessing.calculate_pairwise_hamming_distances
22
+ smftools.preprocessing.calculate_position_Youden
23
+ smftools.preprocessing.calculate_read_length_stats
24
+ smftools.preprocessing.calculate_read_modification_stats
25
+ smftools.preprocessing.clean_NaN
26
+ smftools.preprocessing.filter_adata_by_nan_proportion
27
+ smftools.preprocessing.filter_reads_on_length_quality_mapping
28
+ smftools.preprocessing.filter_reads_on_modification_thresholds
29
+ smftools.preprocessing.flag_duplicate_reads
30
+ smftools.preprocessing.invert_adata
31
+ smftools.preprocessing.load_sample_sheet
32
+ smftools.preprocessing.make_dirs
33
+ smftools.preprocessing.min_non_diagonal
34
+ smftools.preprocessing.recipes
35
+ smftools.preprocessing.reindex_references_adata
36
+ smftools.preprocessing.subsample_adata
37
+ ```
38
+
39
+ ```{eval-rst}
40
+ .. automodule:: smftools.preprocessing
41
+ :no-members:
42
+ :show-inheritance:
43
+ ```
@@ -0,0 +1,20 @@
1
+ ## Tools: `tl`
2
+
3
+ ```{eval-rst}
4
+ .. autosummary::
5
+ :toctree: generated/tools
6
+
7
+ smftools.tools.calculate_umap
8
+ smftools.tools.cluster_adata_on_methylation
9
+ smftools.tools.general_tools
10
+ smftools.tools.position_stats
11
+ smftools.tools.read_stats
12
+ smftools.tools.spatial_autocorrelation
13
+ smftools.tools.subset_adata
14
+ ```
15
+
16
+ ```{eval-rst}
17
+ .. automodule:: smftools.tools
18
+ :no-members:
19
+ :show-inheritance:
20
+ ```
@@ -13,6 +13,8 @@ This command takes a user passed config file handling:
13
13
  - Experiment info (SMF modality, sequencer type, barcoding kit if nanopore, sample sheet with metadata mapping)
14
14
  - Options to override default workflow parameters from smftools/config. Params are handled from default.yaml -> modality_type.yaml -> user passed config.csv.
15
15
 
16
+ ![](_static/smftools_informatics_diagram.png)
17
+
16
18
  ## Preprocess Usage
17
19
 
18
20
  This command performs preprocessing on the anndata object. It automatically runs the load command under the hood if starting from raw data.
@@ -21,6 +23,8 @@ This command performs preprocessing on the anndata object. It automatically runs
21
23
  smftools preprocess "/Path_to_experiment_config.csv"
22
24
  ```
23
25
 
26
+ ![](_static/smftools_preprocessing_diagram.png)
27
+
24
28
  ## Spatial Usage
25
29
 
26
30
  This command performs spatial analysis on the anndata object. It automatically runs the load command and preprocessing under the hood if they have not been already run.
@@ -29,6 +33,8 @@ This command performs spatial analysis on the anndata object. It automatically r
29
33
  smftools spatial "/Path_to_experiment_config.csv"
30
34
  ```
31
35
 
36
+ - Currently Includes: Position X Position correlation matrices, clustering, dimensionality reduction, spatial autocorrelation.
37
+
32
38
  ## HMM Usage
33
39
 
34
40
  This command performs hmm based feature annotation on the anndata object. It automatically runs the load command and preprocessing under the hood if they have not been already run.
@@ -37,6 +43,8 @@ This command performs hmm based feature annotation on the anndata object. It aut
37
43
  smftools hmm "/Path_to_experiment_config.csv"
38
44
  ```
39
45
 
46
+ - Main outputs wills be stored in adata.layers
47
+
40
48
  ## Batch Usage
41
49
 
42
50
  This command performs batch processing of any of the above commands across multiple experiments. It takes in a tsv, txt, or csv of experiment specific config csvs.
@@ -44,11 +52,38 @@ This command performs batch processing of any of the above commands across multi
44
52
  smftools batch preprocess "/Path_to_experiment_config_path_list.csv"
45
53
  ```
46
54
 
55
+ - Nice when analyzing multiple experiments
56
+
47
57
  ## Concatenate Usage
48
58
 
49
59
  This command concatenates multiple h5ad files and saves them to a new output. The h5ads to concatenate are provided as a txt, tsv, or h5ad file of paths.
50
60
  ```shell
51
- smftools concatenate output.h5ad "/Path_to_h5ad_path_list.csv"
61
+ smftools concatenate output.h5ad -c "/Path_to_h5ad_path_list.csv"
62
+ ```
63
+
64
+ Alternatively, you can just concatenate all h5ads within a given directory.
65
+ ```shell
66
+ smftools concatenate output.h5ad -d "/Path_to_h5ad_file_dir/"
67
+ ```
68
+
69
+ - Mainly used for combining multiple experiments into a single anndata object.
70
+
71
+ ## Subsample POD5 Usage
72
+
73
+ This command subsamples a POD5 file or a directory of POD5 files. It can be done by passing a txt file of read names to use, or an integer number of reads.
74
+ ```shell
75
+ smftools subsample-pod5 -r "/Path_to_read_name_list.txt" -o "/Path_to_output_directory" "/Path_to_input_POD5_dir_or_file"
76
+ ```
77
+
78
+ ```shell
79
+ smftools subsample-pod5 -n 1000 -o "/Path_to_output_directory" "/Path_to_input_POD5_dir_or_file"
80
+ ```
81
+
82
+ ## Optional run logging
83
+
84
+ If you want to maintain run log files of CLI processes, you can use the following syntax to any of the CLI commands. Here is an example using smftools load with logging performed on INFO level logging outputs and above.
85
+ ```shell
86
+ smftools --log-file "/Path_to_output_log_file.log" --log-level INFO load "/Path_to_input_config.csv"
52
87
  ```
53
88
 
54
89
  ## Reading AnnData objects created by smftools
@@ -0,0 +1,6 @@
1
+ # Command-line interface
2
+
3
+ ```{click} smftools.cli_entry:cli
4
+ :prog: smftools
5
+ :nested: full
6
+ ```