smftools 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl

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 (63) hide show
  1. smftools/__init__.py +0 -2
  2. smftools/_settings.py +1 -1
  3. smftools/_version.py +1 -0
  4. smftools/datasets/datasets.py +11 -9
  5. smftools/informatics/__init__.py +8 -7
  6. smftools/informatics/bam_conversion.py +47 -0
  7. smftools/informatics/bam_direct.py +49 -0
  8. smftools/informatics/basecalls_to_adata.py +42 -0
  9. smftools/informatics/fast5_to_pod5.py +19 -0
  10. smftools/informatics/helpers/LoadExperimentConfig.py +74 -0
  11. smftools/informatics/helpers/__init__.py +4 -4
  12. smftools/informatics/helpers/align_and_sort_BAM.py +52 -0
  13. smftools/informatics/helpers/binarize_converted_base_identities.py +10 -3
  14. smftools/informatics/helpers/canoncall.py +12 -1
  15. smftools/informatics/helpers/converted_BAM_to_adata.py +30 -13
  16. smftools/informatics/helpers/count_aligned_reads.py +12 -5
  17. smftools/informatics/helpers/extract_base_identities.py +13 -6
  18. smftools/informatics/helpers/extract_mods.py +17 -5
  19. smftools/informatics/helpers/find_conversion_sites.py +15 -9
  20. smftools/informatics/helpers/generate_converted_FASTA.py +49 -29
  21. smftools/informatics/helpers/get_native_references.py +10 -7
  22. smftools/informatics/helpers/make_dirs.py +9 -3
  23. smftools/informatics/helpers/make_modbed.py +10 -4
  24. smftools/informatics/helpers/modQC.py +10 -2
  25. smftools/informatics/helpers/modcall.py +13 -1
  26. smftools/informatics/helpers/modkit_extract_to_adata.py +25 -13
  27. smftools/informatics/helpers/one_hot_encode.py +8 -3
  28. smftools/informatics/helpers/separate_bam_by_bc.py +18 -5
  29. smftools/informatics/helpers/split_and_index_BAM.py +18 -10
  30. smftools/informatics/pod5_conversion.py +34 -7
  31. smftools/informatics/pod5_direct.py +31 -5
  32. smftools/informatics/pod5_to_adata.py +31 -8
  33. smftools/informatics/readwrite.py +13 -16
  34. smftools/informatics/subsample_pod5.py +48 -0
  35. smftools/preprocessing/__init__.py +0 -6
  36. smftools/preprocessing/append_C_context.py +15 -8
  37. smftools/preprocessing/binarize_on_Youden.py +8 -4
  38. smftools/preprocessing/binary_layers_to_ohe.py +9 -4
  39. smftools/preprocessing/calculate_complexity.py +26 -14
  40. smftools/preprocessing/calculate_converted_read_methylation_stats.py +12 -5
  41. smftools/preprocessing/calculate_coverage.py +13 -7
  42. smftools/preprocessing/calculate_pairwise_hamming_distances.py +11 -6
  43. smftools/preprocessing/calculate_position_Youden.py +21 -12
  44. smftools/preprocessing/calculate_read_length_stats.py +11 -6
  45. smftools/preprocessing/clean_NaN.py +12 -5
  46. smftools/preprocessing/filter_converted_reads_on_methylation.py +12 -5
  47. smftools/preprocessing/filter_reads_on_length.py +13 -5
  48. smftools/preprocessing/invert_adata.py +9 -5
  49. smftools/preprocessing/mark_duplicates.py +20 -11
  50. smftools/preprocessing/min_non_diagonal.py +9 -4
  51. smftools/preprocessing/remove_duplicates.py +9 -3
  52. smftools/readwrite.py +13 -16
  53. smftools-0.1.1.dist-info/METADATA +88 -0
  54. smftools-0.1.1.dist-info/RECORD +64 -0
  55. smftools/informatics/helpers/align_BAM.py +0 -49
  56. smftools/informatics/helpers/load_experiment_config.py +0 -17
  57. smftools-0.1.0.dist-info/METADATA +0 -75
  58. smftools-0.1.0.dist-info/RECORD +0 -58
  59. /smftools/informatics/helpers/{informatics.py → archived/informatics.py} +0 -0
  60. /smftools/informatics/helpers/{load_adata.py → archived/load_adata.py} +0 -0
  61. /smftools/preprocessing/{preprocessing.py → archives/preprocessing.py} +0 -0
  62. {smftools-0.1.0.dist-info → smftools-0.1.1.dist-info}/WHEEL +0 -0
  63. {smftools-0.1.0.dist-info → smftools-0.1.1.dist-info}/licenses/LICENSE +0 -0
smftools/readwrite.py CHANGED
@@ -1,27 +1,12 @@
1
1
  ## readwrite ##
2
2
 
3
- # Basic I/O
4
- import os
5
- # Datetime
6
- from datetime import datetime
7
- # Data structures and basic operations
8
- import math
9
- import numpy as np
10
- import pandas as pd
11
- import anndata as ad
12
- import scipy.sparse as sp
13
-
14
- # Runtime warnings
15
- import warnings
16
- warnings.filterwarnings('ignore', category=UserWarning, module='anndata')
17
- warnings.filterwarnings('ignore', category=FutureWarning, module='anndata')
18
-
19
3
  ######################################################################################################
