gencodegenes 1.0.8__tar.gz → 1.0.10__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.
- {gencodegenes-1.0.8/src/gencodegenes.egg-info → gencodegenes-1.0.10}/PKG-INFO +1 -1
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/setup.py +1 -2
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencode.cpp +10 -7
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencode.h +1 -0
- gencodegenes-1.0.10/src/gencodegenes/__init__.py +7 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencodegenes/gencode.cpp +16967 -10380
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencodegenes/gencode.pyx +23 -2
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencodegenes/transcript.cpp +14980 -8668
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencodegenes/transcript.pxd +1 -1
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencodegenes/transcript.pyx +3 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencodegenes/tx.cpp +24 -13
- {gencodegenes-1.0.8/src → gencodegenes-1.0.10/src/gencodegenes}/tx.h +8 -6
- {gencodegenes-1.0.8 → gencodegenes-1.0.10/src/gencodegenes.egg-info}/PKG-INFO +1 -1
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencodegenes.egg-info/requires.txt +0 -1
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gtf.cpp +35 -10
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gtf.h +3 -1
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/tx.cpp +24 -13
- {gencodegenes-1.0.8/src/gencodegenes → gencodegenes-1.0.10/src}/tx.h +8 -6
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/tests/test_gencode.py +70 -0
- gencodegenes-1.0.8/src/gencodegenes/__init__.py +0 -6
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/LICENSE.txt +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/MANIFEST.in +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/README.md +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/pyproject.toml +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/setup.cfg +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencodegenes.egg-info/SOURCES.txt +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencodegenes.egg-info/dependency_links.txt +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gencodegenes.egg-info/top_level.txt +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gzstream/gzstream.C +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/src/gzstream/gzstream.h +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/tests/__init__.py +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/tests/data/example.grch38.fa +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/tests/data/example.grch38.gtf +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/tests/test_sequence_methods.py +0 -0
- {gencodegenes-1.0.8 → gencodegenes-1.0.10}/tests/test_transcript.py +0 -0
|
@@ -112,14 +112,13 @@ setup(name="gencodegenes",
|
|
|
112
112
|
description='Package to load genes from GENCODE GTF files',
|
|
113
113
|
long_description=io.open('README.md', encoding='utf-8').read(),
|
|
114
114
|
long_description_content_type='text/markdown',
|
|
115
|
-
version="1.0.
|
|
115
|
+
version="1.0.10",
|
|
116
116
|
author="Jeremy McRae",
|
|
117
117
|
author_email="jeremy.mcrae@gmail.com",
|
|
118
118
|
license="MIT",
|
|
119
119
|
url='https://github.com/jeremymcrae/gencodegenes',
|
|
120
120
|
packages=["gencodegenes"],
|
|
121
121
|
install_requires=[
|
|
122
|
-
'cython >= 0.27.0',
|
|
123
122
|
'pyfaidx >= 0.5.8',
|
|
124
123
|
],
|
|
125
124
|
package_dir={'': 'src'},
|
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
namespace gencode {
|
|
17
17
|
|
|
18
18
|
// check which exon is first, by start position
|
|
19
|
-
bool compareExons(std::vector<int> e1, std::vector<int> e2) {
|
|
19
|
+
static bool compareExons(std::vector<int> e1, std::vector<int> e2) {
|
|
20
20
|
return (e1[0] < e2[0]);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
void sort_exons(std::vector<std::vector<int> > & exons) {
|
|
23
|
+
static void sort_exons(std::vector<std::vector<int> > & exons) {
|
|
24
24
|
std::sort(exons.begin(), exons.end(), compareExons);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// find the index of the exon containing a given chromosome position
|
|
28
|
-
std::uint32_t get_exon_num(std::vector<std::vector<int> > exons, int pos) {
|
|
28
|
+
static std::uint32_t get_exon_num(std::vector<std::vector<int> > exons, int pos) {
|
|
29
29
|
for (std::uint32_t i=0; i<exons.size(); i++) {
|
|
30
30
|
if ((pos >= exons[i][0]) && (pos <= exons[i][1])) {
|
|
31
31
|
return i;
|
|
@@ -41,7 +41,7 @@ std::uint32_t get_exon_num(std::vector<std::vector<int> > exons, int pos) {
|
|
|
41
41
|
// just set the first CDS coord and last CDS coord to their values though,
|
|
42
42
|
// as at least one stop codon spans an intron boundary, which messes up the
|
|
43
43
|
// CDS if included as is.
|
|
44
|
-
void include_end_codons(std::map<std::string, int> cds_range, TxInfo & info) {
|
|
44
|
+
static void include_end_codons(std::map<std::string, int> cds_range, TxInfo & info) {
|
|
45
45
|
if (info.cds.size() == 0) {
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
@@ -76,12 +76,13 @@ void include_end_codons(std::map<std::string, int> cds_range, TxInfo & info) {
|
|
|
76
76
|
//
|
|
77
77
|
// When we load lines from gencode GTF files, each line represents a single exon
|
|
78
78
|
// or CDS, and we need to combine these based on transcript ID
|
|
79
|
-
void load_transcripts(std::vector<NamedTx> & transcripts, GTF >f_file, bool coding=true) {
|
|
79
|
+
static void load_transcripts(std::vector<NamedTx> & transcripts, GTF >f_file, bool coding=true) {
|
|
80
80
|
std::set<std::string> permit = {"exon", "CDS", "UTR", "transcript",
|
|
81
81
|
"stop_codon", "start_codon"};
|
|
82
82
|
std::map<std::string, int> cds_range = {{"max", 0}, {"min", 999999999}};
|
|
83
83
|
std::string tx_id = "";
|
|
84
84
|
std::string symbol = "";
|
|
85
|
+
std::vector<std::string> alt_ids;
|
|
85
86
|
std::string current;
|
|
86
87
|
TxInfo info;
|
|
87
88
|
|
|
@@ -105,6 +106,7 @@ void load_transcripts(std::vector<NamedTx> & transcripts, GTF >f_file, bool co
|
|
|
105
106
|
if (tx_id == "") {
|
|
106
107
|
tx_id = current;
|
|
107
108
|
symbol = gtf.symbol;
|
|
109
|
+
alt_ids = gtf.alternate_ids;
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
if (tx_id != current) {
|
|
@@ -114,12 +116,13 @@ void load_transcripts(std::vector<NamedTx> & transcripts, GTF >f_file, bool co
|
|
|
114
116
|
info.transcript_type);
|
|
115
117
|
tx.set_exons(info.exons);
|
|
116
118
|
tx.set_cds(info.cds);
|
|
117
|
-
transcripts.push_back({symbol, tx, info.is_canonical});
|
|
119
|
+
transcripts.push_back({symbol, alt_ids, tx, info.is_canonical});
|
|
118
120
|
info = {};
|
|
119
121
|
tx_id = current;
|
|
120
122
|
cds_range["max"] = 0;
|
|
121
123
|
cds_range["min"] = 999999999;
|
|
122
124
|
symbol = gtf.symbol;
|
|
125
|
+
alt_ids = gtf.alternate_ids;
|
|
123
126
|
info.is_canonical = false;
|
|
124
127
|
}
|
|
125
128
|
|
|
@@ -152,7 +155,7 @@ void load_transcripts(std::vector<NamedTx> & transcripts, GTF >f_file, bool co
|
|
|
152
155
|
Tx tx = Tx(info.name, info.chrom, info.start, info.end, info.strand[0], info.transcript_type);
|
|
153
156
|
tx.set_exons(info.exons);
|
|
154
157
|
tx.set_cds(info.cds);
|
|
155
|
-
transcripts.push_back({symbol, tx, info.is_canonical});
|
|
158
|
+
transcripts.push_back({symbol, alt_ids, tx, info.is_canonical});
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
|