brie 2.2.3__tar.gz → 2.3.1__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 (87) hide show
  1. brie-2.3.1/.github/workflows/publish.yml +27 -0
  2. brie-2.3.1/.gitmodules +3 -0
  3. brie-2.3.1/.readthedocs.yml +32 -0
  4. brie-2.3.1/MANIFEST.in +2 -0
  5. {brie-2.2.3 → brie-2.3.1}/PKG-INFO +1 -1
  6. {brie-2.2.3 → brie-2.3.1}/brie/bin/count.py +19 -7
  7. {brie-2.2.3 → brie-2.3.1}/brie/utils/count.py +22 -10
  8. {brie-2.2.3 → brie-2.3.1}/brie/utils/io_utils.py +1 -2
  9. brie-2.3.1/brie/version.py +2 -0
  10. {brie-2.2.3 → brie-2.3.1}/brie.egg-info/PKG-INFO +1 -1
  11. {brie-2.2.3 → brie-2.3.1}/brie.egg-info/SOURCES.txt +3 -0
  12. {brie-2.2.3 → brie-2.3.1}/doc/release.rst +9 -1
  13. brie-2.2.3/.readthedocs.yml +0 -16
  14. brie-2.2.3/brie/version.py +0 -2
  15. {brie-2.2.3 → brie-2.3.1}/.gitignore +0 -0
  16. {brie-2.2.3 → brie-2.3.1}/.travis.yml +0 -0
  17. {brie-2.2.3 → brie-2.3.1}/LICENSE +0 -0
  18. {brie-2.2.3 → brie-2.3.1}/README.rst +0 -0
  19. {brie-2.2.3 → brie-2.3.1}/brie/__init__.py +0 -0
  20. {brie-2.2.3 → brie-2.3.1}/brie/_cli/__init__.py +0 -0
  21. {brie-2.2.3 → brie-2.3.1}/brie/_cli/_cli.py +0 -0
  22. {brie-2.2.3 → brie-2.3.1}/brie/_cli/count.py +0 -0
  23. {brie-2.2.3 → brie-2.3.1}/brie/_cli/download.py +0 -0
  24. {brie-2.2.3 → brie-2.3.1}/brie/_cli/extract.py +0 -0
  25. {brie-2.2.3 → brie-2.3.1}/brie/_cli/quant.py +0 -0
  26. {brie-2.2.3 → brie-2.3.1}/brie/bin/__init__.py +0 -0
  27. {brie-2.2.3 → brie-2.3.1}/brie/bin/brie_main.py +0 -0
  28. {brie-2.2.3 → brie-2.3.1}/brie/bin/quant.py +0 -0
  29. {brie-2.2.3 → brie-2.3.1}/brie/models/__init__.py +0 -0
  30. {brie-2.2.3 → brie-2.3.1}/brie/models/base_model.py +0 -0
  31. {brie-2.2.3 → brie-2.3.1}/brie/models/hypothesis_tests.py +0 -0
  32. {brie-2.2.3 → brie-2.3.1}/brie/models/model_Beta.py +0 -0
  33. {brie-2.2.3 → brie-2.3.1}/brie/models/model_TFProb.py +0 -0
  34. {brie-2.2.3 → brie-2.3.1}/brie/models/model_TFProb_dev.py +0 -0
  35. {brie-2.2.3 → brie-2.3.1}/brie/models/model_wrap.py +0 -0
  36. {brie-2.2.3 → brie-2.3.1}/brie/models/simulator.py +0 -0
  37. {brie-2.2.3 → brie-2.3.1}/brie/models/tools.py +0 -0
  38. {brie-2.2.3 → brie-2.3.1}/brie/plot/LRtest_plot.py +0 -0
  39. {brie-2.2.3 → brie-2.3.1}/brie/plot/__init__.py +0 -0
  40. {brie-2.2.3 → brie-2.3.1}/brie/plot/base_plot.py +0 -0
  41. {brie-2.2.3 → brie-2.3.1}/brie/settings.py +0 -0
  42. {brie-2.2.3 → brie-2.3.1}/brie/utils/__init__.py +0 -0
  43. {brie-2.2.3 → brie-2.3.1}/brie/utils/base_utils.py +0 -0
  44. {brie-2.2.3 → brie-2.3.1}/brie/utils/bias_utils.py +0 -0
  45. {brie-2.2.3 → brie-2.3.1}/brie/utils/count_droplet.py +0 -0
  46. {brie-2.2.3 → brie-2.3.1}/brie/utils/fasta_utils.py +0 -0
  47. {brie-2.2.3 → brie-2.3.1}/brie/utils/gtf_utils.py +0 -0
  48. {brie-2.2.3 → brie-2.3.1}/brie/utils/preprocessing.py +0 -0
  49. {brie-2.2.3 → brie-2.3.1}/brie/utils/run_utils.py +0 -0
  50. {brie-2.2.3 → brie-2.3.1}/brie/utils/sam_utils.py +0 -0
  51. {brie-2.2.3 → brie-2.3.1}/brie/utils/tran_utils.py +0 -0
  52. {brie-2.2.3 → brie-2.3.1}/brie/version1/brie.py +0 -0
  53. {brie-2.2.3 → brie-2.3.1}/brie/version1/brie_diff.py +0 -0
  54. {brie-2.2.3 → brie-2.3.1}/brie/version1/model_brie.py +0 -0
  55. {brie-2.2.3 → brie-2.3.1}/brie.egg-info/dependency_links.txt +0 -0
  56. {brie-2.2.3 → brie-2.3.1}/brie.egg-info/entry_points.txt +0 -0
  57. {brie-2.2.3 → brie-2.3.1}/brie.egg-info/requires.txt +0 -0
  58. {brie-2.2.3 → brie-2.3.1}/brie.egg-info/top_level.txt +0 -0
  59. {brie-2.2.3 → brie-2.3.1}/doc/Makefile +0 -0
  60. {brie-2.2.3 → brie-2.3.1}/doc/brie1.rst +0 -0
  61. {brie-2.2.3 → brie-2.3.1}/doc/brie_count.rst +0 -0
  62. {brie-2.2.3 → brie-2.3.1}/doc/brie_quant.rst +0 -0
  63. {brie-2.2.3 → brie-2.3.1}/doc/conf.py +0 -0
  64. {brie-2.2.3 → brie-2.3.1}/doc/image/BRIE2_roadmap.png +0 -0
  65. {brie-2.2.3 → brie-2.3.1}/doc/index.rst +0 -0
  66. {brie-2.2.3 → brie-2.3.1}/doc/install.rst +0 -0
  67. {brie-2.2.3 → brie-2.3.1}/doc/quick_start.rst +0 -0
  68. {brie-2.2.3 → brie-2.3.1}/doc/requirements.txt +0 -0
  69. {brie-2.2.3 → brie-2.3.1}/doc/tutorial.rst +0 -0
  70. {brie-2.2.3 → brie-2.3.1}/examples/brie2_demo.sh +0 -0
  71. {brie-2.2.3 → brie-2.3.1}/examples/demo_v1/anno_maker.sh +0 -0
  72. {brie-2.2.3 → brie-2.3.1}/examples/demo_v1/brie_demo.sh +0 -0
  73. {brie-2.2.3 → brie-2.3.1}/examples/gastrulation/E-MTAB-4079.130cells.txt +0 -0
  74. {brie-2.2.3 → brie-2.3.1}/examples/gastrulation/brie_sashimi.sh +0 -0
  75. {brie-2.2.3 → brie-2.3.1}/examples/gastrulation/gastrulation_130cells.sh +0 -0
  76. {brie-2.2.3 → brie-2.3.1}/examples/gastrulation/prepare_anno.sh +0 -0
  77. {brie-2.2.3 → brie-2.3.1}/examples/gastrulation/sashimi_setting.txt +0 -0
  78. {brie-2.2.3 → brie-2.3.1}/examples/make_list.sh +0 -0
  79. {brie-2.2.3 → brie-2.3.1}/requirements.txt +0 -0
  80. {brie-2.2.3 → brie-2.3.1}/setup.cfg +0 -0
  81. {brie-2.2.3 → brie-2.3.1}/setup.py +0 -0
  82. {brie-2.2.3 → brie-2.3.1}/simulator/README.rst +0 -0
  83. {brie-2.2.3 → brie-2.3.1}/simulator/simuDropout.py +0 -0
  84. {brie-2.2.3 → brie-2.3.1}/simulator/simuPSI.py +0 -0
  85. {brie-2.2.3 → brie-2.3.1}/simulator/spanki_demo.sh +0 -0
  86. {brie-2.2.3 → brie-2.3.1}/simulator/utils.py +0 -0
  87. {brie-2.2.3 → brie-2.3.1}/tests/README.rst +0 -0
