fix outputs
Browse files
app.py
CHANGED
|
@@ -7,10 +7,13 @@ def fold(id, sequence):
|
|
| 7 |
ct_file = f"output/{id}.ct"
|
| 8 |
structure_draw = f"output/{id}.png"
|
| 9 |
|
| 10 |
-
sp.run(f"sincFold pred {sequence} --name {id} -o output --draw", shell=True)
|
| 11 |
dotbracket = ct2dot(ct_file)
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
return dotbracket,
|
| 14 |
|
| 15 |
|
| 16 |
def run():
|
|
@@ -21,15 +24,15 @@ def run():
|
|
| 21 |
lines=1,
|
| 22 |
value="16s_C.elegans_domain2"),
|
| 23 |
gr.Textbox(label="RNA Sequence",
|
| 24 |
-
info="RNA Sequence",
|
| 25 |
lines=3,
|
| 26 |
value="GAUAAACCUUUAGCAAUAAACGAAAGUUUAACUAAGCCAUACUAACCCCAGGGUUGGUCAAUUUCGUGCCAGCCACCGCGGUCACACGAUUAACCCAAGCCAAUAGAAAUCGGCGUAAAGAGUGUUUUAGAUCAAUCCCCCAAUAAAGCUAAAAUUCACCUG")],
|
| 27 |
outputs=[
|
|
|
|
| 28 |
gr.Textbox(label="Dotbracket structure",
|
| 29 |
-
info="Sequence ID",
|
| 30 |
lines=3),
|
|
|
|
| 31 |
gr.File(label="CT file"),
|
| 32 |
-
|
| 33 |
|
| 34 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 35 |
|
|
|
|
| 7 |
ct_file = f"output/{id}.ct"
|
| 8 |
structure_draw = f"output/{id}.png"
|
| 9 |
|
| 10 |
+
sp.run(f"sincFold pred {sequence} --name {id} -o output --draw --draw-resolution 10", shell=True)
|
| 11 |
dotbracket = ct2dot(ct_file)
|
| 12 |
+
fasta_file = f"output/{id}.fasta"
|
| 13 |
+
with open(fasta_file, "w") as f:
|
| 14 |
+
f.write(f">{id}\n{sequence}\n{dotbracket}")
|
| 15 |
|
| 16 |
+
return structure_draw, dotbracket, fasta_file, ct_file
|
| 17 |
|
| 18 |
|
| 19 |
def run():
|
|
|
|
| 24 |
lines=1,
|
| 25 |
value="16s_C.elegans_domain2"),
|
| 26 |
gr.Textbox(label="RNA Sequence",
|
|
|
|
| 27 |
lines=3,
|
| 28 |
value="GAUAAACCUUUAGCAAUAAACGAAAGUUUAACUAAGCCAUACUAACCCCAGGGUUGGUCAAUUUCGUGCCAGCCACCGCGGUCACACGAUUAACCCAAGCCAAUAGAAAUCGGCGUAAAGAGUGUUUUAGAUCAAUCCCCCAAUAAAGCUAAAAUUCACCUG")],
|
| 29 |
outputs=[
|
| 30 |
+
gr.Image(label="Structure"),
|
| 31 |
gr.Textbox(label="Dotbracket structure",
|
|
|
|
| 32 |
lines=3),
|
| 33 |
+
gr.File(label="Fasta file"),
|
| 34 |
gr.File(label="CT file"),
|
| 35 |
+
])
|
| 36 |
|
| 37 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 38 |
|