pytransdecoder 0.2.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. pytransdecoder/__init__.py +7 -0
  2. pytransdecoder/__main__.py +6 -0
  3. pytransdecoder/cli.py +781 -0
  4. pytransdecoder/core/__init__.py +1 -0
  5. pytransdecoder/core/base_freqs.py +71 -0
  6. pytransdecoder/core/decoys.py +113 -0
  7. pytransdecoder/core/fasta.py +55 -0
  8. pytransdecoder/core/gene_model.py +143 -0
  9. pytransdecoder/core/gff3_parser.py +58 -0
  10. pytransdecoder/core/homology_starts.py +54 -0
  11. pytransdecoder/core/kozak.py +180 -0
  12. pytransdecoder/core/models.py +123 -0
  13. pytransdecoder/core/orf_finder.py +317 -0
  14. pytransdecoder/core/presets.py +152 -0
  15. pytransdecoder/core/prng.py +54 -0
  16. pytransdecoder/core/pwm.py +174 -0
  17. pytransdecoder/core/sequence.py +19 -0
  18. pytransdecoder/core/translator.py +143 -0
  19. pytransdecoder/core/writers.py +69 -0
  20. pytransdecoder/genome.py +338 -0
  21. pytransdecoder/longorfs.py +180 -0
  22. pytransdecoder/predict.py +1621 -0
  23. pytransdecoder/presets/apicomplexan/hexamer.scores.gz +0 -0
  24. pytransdecoder/presets/apicomplexan/kozak.tsv +9 -0
  25. pytransdecoder/presets/apicomplexan/preset.json +20 -0
  26. pytransdecoder/presets/apicomplexan/thresholds.tsv.gz +0 -0
  27. pytransdecoder/presets/apicomplexan/training_orfs.cds.gz +0 -0
  28. pytransdecoder/presets/ciliate/hexamer.scores.gz +0 -0
  29. pytransdecoder/presets/ciliate/kozak.tsv +9 -0
  30. pytransdecoder/presets/ciliate/preset.json +20 -0
  31. pytransdecoder/presets/ciliate/thresholds.tsv.gz +0 -0
  32. pytransdecoder/presets/ciliate/training_orfs.cds.gz +0 -0
  33. pytransdecoder/presets/fungus/hexamer.scores.gz +0 -0
  34. pytransdecoder/presets/fungus/kozak.tsv +9 -0
  35. pytransdecoder/presets/fungus/preset.json +20 -0
  36. pytransdecoder/presets/fungus/thresholds.tsv.gz +0 -0
  37. pytransdecoder/presets/fungus/training_orfs.cds.gz +0 -0
  38. pytransdecoder/presets/green_alga/hexamer.scores.gz +0 -0
  39. pytransdecoder/presets/green_alga/kozak.tsv +9 -0
  40. pytransdecoder/presets/green_alga/preset.json +20 -0
  41. pytransdecoder/presets/green_alga/thresholds.tsv.gz +0 -0
  42. pytransdecoder/presets/green_alga/training_orfs.cds.gz +0 -0
  43. pytransdecoder/presets/insect/hexamer.scores.gz +0 -0
  44. pytransdecoder/presets/insect/kozak.tsv +9 -0
  45. pytransdecoder/presets/insect/preset.json +20 -0
  46. pytransdecoder/presets/insect/thresholds.tsv.gz +0 -0
  47. pytransdecoder/presets/insect/training_orfs.cds.gz +0 -0
  48. pytransdecoder/presets/mammal/hexamer.scores.gz +0 -0
  49. pytransdecoder/presets/mammal/kozak.tsv +9 -0
  50. pytransdecoder/presets/mammal/preset.json +20 -0
  51. pytransdecoder/presets/mammal/thresholds.tsv.gz +0 -0
  52. pytransdecoder/presets/mammal/training_orfs.cds.gz +0 -0
  53. pytransdecoder/presets/plant/hexamer.scores.gz +0 -0
  54. pytransdecoder/presets/plant/kozak.tsv +9 -0
  55. pytransdecoder/presets/plant/preset.json +20 -0
  56. pytransdecoder/presets/plant/thresholds.tsv.gz +0 -0
  57. pytransdecoder/presets/plant/training_orfs.cds.gz +0 -0
  58. pytransdecoder-0.2.1.dist-info/METADATA +307 -0
  59. pytransdecoder-0.2.1.dist-info/RECORD +63 -0
  60. pytransdecoder-0.2.1.dist-info/WHEEL +5 -0
  61. pytransdecoder-0.2.1.dist-info/entry_points.txt +3 -0
  62. pytransdecoder-0.2.1.dist-info/licenses/LICENSE +28 -0
  63. pytransdecoder-0.2.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,9 @@
