Skip to content

Commit

Permalink
Merge pull request #56 from Jumitti/beta
Browse files Browse the repository at this point in the history
Fix email export
  • Loading branch information
Jumitti authored Apr 26, 2024
2 parents 466bb5b + c89048f commit f9d5267
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions navigation/aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ def email(excel_file, csv_file, txt_output, email_receiver, body, jaspar):
filename=f'Results_TFinder_{current_date_time}.csv')
msg.attach(attachment_csv)

if jaspar == 'PWM':
if matrix_type == 'With FASTA sequences':
image = MIMEImage(st.session_state['weblogo'].read(), name=f'LOGOMAKER_{current_date_time}.jpg')
msg.attach(image)
elif jaspar == 'Individual Motif':
if jaspar == 'PWM' or jaspar == 'Individual Motif':
image = MIMEImage(st.session_state['weblogo'].read(), name=f'LOGOMAKER_{current_date_time}.jpg')
msg.attach(image)

Expand Down Expand Up @@ -212,16 +208,11 @@ def aio_page():
st.session_state['upstream'] = upstream
downstream = int(downstream_entry)

if 'button_clicked' not in st.session_state:
st.session_state.button_clicked = False

# Run Promoter Finder
if st.button(f"🧬 :blue[**Step 1.5**] Extract {prom_term}", help='(~5sec/gene)'):
with st.spinner('Please wait...'):
with colprom1:

st.session_state.button_clicked = True

pbar = st.progress(0,
text='**:blue[Extract sequence...] ⚠️:red[PLEASE WAIT UNTIL END WITHOUT CHANGING ANYTHING]**')
for i, gene_id in enumerate(gene_ids):
Expand Down Expand Up @@ -783,7 +774,7 @@ def aio_page():
if st.button("Send ✉"):
if jaspar == 'PWM':
if matrix_type == 'With PWM':
body = f"Hello 🧬\n\nResults obtained with TFinder.\n\nPosition Weight Matrix:\n{matrix_text}\n\nThis email also includes the sequences used in FASTA format and an Excel table of results.\n\nFor all requests/information, please refer to the 'Contact' tab on the TFinder website. We would be happy to answer all your questions.\n\nBest regards\nTFinder Team 🔎🧬"
body = f"Hello 🧬\n\nResults obtained with TFinder.\n\nPosition Weight Matrix:\n{matrix_str}\n\nThis email also includes the sequences used in FASTA format and an Excel table of results.\n\nFor all requests/information, please refer to the 'Contact' tab on the TFinder website. We would be happy to answer all your questions.\n\nBest regards\nTFinder Team 🔎🧬"
if matrix_type == 'With FASTA sequences':
body = f"Hello 🧬\n\nResults obtained with TFinder.\n\nResponsive Elements:\n{individual_motif}\n\nPosition Weight Matrix:\n{matrix_text}\n\nThis email also includes the sequences used in FASTA format and an Excel table of results.\n\nFor all requests/information, please refer to the 'Contact' tab on the TFinder website. We would be happy to answer all your questions.\n\nBest regards\nTFinder Team 🔎🧬"
elif jaspar == 'JASPAR_ID':
Expand Down

0 comments on commit f9d5267

Please sign in to comment.