20
4
  ## Datetime functionality
21
5
  def date_string():
22
6
  """
23
7
  Each time this is called, it returns the current date string
24
8
  """
9
+ from datetime import datetime
25
10
  current_date = datetime.now()
26
11
  date_string = current_date.strftime("%Y%m%d")
27
12
  date_string = date_string[2:]
@@ -31,6 +16,7 @@ def time_string():
31
16
  """
32
17
  Each time this is called, it returns the current time string
33
18
  """
19
+ from datetime import datetime
34
20
  current_time = datetime.now()
35
21
  return current_time.strftime("%H:%M:%S")
36
22
  ######################################################################################################
@@ -42,6 +28,9 @@ def adata_to_df(adata, layer=None):
42
28
  Input: An adata object with a specified layer.
43
29
  Output: A dataframe for the specific layer.
44
30
  """
31
+ import pandas as pd
32
+ import anndata as ad
33
+
45
34
  # Extract the data matrix from the given layer
46
35
  if layer:
47
36
  data_matrix = adata.layers[layer]
@@ -60,6 +49,7 @@ def save_matrix(matrix, save_name):
60
49
  Input: A numpy matrix and a save_name
61
50
  Output: A txt file representation of the data matrix
62
51
  """
52
+ import numpy as np
63
53
  np.savetxt(f'{save_name}.txt', matrix)
64
54
 
65
55
  def concatenate_h5ads(output_file, file_suffix='h5ad.gz', delete_inputs=True):
@@ -67,6 +57,13 @@ def concatenate_h5ads(output_file, file_suffix='h5ad.gz', delete_inputs=True):
67
57
  Concatenate all h5ad files in a directory and delete them after the final adata is written out.
68
58
  Input: an output file path relative to the directory in which the function is called