@@ -0,0 +1,27 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build-and-publish:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ id-token: write # required for trusted publishing
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.11"
19
+
20
+ - name: Install build
21
+ run: pip install build
22
+
23
+ - name: Build sdist and wheel
24
+ run: python -m build
25
+
26
+ - name: Publish to PyPI
27
+ uses: pypa/gh-action-pypi-publish@release/v1
brie-2.3.1/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "brie-tutorials"]
2
+ path = brie-tutorials
3
+ url = https://github.com/huangyh09/brie-tutorials
@@ -0,0 +1,32 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ # Set the OS, Python version and other tools you might need
9
+ build:
10
+ os: ubuntu-22.04
11
+ tools:
12
+ python: "3.11"
13
+ # You can also specify other tool versions:
14
+ # nodejs: "19"
15
+ # rust: "1.64"
16
+ # golang: "1.19"
17
+
18
+ # Build documentation in the "docs/" directory with Sphinx
19
+ sphinx:
20
+ configuration: doc/conf.py
21
+
22
+ # Optionally build your docs in additional formats such as PDF and ePub
23
+ # formats:
24
+ # - pdf
25
+ # - epub
26
+
27
+ # Optional but recommended, declare the Python requirements required
28
+ # to build your documentation
29
+ # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
30
+ python:
31
+ install:
32
+ - requirements: doc/requirements.txt
brie-2.3.1/MANIFEST.in ADDED
@@ -0,0 +1,2 @@
1
+ include requirements.txt
2
+ include README.rst
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: brie
3
- Version: 2.2.3
3
+ Version: 2.3.1
4
4
  Summary: BRIE: Bayesian regression for isoform estimate
