Skip to content

Commit d637f61

Browse files
committed
The tf_class and tf_family in Bio.motifs.jaspar.db should be string array
1 parent 8ebc169 commit d637f61

File tree

5 files changed

+41
-33
lines changed

5 files changed

+41
-33
lines changed

docs/changelog.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Changelog
33
=========
44

5-
Version 1.0.0
5+
Version 1.6.0
66
-------------
7-
Released date:
7+
Released date: July 02, 2021
88

9-
Notes:
9+
Notes: Both tf_family and tf_class are now string array.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'Aziz Khan'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = 'v1.5.5'
25+
release = 'v1.6.0'
2626

2727

2828
# -- General configuration ---------------------------------------------------

docs/how_to_use.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ Printing the motif will all the associated meta-information stored in the JASPAR
6767
TF name YY1
6868
Matrix ID MA0095.2
6969
Collection CORE
70-
TF class C2H2 zinc finger factors
71-
TF family More than 3 adjacent zinc finger factors
70+
TF class ['C2H2 zinc finger factors']
71+
TF family ['More than 3 adjacent zinc finger factors']
7272
Species 9606
7373
Taxonomic group vertebrates
7474
Accession ['P25490']
@@ -108,8 +108,8 @@ You can use the `fetch_motifs_by_name` function to find motifs by TF name. This
108108
TF name CTCF
109109
Matrix ID MA0139.1
110110
Collection CORE
111-
TF class C2H2 zinc finger factors
112-
TF family More than 3 adjacent zinc finger factors
111+
TF class ['C2H2 zinc finger factors'
112+
TF family ['More than 3 adjacent zinc finger factors']
113113
Species 9606
114114
Taxonomic group vertebrates
115115
Accession ['P49711']
@@ -126,8 +126,8 @@ You can use the `fetch_motifs_by_name` function to find motifs by TF name. This
126126
TF name CTCF
127127
Matrix ID MA0531.1
128128
Collection CORE
129-
TF class C2H2 zinc finger factors
130-
TF family More than 3 adjacent zinc finger factors
129+
TF class ['C2H2 zinc finger factors']
130+
TF family ['More than 3 adjacent zinc finger factors']
131131
Species 7227
132132
Taxonomic group insects
133133
Accession ['Q9VS55']

pyjaspar/__init__.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
TF name YY1
1818
Matrix ID MA0095.2
1919
Collection CORE
20-
TF class C2H2 zinc finger factors
21-
TF family More than 3 adjacent zinc finger factors
20+
TF class ['C2H2 zinc finger factors']
21+
TF family ['More than 3 adjacent zinc finger factors']
2222
Species 9606
2323
Taxonomic group vertebrates
2424
Accession ['P25490']
@@ -42,7 +42,7 @@
4242
for motif in motifs:
4343
pass # do something with the motif
4444
"""
45-
__version__ = '1.5.5'
45+
__version__ = '1.6.0'
4646

4747

4848
import warnings
@@ -400,14 +400,18 @@ def _fetch_motif_by_internal_id(self, int_id):
400400

401401
# fetch remaining annotation as tags from the ANNOTATION table
402402
cur.execute("select TAG, VAL from MATRIX_ANNOTATION where id = ?", (int_id,))
403+
404+
#Since jaspar 2018 tf_family and tf_class are return as array
405+
tf_family = []
406+
tf_class = []
403407
rows = cur.fetchall()
404408
for row in rows:
405409
attr = row[0]
406410
val = row[1]
407411
if attr == "class":
408-
motif.tf_class = val
412+
tf_class.append(val)
409413
elif attr == "family":
410-
motif.tf_family = val
414+
tf_family.append(val)
411415
elif attr == "tax_group":
412416
motif.tax_group = val
413417
elif attr == "type":
@@ -425,6 +429,9 @@ def _fetch_motif_by_internal_id(self, int_id):
425429
"""
426430
pass
427431

432+
motif.tf_family = tf_family
433+
motif.tf_class = tf_class
434+
428435
return motif
429436

430437
def _fetch_counts_matrix(self, int_id):

pyjaspar_notebook.ipynb

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
{
3535
"cell_type": "code",
36-
"execution_count": 33,
36+
"execution_count": 2,
3737
"metadata": {},
3838
"outputs": [],
3939
"source": [
@@ -49,7 +49,7 @@
4949
},
5050
{
5151
"cell_type": "code",
52-
"execution_count": 34,
52+
"execution_count": 3,
5353
"metadata": {
5454
"scrolled": true
5555
},
@@ -75,7 +75,7 @@
7575
},
7676
{
7777
"cell_type": "code",
78-
"execution_count": 35,
78+
"execution_count": 4,
7979
"metadata": {},
8080
"outputs": [
8181
{
@@ -130,7 +130,7 @@
130130
"metadata": {},
131131
"outputs": [],
132132
"source": [
133-
"motif = jdb_obj.fetch_motif_by_id('MA0095.2')"
133+
"motif = jdb_obj.fetch_motif_by_id('MA0006.1')"
134134
]
135135
},
136136
{
@@ -142,29 +142,30 @@
142142
},
143143
{
144144
"cell_type": "code",
145-
"execution_count": 10,
145+
"execution_count": 7,
146146
"metadata": {},
147147
"outputs": [
148148
{
149149
"name": "stdout",
150150
"output_type": "stream",
151151
"text": [
152-
"TF name\tYY1\n",
153-
"Matrix ID\tMA0095.2\n",
152+
"TF name\tAhr::Arnt\n",
153+
"Matrix ID\tMA0006.1\n",
154154
"Collection\tCORE\n",
155-
"TF class\tC2H2 zinc finger factors\n",
156-
"TF family\tMore than 3 adjacent zinc finger factors\n",
157-
"Species\t9606\n",
155+
"TF class\t['Basic helix-loop-helix factors (bHLH)', 'Basic helix-loop-helix factors (bHLH)']\n",
156+
"TF family\t['PAS domain factors', 'PAS domain factors']\n",
157+
"Species\t10090\n",
158158
"Taxonomic group\tvertebrates\n",
159-
"Accession\t['P25490']\n",
160-
"Data type used\tChIP-seq\n",
161-
"Medline\t18950698\n",
159+
"Accession\t['P30561', 'P53762']\n",
160+
"Data type used\tSELEX\n",
161+
"Medline\t7592839\n",
162+
"Comments\tdimer\n",
162163
"Matrix:\n",
163-
" 0 1 2 3 4 5 6 7 8 9 10 11\n",
164-
"A: 1126.00 6975.00 6741.00 2506.00 7171.00 0.00 11.00 13.00 812.00 867.00 899.00 1332.00\n",
165-
"C: 4583.00 0.00 99.00 1117.00 0.00 12.00 0.00 0.00 5637.00 1681.00 875.00 4568.00\n",
166-
"G: 801.00 181.00 268.00 3282.00 0.00 0.00 7160.00 7158.00 38.00 2765.00 4655.00 391.00\n",
167-
"T: 661.00 15.00 63.00 266.00 0.00 7159.00 0.00 0.00 684.00 1858.00 742.00 880.00\n",
164+
" 0 1 2 3 4 5\n",
165+
"A: 3.00 0.00 0.00 0.00 0.00 0.00\n",
166+
"C: 8.00 0.00 23.00 0.00 0.00 0.00\n",
167+
"G: 2.00 23.00 0.00 23.00 0.00 24.00\n",
168+
"T: 11.00 1.00 1.00 1.00 24.00 0.00\n",
168169
"\n",
169170
"\n",
170171
"\n"

0 commit comments

Comments
 (0)