Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumitti committed May 23, 2024
2 parents e9123db + 5610150 commit 6be876b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
21 changes: 14 additions & 7 deletions TFinder-v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,15 @@ def load_lottiefile(filepath: str):
horizontal_orientation=True)

st.success("Hello everyone, TFinder is growing every day and we would like to know you a little more. "
"We will not collect any data through Streamlit and it is difficult for us to know your uses and your feedback.\n\n"
"We will not collect any data through Streamlit and it is difficult for us to know your uses and your feedback. "
f"[HERE](https://airtable.com/appRn3TQqhuSFS8KO/pagm4Vau8lEFdRX3q/form) you will find a form to answer some of our questions if you wish. See you soon 😊")

st.success("If the application does not work, here are other deployments:\n"
f" - TFinder on [Streamlit](https://streamlit.io/): [https://tfinder-ipmc.streamlit.app/](https://tfinder-ipmc.streamlit.app/)\n"
f" - TFinder on [Health Universe](https://www.healthuniverse.com/): [https://apps.healthuniverse.com/nhu-dxv-ktj](https://apps.healthuniverse.com/nhu-dxv-ktj)\n"
f" - TFinder on [Ploomber](https://ploomber.io/): [https://rough-meadow-6083.ploomberapp.io/](https://rough-meadow-6083.ploomberapp.io/)\n"
f" - (BETA) TFinder: [https://tfinder-beta.streamlit.app/](https://tfinder-beta.streamlit.app/)\n")

if chosen_tab == HOME:
home_page()

Expand Down Expand Up @@ -232,12 +238,13 @@ def load_lottiefile(filepath: str):

# streamlit_analytics.stop_tracking()
# views = streamlit_analytics.main.counts["total_pageviews"]
local_test = platform.processor()
if local_test == "":
unique_users = st.secrets['unique_users']
st.sidebar.markdown(f"Unique users 👥: {unique_users}")
st.session_state["LOCAL"] = 'False'
else:
try:
local_test = platform.processor()
if local_test == "":
unique_users = st.secrets['unique_users']
st.sidebar.markdown(f"Unique users 👥: {unique_users}")
st.session_state["LOCAL"] = 'False'
except Exception as e:
st.session_state["LOCAL"] = 'True'
st.sidebar.markdown(f"TFinder Local Version")

Expand Down
2 changes: 1 addition & 1 deletion clock.time
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Last updated at 14:21 on 2023-11-06
Last updated at 09:04 on 2024-05-02
10 changes: 4 additions & 6 deletions tfinder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,11 @@ def transform_matrix(matrix):

@staticmethod
# Generate random sequences for p_value
def generate_ranseq(probabilities, seq_length, progress_bar, num_random_seqs):
def generate_ranseq(probabilities, seq_length, progress_bar):
motif_length = seq_length
random_sequences = []

for _ in range(num_random_seqs):
for _ in range(1000000):
random_sequence = IMO.generate_random_sequence(motif_length, probabilities)
random_sequences.append(random_sequence)
progress_bar.update(1)
Expand Down Expand Up @@ -479,8 +479,6 @@ def individual_motif_finder(dna_sequences, threshold, matrix, progress_bar, calc

matrices = IMO.transform_matrix(matrix)

num_random_seqs = 1000000

seq_length = len(matrices['+ f']['A'])

if calc_pvalue == 'ATGCPreset':
Expand All @@ -491,7 +489,7 @@ def individual_motif_finder(dna_sequences, threshold, matrix, progress_bar, calc

probabilities = [percentage_a, percentage_c, percentage_g, percentage_t]

random_sequences = IMO.generate_ranseq(probabilities, seq_length, progress_bar, num_random_seqs)
random_sequences = IMO.generate_ranseq(probabilities, seq_length, progress_bar)

random_scores = {}
matrix_random_scores = []
Expand Down Expand Up @@ -525,7 +523,7 @@ def individual_motif_finder(dna_sequences, threshold, matrix, progress_bar, calc

probabilities = [percentage_a, percentage_c, percentage_g, percentage_t]

random_sequences = IMO.generate_ranseq(probabilities, seq_length, progress_bar, num_random_seqs)
random_sequences = IMO.generate_ranseq(probabilities, seq_length, progress_bar)

if calc_pvalue == 'ATGCProportion':
random_scores = {}
Expand Down

0 comments on commit 6be876b

Please sign in to comment.