jfataphd commited on
Commit
dcd525b
·
1 Parent(s): e808b1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -721,6 +721,14 @@ if query:
721
  # Reset the index
722
  df13.reset_index(inplace=True)
723
 
 
 
 
 
 
 
 
 
724
  # Replace hyphens with spaces in the 'text' column
725
  df13['Drugs'] = df13['Drugs'].str.replace('-', ' ')
726
 
@@ -730,7 +738,7 @@ if query:
730
  df13['href'] = [f'https://pubmed.ncbi.nlm.nih.gov/?term={database_name}%5Bmh%5D+NOT+review%5Bpt%5D' \
731
  '+AND+english%5Bla%5D+AND+hasabstract+AND+1990:2022%5Bdp%5D+AND+' + c for c in df13['text']]
732
  df13['href2'] = [f'https://en.wikipedia.org/wiki/' + c for c in df13['text']]
733
- df13['href3'] = [f'https://beta.clinicaltrials.gov/search?distance=50&cond={database_name}&term={c}&viewType=Table' for c in df13['text']]
734
  assert isinstance(df13, object)
735
  df13['database'] = database_name
736
 
@@ -748,7 +756,7 @@ if query:
748
  texttemplate="<span style='font-family: Arial; font-size: 20px;'>%{customdata[3]}<br><br>"
749
  "<a href='%{customdata[0]}'>PubMed"
750
  "</a><br><br><a href='%{customdata[2]}'>Wikipedia"
751
- "</span></a><br><a href='%{customdata[4]}'>ClinicalTrials.gov"
752
  "</span></a>")
753
  fig.update_layout(uniformtext=dict(minsize=15), treemapcolorway=["Thistle"])
754
  # # display the treemap in Streamlit
 
721
  # Reset the index
722
  df13.reset_index(inplace=True)
723
 
724
+ database_name = database_name
725
+
726
+ # Split the string on the underscore
727
+ words = database_name.split('_')
728
+
729
+ # Assign the split words to two separate variables
730
+ word1, word2 = words
731
+
732
  # Replace hyphens with spaces in the 'text' column
733
  df13['Drugs'] = df13['Drugs'].str.replace('-', ' ')
734
 
 
738
  df13['href'] = [f'https://pubmed.ncbi.nlm.nih.gov/?term={database_name}%5Bmh%5D+NOT+review%5Bpt%5D' \
739
  '+AND+english%5Bla%5D+AND+hasabstract+AND+1990:2022%5Bdp%5D+AND+' + c for c in df13['text']]
740
  df13['href2'] = [f'https://en.wikipedia.org/wiki/' + c for c in df13['text']]
741
+ df13['href3'] = [f'https://beta.clinicaltrials.gov/search?distance=50&cond={word1}%20{word2}&term={c}&viewType=Table' for c in df13['text']]
742
  assert isinstance(df13, object)
743
  df13['database'] = database_name
744
 
 
756
  texttemplate="<span style='font-family: Arial; font-size: 20px;'>%{customdata[3]}<br><br>"
757
  "<a href='%{customdata[0]}'>PubMed"
758
  "</a><br><br><a href='%{customdata[2]}'>Wikipedia"
759
+ "</a><br><a href='%{customdata[4]}'>ClinicalTrials.gov"
760
  "</span></a>")
761
  fig.update_layout(uniformtext=dict(minsize=15), treemapcolorway=["Thistle"])
762
  # # display the treemap in Streamlit