pydna 5.5.4__tar.gz → 5.5.6__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.
- {pydna-5.5.4 → pydna-5.5.6}/PKG-INFO +8 -8
- {pydna-5.5.4 → pydna-5.5.6}/README.md +4 -6
- {pydna-5.5.4 → pydna-5.5.6}/pyproject.toml +8 -13
- pydna-5.5.6/src/pydna/__init__.py +233 -0
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/_pretty.py +8 -8
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/_thermodynamic_data.py +3 -3
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/all.py +1 -12
- pydna-5.5.6/src/pydna/alphabet.py +995 -0
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/amplicon.py +19 -24
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/amplify.py +75 -95
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/assembly.py +64 -81
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/assembly2.py +375 -310
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/codon.py +4 -4
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/common_sub_strings.py +6 -8
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/contig.py +203 -10
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/design.py +176 -60
- pydna-5.5.6/src/pydna/dseq.py +2900 -0
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/dseqrecord.py +197 -179
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/gateway.py +6 -6
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/gel.py +5 -5
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/genbank.py +43 -46
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/genbankfixer.py +89 -92
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/ladders.py +11 -12
- pydna-5.5.6/src/pydna/oligonucleotide_hybridization.py +124 -0
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/opencloning_models.py +187 -60
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/parsers.py +45 -32
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/primer.py +4 -4
- pydna-5.5.6/src/pydna/primer_screen.py +833 -0
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/readers.py +14 -9
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/seq.py +137 -47
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/seqrecord.py +54 -62
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/sequence_picker.py +2 -5
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/sequence_regex.py +6 -6
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/tm.py +17 -17
- pydna-5.5.6/src/pydna/types.py +44 -0
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/utils.py +97 -75
- pydna-5.5.4/src/pydna/__init__.py +0 -398
- pydna-5.5.4/src/pydna/conftest.py +0 -42
- pydna-5.5.4/src/pydna/download.py +0 -32
- pydna-5.5.4/src/pydna/dseq.py +0 -1830
- pydna-5.5.4/src/pydna/genbankfile.py +0 -42
- pydna-5.5.4/src/pydna/genbankrecord.py +0 -168
- pydna-5.5.4/src/pydna/goldengate.py +0 -45
- pydna-5.5.4/src/pydna/ligate.py +0 -62
- pydna-5.5.4/src/pydna/types.py +0 -44
- pydna-5.5.4/src/pydna/user_cloning.py +0 -29
- {pydna-5.5.4 → pydna-5.5.6}/LICENSE.txt +0 -0
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/cre_lox.py +0 -0
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/crispr.py +0 -0
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/fakeseq.py +0 -0
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/fusionpcr.py +0 -0
- {pydna-5.5.4 → pydna-5.5.6}/src/pydna/threading_timer_decorator_exit.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pydna
|
|
3
|
-
Version: 5.5.
|
|
3
|
+
Version: 5.5.6
|
|
4
4
|
Summary: Representing double stranded DNA and functions for simulating cloning and homologous recombination between DNA molecules.
|
|
5
5
|
License: BSD
|
|
6
6
|
License-File: LICENSE.txt
|
|
@@ -23,6 +23,7 @@ Provides-Extra: clipboard
|
|
|
23
23
|
Provides-Extra: download
|
|
24
24
|
Provides-Extra: express
|
|
25
25
|
Provides-Extra: gel
|
|
26
|
+
Provides-Extra: primer-screen
|
|
26
27
|
Requires-Dist: appdirs (>=1.4.4)
|
|
27
28
|
Requires-Dist: biopython (==1.85)
|
|
28
29
|
Requires-Dist: cai2 (>=1.0.5) ; extra == "express"
|
|
@@ -30,9 +31,10 @@ Requires-Dist: matplotlib (>=3.4.3) ; extra == "gel"
|
|
|
30
31
|
Requires-Dist: networkx (>=2.8.8)
|
|
31
32
|
Requires-Dist: numpy (>1.26) ; python_version < "3.12"
|
|
32
33
|
Requires-Dist: numpy (>=2.3.0) ; python_version >= "3.12"
|
|
33
|
-
Requires-Dist: opencloning-linkml (
|
|
34
|
+
Requires-Dist: opencloning-linkml (>=0.4.9,<0.5.0)
|
|
34
35
|
Requires-Dist: pillow (>=8.4.0) ; extra == "gel"
|
|
35
36
|
Requires-Dist: prettytable (>=3.5.0)
|
|
37
|
+
Requires-Dist: pyahocorasick (>=2.2.0) ; extra == "primer-screen"
|
|
36
38
|
Requires-Dist: pydivsufsort (>=0.0.14)
|
|
37
39
|
Requires-Dist: pyfiglet (==0.8.post1)
|
|
38
40
|
Requires-Dist: pyparsing (>=2.4.7) ; extra == "download"
|
|
@@ -506,7 +508,7 @@ poetry run pre-commit install
|
|
|
506
508
|
> =================================== FAILURES ===================================
|
|
507
509
|
> ___________________ [doctest] pydna.assembly2.blunt_overlap ____________________
|
|
508
510
|
> ```
|
|
509
|
-
> This means that the doctest of the function `blunt_overlap` failed. You can run the same test locally with `
|
|
511
|
+
> This means that the doctest of the function `blunt_overlap` failed. You can run the same test locally with `pytest src/pydna --doctest-modules` (use the appropriate path to the module file). That will give you information of what's failing. Fix, and re-run until it passes!
|
|
510
512
|
|
|
511
513
|
### Creating a PR 🔗
|
|
512
514
|
|
|
@@ -531,17 +533,15 @@ To work locally with the documentation, check the [documentation README](docs/RE
|
|
|
531
533
|
See the [releases](https://github.com/pydna-group/pydna/releases) for changes and releases.
|
|
532
534
|
|
|
533
535
|
The build workflow builds a PyPI packages using poetry. This workflow is triggered by publishing a Github release manually from the Github web interface.
|
|
536
|
+
We keep future release names [here](https://docs.google.com/document/d/1PrBYKzDh6QBcqfH9ksjpgArJo3ibDhMRNcibfXtYmCc/edit?tab=t.0). Please edit to
|
|
537
|
+
reflect used release names.
|
|
534
538
|
|
|
535
|
-

|
|
536
540
|
|
|
537
541
|
## History 📜
|
|
538
542
|
|
|
539
543
|
Pydna was made public in 2012 on [Google code](https://code.google.com/archive/p/pydna).
|
|
540
544
|
|
|
541
|
-
:microbe:
|
|
542
|
-
|
|
543
|
-
:portugal:
|
|
544
|
-
|
|
545
545
|
## Who is using pydna? 🧪
|
|
546
546
|
|
|
547
547
|
Taylor, L. J., & Strebel, K. (2017).
|
|
@@ -456,7 +456,7 @@ poetry run pre-commit install
|
|
|
456
456
|
> =================================== FAILURES ===================================
|
|
457
457
|
> ___________________ [doctest] pydna.assembly2.blunt_overlap ____________________
|
|
458
458
|
> ```
|
|
459
|
-
> This means that the doctest of the function `blunt_overlap` failed. You can run the same test locally with `
|
|
459
|
+
> This means that the doctest of the function `blunt_overlap` failed. You can run the same test locally with `pytest src/pydna --doctest-modules` (use the appropriate path to the module file). That will give you information of what's failing. Fix, and re-run until it passes!
|
|
460
460
|
|
|
461
461
|
### Creating a PR 🔗
|
|
462
462
|
|
|
@@ -481,17 +481,15 @@ To work locally with the documentation, check the [documentation README](docs/RE
|
|
|
481
481
|
See the [releases](https://github.com/pydna-group/pydna/releases) for changes and releases.
|
|
482
482
|
|
|
483
483
|
The build workflow builds a PyPI packages using poetry. This workflow is triggered by publishing a Github release manually from the Github web interface.
|
|
484
|
+
We keep future release names [here](https://docs.google.com/document/d/1PrBYKzDh6QBcqfH9ksjpgArJo3ibDhMRNcibfXtYmCc/edit?tab=t.0). Please edit to
|
|
485
|
+
reflect used release names.
|
|
484
486
|
|
|
485
|
-

|
|
486
488
|
|
|
487
489
|
## History 📜
|
|
488
490
|
|
|
489
491
|
Pydna was made public in 2012 on [Google code](https://code.google.com/archive/p/pydna).
|
|
490
492
|
|
|
491
|
-
:microbe:
|
|
492
|
-
|
|
493
|
-
:portugal:
|
|
494
|
-
|
|
495
493
|
## Who is using pydna? 🧪
|
|
496
494
|
|
|
497
495
|
Taylor, L. J., & Strebel, K. (2017).
|
|
@@ -35,7 +35,7 @@ license = "BSD"
|
|
|
35
35
|
name = "pydna"
|
|
36
36
|
readme = "README.md"
|
|
37
37
|
repository = "https://github.com/pydna-group/pydna/tree/master"
|
|
38
|
-
version = "5.5.
|
|
38
|
+
version = "5.5.6"
|
|
39
39
|
[tool.poetry.dependencies]
|
|
40
40
|
appdirs = ">=1.4.4"
|
|
41
41
|
biopython = "1.85"
|
|
@@ -54,18 +54,20 @@ pyparsing = { version = ">=2.4.7", optional = true }
|
|
|
54
54
|
pyperclip = { version = ">=1.8.2", optional = true }
|
|
55
55
|
python = ">=3.10,<4.0"
|
|
56
56
|
requests = { version = ">=2.26.0", optional = true }
|
|
57
|
+
pyahocorasick = { version = ">=2.2.0", optional = true }
|
|
57
58
|
scipy = [
|
|
58
59
|
{ version = ">=1.11.3", python = ">=3.12", optional = true },
|
|
59
60
|
{ version = ">=1.9.3", python = "<3.12", optional = true },
|
|
60
61
|
]
|
|
61
62
|
seguid = ">=0.0.5"
|
|
62
63
|
regex = "^2024.11.6"
|
|
63
|
-
opencloning-linkml = "0.4.
|
|
64
|
+
opencloning-linkml = "^0.4.9"
|
|
64
65
|
[tool.poetry.extras]
|
|
65
66
|
clipboard = ["pyperclip"]
|
|
66
67
|
download = ["pyparsing", "requests"]
|
|
67
68
|
express = ["cai2"]
|
|
68
69
|
gel = ["scipy", "matplotlib", "pillow"]
|
|
70
|
+
primer_screen = ["pyahocorasick"]
|
|
69
71
|
[build-system]
|
|
70
72
|
build-backend = "poetry_dynamic_versioning.backend"
|
|
71
73
|
requires = ["poetry-core", "poetry-dynamic-versioning"]
|
|
@@ -102,26 +104,19 @@ pandas = "*"
|
|
|
102
104
|
autopep8 = "^2.1.0"
|
|
103
105
|
black = "^25.1.0"
|
|
104
106
|
pre-commit = ">3.6"
|
|
105
|
-
nbstripout = "^0.
|
|
107
|
+
nbstripout = "^0.9"
|
|
106
108
|
flake8-bugbear = "^24.12.12"
|
|
107
109
|
|
|
108
110
|
[tool.pytest.ini_options]
|
|
109
111
|
minversion = "6.0.2"
|
|
110
112
|
python_files = "test_*.py"
|
|
111
|
-
testpaths = ["tests", "src"]
|
|
113
|
+
testpaths = ["tests", "src/pydna"]
|
|
114
|
+
norecursedirs = ["*"]
|
|
115
|
+
|
|
112
116
|
[tool.black]
|
|
113
117
|
include = '\.pyi?$'
|
|
114
118
|
line-length = 88
|
|
115
119
|
target-version = ["py38", "py39", "py310", "py311", "py312"]
|
|
116
|
-
# 'extend-exclude' excludes files or directories in addition to the defaults
|
|
117
|
-
extend-exclude = '''
|
|
118
|
-
(
|
|
119
|
-
^/foo.py # exclude a file named foo.py in the root of the project
|
|
120
|
-
| .*_pb2.py # exclude autogenerated Protocol Buffer files anywhere in the project
|
|
121
|
-
| ^docs/ # exclude all files in the docs/ directory
|
|
122
|
-
| ^tests/ # exclude all files in the tests/ directory
|
|
123
|
-
)
|
|
124
|
-
'''
|
|
125
120
|
|
|
126
121
|
[tool.poetry.requires-plugins]
|
|
127
122
|
poetry-plugin-export = ">=1.9"
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# Copyright 2013-2023 by Björn Johansson. All rights reserved.
|
|
4
|
+
# This code is part of the Python-dna distribution and governed by its
|
|
5
|
+
# license. Please see the LICENSE.txt file that should have been included
|
|
6
|
+
# as part of this package.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
"""
|
|
10
|
+
:copyright: Copyright 2013-2023 by Björn Johansson. All rights reserved.
|
|
11
|
+
:license: This code is part of the pydna package, governed by the
|
|
12
|
+
license in LICENSE.txt that should be included as part
|
|
13
|
+
of this package.
|
|
14
|
+
|
|
15
|
+
pydna
|
|
16
|
+
=====
|
|
17
|
+
Pydna is a python package providing code for simulation of the creation of
|
|
18
|
+
recombinant DNA molecules using
|
|
19
|
+
`molecular biology <https://en.wikipedia.org/wiki/Molecular_biology>`_
|
|
20
|
+
techniques. Development of pydna happens in this Github `repository <https://github.com/pydna-group/pydna>`_.
|
|
21
|
+
|
|
22
|
+
Provided:
|
|
23
|
+
1. PCR simulation
|
|
24
|
+
2. Assembly simulation based on shared identical sequences
|
|
25
|
+
3. Primer design for amplification of a given sequence
|
|
26
|
+
4. Automatic design of primer tails for Gibson assembly
|
|
27
|
+
or homologous recombination.
|
|
28
|
+
5. Restriction digestion and cut&paste cloning
|
|
29
|
+
6. Agarose gel simulation
|
|
30
|
+
7. Download sequences from Genbank
|
|
31
|
+
8. Parsing various sequence formats including the capacity to
|
|
32
|
+
handle broken Genbank format
|
|
33
|
+
|
|
34
|
+
pydna package layout
|
|
35
|
+
--------------------
|
|
36
|
+
|
|
37
|
+
The most important modules and how to import functions or classes from
|
|
38
|
+
them are listed below. Class names starts with a capital letter,
|
|
39
|
+
functions with a lowercase letter:
|
|
40
|
+
|
|
41
|
+
::
|
|
42
|
+
|
|
43
|
+
from pydna.module import function
|
|
44
|
+
from pydna.module import Class
|
|
45
|
+
|
|
46
|
+
Example: from pydna.gel import Gel
|
|
47
|
+
|
|
48
|
+
pydna
|
|
49
|
+
├── amplify
|
|
50
|
+
│ ├── Anneal
|
|
51
|
+
│ └── pcr
|
|
52
|
+
│
|
|
53
|
+
├── assembly
|
|
54
|
+
│ └── Assembly
|
|
55
|
+
│
|
|
56
|
+
├── design
|
|
57
|
+
│ ├── assembly_fragments
|
|
58
|
+
│ └── primer_design
|
|
59
|
+
│
|
|
60
|
+
├── dseqrecord
|
|
61
|
+
│ └── Dseqrecord
|
|
62
|
+
├── gel
|
|
63
|
+
│ └── Gel
|
|
64
|
+
│
|
|
65
|
+
├── genbank
|
|
66
|
+
│ ├── genbank
|
|
67
|
+
│ └── Genbank
|
|
68
|
+
│
|
|
69
|
+
├── parsers
|
|
70
|
+
│ ├── parse
|
|
71
|
+
│ └── parse_primers
|
|
72
|
+
│
|
|
73
|
+
└── readers
|
|
74
|
+
├── read
|
|
75
|
+
└── read_primers
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
How to use the documentation
|
|
80
|
+
----------------------------
|
|
81
|
+
Documentation is available as docstrings provided in the source code for
|
|
82
|
+
each module.
|
|
83
|
+
These docstrings can be inspected by reading the source code directly.
|
|
84
|
+
See further below on how to obtain the code for pydna.
|
|
85
|
+
|
|
86
|
+
In the python shell, use the built-in ``help`` function to view a
|
|
87
|
+
function's docstring::
|
|
88
|
+
|
|
89
|
+
>>> from pydna import readers
|
|
90
|
+
>>> help(readers.read)
|
|
91
|
+
... # doctest: +SKIP
|
|
92
|
+
|
|
93
|
+
The doctrings are also used to provide an automaticly generated reference
|
|
94
|
+
manual available online at
|
|
95
|
+
`read the docs <https://pydna-group.github.io/pydna>`_.
|
|
96
|
+
|
|
97
|
+
Docstrings can be explored using `IPython <http://ipython.org/>`_, an
|
|
98
|
+
advanced Python shell with
|
|
99
|
+
TAB-completion and introspection capabilities. To see which functions
|
|
100
|
+
are available in `pydna`,
|
|
101
|
+
type `pydna.<TAB>` (where `<TAB>` refers to the TAB key).
|
|
102
|
+
Use `pydna.open_config_folder?<ENTER>`to view the docstring or
|
|
103
|
+
`pydna.open_config_folder??<ENTER>` to view the source code.
|
|
104
|
+
|
|
105
|
+
In the `Spyder IDE <https://github.com/spyder-ide/spyder>`_ it is possible
|
|
106
|
+
to place the cursor immediately before the name of a module,class or
|
|
107
|
+
function and press ctrl+i to bring up docstrings in a separate window in Spyder
|
|
108
|
+
|
|
109
|
+
Code snippets are indicated by three greater-than signs::
|
|
110
|
+
|
|
111
|
+
>>> x=41
|
|
112
|
+
>>> x=x+1
|
|
113
|
+
>>> x
|
|
114
|
+
42
|
|
115
|
+
|
|
116
|
+
pydna source code
|
|
117
|
+
-----------------
|
|
118
|
+
|
|
119
|
+
The pydna source code is
|
|
120
|
+
`available on Github <https://github.com/pydna-group/pydna>`_.
|
|
121
|
+
|
|
122
|
+
How to get more help
|
|
123
|
+
--------------------
|
|
124
|
+
|
|
125
|
+
Please join the
|
|
126
|
+
`Google group <https://groups.google.com/forum/#!forum/pydna>`_
|
|
127
|
+
for pydna, this is the preferred location for help. If you find bugs
|
|
128
|
+
in pydna itself, open an issue at the
|
|
129
|
+
`Github repository <https://github.com/pydna-group/pydna/issues>`_.
|
|
130
|
+
|
|
131
|
+
Examples of pydna in use
|
|
132
|
+
------------------------
|
|
133
|
+
|
|
134
|
+
See this repository for a collection of
|
|
135
|
+
`examples <https://github.com/MetabolicEngineeringGroupCBMA/pydna-examples?tab=readme-ov-file#pydna-examples>`_.
|
|
136
|
+
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
from pydna._pretty import PrettyTable
|
|
140
|
+
from Bio.Restriction import FormattedSeq
|
|
141
|
+
import os
|
|
142
|
+
|
|
143
|
+
__author__ = "Björn Johansson"
|
|
144
|
+
__copyright__ = "Copyright 2013 - 2023 Björn Johansson"
|
|
145
|
+
__credits__ = ["Björn Johansson", "Mark Budde"]
|
|
146
|
+
__license__ = "BSD"
|
|
147
|
+
__maintainer__ = "Björn Johansson"
|
|
148
|
+
__email__ = "bjorn_johansson@bio.uminho.pt"
|
|
149
|
+
__status__ = "Development" # "Production" #"Prototype"
|
|
150
|
+
__version__ = "5.5.6"
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class _PydnaWarning(Warning):
|
|
154
|
+
"""Pydna warning.
|
|
155
|
+
|
|
156
|
+
Pydna uses this warning (or subclasses of it), to make it easy to
|
|
157
|
+
silence all warning messages:
|
|
158
|
+
|
|
159
|
+
>>> import warnings
|
|
160
|
+
>>> from pydna import _PydnaWarning
|
|
161
|
+
>>> warnings.simplefilter('ignore', _PydnaWarning)
|
|
162
|
+
|
|
163
|
+
Consult the warnings module documentation for more details.
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
pass
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
class _PydnaDeprecationWarning(_PydnaWarning):
|
|
170
|
+
"""pydna deprecation warning.
|
|
171
|
+
|
|
172
|
+
Pydna uses this warning instead of the built in DeprecationWarning
|
|
173
|
+
since those are ignored by default since Python 2.7.
|
|
174
|
+
|
|
175
|
+
To silence all our deprecation warning messages, use:
|
|
176
|
+
|
|
177
|
+
>>> import warnings
|
|
178
|
+
>>> from pydna import _PydnaDeprecationWarning
|
|
179
|
+
>>> warnings.simplefilter('ignore', _PydnaDeprecationWarning)
|
|
180
|
+
|
|
181
|
+
Code marked as deprecated will be removed in a future version
|
|
182
|
+
of Pydna. This can be discussed in the Pydna google group:
|
|
183
|
+
https://groups.google.com/forum/#!forum/pydna
|
|
184
|
+
|
|
185
|
+
"""
|
|
186
|
+
|
|
187
|
+
pass
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def get_env():
|
|
191
|
+
"""Print a an ascii table containing all environmental variables.
|
|
192
|
+
|
|
193
|
+
Pydna related variables have names that starts with `pydna_`
|
|
194
|
+
"""
|
|
195
|
+
_table = PrettyTable(["Variable", "Value"])
|
|
196
|
+
# _table.set_style(_prettytable.DEFAULT)
|
|
197
|
+
_table.align["Variable"] = "l" # Left align
|
|
198
|
+
_table.align["Value"] = "l" # Left align
|
|
199
|
+
_table.padding_width = 1 # One space between column edges and contents
|
|
200
|
+
for k, v in sorted(os.environ.items()):
|
|
201
|
+
if k.lower().startswith("pydna"):
|
|
202
|
+
_table.add_row([k, v])
|
|
203
|
+
return _table
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
def logo():
|
|
207
|
+
"""Ascii-art logotype of pydna."""
|
|
208
|
+
from pydna._pretty import pretty_str
|
|
209
|
+
|
|
210
|
+
message = f"pydna {__version__}"
|
|
211
|
+
try:
|
|
212
|
+
from pyfiglet import Figlet
|
|
213
|
+
except ModuleNotFoundError:
|
|
214
|
+
pass
|
|
215
|
+
else:
|
|
216
|
+
f = Figlet()
|
|
217
|
+
message = f.renderText(message)
|
|
218
|
+
return pretty_str(message)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
## Override Bio.Restriction.FormattedSeq._table
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def _make_FormattedSeq_table() -> bytes:
|
|
225
|
+
table = bytearray(256)
|
|
226
|
+
upper_to_lower = ord("A") - ord("a")
|
|
227
|
+
for c in b"ABCDEFGHIJKLMNOPQRSTUVWXYZ": # Only allow IUPAC letters
|
|
228
|
+
table[c] = c # map uppercase to uppercase
|
|
229
|
+
table[c - upper_to_lower] = c # map lowercase to uppercase
|
|
230
|
+
return bytes(table)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
FormattedSeq._table = _make_FormattedSeq_table()
|
|
@@ -6,10 +6,10 @@ The pretty_str class is similar to str but has a _repr_pretty_ method
|
|
|
6
6
|
for for nicer string output in the IPython shell and Jupyter notebook.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
from prettytable import PrettyTable as
|
|
10
|
-
from prettytable import TableStyle
|
|
11
|
-
from copy import copy
|
|
12
|
-
from typing import List
|
|
9
|
+
from prettytable import PrettyTable as Pt
|
|
10
|
+
from prettytable import TableStyle
|
|
11
|
+
from copy import copy
|
|
12
|
+
from typing import List
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class pretty_str(str):
|
|
@@ -19,10 +19,10 @@ class pretty_str(str):
|
|
|
19
19
|
p.text(self)
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
class PrettyTable(
|
|
22
|
+
class PrettyTable(Pt):
|
|
23
23
|
"""docstring."""
|
|
24
24
|
|
|
25
|
-
def lol(self) ->
|
|
25
|
+
def lol(self) -> List[list]:
|
|
26
26
|
"""docstring."""
|
|
27
27
|
return [self._field_names] + self._rows
|
|
28
28
|
|
|
@@ -31,6 +31,6 @@ class PrettyTable(_Pt):
|
|
|
31
31
|
return self.get_string()
|
|
32
32
|
|
|
33
33
|
def _repr_markdown_(self) -> pretty_str:
|
|
34
|
-
c =
|
|
35
|
-
c.set_style(
|
|
34
|
+
c = copy(self)
|
|
35
|
+
c.set_style(TableStyle.MARKDOWN)
|
|
36
36
|
return pretty_str(c.get_string())
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
# license. Please see the LICENSE.txt file that should have been included
|
|
6
6
|
# as part of this package.
|
|
7
7
|
|
|
8
|
-
import collections
|
|
8
|
+
import collections
|
|
9
9
|
|
|
10
|
-
dHBr =
|
|
11
|
-
dSBr =
|
|
10
|
+
dHBr = collections.defaultdict(dict)
|
|
11
|
+
dSBr = collections.defaultdict(dict)
|
|
12
12
|
|
|
13
13
|
dHBr[0][0] = -9100
|
|
14
14
|
dSBr[0][0] = -24
|
|
@@ -18,7 +18,7 @@ ttt
|
|
|
18
18
|
Dseqrecord(-3)
|
|
19
19
|
>>> from pydna.all import __all__
|
|
20
20
|
>>> __all__
|
|
21
|
-
['Anneal', 'pcr', 'Assembly', 'genbank', 'Genbank', '
|
|
21
|
+
['Anneal', 'pcr', 'Assembly', 'genbank', 'Genbank', 'Dseqrecord',
|
|
22
22
|
'Dseq', 'read', 'read_primer', 'parse', 'parse_primers', 'primer_design', 'assembly_fragments', 'eq', 'gbtext_clean']
|
|
23
23
|
>>>
|
|
24
24
|
"""
|
|
@@ -30,20 +30,16 @@ __all__ = [
|
|
|
30
30
|
"Assembly",
|
|
31
31
|
"genbank",
|
|
32
32
|
"Genbank",
|
|
33
|
-
"download_text",
|
|
34
33
|
"Dseqrecord",
|
|
35
34
|
"Dseq",
|
|
36
35
|
"read",
|
|
37
36
|
"read_primer",
|
|
38
37
|
"parse",
|
|
39
38
|
"parse_primers",
|
|
40
|
-
# "ape",
|
|
41
39
|
"primer_design",
|
|
42
40
|
"assembly_fragments",
|
|
43
|
-
# "circular_assembly_fragments",
|
|
44
41
|
"eq",
|
|
45
42
|
"gbtext_clean",
|
|
46
|
-
# "PrimerList",
|
|
47
43
|
]
|
|
48
44
|
|
|
49
45
|
|
|
@@ -52,20 +48,13 @@ from pydna.amplify import pcr
|
|
|
52
48
|
from pydna.assembly import Assembly
|
|
53
49
|
from pydna.genbank import genbank
|
|
54
50
|
from pydna.genbank import Genbank
|
|
55
|
-
from pydna.download import download_text
|
|
56
51
|
from pydna.dseqrecord import Dseqrecord
|
|
57
52
|
from pydna.dseq import Dseq
|
|
58
53
|
from pydna.readers import read
|
|
59
54
|
from pydna.readers import read_primer
|
|
60
55
|
from pydna.parsers import parse
|
|
61
56
|
from pydna.parsers import parse_primers
|
|
62
|
-
|
|
63
|
-
# from pydna.editor import ape
|
|
64
57
|
from pydna.design import primer_design
|
|
65
58
|
from pydna.design import assembly_fragments
|
|
66
|
-
|
|
67
|
-
# from pydna.design import circular_assembly_fragments
|
|
68
59
|
from pydna.utils import eq
|
|
69
60
|
from pydna.genbankfixer import gbtext_clean
|
|
70
|
-
|
|
71
|
-
# from pydna.myprimers import PrimerList
|