Skip to content

Commit

Permalink
setup.py fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnfarrell committed Jul 6, 2018
1 parent 52ac952 commit 68dcae7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'pysam>=0.10.0',
'HTSeq>=0.6',
'bx-python>=0.5',
'forgi>=0.4']
'forgi==0.20']

major, minor, micro = sys.version_info[:3]
if major == '2':
Expand Down
9 changes: 7 additions & 2 deletions smallrnaseq/novel.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ def check_mature(seq, struct, mature):
"""Check if the mature sequence is not in hairpin loop and inside stem"""

bg = utils.get_bg(seq, struct)
if bg is None:
return
start = utils.find_subseq(seq, mature)+1
end = start + len(mature)
loops = list(bg.hloop_iterator())
Expand Down Expand Up @@ -424,7 +426,8 @@ def generate_precursors(ref_fasta, coords, mature=None, step=5):
struct,sc = utils.rnafold(prseq)
#prseq, struct = check_hairpin(prseq, struct)
mstatus = check_mature(prseq, struct, mature)
#print (mstatus)
if mstatus is None:
continue
#print (i)
#print (prseq)
#print (struct)
Expand All @@ -442,6 +445,8 @@ def generate_precursors(ref_fasta, coords, mature=None, step=5):
struct,sc = utils.rnafold(prseq)
#prseq, struct = check_hairpin(prseq, struct)
mstatus = check_mature(prseq, struct, mature)
if mstatus is None:
continue
N.append({'precursor':prseq,'struct':struct,'score':sc,
'chrom':chrom,'start':start3,'end':end3,
'mature':mature,'strand':strand,'mature_check': mstatus})
Expand Down Expand Up @@ -611,7 +616,7 @@ def find_mirnas(reads, ref_fasta, score_cutoff=.8, read_cutoff=50, species='',
m['mature'] = True
X.append(m)
#remainder of reads assigned as non-mature
o = df.loc[-df.index.isin(m.index)].copy()
o = df.loc[~df.index.isin(m.index)].copy()
o['mature'] = False
X.append(o)

Expand Down
11 changes: 8 additions & 3 deletions smallrnaseq/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,13 @@ def get_bg(seq, struct=None):

import forgi.graph.bulge_graph as cgb
if struct == None:
struct,sc = utils.rnafold(seq)
struct,sc = rnafold(seq)
bg = cgb.BulgeGraph()
bg.from_dotbracket(struct)
bg.seq = seq
return bg
#print (bg.struct)
try:
bg.seq = seq
return bg
except Exception as e:
print (e)
return
4 changes: 3 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ parts:
part1:
plugin: python
python-version: python2
python-packages:
[numpy]
stage-packages:
[python-numpy,libblas3,libopenblas-dev]
[libblas3,libopenblas-dev]
smallrnaseq:
plugin: python
python-version: python2
Expand Down

0 comments on commit 68dcae7

Please sign in to comment.