Skip to content

Commit 5845055

Browse files
committed
guess database if not provided
1 parent e67cf7c commit 5845055

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mirtop/mirna/mapper.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def get_primary_transcript(database):
5858
raise ValueError("Only miRBase is supported for this action.")
5959

6060

61-
def read_gtf_to_mirna(gtf, database):
61+
def read_gtf_to_mirna(gtf, database=None):
6262
"""
6363
Load GTF file with precursor positions on genome.
6464
@@ -72,6 +72,8 @@ def read_gtf_to_mirna(gtf, database):
7272
"""
7373
if not gtf:
7474
return gtf
75+
if not database:
76+
database = _guess_database_file(gtf)
7577
if database.find("miRBase") > -1:
7678
mapped = read_gtf_to_precursor_mirbase(gtf, format="genomic")
7779
elif database.find("MirGeneDB") > -1:
@@ -147,7 +149,7 @@ def read_gtf_chr2mirna2(gtf): # to remove
147149
return db_mir
148150

149151

150-
def read_gtf_to_precursor(gtf, database):
152+
def read_gtf_to_precursor(gtf, database=None):
151153
"""
152154
Load GTF file with precursor positions on genome
153155
Return dict with key being precursor name and
@@ -165,6 +167,8 @@ def read_gtf_to_precursor(gtf, database):
165167
"""
166168
if not gtf:
167169
return gtf
170+
if not database:
171+
database = _guess_database_file(gtf)
168172
if database.find("miRBase") > -1:
169173
mapped = read_gtf_to_precursor_mirbase(gtf)
170174
elif database.find("MirGeneDB") > -1:

0 commit comments

Comments
 (0)