69
59
  """
60
+ import os
61
+ import anndata as ad
62
+ # Runtime warnings
63
+ import warnings
64
+ warnings.filterwarnings('ignore', category=UserWarning, module='anndata')
65
+ warnings.filterwarnings('ignore', category=FutureWarning, module='anndata')
66
+
70
67
  # List all files in the directory
71
68
  files = os.listdir(os.getcwd())
72
69
  # get current working directory
@@ -0,0 +1,88 @@
1
+ Metadata-Version: 2.3
2
+ Name: smftools
3
+ Version: 0.1.1
4
+ Summary: Single Molecule Footprinting Analysis in Python.
5
+ Project-URL: Source, https://github.com/jkmckenna/smftools
6
+ Author: Joseph McKenna
7
+ Maintainer-email: Joseph McKenna <jkmckenna@berkeley.edu>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: anndata,chromatin-accessibility,machine-learning,nanopore,protein-dna-binding,single-locus,single-molecule-footprinting
11
+ Classifier: Development Status :: 2 - Pre-Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Natural Language :: English
17
+ Classifier: Operating System :: MacOS :: MacOS X
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
24
+ Classifier: Topic :: Scientific/Engineering :: Visualization
25
+ Requires-Python: >=3.9
26
+ Requires-Dist: anndata>=0.10.0
27
+ Requires-Dist: biopython>=1.79
28
+ Requires-Dist: cython>=0.29.28
29
+ Requires-Dist: networkx>=3.2
30
+ Requires-Dist: numpy<2,>=1.22.0
31
+ Requires-Dist: pandas>=1.4.2
32
+ Requires-Dist: pod5>=0.1.21
33
+ Requires-Dist: pomegranate>1.0.0
34
+ Requires-Dist: pysam>=0.19.1
35
+ Requires-Dist: scanpy>=1.9
36
+ Requires-Dist: scikit-learn>=1.0.2
37
+ Requires-Dist: scipy>=1.7.3
38
+ Requires-Dist: seaborn>=0.11
39
+ Requires-Dist: torch>=1.9.0
40
+ Requires-Dist: tqdm
41
+ Provides-Extra: base-tests
42
+ Requires-Dist: pytest; extra == 'base-tests'
43
+ Requires-Dist: pytest-cov; extra == 'base-tests'
44
+ Provides-Extra: docs
45
+ Requires-Dist: ipython>=7.20; extra == 'docs'
46
+ Requires-Dist: matplotlib!=3.6.1; extra == 'docs'
47
+ Requires-Dist: myst-nb>=1; extra == 'docs'
48
+ Requires-Dist: myst-parser>=2; extra == 'docs'
49
+ Requires-Dist: nbsphinx>=0.9; extra == 'docs'
50
+ Requires-Dist: readthedocs-sphinx-search; extra == 'docs'
51
+ Requires-Dist: setuptools; extra == 'docs'
52
+ Requires-Dist: sphinx-autodoc-typehints>=1.25.2; extra == 'docs'
53
+ Requires-Dist: sphinx-book-theme>=1.1.0; extra == 'docs'
54
+ Requires-Dist: sphinx-copybutton; extra == 'docs'
55
+ Requires-Dist: sphinx-design; extra == 'docs'
56
+ Requires-Dist: sphinx>=7; extra == 'docs'
57
+ Requires-Dist: sphinxcontrib-bibtex; extra == 'docs'
58
+ Requires-Dist: sphinxext-opengraph; extra == 'docs'
59
+ Description-Content-Type: text/markdown
60
+
61
+ [![PyPI](https://img.shields.io/pypi/v/smftools.svg)](https://pypi.org/project/smftools)
62
+ [![Docs](https://readthedocs.org/projects/smftools/badge/?version=latest)](https://smftools.readthedocs.io/en/latest/?badge=latest)
63
+
64
+ # smftools
65
+ 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, analysis, and visualization. Data structures are compatible with analyses developed within the [scverse](https://github.com/scverse) project, including [scanpy](https://github.com/scverse/scanpy) and [scvi-tools](https://github.com/scverse/scvi-tools).
66
+
67
+ ## Philosophy
68
+ While most genomic data structures handle low-coverage data (<100X) along large references, smftools prioritizes high-coverage data (scalable to at least 1 million X 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.
69
+
70
+ ## Dependencies
71
+ The following CLI tools need to be installed and configured before using the informatics (smftools.inform) module of smftools:
72
+ 1) [Dorado](https://github.com/nanoporetech/dorado) -> For standard/modified basecalling and alignment. Can be attained by downloading and configuring nanopore MinKnow software.
73
+ 2) [Samtools](https://github.com/samtools/samtools) -> For working with SAM/BAM files
74
+ 3) [Minimap2](https://github.com/lh3/minimap2) -> The aligner used by Dorado
75
+ 4) [Modkit](https://github.com/nanoporetech/modkit) -> Extracting summary statistics and read level methylation calls from modified BAM files
76
+
77
+ ## Modules
78
+ - Informatics: Processes raw SMF data coming from Nanopore POD5 files, BAM files, or FASTQ files and organizes it into an AnnData object.
79
+ - Preprocessing: Filters the AnnData object on read length, total methylation, and a variety of QC metrics.
80
+ - Tools: Appends various analyses to the AnnData object.
81
+ - Plotting: Visualization of analyses stored within the AnnData object.
82
+
83
+ ## Announcements
84
+ ### 09/09/24 - The pre-alpha phase package ([smftools-0.1.1](https://pypi.org/project/smftools/))
85
+ 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.
86
+
87
+ ### 08/30/24 - The pre-alpha phase package ([smftools-0.1.0](https://pypi.org/project/smftools/)) is installable through pypi!
88
+ 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 standard 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!
@@ -0,0 +1,64 @@
1
+ smftools/__init__.py,sha256=zy4ckT7hKrLrlm6NiZQoupvc6oSN7wJsyOBCYdzukcQ,401
2
+ smftools/_settings.py,sha256=RkGSrezDzZnh6AODA3o2LiSAINBxxxal5weq-2RZuM0,379
3
+ smftools/_version.py,sha256=8oAxKUG747GUokmxjkrWejyJa5yPNEsoJDlXxoedxTw,21
4
+ smftools/readwrite.py,sha256=DgVisHYdkjzaO7suPbUvluImeTc3jqGDlioNveHUxPc,4158
5
+ smftools/datasets/F1_hybrid_NKG2A_enhander_promoter_GpC_conversion_SMF.h5ad.gz,sha256=q6wJtgFRDln0o20XNCx1qad3lwcdCoylqPN7wskTfI8,2926497
6
+ smftools/datasets/__init__.py,sha256=xkSTlPuakVYVCuRurif9BceNBDt6bsngJvvjI8757QI,142
7
+ smftools/datasets/dCas9_m6A_invitro_kinetics.h5ad.gz,sha256=niOcVHaYY7h3XyvwSkN-V_NMBaRt2vTP5TrJO0CwMCs,8385050
8
+ smftools/datasets/datasets.py,sha256=FZ6e7SU6Zt1-gf3az71AgQLpyNvAEiOb5ctbwyP3XSU,553
9
+ smftools/informatics/__init__.py,sha256=Aa-QNdfrpZrTPq8xqP4NBA7bb1VLLYaduH-US6pKNA4,280
10
+ smftools/informatics/bam_conversion.py,sha256=mLjIVx-07sa3TDQ_qhPKoAfTjqThvyh-MAq8BDtatHg,2719
11
+ smftools/informatics/bam_direct.py,sha256=2Y7C8N9QrgJyXqP3WEVZ7fi5qU-iNj_KN0ve-xvXD-U,2964
12
+ smftools/informatics/basecalls_to_adata.py,sha256=krnf5fdOuXZmnwW-y_eDC5hEjODUUyMEoY5z6R-65UI,1905
13
+ smftools/informatics/fast5_to_pod5.py,sha256=i2sPWME6p6jttG6WbcQFCzI22WVpwcXgZBG9RXqIlzU,717
14
+ smftools/informatics/pod5_conversion.py,sha256=x_d55jk2vX5hiSWH6-W4oWdmI-uTce8iRhhBqSzYS_I,3073
15
+ smftools/informatics/pod5_direct.py,sha256=aozZQdeYA5AFAEnku6un5gtGtZEdekk-6W7e7K_pBLw,3383
16
+ smftools/informatics/pod5_to_adata.py,sha256=1lSr32fAKXkxU5nV3C0UBDW6i2FnSbD_aqlKG4Yn9RU,1763
17
+ smftools/informatics/readwrite.py,sha256=DgVisHYdkjzaO7suPbUvluImeTc3jqGDlioNveHUxPc,4158
18
+ smftools/informatics/subsample_pod5.py,sha256=6g8fV2K1YJFEDVHs_bTJDuOSsIkMWpw5Lvk9uittW9k,2188
19
+ smftools/informatics/helpers/LoadExperimentConfig.py,sha256=gsWGoa9cydwY4Kd-hTXF2gtmxc8glRRD2V1JB88e9js,2822
20
+ smftools/informatics/helpers/__init__.py,sha256=luoFmS4B3XnG68XVziqtmPEZy-X3228LEZzQaHX84Cc,1487
21
+ smftools/informatics/helpers/align_and_sort_BAM.py,sha256=835lNQafsdY-PMQZAv3HgLcXNkeduZA4HUewXgGV87M,2447
22
+ smftools/informatics/helpers/binarize_converted_base_identities.py,sha256=kAYtPwMY5-gUL2muXOcbSiowQ2Mkls90GXXFaCKG5Pk,1773
23
+ smftools/informatics/helpers/canoncall.py,sha256=XaAM_Vd_Q3SQIIlb10-7z5Zo-YADnIcC4eMQjZt1H-E,961
24
+ smftools/informatics/helpers/converted_BAM_to_adata.py,sha256=cD-4gnJqCULGexedtETo-NGz-uqq16HwK_9zgCM7w_8,9769
25
+ smftools/informatics/helpers/count_aligned_reads.py,sha256=Jttzh94T2uALC-dCvjlq58tupj5VxuKj3j301ICj7eI,2058
26
+ smftools/informatics/helpers/extract_base_identities.py,sha256=-iBSEgnsp3EESSOupGcDGObGWykxucD5YC7aW_pEJ2k,2733
27
+ smftools/informatics/helpers/extract_mods.py,sha256=UBFjXDKz_A6ivjcocYT1_pKjvygY2Fdg0RjQmMS8UuA,2269
28
+ smftools/informatics/helpers/find_conversion_sites.py,sha256=52RvFQkIBly-CqToFe2zaKkpsUSixe8rHxZfL32EygA,3570
29
+ smftools/informatics/helpers/generate_converted_FASTA.py,sha256=fKmjpvBQF8fHljzcGtqUgMwdWIfnmwnhI-Y3A59_qDk,3939
30
+ smftools/informatics/helpers/get_native_references.py,sha256=fRuyEm9UJkfd5DwHmFb1bxEtNvtSI1_BxGRmrCymGkw,981
31
+ smftools/informatics/helpers/make_dirs.py,sha256=lWHXpwC76MFM5sSme9i_WeYUaxutzybendokhny03ds,537
32
+ smftools/informatics/helpers/make_modbed.py,sha256=cOQ97gPfRiCcw_fqboxousXIiOYjp78IFYLbu749U1Y,939
33
+ smftools/informatics/helpers/modQC.py,sha256=LeOBObG8gAVVdgESIMceYhd5AW1gfN7ABo91OQtOzTM,1041
34
+ smftools/informatics/helpers/modcall.py,sha256=ZcBl3QK622gG1IFy6agOWVADvsjr7WZIcglhSmYl02E,1133
35
+ smftools/informatics/helpers/modkit_extract_to_adata.py,sha256=KDnFSHH0PdaANH6uzcVpoii7s5u5gIfkSMgsQCiWORs,25279
36
+ smftools/informatics/helpers/one_hot_encode.py,sha256=rNHAfLG8smkpSEDBYj73cVwCNNbFhVfMW4SB2ijydMk,577
37
+ smftools/informatics/helpers/separate_bam_by_bc.py,sha256=mGiB6y4xs_WATf-VDyVz4tg6BG3I6ZzYcpuEjeA1oVo,1580
38
+ smftools/informatics/helpers/split_and_index_BAM.py,sha256=p2qRV-bOXj1P0JcvBqmK3ihRyM7_bVnKCi3bog_2kR8,1143
39
+ smftools/informatics/helpers/archived/informatics.py,sha256=gKb2ZJ_LcAeEXuQqn9e-QDF_sS4tMpMTr2vZlqa7n54,14572
40
+ smftools/informatics/helpers/archived/load_adata.py,sha256=DhvYYqO9VLsZqhL1WjN9sd-e3fgvdXGlgTP18z1h0L0,33654
41
+ smftools/plotting/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
+ smftools/preprocessing/__init__.py,sha256=PoemcyddUsfRPtJ7Ggr5G69nTXIQCFmz6lctpoEXYUA,1153
43
+ smftools/preprocessing/append_C_context.py,sha256=-4P3Dkq60QW57AB9NR6iRjmz-Dl27s2V-HqWWOTB21M,2485
44
+ smftools/preprocessing/binarize_on_Youden.py,sha256=slkkt56DZ1FZWy8Un5mNJEZ49JlPnPKow2zU4GoHEr8,2303
45
+ smftools/preprocessing/binary_layers_to_ohe.py,sha256=931eHuVda6pMZTvC7jVTKkY2a_KQWpSfgi-nkA5NmaI,1238
46
+ smftools/preprocessing/calculate_complexity.py,sha256=nDdEzHaN7KBN7QfqaFgQoTBT_6cpOa44l8IDHwa76fs,3224
47
+ smftools/preprocessing/calculate_converted_read_methylation_stats.py,sha256=FCDVLOxT8iHTBeG6EbEFt_S_mIQvYosEAb9-hbc8fhA,2720
48
+ smftools/preprocessing/calculate_coverage.py,sha256=46-U7YW98uL3pEVnfhBueGZOnNr3a3rWr3mT7YToglM,2019
49
+ smftools/preprocessing/calculate_pairwise_hamming_distances.py,sha256=EIcIOOw0tpECR9hfZeMNlq0J_L2-J-Jp5-RzVkoGO7o,951
50
+ smftools/preprocessing/calculate_position_Youden.py,sha256=mfQ6nFfUaEaKg_icyHA1zZlhh0wHjpLE56BZDXOdP_4,6364
51
+ smftools/preprocessing/calculate_read_length_stats.py,sha256=wIz-EtOz7S_RDSqAAv7SoiTIQq9Ovkfs4dE4BdHXyNo,1793
52
+ smftools/preprocessing/clean_NaN.py,sha256=nnm_zCEGilgDGvxxPBP81sYHJ9LrZ2MVvI1ydf0iPxk,1160
53
+ smftools/preprocessing/filter_converted_reads_on_methylation.py,sha256=3BwBWyPnVuOH46J2mgafRXcNzWYRxc4sr7nKTInLyfU,1242
54
+ smftools/preprocessing/filter_reads_on_length.py,sha256=LfGz0h3Xf8XUxv3ifXLbfeAOzSYYZVUJcHy73ykUu3A,2135
55
+ smftools/preprocessing/invert_adata.py,sha256=6ab7WjUjGUYd2uqXV93k1B4U6laxSwlWSgaR0Lg7apc,655
56
+ smftools/preprocessing/mark_duplicates.py,sha256=nKbdUEikJFekWuJ259J4XBPE5elcp44VkyY14jLLZEk,7167
57
+ smftools/preprocessing/min_non_diagonal.py,sha256=hx1asW8CEmLaIroZISW8EcAf_RnBEC_nofGD8QG0b1E,711
58
+ smftools/preprocessing/remove_duplicates.py,sha256=W0QQ5LLmIGj8OTfXuiTLJjFhOjv5r-TTipTupq-nf50,432
59
+ smftools/preprocessing/archives/preprocessing.py,sha256=4mLT09A7vwRZ78FHmuwtv38mH9TQ9qrZc_WjHRhhkIw,34379
60
+ smftools/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
+ smftools-0.1.1.dist-info/METADATA,sha256=8iWTWzl1ZIZvpYRbp6ov1NizrUJMwBbWNCs31QV3LjY,6262
62
+ smftools-0.1.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
63
+ smftools-0.1.1.dist-info/licenses/LICENSE,sha256=F8LwmL6vMPddaCt1z1S83Kh_OZv50alTlY7BvVx1RXw,1066
64
+ smftools-0.1.1.dist-info/RECORD,,
@@ -1,49 +0,0 @@
1
- ## align_BAM
2
- import subprocess
3
-
4
- def align_BAM(fasta, bam, bam_suffix):
5
- """
6
- A wrapper for running dorado aligner and samtools functions
7
- """
8
- aligned_BAM=f"{bam}_aligned"
9
- aligned_sorted_BAM=f"{aligned_BAM}_sorted"
10
- output = bam + bam_suffix
11
- aligned_output = aligned_BAM + bam_suffix
12
- aligned_sorted_output = aligned_sorted_BAM + bam_suffix
13
-
14
- # Run dorado aligner
15
- subprocess.run([
16
- "dorado", "aligner",
17
- "--secondary=no",
18
- fasta,
19
- output
20
- ], stdout=open(aligned_output, "w"))
21
-
22
- # Sort the BAM on positional coordinates
23
- subprocess.run([
24
- "samtools", "sort",
25
- "-o", aligned_sorted_output,
26
- aligned_output
27
- ])
28
-
29
- # Create a BAM index file
30
- subprocess.run([
31
- "samtools", "index",
32
- aligned_sorted_output
33
- ])
34
-
35
- # Make a bed file of coordinates for the BAM
36
- subprocess.run([
37
- "samtools", "view",
38
- aligned_sorted_output
39
- ], stdout=subprocess.PIPE) | subprocess.run([
40
- "awk", '{print $3, $4, $4+length($10)-1}'
41
- ], stdin=subprocess.PIPE, stdout=open(f"{aligned_sorted_BAM}_bed.bed", "w"))
42
-
43
- # Make a text file of reads for the BAM
44
- subprocess.run([
45
- "samtools", "view",
46
- aligned_sorted_output
47
- ], stdout=subprocess.PIPE) | subprocess.run([
48
- "cut", "-f1"
49
- ], stdin=subprocess.PIPE, stdout=open(f"aligned_sorted_BAM_read_names.txt", "w"))
@@ -1,17 +0,0 @@
1
- ## load_experiment_config
2
- import csv
3
-
4
- def load_experiment_config(experiment_config):
5
- """
6
- Loads in the experiment configuration csv and saves global variables with experiment configuration parameters
7
- """
8
- with open(experiment_config, mode='r', encoding='utf-8-sig') as csvfile:
9
- reader = csv.DictReader(csvfile)
10
- for row in reader:
11
- # Extract variable name and value from each row
12
- var_name = row['variable']
13
- value = row['value']
14
-
15
- # Alternatively, set it directly in the globals() dictionary
16
- globals()[var_name] = value
17
-
@@ -1,75 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: smftools
3
- Version: 0.1.0
4
- Summary: Single Molecule Footprinting Analysis in Python.
5
- Project-URL: Source, https://github.com/jkmckenna/smftools
6
- Author: Joseph McKenna
7
- Maintainer-email: Joseph McKenna <jkmckenna@berkeley.edu>
8
- License-Expression: MIT
9
- License-File: LICENSE
10
- Keywords: anndata,chromatin-accessibility,machine-learning,nanopore,protein-dna-binding,single-locus,single-molecule-footprinting
11
- Classifier: Development Status :: 2 - Pre-Alpha
12
- Classifier: Environment :: Console
13
- Classifier: Intended Audience :: Developers
14
- Classifier: Intended Audience :: Science/Research
15
- Classifier: License :: OSI Approved :: MIT License
16
- Classifier: Natural Language :: English
17
- Classifier: Operating System :: MacOS :: MacOS X
18
- Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.9
20
- Classifier: Programming Language :: Python :: 3.10
21
- Classifier: Programming Language :: Python :: 3.11
22
- Classifier: Programming Language :: Python :: 3.12
23
- Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
24
- Classifier: Topic :: Scientific/Engineering :: Visualization
25
- Requires-Python: >=3.9
26
- Requires-Dist: anndata>=0.10.0
27
- Requires-Dist: biopython>=1.79
28
- Requires-Dist: cython>=0.29.28
29
- Requires-Dist: networkx>=3.2
30
- Requires-Dist: numpy<2,>=1.22.0
31
- Requires-Dist: pandas>=1.4.2
32
- Requires-Dist: pomegranate>1.0.0
33
- Requires-Dist: pysam>=0.19.1
34
- Requires-Dist: scanpy>=1.9
35
- Requires-Dist: scikit-learn>=1.0.2
36
- Requires-Dist: scipy>=1.7.3
37
- Requires-Dist: seaborn>=0.11
38
- Requires-Dist: tqdm
39
- Provides-Extra: base-tests
40
- Requires-Dist: pytest; extra == 'base-tests'
41
- Requires-Dist: pytest-cov; extra == 'base-tests'
42
- Provides-Extra: doc
43
- Requires-Dist: ipython>=7.20; extra == 'doc'
44
- Requires-Dist: matplotlib!=3.6.1; extra == 'doc'
45
- Requires-Dist: myst-nb>=1; extra == 'doc'
46
- Requires-Dist: myst-parser>=2; extra == 'doc'
47
- Requires-Dist: nbsphinx>=0.9; extra == 'doc'
48
- Requires-Dist: readthedocs-sphinx-search; extra == 'doc'
49
- Requires-Dist: setuptools; extra == 'doc'
50
- Requires-Dist: sphinx-autodoc-typehints>=1.25.2; extra == 'doc'
51
- Requires-Dist: sphinx-book-theme>=1.1.0; extra == 'doc'
52
- Requires-Dist: sphinx-copybutton; extra == 'doc'
53
- Requires-Dist: sphinx-design; extra == 'doc'
54
- Requires-Dist: sphinx>=7; extra == 'doc'
55
- Requires-Dist: sphinxcontrib-bibtex; extra == 'doc'
56
- Requires-Dist: sphinxext-opengraph; extra == 'doc'
57
- Provides-Extra: torch
58
- Requires-Dist: pomeganate>=1.0.0; extra == 'torch'
59
- Requires-Dist: torch>=1.9.0; extra == 'torch'
60
- Provides-Extra: torch-tests
61
- Requires-Dist: pomeganate>=1.0.0; extra == 'torch-tests'
62
- Requires-Dist: pytest; extra == 'torch-tests'
63
- Requires-Dist: pytest-cov; extra == 'torch-tests'
64
- Requires-Dist: torch>=1.9.0; extra == 'torch-tests'
65
- Description-Content-Type: text/markdown
66
-
67
- # smftools
68
- A tool for processing raw sequencing data for single molecule footprinting experiments at single genomic loci.
69
-
70
- ## Dependencies
71
- The following tools need to be installed and configured:
72
- 1) [Dorado](https://github.com/nanoporetech/dorado) -> For standard/modified basecalling and alignment. Can be attained by downloading and configuring nanopore MinKnow software.
73
- 2) [Samtools](https://github.com/samtools/samtools) -> For working with SAM/BAM files
74
- 3) [Minimap2](https://github.com/lh3/minimap2) -> The aligner used by Dorado
75
- 4) [Modkit](https://github.com/nanoporetech/modkit) -> Extracting summary statistics and read level methylation calls from modified BAM files
@@ -1,58 +0,0 @@
1
- smftools/__init__.py,sha256=pWcysCXCokCdW4YySaA8BMumZkE56m15otMPG88nQGc,444
2
- smftools/_settings.py,sha256=a1uYWNBNtQb30cGSdpjeiIMnQV1Fip7IZAQrNzjXR5w,324
3
- smftools/readwrite.py,sha256=p-K_RYOrM0vDawBTcuCUyuwVzmYwJqNMvhv9fCTLDKE,4159
4
- smftools/datasets/F1_hybrid_NKG2A_enhander_promoter_GpC_conversion_SMF.h5ad.gz,sha256=q6wJtgFRDln0o20XNCx1qad3lwcdCoylqPN7wskTfI8,2926497
5
- smftools/datasets/__init__.py,sha256=xkSTlPuakVYVCuRurif9BceNBDt6bsngJvvjI8757QI,142
6
- smftools/datasets/dCas9_m6A_invitro_kinetics.h5ad.gz,sha256=niOcVHaYY7h3XyvwSkN-V_NMBaRt2vTP5TrJO0CwMCs,8385050
7
- smftools/datasets/datasets.py,sha256=rAcp7_Raa8Uv95DISj-oACY1fE_5fIfb5Poj-9WVOWo,473
8
- smftools/informatics/__init__.py,sha256=Bjufdncl978d-tNriuRHX92mjeAO5axjTlZP7iePjms,235
9
- smftools/informatics/pod5_conversion.py,sha256=m_qNRSNeUndl5KO8PJPMLCOWqcVq-TJSvoyUnJW-UHE,1399
10
- smftools/informatics/pod5_direct.py,sha256=MGQkpHI2qQuEO0IDFOiXjL0Pq59oC1DwUaIWH7jTHiU,1707
11
- smftools/informatics/pod5_to_adata.py,sha256=R31bkGbparRGpYpTZ69znQThK1xCGChlf4oP836IC9Y,722
12
- smftools/informatics/readwrite.py,sha256=p-K_RYOrM0vDawBTcuCUyuwVzmYwJqNMvhv9fCTLDKE,4159
13
- smftools/informatics/helpers/__init__.py,sha256=ws8Zyxin68L7G5R9Rna_qoBnkSNOaD1ndlcrooV2d-k,1466
14
- smftools/informatics/helpers/align_BAM.py,sha256=vZpkbI-mUqd6qJaovRhuNM03s816fjd5hNEcfA0oHxo,1414
15
- smftools/informatics/helpers/binarize_converted_base_identities.py,sha256=rTdk06BmU_bvuE1NOU1LGSQs9ytkl7vQjZcwMbA5Yx0,1409
16
- smftools/informatics/helpers/canoncall.py,sha256=Ujz0Pkp_wW-XJyb3uB2fzVpB12c2MCOWVTg_uIOQL8c,397
17
- smftools/informatics/helpers/converted_BAM_to_adata.py,sha256=7tntnkTZpNqS0WTMbO42ksxXqzk9NFpXK0q6uWSqtkM,8593
18
- smftools/informatics/helpers/count_aligned_reads.py,sha256=Q9iU0zwwNZRn0oOxRl_x5OAF7YgaRkSpQBojaBccQsI,1814
19
- smftools/informatics/helpers/extract_base_identities.py,sha256=nrQy8cUyOA2C8cKKL6SpZ97U0ZGhChw8Qdk0BwuxIT4,2406
20
- smftools/informatics/helpers/extract_mods.py,sha256=IQdpQxh_2NStKK4kIVKa8UAcV-fVJSs_bzB3JLe0Jx4,1602
21
- smftools/informatics/helpers/find_conversion_sites.py,sha256=aer63p2JHqaoB3wSK9xqpSjow7w7UyrMSJ06aKTQSiQ,3208
22
- smftools/informatics/helpers/generate_converted_FASTA.py,sha256=xHjspkeCiSKjqb6zUrjCG13OKW597LJ4_w33tg-wFok,3006
23
- smftools/informatics/helpers/get_native_references.py,sha256=wx_RXnPwj0NGp7Tx1_hXyO8ZzQJHZwa0b3a6r3266FY,976
24
- smftools/informatics/helpers/informatics.py,sha256=gKb2ZJ_LcAeEXuQqn9e-QDF_sS4tMpMTr2vZlqa7n54,14572
25
- smftools/informatics/helpers/load_adata.py,sha256=DhvYYqO9VLsZqhL1WjN9sd-e3fgvdXGlgTP18z1h0L0,33654
26
- smftools/informatics/helpers/load_experiment_config.py,sha256=boF524jZZKzBjc2yvAiMYvhM4OW_efXSbwU-nINKDdg,607
27
- smftools/informatics/helpers/make_dirs.py,sha256=UxghbuquyXgDD-H24Ghf1B7Kfpdt04NgMs8GE6zSJ3U,475
28
- smftools/informatics/helpers/make_modbed.py,sha256=m1lQUbw0W63YjiM_Tmy6QOL3GkHgvSuCrkX2Bo8sCco,741
29
- smftools/informatics/helpers/modQC.py,sha256=C-WVaoLN7Dxh--JcWa4UXzhwFpf0AXrFA99IsxfVXwo,770
30
- smftools/informatics/helpers/modcall.py,sha256=f41SkaXi2fYgv7B0oAFwj-9CZ0XVhvzWHfe977rT0wQ,493
31
- smftools/informatics/helpers/modkit_extract_to_adata.py,sha256=TvIHDXWTO2QxArGyIU3w-dQBVyq0rQ1A4iMvV9Rb_7A,24407
32
- smftools/informatics/helpers/one_hot_encode.py,sha256=jxfTNREED0YhdvwhVmRrt2BZUfiOrOUURVSOVtGypns,439
33
- smftools/informatics/helpers/separate_bam_by_bc.py,sha256=AFT-v0XXuW2rRYG6FC-8gulhAA6a4YGAa0UEuMDlimc,1235
34
- smftools/informatics/helpers/split_and_index_BAM.py,sha256=HqPAy5YxK0jokCWCUlUIWSLf2n-Gubkge-xxYfX4XLE,755
35
- smftools/plotting/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- smftools/preprocessing/__init__.py,sha256=ngs4XYcd9gSXwSa-gi1pWMblCRJ_uZo5MMkg5vuhDOU,1438
37
- smftools/preprocessing/append_C_context.py,sha256=sfHiV3gBOum3KyZ6wFOCUcDUieW9rra3hKFkWEb8wmk,2063
38
- smftools/preprocessing/binarize_on_Youden.py,sha256=CO0KnxxHmCwq7tlrBh7BuY0_6SEacR7NwRhkwaWoVUg,2056
39
- smftools/preprocessing/binary_layers_to_ohe.py,sha256=zahq1YcgAeva-b1CcEVaBK4XaNmMgE6IpfiedYepI5k,876
40
- smftools/preprocessing/calculate_complexity.py,sha256=H4j0mCWL-jFWZ8UoTGa5lNEcqByfwIDtlsJrpNRNkg4,2751
41
- smftools/preprocessing/calculate_converted_read_methylation_stats.py,sha256=ZIOKGkbWI15RzpnfgWU4MUXFz3LlUjL_yjodGrye8-A,2626
42
- smftools/preprocessing/calculate_coverage.py,sha256=Q-RjTqbYt9jc-Axk807_h0m7_oDFdewrO805FQARLUA,1852
43
- smftools/preprocessing/calculate_pairwise_hamming_distances.py,sha256=l0IYlWu9RCDq4R2pJm_qGXN_RyFkIuah9fFLvg1Hti0,843
44
- smftools/preprocessing/calculate_position_Youden.py,sha256=FUSsrhp8L8TLoJaX2cSl8u1phNbYpTRJfVqsrwMOWgY,6008
45
- smftools/preprocessing/calculate_read_length_stats.py,sha256=kKcEw4zS-GnJ2nyC5c24YVMY2oBmxmcxjPWLGnrkwws,1711
46
- smftools/preprocessing/clean_NaN.py,sha256=HCRX_nA6H3o7CysCa6yxN07xQEoh6LvdkX7aAYqSKR8,1024
47
- smftools/preprocessing/filter_converted_reads_on_methylation.py,sha256=krqDb6TNjQx4IICXbEQ8SDcaSjrWZ-9ChtaEiIxU5KY,962
48
- smftools/preprocessing/filter_reads_on_length.py,sha256=-tXMIpg8Mx8GskCfjBy0ZBczuJRTZdyuSZtDyb6KDJs,1737
49
- smftools/preprocessing/invert_adata.py,sha256=vpR0jynLODhE8mpiHZQIv1XUY9pd7cEG0ujC-GArXIE,616
50
- smftools/preprocessing/mark_duplicates.py,sha256=Qd1fluCHkL7ZAY37wGmBe40HwkRipOkbDAp6lnoLU9I,6818
51
- smftools/preprocessing/min_non_diagonal.py,sha256=o79E5xy-aO-cSwN5dUVi5oj8_EfQBDPcj1D0_7fvk1Q,644
52
- smftools/preprocessing/preprocessing.py,sha256=4mLT09A7vwRZ78FHmuwtv38mH9TQ9qrZc_WjHRhhkIw,34379
53
- smftools/preprocessing/remove_duplicates.py,sha256=sgdRjZSLakocTRwAukdp1RpFhODbeOjNN_EWZkTshAc,395
54
- smftools/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
- smftools-0.1.0.dist-info/METADATA,sha256=Loh3iFQgPLn6Xe_WdbeATlGiMqggFaYJOqgwf5e8WRI,3422
56
- smftools-0.1.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
57
- smftools-0.1.0.dist-info/licenses/LICENSE,sha256=F8LwmL6vMPddaCt1z1S83Kh_OZv50alTlY7BvVx1RXw,1066
58
- smftools-0.1.0.dist-info/RECORD,,