5
5
  Home-page: https://brie.readthedocs.io
6
6
  Author: Yuanhua Huang
@@ -17,7 +17,7 @@ from ..utils.io_utils import read_brieMM, read_gff, convert_to_annData
17
17
  #TODO: something wrong as there is no reads for isoform 2. Please check!!
18
18
 
19
19
  def smartseq_count(gff_file, samList_file, out_dir=None, nproc=1,
20
- event_type='SE', verbose=False):
20
+ event_type='SE', verbose=False, edge_hang=10, junc_hang=2):
21
21
  """CLI for counting reads supporting isoforms
22
22
  """
23
23
  # Parameter check
@@ -102,7 +102,7 @@ def smartseq_count(gff_file, samList_file, out_dir=None, nproc=1,
102
102
  %(len(genes), sam_table.shape[0], nproc))
103
103
 
104
104
  get_smartseq_matrix(genes, sam_table, out_dir, event_type=event_type,
105
- edge_hang=10, junc_hang=2, nproc=nproc, verbose=verbose)
105
+ edge_hang=edge_hang, junc_hang=junc_hang, nproc=nproc, verbose=verbose)
106
106
 
107
107
 
108
108
  ## Don't save into h5ad if not all genes only with two isoforms
@@ -134,7 +134,8 @@ def smartseq_count(gff_file, samList_file, out_dir=None, nproc=1,
134
134
 
135
135
 
136
136
  def droplet_count(gff_file, sam_file, barcode_file, out_dir=None, nproc=1,
137
- event_type='SE', CB_tag='CB', UMI_tag='UR', verbose=False):
137
+ event_type='SE', CB_tag='CB', UMI_tag='UR', verbose=False,
138
+ edge_hang=10, junc_hang=2):
138
139
  """CLI for counting reads supporting isoforms
139
140
  """
140
141
  ## TODO: Parameter check
@@ -217,7 +218,8 @@ def droplet_count(gff_file, sam_file, barcode_file, out_dir=None, nproc=1,
217
218
  %(len(genes), cell_list.shape[0], nproc))
218
219
 
219
220
  res = get_droplet_matrix(genes, sam_file, cell_list, out_dir, event_type,
220
- 10, 2, CB_tag, UMI_tag, nproc, verbose)
221
+ edge_hang, junc_hang, CB_tag, UMI_tag, nproc,
222
+ verbose)
221
223
 
