Skip to content

Commit

Permalink
Merge pull request #80 from Jumitti/beta
Browse files Browse the repository at this point in the history
Score, Score Adjusted and documentation
  • Loading branch information
Jumitti authored Dec 11, 2024
2 parents 13f0097 + fddc516 commit 2ef90d7
Show file tree
Hide file tree
Showing 7 changed files with 511 additions and 1,147 deletions.
75 changes: 25 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,71 +26,46 @@ The in-silico research of TFBS can be tedious and time-consuming at various stag

TFinder is an ultra-intuitive, easy-to-use and fast analysis open source and free tool that allows both the retrieval and search of TFBS in a unique site. TFinder allows the analysis of an unlimited number of genes; the selection of up to five different species (human, mouse, rat, drosophila, zebrafish); the choice and examination of either promoter or terminator gene regions; the configuration of an upstream downstream window of sequence analysis and the search of TFBS in different formats including IUPAC code, a JASPAR ID or a Position Weight Matrix. TFinder, searches for TFBS on the sense and antisense strand but also considers the search with the complementary forms. The software takes care of everything in record time.

## Features - FULL DOCUMENTATION [HERE](https://jumitti.notion.site/tfinder?pvs=4)

### Promoter and Terminator Extractor

- Support gene name (for Human, Mouse, Rat, Drosophila, Zebrafish), Gene ID and transcripts (NM_, XM_, NR_, XR_)
- Support Current genome version and previous (see [documentation](https://www.notion.so/jumitti/Promoter-and-Terminator-Extraction-15973c6e8b9c8016ad21d5f070eac965?pvs=4#15973c6e8b9c80efae51fc76c56bbc06))
- Support extraction of all transcripts variants
- Extract promoter and/or terminator of gene by setting upstream and downstream from TSS/gene end
- Extract unlimited number of gene
- Advance mode for settings (ex: extract promoter and terminator at the same time)
- Speed: 12 sequence / min

### Motif Finder

- Support IUPAC individual motif
- Support JASPAR ID
- Support Position Weight Matrix
- Create a PWM from FASTA sequence
- Calcul of Score (Weight) and normalization for better interpretation
- Automatic Threshold function to Score normalized
- (Pseudocount, background nucleotide frequencies... can be set by users)
- p-value dependant from nucleotide frequencies from the sequence or imposed
- Speed: 80kb/sec (without p-value)

## How to install/use

**No installation is required**. You can access it by clicking here [![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://tfinder-ipmc.streamlit.app/)

A beta version of TFinder exists here. [![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://tfinder-jti99236fxoncgfqnhrcrw.streamlit.app/)


## Functions

### Browser compatibility

- Opera GX
- Chrome (also Chromium)
- Safari
- Edge
- Mozilla
- Phone

### Gene regulatory regions Extractor
- Extract mutliple regulatory regions (promoter/terminator) using ENTREZ_GENE_ID or NCBI Gene Name in FASTA format ([NCBI API](https://www.ncbi.nlm.nih.gov/home/develop/api/))
- Extract regions of sliced variant (NM, XM, NR, XR) and can extract all sliced variants from a gene name or ENTREZ_GENE_ID
- Species: Human 🙋🏼‍♂️, Mouse 🖱, Rat 🐀, Drosophila 🦟, Zebrafish 🐟
- Set Upstream and Downstream from Transcription Start Site (TSS) and Gene End


- Mode "Advance": allows to extract for the same gene the promoter and terminator regions for several species

### Individual Motif Finder
- Support multiple DNA sequences in FASTA format
- Find Individual Motif occurrences (like TFBS, enzymes restriction site, specific pattern... whatever you want)
- Support IUPAC code
- Generate PWM Individual Motif
- Support PWM transcription factor of JASPAR ([JASPAR API](https://jaspar.genereg.net/api/v1/docs/))
- Calculation of the distance of the found element to TSS or Gene End
- Relative Score calculation:
<p align="center">
<img src="https://latex.codecogs.com/svg.image?{\color{red}\text{Relative&space;Score}=\frac{\text{Score&space;of&space;the&space;element&space;found}-\text{Minimum&space;score&space;of&space;the&space;reference&space;matrix}}{\text{Maximum&space;score&space;of&space;the&space;reference&space;matrix}-\text{Minimum&space;score&space;of&space;the&space;reference&space;matrix}}}" alt="relscore equation">
</p>

- p-value: 1000000 random sequences of reactive element length are generated based on the proportion of A, T, G, C in the analysed sequence. p-value is the number of random sequences generated having a relative score greater than or equal to the relative score of the element found divided by the number of random sequences generated
<p align="center">
<img src="https://latex.codecogs.com/svg.image?{\color{red}\text{p-value}=\frac{\text{Nb&space;Relative&space;Score&space;random&space;kmer}\geq\text{Relative&space;Score&space;element&space;found}}{\text{Nb&space;random&space;kmer}}}" alt="relscore equation">
</p>

- Interactive graph
- Download results as excel (.xlsx)
- Export results via e-mail

## Image

![graph_webui](https://raw.githubusercontent.com/Jumitti/TFinder/main/img/promtermoriginal.png)
![graph_webui](https://raw.githubusercontent.com/Jumitti/TFinder/main/img/bsfMS.png)
![graph_webui](https://raw.githubusercontent.com/Jumitti/TFinder/main/img/Graph%20WebUI.png)

## Working on...

- Cleaning code
- Fixing bug
- Improvements...

## More

Report an issue/bug 🆘 ➡️ [Click here](https://github.com/Jumitti/TFinder/issues/new/choose)

Want to talk ? 🙋🏼‍♂️ -> [Chat Room](https://github.com/Jumitti/TFinder/discussions)

Banner was generated with [Adobe Firefly](https://firefly.adobe.com/inspire/images)

Artwork made by [Minniti Pauline](https://minnitidesign.fr/)
Expand Down
48 changes: 27 additions & 21 deletions TFinder-v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def load_lottiefile(filepath: str):

if not st.session_state.lottie:
lottfinder = load_lottiefile(".streamlit/TFinder_logo_animated.json")
st.lottie(lottfinder, speed=1.3, loop=False)
st.lottie(lottfinder, speed=1.3, loop=False, quality="high", height=1520, width=1520)
time.sleep(2)
st.session_state.lottie = True
rerun()
Expand Down Expand Up @@ -93,20 +93,20 @@ def load_lottiefile(filepath: str):

HOME = 'Home'
APPLICATION = 'Tools/Software'
RESOURCE = 'Resources'
# RESOURCE = 'Resources'
CONTACT = 'Contact'

tabs = [
HOME,
APPLICATION,
RESOURCE,
# RESOURCE,
CONTACT,
]

option_data = [
{'icon': "🏠", 'label': HOME},
{'icon': "🖥️", 'label': APPLICATION},
{'icon': "📑", 'label': RESOURCE},
# {'icon': "📑", 'label': RESOURCE},
{'icon': "✉️", 'label': CONTACT},
]

Expand All @@ -128,20 +128,29 @@ def load_lottiefile(filepath: str):
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" - (BETA) TFinder: [https://tfinder-beta.streamlit.app/](https://tfinder-beta.streamlit.app/)\n")
try:

if 'LOCAL' not in st.session_state:
local_test = platform.processor()
print("Platform:", local_test)
if local_test == "":
st.session_state["LOCAL"] = 'False'
else:
st.session_state["LOCAL"] = 'True'

if st.session_state["LOCAL"] == 'False':
if st.secrets["message_from_god"] != "":
st.warning(st.secrets["message_from_god"])
if st.secrets['ncbi_error'] == "True":
st.error("⚠ NCBI server maintenance, problems and slowdowns may be observed")
except Exception as e:
print(e)

if chosen_tab == HOME:
home_page()

elif chosen_tab == APPLICATION:
allapp_page()

elif chosen_tab == RESOURCE:
resource_page()
# elif chosen_tab == RESOURCE:
# resource_page()

elif chosen_tab == CONTACT:
contact_page()
Expand All @@ -153,12 +162,14 @@ def load_lottiefile(filepath: str):
# streamlit_analytics.start_tracking()

# Credit
st.logo("img/TFinder_logo_site.png")
st.sidebar.image("img/TFinder_logo_site.png")

# Help
st.sidebar.title("Help")
# with st.sidebar.expander("Video tutorials"):
# st.write('coming soon')
st.sidebar.markdown("FULL DOCUMENTATION [HERE](https://jumitti.notion.site/tfinder?pvs=4)")

with st.sidebar.expander("Regulatory regions extractor"):
st.subheader("Gene ID:")
Expand Down Expand Up @@ -239,19 +250,16 @@ def load_lottiefile(filepath: str):
"[Have a question 🤔](https://github.com/Jumitti/TFinder/issues/new?assignees=&labels=question&projects=&template=question_report.md&title=%5BQUESTION%5D)")
st.sidebar.markdown(
"[Features request 💡](https://github.com/Jumitti/TFinder/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.md&title=%5BFEATURE%5D)")
st.sidebar.markdown("[Want to talk ? 🙋🏼‍♂](https://github.com/Jumitti/TFinder/discussions)")

# streamlit_analytics.stop_tracking()
# views = streamlit_analytics.main.counts["total_pageviews"]
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'

if st.session_state["LOCAL"] == 'True':
st.sidebar.markdown(f"TFinder Local Version")
else:
unique_users = st.secrets['unique_users']
st.sidebar.markdown(f"Unique users 👥: {unique_users}")


modal = Modal(key="TFinder Key", title="Disclaimers - Welcome to TFinder", padding=50, max_width=900)

Expand All @@ -264,11 +272,9 @@ def load_lottiefile(filepath: str):
st.markdown(
'TFinder use [NCBI API](https://www.ncbi.nlm.nih.gov/books/NBK25497/#chapter2.Usage_Guidelines_and_Requiremen)'
': More information [NCBI Website and Data Usage Policies and Disclaimers](https://www.ncbi.nlm.nih.gov/home/about/policies/)')
try:
if st.session_state['LOCAL'] == 'False':
if st.secrets['ncbi_error'] == "True":
st.error("⚠ NCBI server maintenance, problems and slowdowns may be observed")
except Exception as e:
print(e)
st.markdown("TFinder use [JASPAR API](https://doi.org/10.1093/bioinformatics/btx804)")
st.markdown('')
st.markdown(
Expand Down
Loading

0 comments on commit 2ef90d7

Please sign in to comment.