diff --git a/navigation/aio.py b/navigation/aio.py index e7ae5cb4..8cb6abea 100644 --- a/navigation/aio.py +++ b/navigation/aio.py @@ -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) @@ -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): @@ -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':