222
224
  ## Don't save into h5ad if not all genes only with two isoforms
223
225
  n_trans = [len(g.trans) for g in genes]
@@ -278,6 +280,13 @@ def main():
278
280
  group2.add_option("--eventType", "-t", dest="event_type", default="SE",
279
281
  help="Type of splicing event for check. SE: skipping-exon; "
280
282
  "Any: no-checking [default: %default]")
283
+
284
+ group3 = OptionGroup(parser, "Reads compatibility")
285
+ group3.add_option("--minMatch", type="int", dest="min_match", default="10",
286
+ help="Min matched bases to the isoform; consider the read length and "
287
+ "transcript completeness [default: %default]")
288
+ group3.add_option("--maxMiss", type="int", dest="max_miss", default="2",
289
+ help="Max missed bases in the isoform range [default: %default]")
281
290
 
282
291
  # group.add_option("--add_premRNA", action="store_true", dest="add_premRNA",
283
292
  # default=False, help="Add the pre-mRNA as a transcript")
@@ -285,6 +294,7 @@ def main():
285
294
  parser.add_option_group(group0)
286
295
  parser.add_option_group(group1)
287
296
  parser.add_option_group(group2)
297
+ parser.add_option_group(group3)
288
298
 
289
299
  (options, args) = parser.parse_args()
290
300
  if len(sys.argv[1:]) == 0:
@@ -301,11 +311,13 @@ def main():
301
311
 
302
312
  if options.samList_file is not None:
303
313
  smartseq_count(options.gff_file, options.samList_file, options.out_dir,
304
- options.nproc, options.event_type, options.verbose)
314
+ options.nproc, options.event_type, options.verbose,
315
+ options.min_match, options.max_miss)
305
316
  else:
306
317
  droplet_count(options.gff_file, options.sam_file, options.barcodes_file,
307
- options.out_dir, options.nproc, options.event_type, options.cell_tag,
308
- options.UMI_tag, options.verbose)
318
+ options.out_dir, options.nproc, options.event_type,
319
+ options.cell_tag, options.UMI_tag, options.verbose,
320
+ options.min_match, options.max_miss)
309
321
 
310
322
 
311
323
  if __name__ == "__main__":
@@ -118,26 +118,34 @@ def _get_segment(exons, read):
118
118
  def check_reads_compatible(transcript, reads, edge_hang=10, junc_hang=2):
119
119
  """Check if reads are compatible with a transcript
120
120
  """
121
+ # TODO: the configuration can be further optimized
122
+ max_all_miss = junc_hang
123
+ max_exon_miss = junc_hang
124
+ min_all_match = edge_hang
125
+ min_side_match = junc_hang
126
+
121
127
  is_compatible = [True] * len(reads)
122
128
  for i in range(len(reads)):
123
129
  _segs = _get_segment(transcript.exons, reads[i])
124
130
 
125
131
  # check mismatch to regions not in this transcript
126
- if len(reads[i].positions) - sum(_segs) >= junc_hang:
132
+ if len(reads[i].positions) - sum(_segs) >= max_all_miss:
127
133
  is_compatible[i] = False
128
134
  continue
129
135
 
130
136
  # check if edge hang is too short
131
- if (_segs[0] > 0 or _segs[-1] > 0) and sum(_segs[1:-1]) < edge_hang:
137
+ # it may be determined by reads length and transcript completeness
138
+ if (_segs[0] > 0 or _segs[-1] > 0) and sum(_segs[1:-1]) < min_all_match:
132
139
  is_compatible[i] = False
133
140
  continue
134
141
 
135
142
  # check if exon has been skipped
136
- if len(_segs) > 4:
143
+ if len(_segs) > 2:
137
144
  for j in range(2, len(_segs) - 2):
138
- if (_segs[j-1] >= junc_hang and _segs[j+1] >= junc_hang and
139
- transcript.exons[j-1, 1] - transcript.exons[j-1, 0] -
140
- _segs[j] >= junc_hang):
145
+ exon_len = transcript.exons[j-1, 1] - transcript.exons[j-1, 0]
146
+ if (_segs[j-1] >= min_side_match and
147
+ _segs[j+1] >= min_side_match and
148
+ (exon_len - _segs[j]) >= max_exon_miss):
141
149
  is_compatible[i] = False