1
+ #position A C G T (log2-odds in bits, start vs internal in-frame ATG; 437 training starts)
2
+ -6 -0.142 -0.343 -0.885 0.897
3
+ -5 -0.192 -0.661 -0.133 0.600
4
+ -4 0.456 0.623 -0.195 -0.668
5
+ -3 0.627 -1.721 -1.214 -0.661
6
+ -2 -0.040 -0.007 0.214 0.026
7
+ -1 0.909 -0.730 0.675 -0.898
8
+ +4 -0.120 -0.631 0.584 -0.235
9
+ +5 -0.188 0.214 0.367 0.147
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "apicomplexan",
3
+ "source": "pfalciparum benchmark annotation (TransDecoder paper 2026): complete coding transcripts + their fragments",
4
+ "genetic_code": "Universal",
5
+ "gc_pct": 22.0,
6
+ "auto_accept_nt": 519,
7
+ "strata": "len_tx_type",
8
+ "q_levels": [
9
+ 0.001,
10
+ 0.002,
11
+ 0.005,
12
+ 0.01,
13
+ 0.02,
14
+ 0.05,
15
+ 0.1,
16
+ 0.2,
17
+ 0.3,
18
+ 0.5
19
+ ]
20
+ }
@@ -0,0 +1,9 @@
1
+ #position A C G T (log2-odds in bits, start vs internal in-frame ATG; 243 training starts)
2
+ -6 0.206 -0.849 -1.159 0.453
3
+ -5 -0.173 -0.767 0.824 0.160
4
+ -4 0.366 -0.450 -0.552 -0.196
5
+ -3 0.348 0.296 -1.012 -0.074
6
+ -2 0.251 -0.738 0.199 -0.327
7
+ -1 0.476 -0.780 -0.349 -0.331
8
+ +4 0.268 -0.610 -0.227 -0.039
9
+ +5 0.001 -0.015 0.802 -0.499
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "ciliate",
3
+ "source": "tthermophila benchmark annotation (TransDecoder paper 2026): complete coding transcripts + their fragments",
4
+ "genetic_code": "Tetrahymena",
5
+ "gc_pct": 25.85,
6
+ "auto_accept_nt": null,
7
+ "strata": "len_tx_type",
8
+ "q_levels": [
9
+ 0.001,
10
+ 0.002,
11
+ 0.005,
12
+ 0.01,
13
+ 0.02,
14
+ 0.05,
15
+ 0.1,
16
+ 0.2,
17
+ 0.3,
18
+ 0.5
19
+ ]
20
+ }
@@ -0,0 +1,9 @@
1
+ #position A C G T (log2-odds in bits, start vs internal in-frame ATG; 390 training starts)
2
+ -6 0.132 -0.418 -0.897 0.772
3
+ -5 -0.140 -0.526 0.067 0.438
4
+ -4 0.222 0.473 -0.251 -0.303
5
+ -3 0.781 -1.282 -0.406 -0.131
6
+ -2 0.229 -0.309 -0.195 0.037
7
+ -1 0.263 0.146 0.125 -0.461
8
+ +4 0.267 -0.834 0.207 -0.098
9
+ +5 -0.098 0.539 0.494 -0.922
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "fungus",
3
+ "source": "spombe benchmark annotation (TransDecoder paper 2026): complete coding transcripts + their fragments",
4
+ "genetic_code": "Universal",
5
+ "gc_pct": 37.84,
6
+ "auto_accept_nt": 615,
7
+ "strata": "len_tx_type",
8
+ "q_levels": [
9
+ 0.001,
10
+ 0.002,
11
+ 0.005,
12
+ 0.01,
13
+ 0.02,
14
+ 0.05,
15
+ 0.1,
16
+ 0.2,
17
+ 0.3,
18
+ 0.5
19
+ ]
20
+ }
@@ -0,0 +1,9 @@
1
+ #position A C G T (log2-odds in bits, start vs internal in-frame ATG; 368 training starts)
2
+ -6 0.305 -0.214 -0.195 0.552
3
+ -5 -0.102 -0.008 0.413 -0.474
4
+ -4 2.066 -0.368 -0.991 0.566
5
+ -3 1.420 -0.966 -0.440 -0.112
6
+ -2 0.427 0.031 0.164 -0.919
7
+ -1 2.432 -0.987 -0.650 1.273
8
+ +4 0.318 -0.661 0.243 0.105
9
+ +5 0.214 0.321 -0.069 -1.042
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "green_alga",
3
+ "source": "creinhardtii benchmark annotation (TransDecoder paper 2026): complete coding transcripts + their fragments",
4
+ "genetic_code": "Universal",
5
+ "gc_pct": 68.17,
6
+ "auto_accept_nt": 1347,
7
+ "strata": "len_tx_type",
8
+ "q_levels": [
9
+ 0.001,
10
+ 0.002,
11
+ 0.005,
12
+ 0.01,
13
+ 0.02,
14
+ 0.05,
15
+ 0.1,
16
+ 0.2,
17
+ 0.3,
18
+ 0.5
19
+ ]
20
+ }
@@ -0,0 +1,9 @@
1
+ #position A C G T (log2-odds in bits, start vs internal in-frame ATG; 446 training starts)
2
+ -6 0.252 -0.258 -0.273 0.339
3
+ -5 -0.407 0.232 0.450 -0.145
4
+ -4 0.745 0.430 -1.021 -0.313
5
+ -3 1.210 -2.084 -0.227 -1.356
6
+ -2 0.280 0.264 -0.361 -0.654
7
+ -1 0.726 -0.137 -0.450 -0.259
8
+ +4 0.187 -0.572 0.061 0.376
9
+ +5 -0.160 0.397 0.114 -0.398
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "insect",
3
+ "source": "dmel benchmark annotation (TransDecoder paper 2026): complete coding transcripts + their fragments",
4
+ "genetic_code": "Universal",
5
+ "gc_pct": 50.84,
6
+ "auto_accept_nt": 804,
7
+ "strata": "len_tx_type",
8
+ "q_levels": [
9
+ 0.001,
10
+ 0.002,
11
+ 0.005,
12
+ 0.01,
13
+ 0.02,
14
+ 0.05,
15
+ 0.1,
16
+ 0.2,
17
+ 0.3,
18
+ 0.5
19
+ ]
20
+ }
@@ -0,0 +1,9 @@
1
+ #position A C G T (log2-odds in bits, start vs internal in-frame ATG; 308 training starts)
2
+ -6 -0.613 -0.312 0.298 0.538
3
+ -5 -0.828 0.169 0.640 0.117
4
+ -4 0.217 0.544 -0.191 -0.976
5
+ -3 0.877 -2.042 0.095 -1.261
6
+ -2 -0.095 0.594 0.179 -0.845
7
+ -1 -0.280 0.254 0.258 -0.979
8
+ +4 -0.180 -0.969 0.483 0.043
9
+ +5 -0.283 0.624 0.270 -0.780
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "mammal",
3
+ "source": "human benchmark annotation (TransDecoder paper 2026): complete coding transcripts + their fragments + GENCODE lncRNAs",
4
+ "genetic_code": "Universal",
5
+ "gc_pct": 49.81,
6
+ "auto_accept_nt": 726,
7
+ "strata": "len_tx_type",
8
+ "q_levels": [
9
+ 0.001,
10
+ 0.002,
11
+ 0.005,
12
+ 0.01,
13
+ 0.02,
14
+ 0.05,
15
+ 0.1,
16
+ 0.2,
17
+ 0.3,
18
+ 0.5
19
+ ]
20
+ }
@@ -0,0 +1,9 @@
1
+ #position A C G T (log2-odds in bits, start vs internal in-frame ATG; 396 training starts)
2
+ -6 -0.201 -0.071 -0.466 0.816
3
+ -5 -0.126 0.031 -0.070 0.168
4
+ -4 0.509 -0.252 0.120 -0.606
5
+ -3 0.469 -0.673 -0.175 -0.018
6
+ -2 0.179 0.331 -0.633 -0.237
7
+ -1 0.578 -0.113 -0.026 -0.969
8
+ +4 -0.607 -1.330 0.880 -0.792
9
+ +5 -0.115 0.833 -0.098 -0.828
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "plant",
3
+ "source": "athal benchmark annotation (TransDecoder paper 2026): complete coding transcripts + their fragments",
4
+ "genetic_code": "Universal",
5
+ "gc_pct": 42.1,
6
+ "auto_accept_nt": 663,
7
+ "strata": "len_tx_type",
8
+ "q_levels": [
9
+ 0.001,
10
+ 0.002,
11
+ 0.005,
12
+ 0.01,
13
+ 0.02,
14
+ 0.05,
15
+ 0.1,
16
+ 0.2,
17
+ 0.3,
18
+ 0.5
19
+ ]
20
+ }
@@ -0,0 +1,307 @@
1
+ Metadata-Version: 2.4
2
+ Name: pytransdecoder
3
+ Version: 0.2.1
4
+ Summary: TransDecoder, the original Perl version ported to Python by AI/LLMs with new features integrated
5
+ Author: Brian Haas, ported to python by AI/LLMs
6
+ License: BSD-3-Clause
7
+ Project-URL: Homepage, https://github.com/TransDecoder/PyTransDecoder
8
+ Project-URL: Repository, https://github.com/TransDecoder/PyTransDecoder
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: biopython>=1.81
13
+ Requires-Dist: tqdm>=4.65
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest>=7.4; extra == "dev"
16
+ Requires-Dist: pytest-cov>=4.1; extra == "dev"
17
+ Requires-Dist: black>=23.0; extra == "dev"
18
+ Requires-Dist: mypy>=1.0; extra == "dev"
19
+ Dynamic: license-file
20
+
21
+ # PyTransDecoder
22
+
23
+ Python port of [TransDecoder](https://github.com/TransDecoder/TransDecoder) - identify candidate coding regions within transcript sequences.
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ pip install pytransdecoder
29
+ ```
30
+
31
+ or from a clone of this repository:
32
+
33
+ ```bash
34
+ cd PyTransDecoder
35
+ pip install -e .
36
+ ```
37
+
38
+ ## Quick Start
39
+
40
+ Use `pyTransdecoder` as the primary interface when you want the standard end-to-end pipeline:
41
+
42
+ ```bash
43
+ pyTransdecoder -t transcripts.fasta
44
+ ```
45
+
46
+ This runs LongOrfs followed by Predict and writes the usual `*.transdecoder.{gff3,bed,pep,cds}` outputs.
47
+
48
+ You can also have the pipeline run homology support searches directly:
49
+
50
+ ```bash
51
+ pyTransdecoder -t transcripts.fasta \
52
+ --blast-search-pep uniprot_sprot.pep \
53
+ --pfam-search-db Pfam-A.hmm
54
+ ```
55
+
56
+ ## Phase-Specific Commands
57
+
58
+ If you want to run the phases separately, use the subcommand CLI:
59
+
60
+ ### Phase 1: Extract Long ORFs
61
+
62
+ ```bash
63
+ pytransdecoder longorfs -t transcripts.fasta
64
+ ```
65
+
66
+ This creates a directory `transcripts.fasta.transdecoder_dir/` with:
67
+ - `longest_orfs.pep` - Protein sequences
68
+ - `longest_orfs.cds` - CDS sequences
69
+ - `longest_orfs.gff3` - ORF annotations
70
+ - `base_freqs.dat` - Nucleotide frequencies
71
+
72
+ ### Options
73
+
74
+ ```
75
+ -t, --transcripts PATH Input transcripts FASTA file [required]
76
+ -m, --min-protein-length INT Minimum protein length (default: 50 aa; Predict's target-decoy
77
+ test, not this cutoff, controls chance ORFs)
78
+ -G, --genetic-code TEXT Genetic code (default: Standard)
79
+ -S, --strand-specific Only analyze top strand
80
+ -O, --output-dir PATH Output directory
81
+ --gene-trans-map PATH Gene-to-transcript mapping file
82
+ --complete-orfs-only Only output complete ORFs
83
+ -v, --verbose Verbose output
84
+ ```
85
+
86
+ ## CLI Compatibility
87
+
88
+ PyTransDecoder's CLI accepts **both underscore and dash formats** for option names, ensuring compatibility with existing Perl TransDecoder workflows:
89
+
90
+ ```bash
91
+ # Both of these work identically:
92
+ pytransdecoder predict -t transcripts.fasta --retain-pfam-hits pfam.domtblout
93
+ pytransdecoder predict -t transcripts.fasta --retain_pfam_hits pfam.domtblout
94
+ ```
95
+
96
+ This means you can use existing scripts and Makefiles without modification.
97
+
98
+ Legacy compatibility wrappers for `TransDecoder.LongOrfs` and `TransDecoder.Predict` now live under [`util/`](https://github.com/TransDecoder/PyTransDecoder/tree/main/util) instead of the repository root.
99
+
100
+ ## Supported Genetic Codes
101
+
102
+ - universal/standard
103
+ - vertebrate_mitochondrial
104
+ - yeast_mitochondrial
105
+ - invertebrate_mitochondrial
106
+ - ciliate/tetrahymena/dasycladacean
107
+ - euplotid
108
+ - bacterial
109
+ - candida
110
+ - And 15+ more...
111
+
112
+ ## Phase 2: Predict Likely Coding Regions
113
+
114
+ ### Basic Usage
115
+
116
+ ```bash
117
+ pytransdecoder predict -t transcripts.fasta
118
+ ```
119
+
120
+ This creates final output files in the same directory as your transcripts:
121
+ - `transcripts.fasta.transdecoder.gff3` - Gene predictions
122
+ - `transcripts.fasta.transdecoder.bed` - BED format
123
+ - `transcripts.fasta.transdecoder.pep` - Protein sequences
124
+ - `transcripts.fasta.transdecoder.cds` - CDS sequences
125
+
126
+ ### With Homology Support
127
+
128
+ ```bash
129
+ # Run BLASTP against UniProt
130
+ blastp -query transcripts.fasta.transdecoder_dir/longest_orfs.pep \
131
+ -db uniprot_sprot.pep -max_target_seqs 1 \
132
+ -outfmt 6 -evalue 1e-5 -num_threads 4 > blastp.outfmt6
133
+
134
+ # Run Pfam domain search
135
+ hmmscan --cpu 4 --domtblout pfam.domtblout Pfam-A.hmm \
136
+ transcripts.fasta.transdecoder_dir/longest_orfs.pep
137
+
138
+ # Run predict with homology data
139
+ pytransdecoder predict -t transcripts.fasta \
140
+ --retain-blastp-hits blastp.outfmt6 \
141
+ --retain-pfam-hits pfam.domtblout
142
+ ```
143
+
144
+ ORFs with a hit are kept even when their coding signal alone would not keep them. Hits to
145
+ transposable-element proteins (or to host proteins with a TE-derived segment) can therefore keep
146
+ short ORFs in TE-containing transcripts. These are kept on purpose; to find and remove them by
147
+ best-hit protein or by repeat overlap, see
148
+ [docs/homology_te_screen.md](https://github.com/TransDecoder/PyTransDecoder/blob/main/docs/homology_te_screen.md).
149
+
150
+ For the full pipeline entrypoint, you can skip the separate Pfam step and let
151
+ `pyTransdecoder` prepare and search the HMM database for you:
152
+
153
+ ```bash
154
+ pyTransdecoder -t transcripts.fasta --pfam-search-db Pfam-A.hmm
155
+ ```
156
+
157
+ ### Options
158
+
159
+ ```
160
+ -t, --transcripts PATH Input transcripts FASTA file [required]
161
+ -O, --output-dir PATH Output directory
162
+ -T, --top-orfs-train INT Training ORFs (default: 500)
163
+ --retain-long-orfs-mode 'dynamic' or 'strict' (default: dynamic)
164
+ --retain-pfam-hits PATH Pfam domain hits (domtblout format)
165
+ --retain-blastp-hits PATH BLAST hits (outfmt 6 format)
166
+ --retain-multiple-orfs Report all non-overlapping ORFs passing selection
167
+ (default: the best ORF per transcript)
168
+ --no-refine-starts Skip start codon refinement
169
+ --no-homology-start-assist Do not let BLASTP/Pfam hits decide 5'-partial vs trimmed starts
170
+ (default: they do whenever hits are supplied)
171
+ --start-contrast-alpha FLOAT Start refinement: UTR score per base of upstream segment (default: 0.4)
172
+ --start-kozak-weight FLOAT Start refinement: bases of coding signal per bit of Kozak score (default: 17)
173
+ --max-qvalue FLOAT Keep ORFs (without homology) with target-decoy q-value <= this
174
+ (default: 0.05)
175
+ --precise Same as --max-qvalue 0.01: fewer calls on noncoding sequence
176
+ --sensitive Same as --max-qvalue 0.2: more short and partial ORFs
177
+ --decoy-shuffles INT Shuffled copies per transcript (default: 0 = automatic)
178
+ --decoy-seed INT Seed of the decoy shuffles (default: 42)
179
+ --preset NAME|DIR Models and thresholds from a preset instead of the input
180
+ (recommended below ~1,000 transcripts or for mostly partial sets)
181
+ -G, --genetic-code TEXT Genetic code (default: Standard)
182
+ -v, --verbose Verbose output
183
+ ```
184
+
185
+ ### How It Works
186
+
187
+ 1. **Training**: Selects top longest unique ORFs to train hexamer scoring model
188
+ 2. **Scoring**: Scores all ORFs using Markov chain model (hexamer composition)
189
+ 3. **Selection**: Chooses best ORFs based on:
190
+ - Homology support (BLAST/Pfam hits)
191
+ - Coding potential score
192
+ - ORF length
193
+ - GC content-based thresholds (ORFs long enough to be unlikely in random sequence of the
194
+ transcriptome's GC content are kept regardless of score; applied only when the genetic
195
+ code's stop codons are TAA/TAG/TGA, the set the thresholds were simulated with)
196
+ - A false discovery rate against decoys: each input transcript is shuffled keeping its
197
+ dinucleotide counts (so length and base composition are kept), decoy ORFs are found in the
198
+ shuffles with the LongOrfs settings and genetic code, and scored with the same model. Within
199
+ strata of ORF length, transcript length and ORF type (complete or partial), an ORF's q-value
200
+ is the lowest estimated FDR (decoys / targets at or above its frame contrast) of any cutoff
201
+ that accepts it. Without homology support an ORF needs in-frame score > 0, a higher score
202
+ than the shifted frames, and q <= `--max-qvalue` (0.05; `--precise` 0.01, `--sensitive` 0.2).
203
+ Short ORFs, which are far more frequent by chance, therefore need more coding evidence, with
204
+ no fixed length cutoff. The decoys are reproducible (`--decoy-seed`) and identical in
205
+ TransDecoder (Perl).
206
+ - Translated noncanonical ORFs (Ribo-seq ORFs) mostly lack codon-usage signal, so finding
207
+ them needs translation evidence.
208
+ - **Small inputs**: below ~1,000 transcripts the coding model and the decoy statistics learned
209
+ from the input are unreliable. `--preset NAME` uses a coding model, start model and q-value
210
+ thresholds learned from a reference transcriptome instead (bundled: see `--help`;
211
+ `pytransdecoder build-preset` makes one from a Predict run on a related species).
212
+ 4. **Start refinement**: an ORF that runs to the 5' end of its transcript (no start codon) is
213
+ either a truncated (5'-partial) ORF or one that extends into the 5' UTR. For the segment
214
+ before its first in-frame ATG, two scores are compared, both in bases' worth of typical coding
215
+ signal (the training ORFs' median per-base frame contrast):
216
+ - **coding score**: the segment's frame contrast (coding score in frame minus the better
217
+ shifted frame) divided by that typical per-base value;
218
+ - **UTR score**: `--start-contrast-alpha` (0.4) x segment length + `--start-kozak-weight` (17)
219
+ x the ATG's Kozak score in bits (log2-odds of -6..-1, +4..+5 against in-frame ATGs inside
220
+ the training ORFs).
221
+ If the UTR score is higher, the ORF is trimmed to start at the ATG; otherwise it stays 5'
222
+ partial. Each bit of Kozak score lets the ATG overrule 17 bases of coding signal. See
223
+ [docs/start_codon_refinement.md](https://github.com/TransDecoder/PyTransDecoder/blob/main/docs/start_codon_refinement.md) for a step-by-step
224
+ walkthrough with examples and advice on choosing alpha. The Kozak model is written to the
225
+ work directory as `start_refinement.kozak.tsv` (bits), `.kozak.counts.tsv` and a sequence
226
+ logo, `.kozak.logo.svg`.
227
+ **With homology hits** (`--retain-blastp-hits` and/or `--retain-pfam-hits`), the hits of the
228
+ ORF's longest-ORF peptide decide first (PyTransDecoder only; turn off with
229
+ `--no-homology-start-assist`):
230
+ - BLASTP, trim: the best hit's subject N-terminus (subject start <= 3) aligns within 5 aa of the
231
+ first ATG;
232
+ - BLASTP, keep 5' partial: the alignment starts >= 5 aa upstream of the ATG and the subject
233
+ continues further N-terminal (subject start > 1);
234
+ - Pfam, keep 5' partial: a domain envelope starts upstream of the ATG.
235
+ Where no rule fires, or a trim and a keep call conflict, the coding-vs-UTR rule above decides.
236
+ Each rule is used only if its hits file was given. Per-ORF evidence and decisions are written
237
+ to `start_refinement.homology.tsv` in the work directory, and ORFs trimmed by homology carry
238
+ `start_homology=R2` in the GFF3. See [docs/start_codon_refinement.md](https://github.com/TransDecoder/PyTransDecoder/blob/main/docs/start_codon_refinement.md).
239
+ 5. **Output**: Generates final predictions in multiple formats
240
+
241
+ ## Annotating a Genome from Transcript Structures
242
+
243
+ Transcripts reconstructed from RNA-seq (StringTie, LRAA, Cufflinks, PASA, or Trinity aligned to
244
+ the genome) can be annotated with coding regions on the genome: ORFs predicted on the transcript
245
+ sequences are propagated through each transcript's exon structure, giving gene / mRNA / exon /
246
+ CDS / five_prime_UTR / three_prime_UTR models in GFF3.
247
+
248
+ From a genome and a GTF (transcript sequences are extracted with gffread):
249
+
250
+ ```bash
251
+ pyTransdecoder --genome genome.fa --gtf stringtie.gtf -O out
252
+ # -> out/stringtie.cDNA.fasta.transdecoder.genome.gff3 (and .genome.bed)
253
+ ```
254
+
255
+ From transcript sequences and their structures (GTF, alignment GFF3 from GMAP/PASA with
256
+ `Target=`, or minimap2 SAM/BAM spliced alignments):
257
+
258
+ ```bash
259
+ pyTransdecoder -t Trinity.fasta --structures Trinity.minimap2.bam -O out
260
+ # or, after LongOrfs + Predict:
261
+ pytransdecoder genome-map --orfs Trinity.fasta.transdecoder.gff3 --structures Trinity.minimap2.bam \
262
+ -t Trinity.fasta -o Trinity.fasta.transdecoder.genome.gff3
263
+ ```
264
+
265
+ Notes:
266
+ - ORFs on the opposite strand of a spliced transcript are not propagated; single-exon
267
+ transcripts take the ORF's orientation.
268
+ - Alignment blocks carry transcript coordinates (GFF3 `Target`, SAM CIGAR), so transcripts with
269
+ indels or clipped ends map base-accurately; an ORF whose CDS is not within the aligned part of
270
+ its transcript is not propagated. Only primary SAM/BAM alignments are used.
271
+ - GTF transcripts with strand `.` are taken as `+`, as gffread extracts them; use
272
+ `--unstranded-as minus` for sequences extracted with TransDecoder's
273
+ `util/gtf_genome_to_cdna_fasta.pl`.
274
+ - Isoforms are grouped by the GTF `gene_id` (or the TransDecoder gene id, e.g. with
275
+ `--gene-trans-map`), with the chromosome and strand appended.
276
+
277
+ ## Development Status
278
+
279
+ - ✅ Phase 1 (LongOrfs): Implemented and validated
280
+ - ✅ Phase 2 (Predict): Implemented and tested
281
+ - ⏳ Performance benchmarking on large datasets
282
+
283
+ ## Testing Against Perl Version
284
+
285
+ To validate output matches the Perl version:
286
+
287
+ ```bash
288
+ # Run Perl version
289
+ cd ../TransDecoder
290
+ ./TransDecoder.LongOrfs -t test.fasta
291
+
292
+ # Run Python version
293
+ cd ../PyTransDecoder
294
+ pytransdecoder longorfs -t test.fasta
295
+
296
+ # Compare outputs
297
+ diff ../TransDecoder/test.fasta.transdecoder_dir/longest_orfs.pep \
298
+ test.fasta.transdecoder_dir/longest_orfs.pep
299
+ ```
300
+
301
+ ## Requirements
302
+
303
+ - Python 3.8+
304
+ - BioPython >= 1.81
305
+ - tqdm >= 4.65
306
+
307
+ **Note**: Ported by Claude.io Sonnet 4.5 under guidance by bhaas. Jan 24, 2026.
@@ -0,0 +1,63 @@
1
+ pytransdecoder/__init__.py,sha256=7PHDZ23rYyc7hO6w0-rnwB1E7UMng2uLrbNqWdo_LUA,150
2
+ pytransdecoder/__main__.py,sha256=37cCIfD-m7brRwI36e7id3gNzCLeTdVL7itGvtNl1Yk,107
3
+ pytransdecoder/cli.py,sha256=Av_9mVceZVTATM-dqs6wE2vWHB7pjPyCAIpMnLgtLRI,34862
4
+ pytransdecoder/genome.py,sha256=2lfCaGgJHZzQOVWbUSaZ2-UWjpwZNsqmKGOG1x-Pvew,14631
5
+ pytransdecoder/longorfs.py,sha256=qly1nCGW6q862HLywmNnaX-zZOfUwIBKeTUaU1nlwbA,6509
6
+ pytransdecoder/predict.py,sha256=YPrCFDxbWDzYWllp8J6UlI-m2OcpFR42s4w4dpy-OLc,75446
7
+ pytransdecoder/core/__init__.py,sha256=SezWMpPUMx_7qoZwMVX9vUVg8Y3xarsXLvJOH1z68z0,38
8
+ pytransdecoder/core/base_freqs.py,sha256=QiEbFiMJ71kFU1DanZWSVS55YctJtfxu9VS_FcW2nU0,2617
9
+ pytransdecoder/core/decoys.py,sha256=Bg94NCdTjR3NmhyJKPPABF0Ee2y5u-kx9LGN4UGaNqU,4203
10
+ pytransdecoder/core/fasta.py,sha256=3rGfQGINDDsm90s4lIlhGnOOebzUJjnrs3aRYAUFtgI,1987
11
+ pytransdecoder/core/gene_model.py,sha256=xDUqXPF7QUA3YgcRFLnz7H2fAC_f5XIpeKogjxdMAAk,6301
12
+ pytransdecoder/core/gff3_parser.py,sha256=M5jVtY4uS74bUL73k4Ye6Zhnqatm7X6Y9OFrPgCAj9M,1603
13
+ pytransdecoder/core/homology_starts.py,sha256=sVpSwuzEv_caG9PAh5I5Ihb7qVatOPJS6q0yfO1PEpM,2476
14
+ pytransdecoder/core/kozak.py,sha256=WGMDbfFbp7WnDwj2PNZnm8cx1QSQ-V_WMb07Y2kWQaI,7857
15
+ pytransdecoder/core/models.py,sha256=r9ns5RND7QVVLffk1_d9bz8oo9R357CqHkBu7NQaS7g,3948
16
+ pytransdecoder/core/orf_finder.py,sha256=aws4D8Yx45fBnWMj_xNvAAvOus5VfJ0XC0HcyXG5wiM,12617
17
+ pytransdecoder/core/presets.py,sha256=rX6YHQ3cju--5b8A9FqVg6CQ7lSh8uLdSuuITAcZ9lU,6937
18
+ pytransdecoder/core/prng.py,sha256=uZwc4GLY9gtBoglC35u1k0fDQzRCvm65DAhuwRHehUw,1504
19
+ pytransdecoder/core/pwm.py,sha256=q9KKZiPpKsom5csNm2iB5y-XyMxDONrvo-PbEtahcxA,5926
20
+ pytransdecoder/core/sequence.py,sha256=TwwSKhzTJzZssntm1jf7DNakgVgKj7rhjwg-qbbEF9A,345
21
+ pytransdecoder/core/translator.py,sha256=FVi8SvZCJG5HKDdFTZng1Agrcih2zxqTWpJx4wfa470,4808
22
+ pytransdecoder/core/writers.py,sha256=lkTs1-GgAe42XMFgylG7RJomaAhvwQZeJ7ncbPBqdSw,1799
23
+ pytransdecoder/presets/apicomplexan/hexamer.scores.gz,sha256=xKN4Vsv1Yuh-h7HtVG9OYT6FXYP89LG2tFvtaEh0tKk,225383
24
+ pytransdecoder/presets/apicomplexan/kozak.tsv,sha256=cxw1xx_GE34HUQNhrPIzlQrVrdTgItazqWrXe4lJLqk,327
25
+ pytransdecoder/presets/apicomplexan/preset.json,sha256=jF9cOLWlnaw6nfEFFfYt-64ekCXvPgV4Pz-z0qy4ATg,342
26
+ pytransdecoder/presets/apicomplexan/thresholds.tsv.gz,sha256=sm9s_PrHR_gjbEfh5Yz856rOumjB3W9QAl-8aylu9QY,5309
27
+ pytransdecoder/presets/apicomplexan/training_orfs.cds.gz,sha256=7uSFXrnac29oZpe9iz0jZIQ3ghdOyA-kr2WocVGmAGM,577154
28
+ pytransdecoder/presets/ciliate/hexamer.scores.gz,sha256=Mr2lHaLTRijRC9yxH0z6ADusA63qoMX38a8QlvJK5A4,239964
29
+ pytransdecoder/presets/ciliate/kozak.tsv,sha256=Cs4Rh5JsvLsZAByLucDnMNIzfk-FqgRpdUNUnkwSL_M,327
30
+ pytransdecoder/presets/ciliate/preset.json,sha256=zokziLnP3B-wVHvIQK_xChLV9iz69fcSg1aNV-vLAcs,342
31
+ pytransdecoder/presets/ciliate/thresholds.tsv.gz,sha256=UnX42pnHskdt4JrQWLLrjerjjOi32CU7RT6zyAOpM0E,8424
32
+ pytransdecoder/presets/ciliate/training_orfs.cds.gz,sha256=XC17RtAuw2AzBrBCQkoI2DmnCA2SrDgxm-rXzvUgHrk,691838
33
+ pytransdecoder/presets/fungus/hexamer.scores.gz,sha256=NUXEHB5J_pWHbhUYhU3lbNFFvgI9nigvS8SFOxD-JRM,239943
34
+ pytransdecoder/presets/fungus/kozak.tsv,sha256=Z4QaicJeq86NYJDZUWox3gsjPLDQbrWzIAJhp1Sqky8,324
35
+ pytransdecoder/presets/fungus/preset.json,sha256=IyTfTyj5ASR_I4yV-eQPnt_-Jn2cuAaWSk-D6R0NP3A,332
36
+ pytransdecoder/presets/fungus/thresholds.tsv.gz,sha256=rDsJRn_oKDYcbjGQ8JJYrf2_InLMhUjDAqixYj1qOfg,4776
37
+ pytransdecoder/presets/fungus/training_orfs.cds.gz,sha256=NJpb6zf7P4YqTuyW7cjdMPz_5sFh8igo8HrCI6nvRnA,512609
38
+ pytransdecoder/presets/green_alga/hexamer.scores.gz,sha256=7OFF9HJzr_aHLlQuNEsXxcGi8Gx-dlIdE8BQJ56mav0,236464
39
+ pytransdecoder/presets/green_alga/kozak.tsv,sha256=3EKtFePS46IQcuhNnihCEPe9zw6kV51aQ873hwVGNWQ,324
40
+ pytransdecoder/presets/green_alga/preset.json,sha256=_6hWzjglcPMnQlCCFodEPS5rnAr1tHuqzCZIjrclbfQ,343
41
+ pytransdecoder/presets/green_alga/thresholds.tsv.gz,sha256=3YFq0LY_dsBlsNkJLfS6LR4vDxxNCY3leS9bFvdnnes,7367
42
+ pytransdecoder/presets/green_alga/training_orfs.cds.gz,sha256=QMHhQAolZvg6ow9qFYgniWAyhppsaah3Qgd2SCr63eQ,671531
43
+ pytransdecoder/presets/insect/hexamer.scores.gz,sha256=qAWdadv_lSgBw9lYVbsYlJQW8ZD5UFD_-W39KG6Knuo,242916
44
+ pytransdecoder/presets/insect/kozak.tsv,sha256=8Msh50-V5sJrikX5GErT-9XO2pAqbogy54T-E4eOwqQ,325
45
+ pytransdecoder/presets/insect/preset.json,sha256=FkJa0CZgIG13TiPY0NqCIIfR22gQV0mL45BgFttBjIo,330
46
+ pytransdecoder/presets/insect/thresholds.tsv.gz,sha256=e0H5PcKjAq5yvO93zdjahZTNM5_pdZFYo-eKy9Ae5pc,6498
47
+ pytransdecoder/presets/insect/training_orfs.cds.gz,sha256=HRI1oUOQyu687qIwShIJtoYoEm9NX42fIm3vyHWRUmA,658717
48
+ pytransdecoder/presets/mammal/hexamer.scores.gz,sha256=bG8Wthh4APN0KuIZ1wdw19qFY_lR7shFcwAEFxTba28,242860
49
+ pytransdecoder/presets/mammal/kozak.tsv,sha256=6zK_8P5kSuASO-tI2sBV4dk97I4tdj9cC4K6V2QIxEg,323
50
+ pytransdecoder/presets/mammal/preset.json,sha256=TKceOyby8fK8yy-rw0Zl9CCFgLm3OJ_P3Dk6QqarvwQ,349
51
+ pytransdecoder/presets/mammal/thresholds.tsv.gz,sha256=aDUXYMKnT-VRLf4WmSMRfYWqDC9FOB101ny9EsM2As4,11649
52
+ pytransdecoder/presets/mammal/training_orfs.cds.gz,sha256=sOGgQoh21iKV6ctLIuXxN9HBMl4JTAhfEOpSSgTgidI,683504
53
+ pytransdecoder/presets/plant/hexamer.scores.gz,sha256=TRhP3u6aYjeEC8MVG57s-CuIwIlmz-9ZuOqgIUVg39I,241915
54
+ pytransdecoder/presets/plant/kozak.tsv,sha256=mAY8AE43JkTuR4IsqoZ21vu5EPzXcDVnuyLtbVemt1Q,329
55
+ pytransdecoder/presets/plant/preset.json,sha256=hAwps6Q75lNH8igNtX88vC0DpoZvD2N8jtEeWpxcqF4,329
56
+ pytransdecoder/presets/plant/thresholds.tsv.gz,sha256=dfmrgwcjueLvXiXLIPVOAgIg4JyH-Plc_bxkI7MuzQY,6001
57
+ pytransdecoder/presets/plant/training_orfs.cds.gz,sha256=fWPK8a_hf8SwA6rNZM7dbuTU1HsAvBD28vkrGx61RVM,606972
58
+ pytransdecoder-0.2.1.dist-info/licenses/LICENSE,sha256=TfCmyKcCtNlN1xsUNTkG6T3HV6F6k9Bi-2H_n4cIUZQ,1499
59
+ pytransdecoder-0.2.1.dist-info/METADATA,sha256=uYr9n_bGuTA0H7Q0SiQi2zupM5-AQVOHTVG678JUB3U,13643
60
+ pytransdecoder-0.2.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
61
+ pytransdecoder-0.2.1.dist-info/entry_points.txt,sha256=SM3IHQANJP3OIJh9jsVLoICwHQ6ydbI0dnjwFNwHImo,108
62
+ pytransdecoder-0.2.1.dist-info/top_level.txt,sha256=PYGdqaVT__0vywRq0EO8CgHQP8cHtuPqhryslKZh9Xc,15
63
+ pytransdecoder-0.2.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ pyTransdecoder = pytransdecoder.cli:pipeline_main
3
+ pytransdecoder = pytransdecoder.cli:cli