Skip to content

Commit

Permalink
Fix analyse
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumitti committed Nov 22, 2024
1 parent 47b5ae8 commit 87b0e8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
10 changes: 7 additions & 3 deletions navigation/aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,16 +786,20 @@ def aio_page():
with stqdm(total=iteration,
desc='**:blue[Analyse sequence...] ⚠️:red[PLEASE WAIT UNTIL END WITHOUT CHANGING ANYTHING]**',
mininterval=0.1) as progress_bar:
individual_motif_occurrences = IMO.individual_motif_finder(dna_sequences, threshold, log_odds_matrix,
individual_motif_occurrences, message = IMO.individual_motif_finder(dna_sequences, threshold, log_odds_matrix,
progress_bar,
calc_pvalue,
tss_ge_distance, alldirection)
st.session_state['individual_motif_occurrences'] = individual_motif_occurrences
if message is True:
st.session_state['individual_motif_occurrences'] = individual_motif_occurrences
st.session_state['message'] = message
elif message is False:
st.error(individual_motif_occurrences)

st.divider()
try:
if 'individual_motif_occurrences' in st.session_state:
if len(st.session_state['individual_motif_occurrences']) > 1:
if len(st.session_state['individual_motif_occurrences']) > 0:
current_date_time = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
st.subheader(':blue[Results]')

Expand Down
10 changes: 6 additions & 4 deletions tfinder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,13 +909,15 @@ def individual_motif_finder(dna_sequences, threshold, matrix, progress_bar=None,
header.append("p-value")
header += ["Strand", "Direction", "Gene", "Species", "Region"]
individual_motif_occurrences.insert(0, header)

df = pd.DataFrame(individual_motif_occurrences[1:], columns=individual_motif_occurrences[0])
df = df.sort_values(by="Rel Score", ascending=False)

return df, True
else:
"No consensus sequence found with the specified threshold."
return "No consensus sequence found with the specified threshold.", False

df = pd.DataFrame(individual_motif_occurrences[1:], columns=individual_motif_occurrences[0])
df = df.sort_values(by="Rel Score", ascending=False)

return df

@staticmethod
# IUPAC code
Expand Down

0 comments on commit 87b0e8b

Please sign in to comment.