142
150
  break
143
151
 
@@ -180,12 +188,16 @@ def fetch_reads_count(gene, sam_file, event_type="SE", RNA_type="spliced",
180
188
  idx_U1 = np.arange(n_readsPE, n_readsPE + n_readsU1)
181
189
  idx_U2 = np.arange(n_readsPE + n_readsU1, n_reads)
182
190
 
183
- Rmat[idx_PE, i] = check_reads_compatible(_tran, reads["reads1"])
191
+ Rmat[idx_PE, i] = check_reads_compatible(
192
+ _tran, reads["reads1"], edge_hang=edge_hang, junc_hang=junc_hang)
184
193
  if len(reads["reads2"]) > 0:
185
- Rmat[idx_PE, i] *= check_reads_compatible(_tran, reads["reads2"])
194
+ Rmat[idx_PE, i] *= check_reads_compatible(
195
+ _tran, reads["reads2"], edge_hang=edge_hang, junc_hang=junc_hang)
186
196
 
187
- Rmat[idx_U1, i] = check_reads_compatible(_tran, reads["reads1u"])
188
- Rmat[idx_U2, i] = check_reads_compatible(_tran, reads["reads2u"])
197
+ Rmat[idx_U1, i] = check_reads_compatible(
198
+ _tran, reads["reads1u"], edge_hang=edge_hang, junc_hang=junc_hang)
199
+ Rmat[idx_U2, i] = check_reads_compatible(
200
+ _tran, reads["reads2u"], edge_hang=edge_hang, junc_hang=junc_hang)
189
201
 
190
202
  return Rmat
191
203
 
@@ -48,8 +48,7 @@ def convert_to_annData(Rmat_dict, effLen_tensor, cell_note, gene_note,
48
48
  effLen_tensor[:, 1, :], axis=1)
49
49
  varm['p_ambiguous'] = Prob_tensor[:, :, 2]
50
50
 
51
- adata = anndata.AnnData(X=X, obs=obs, var=var, varm=varm,
52
- layers=layers, dtype='float32')
51
+ adata = anndata.AnnData(X=X, obs=obs, var=var, varm=varm, layers=layers)
53
52
  return adata
54
53
 
55
54
 
@@ -0,0 +1,2 @@
1
+ __version__ = "2.3.1"
2
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: brie
3
- Version: 2.2.3
3
+ Version: 2.3.1
4
4
  Summary: BRIE: Bayesian regression for isoform estimate
5
5
  Home-page: https://brie.readthedocs.io
6
6
  Author: Yuanhua Huang
@@ -1,10 +1,13 @@
1
1
  .gitignore
2
+ .gitmodules
2
3
  .readthedocs.yml
3
4
  .travis.yml
4
5
  LICENSE
6
+ MANIFEST.in
5
7
  README.rst
6
8
  requirements.txt
7
9
  setup.py
10
+ .github/workflows/publish.yml
8
11
  brie/__init__.py
9
12
  brie/settings.py
10
13
  brie/version.py
@@ -5,7 +5,15 @@ Release notes
5
5
  Release in future
6
6
  =================
7
7
 
8
- Release v2.2.3 (15/05/2022)
8
+ Release v2.3.1 (03/11/2026)
9
+ ===========================
10
+ * fix pypi release by adding requirements.txt
11
+
12
+ Release v2.3.0 (17/06/2024)
13
+ ===========================
14
+ * support arguments: min_match and max_miss
15
+
16
+ Release v2.2.3 (15/05/2024)
9
17
  ===========================
10
18
  * minor fix in plotting function brie.pl.count()
11
19
  * add submodule brie-tutorials
@@ -1,16 +0,0 @@
1
- sphinx:
2
- configuration: doc/conf.py
3
- build:
4
- image: latest
5
- python:
6
- version: 3.7
7
- install:
8
- - requirements: doc/requirements.txt
9
- - requirements: requirements.txt
10
- - method: pip
11
- path: .
12
- extra_requirements:
13
- - docs
14
- - method: setuptools
15
- path: package
16
- system_packages: true
@@ -1,2 +0,0 @@
1
- __version__ = "2.2.3"
2
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes