Skip to content
PavlopoulosLabPublic

About

A text-mining web application for automated named entity recognition, document annotation, network and functional enrichment analysis

Topics

Resources

Stars

7 stars

Watchers

3 watching

Forks

Repository files navigation

OnTheFly logo

OnTheFly 3.0

OnTheFly is a web application that finds biomedical entities in documents. Upload your files, paste text or open one of the bundled examples; read each document in its original layout with the recognised entities highlighted; collect the genes, proteins, chemicals and other terms in sortable tables; and send the genes of a document, or of many documents together, to Flame 3.0 for functional enrichment.

  • A home page (/, #/home) introduces OnTheFly: what it finds, the main features, three steps, one-click example cards and the hand-off to Flame 3.0; Annotate in the menu opens the workspace.
  • Upload, paste or try an example: PDF, Office documents, spreadsheets, flat text, images, PostScript and XML files, or pasted text (see Supported formats and limits). Thirteen example files open with one click, from the start screen (grouped by file type) or from the Examples list on the left, which is open until the first document is loaded.
  • An organism per document: when you add files, paste text or open an example, OnTheFly first asks for the organism whose genes/proteins should be recognised: one for all the new documents, or one for each. Documents of different organisms can be open side by side, and each document's organism can be changed later (Change organism…, next to the Document / Entities / Statistics tabs), which re-annotates that document only.
  • One tab per document: every uploaded file, pasted text and example is shown in its own tab. A spreadsheet with several worksheets gets one sheet tab per worksheet inside its document tab (plus a tab for the whole workbook). Spreadsheets (.xlsx, .xls, .ods) are read directly by the server, so they need no LibreOffice.
  • Layout-preserving view: every document is converted to PDF on the server and shown with pdf.js, so fonts, columns, tables and figures look as in the original. Scanned PDFs and images are made searchable with OCR. Zoom with the buttons, with Ctrl/⌘ + mouse wheel or by pinching on a trackpad (around the pointer). Drag the divider to resize the left panel, or hide it with « for the whole width (» brings it back); the browser remembers the layout. Full screen shows the document, the tables or the charts on the whole screen.
  • Highlighted entities with hover popups: genes/proteins of the chosen organism, chemical compounds, organisms, Gene Ontology terms (biological process, cellular component, molecular function), tissues, diseases, environments and phenotypes (APO, FYPO, MPheno, NBO, Mammalian Phenotype) are recognised by the JensenLab tagger and coloured by category. Hovering over a match (or moving to it with the arrow keys and pressing Enter) opens a card with its name, identifier and links to the relevant databases (STRING, Ensembl, UniProt, GeneCards, PubChem, NCBI Taxonomy, QuickGO, OLS, TISSUES, DISEASES, MGI). A colour legend shows the counts per entity type and hides or shows each type.
  • Document, Entities and Statistics in parallel tabs: above the viewer, a Document tab shows the annotated document, an Entities tab the entity tables and the Send to Flame panel, and a Statistics tab the charts; switching keeps your place in the document, and clicking a mention in a table jumps back to it.
  • Entity tables, all together and per category: an All sources tab lists every extracted term in one table, and one tab per category (Genes/proteins, Chemicals, Organisms, Gene Ontology, Tissues, Diseases & phenotypes, Environments) lists that category alone; each tab shows its number of terms. The tables sort like Flame's (click a header; ▲/▼), are searchable, select a row with a click, and cover the current document, the current sheet or all documents. Every identifier links to its source database (Ensembl, PubChem, NCBI Taxonomy, QuickGO, Disease Ontology, MGI, PomBase, OLS; STRING for non-Ensembl proteins), with further databases linked next to it. Duplicates are grouped: different spellings of the same entity ("p53", "TP53") share one row, with mention counts per spelling and per document. Ambiguous matches (one name, several candidate entities) are grouped and flagged, and each candidate can be selected on its own. Select all / none act on the rows shown; a mention count jumps to the mention in the document; Download CSV saves the table, including each identifier's link.
  • Statistics of the extracted terms: a Statistics tab with summary figures, a bar chart of the entity types, ranked bars of the most frequent terms (top 10–50, by mentions or by number of documents/sheets, per category), a word cloud sized by frequency, and a heat map of the terms shared by several documents and sheets. Hover for details, click a bar or word to select it, and download every chart as SVG or its data as CSV.
  • Document similarity heatmaps: how similar the documents (and worksheets) are to each other, from the term categories you tick (e.g. genes only, or genes and diseases) or from the selected entities only, recomputed on every change. Jaccard (shared distinct terms) or cosine (weighted by mentions); one heatmap for the ticked categories or one per category; documents in tab order or clustered so that similar documents sit together. Click a cell to list the terms two documents share and select them (e.g. the shared genes, to send to Flame).
  • Parameters used, in every view: the Document, Entities and Statistics views start with a Parameters used box, refreshed after every annotation run: per document or sheet, how its text was obtained (PDF text layer, LibreOffice, OCR), the organism, the entity types, when it was annotated and how long it took, and the results (matches, distinct entities, ambiguous matches, warnings); the tagger and OnTheFly version; and the view's own settings (scope, category tab, search, sorting, chart and similarity options). Copy as text copies it, e.g. for a methods section. The box is closed at first (one line); Show opens it and Hide closes it, remembered per view.
  • Light and dark mode: light by default, with a header switch for Light / Dark / System (remembered per browser); every panel, table, popup, chart and heatmap has colours chosen for each theme, the dark theme shows a light-lettered logo, and document pages stay white like paper.
  • Flame 3.0, per document or for many documents: the Entities tab of a document (or sheet) has a Send to Flame button for the genes of that tab only. Combining lists from several documents is a separate, global page, Flame lists (in the header): tick any number of documents and worksheets and send them in one request, as one list per document/sheet or as one merged list, into one Flame workspace.

Functional enrichment with Flame 3.0

Flame 3.0 logo

Flame 3.0 now takes care of functional enrichment. OnTheFly sends the selected genes to Flame's API, which creates a new workspace with your lists and returns its link; OnTheFly opens it in a new tab. No account is needed.

In Flame you can analyse the lists with eight established enrichment tools (g:Profiler, STRING, Enrichr, WebGestalt, PANTHER, GeneCodis, Reactome, clusterProfiler) for over-representation or gene set enrichment, run literature enrichment (PubMed, GeneSigDB, Rummagene), explore the STRING protein network with module detection, find transcription factors, kinases and drug signatures related to the list, see KEGG maps with your genes highlighted, compare lists and tools, and export publication-ready figures.


One document: Send to Flame

Open the document's (or worksheet's) Entities tab and click Send to Flame. It sends one list, named after the document (file or file › sheet), for the document's organism: the genes you selected in this tab, or, if none is selected, all genes/proteins recognised there unambiguously. The Flame workspace opens in a new tab.

Many documents: the Flame lists page

Combining lists from several files is a separate page, Flame lists in the header (/#/flame):

  1. Choose the genes to send: the genes/proteins you selected in the tables or hover cards, or all recognised genes of each document (used automatically when nothing is selected). Only genes/proteins are sent.
  2. On the Flame lists page every annotated document is listed, and for a workbook each of its worksheets, with the number of genes it would send. Tick one, several or all of them; ticking one without genes shows why.
  3. Choose one list per document/sheet (named file or file › sheet, containing the chosen genes that occur there) or one merged list (all selected genes of the ticked documents, without duplicates).
  4. Click send. OnTheFly makes a single call to Flame, which creates one workspace holding all lists; Flame resolves the identifiers itself.

Flame analyses one organism at a time: documents are grouped by their organism, and you send one organism's documents per request. Organisms that Flame does not support are marked in the organism list; their genes can be annotated but not sent. Flame accepts up to 10 lists and 20,000 genes per list in one request.

What changed in 3.0

OnTheFly 3.0 is a rewrite of OnTheFly 2.0 that keeps the text-mining part only.

  • No R/Shiny. The server is a Python FastAPI application and the web app is written in React and TypeScript. One Docker image runs everything. The R/Shiny code of OnTheFly 2.0 has been removed from the working tree; it remains in this repository's git history and as the Docker image pavlopouloslab/onthefly.
  • No pdf2htmlEX. Documents are converted to PDF and displayed with pdf.js; the highlights are drawn on the pdf.js text layer, so they line up with the rendered words.
  • Removed analyses, now done in Flame 3.0: functional enrichment (g:Profiler, aGOtool), literature (publication) enrichment, and the STRING protein-protein and STITCH protein-chemical interaction networks. Flame offers all of these and more, so OnTheFly no longer duplicates them.
  • New: document and sheet tabs, entity tables with category tabs where duplicates and ambiguous matches are grouped, sending many documents to Flame in one go, and one-click examples.

Supported formats and limits

Format Extensions Converted to PDF with
PDF .pdf used as is; scanned pages get an invisible OCR text layer (RapidOCR)
Office texts .doc .docx .odt .rtf LibreOffice (Writer)
Spreadsheets .xls .xlsx .ods built-in (python-calamine): each visible, non-empty worksheet becomes a table starting on a new page and is shown as its own sheet tab
Flat text .txt .tsv .csv built-in (CSV/TSV shown as a table)
XML .xml built-in
Images .bmp .png .jpg .jpeg .tif .tiff built-in OCR (RapidOCR with PaddleOCR's PP-OCRv6 models): the image plus an invisible text layer, word by word
PostScript .ps .eps Ghostscript (then built-in OCR if there is no text)
Pasted text – built-in

Limits: 50 MB per file and 30 documents at a time (configurable). Uploaded files are deleted after 24 hours. Very large inputs are cut or refused with a message; see Security and resource limits.

Working with Excel and other file types

The Help page of the app has the full guide; in short:

  • Excel / LibreOffice spreadsheets (.xlsx, .xls, .ods): every visible, non-empty worksheet becomes its own sheet tab (hidden, empty and chart sheets are left out and listed). Formulas show their last saved value; dates are shown as YYYY-MM-DD. Gene and protein names are recognised in any letter case (abca13, ABCA13), but database identifiers in cells (e.g. Ensembl ENSG…) are not: keep a column of gene symbols, or paste identifier lists straight into Flame. Beware of Excel turning gene symbols into dates (SEPT2 → 2-Sep, MARCH1 → 1-Mar): format gene columns as Text. Choose the organism when you add the workbook (it can be changed later). Each sheet can be sent to Flame as its own list. Limits: 50 sheets and 250,000 cells per workbook; 60,000 cells and 200 columns per sheet.
  • CSV / TSV: shown as a table (wide tables in blocks of columns); save as UTF-8 where possible.
  • PDF: shown as is. Pages without text (scans) are read with the built-in OCR; the page keeps its look. Password-protected PDFs are refused.
  • Word, OpenOffice/LibreOffice, RTF: converted with LibreOffice; text inside pictures is not read. If a file does not convert, save it as PDF and upload that.
  • Text, XML, pasted text: laid out on pages as is; XML is indented (large XML as plain text).
  • Images: read with the built-in OCR, which reads the gene labels of pathway diagrams well (see the OCR benchmark); scans of printed text work best at 300 dpi. Check the results.
  • PostScript: converted with Ghostscript.

OCR is built in (a Python package installed with the server). LibreOffice (Word, OpenOffice, RTF) and Ghostscript (PostScript) are external programs: the Docker image includes them, so a server started with docker compose up handles every format. When you run OnTheFly directly on your computer, install them (see Installing them); until then the app marks those formats as unavailable.

Example files

The examples/ folder holds 13 example files: PDF, Office text, spreadsheet, text and image files. In the app, the Examples menu of the upload area opens any of them with one click (the file is loaded and annotated automatically), and the Help page links to each one for download and for opening in the app. A link of the form /#/annotate?example=<file> (for example http://localhost:8080/#/annotate?example=excel_multi_sheet.xlsx) opens the app with that example loaded.

Example PDF Files

Example Office Text (MS Word, OpenOffice, LibreOffice etc) Files

Example spreadsheet (MS Excel, LibreOffice etc) files

Example text files

Example image files

The image examples are pathway diagrams from WikiPathways (released under CC0), full of gene names that only exist as pixels: a good test of the OCR. The Office text examples need LibreOffice on the server (it is in the Docker image); without it they can still be downloaded, but not opened.

Quick start with Docker

git clone https://github.com/PavlopoulosLab/OnTheFly.git
cd OnTheFly
docker compose up -d

Open http://localhost:8080 and click an example, or upload your own files. The image contains the web app, the server, the example files, the OCR models and the converters (LibreOffice Writer, Ghostscript). Documents are kept in the onthefly-data volume until they expire.

Settings from the configuration table can be given in the shell or in a .env file next to docker-compose.yml, e.g. ONTHEFLY_MAX_FILE_MB=20 or ONTHEFLY_HTTP_PORT=9000 (host port).

Without Compose:

docker build -t onthefly:3.0.0 .
docker run -d --name onthefly -p 8080:8080 -v onthefly-data:/data \
  --cap-drop ALL --security-opt no-new-privileges --init onthefly:3.0.0

Running a public server

  • The container needs no extra privileges: it runs as an unprivileged user on port 8080, and docker-compose.yml drops every Linux capability, sets no-new-privileges, runs an init process and limits the number of processes. A read-only root file system can be enabled there too (commented out).
  • Put it behind an HTTPS reverse proxy (nginx, Caddy, …). docker-compose.yml publishes the port on 127.0.0.1 only (set ONTHEFLY_BIND=0.0.0.0 to change that). Let the proxy accept uploads of the file limit (nginx: client_max_body_size 60m; for the default 50 MB).
  • Set FORWARDED_ALLOW_IPS to the proxy's address (or its Docker network, e.g. 172.18.0.0/16), so that the per-client limits see the visitors' addresses from X-Forwarded-For. Never use * while the port can be reached without the proxy: clients could then choose the address that is counted.
  • docker-compose.yml caps the container at 6 GB of memory and 4 CPUs (ONTHEFLY_MEM_LIMIT, ONTHEFLY_CPUS); raise them on a larger machine. Optionally pin the base images in the Dockerfile by digest.
  • Converters should not have outbound network access. LibreOffice, Ghostscript and the OCR never need the network, but they run in the same container as the server, which must reach the JensenLab tagger, STRING and Flame. Restrict the container's outbound traffic (host firewall or egress proxy) to those three hosts (TAGGER_URL, STRING_URL, FLAME_URL).
  • Size ONTHEFLY_MAX_STORAGE_MB to the disk available for the onthefly-data volume.

Local development

Requirements: Python ≥ 3.11 with uv, and Node.js ≥ 20.

# Server (http://localhost:8080)
cd backend
uv sync
uv run uvicorn onthefly.main:app --reload --port 8080

# Web app with hot reload (http://localhost:5174; /api is proxied to port 8080)
cd frontend
npm install
npm run dev

To serve the built web app from the Python server instead, run npm run build in frontend/; the server serves frontend/dist when it exists (ONTHEFLY_STATIC_DIR). The example files are served from examples/ (ONTHEFLY_EXAMPLES_DIR).

OCR models

OCR uses RapidOCR (Apache-2.0) with PaddleOCR's PP-OCRv6 small models on ONNX Runtime (CPU). It is a Python dependency, installed by uv sync. The two model files (about 30 MB) are downloaded once, from the RapidOCR model repository, with:

cd backend
uv run python -m onthefly.ocr --download

Their SHA-256 checksums are pinned in backend/onthefly/ocr.py and checked; the server never downloads models while it runs, and reports OCR as unavailable until the verified models are in place. The Docker image downloads them at build time. Document contents never leave the server for OCR. Why RapidOCR replaced OCRmyPDF/Tesseract: OCR benchmark.

Optional system tools

Word/RTF documents and PostScript need programs on the server. The server finds them on the PATH (or through the variables below) and reports which ones are installed in GET /api/config; a file that needs a missing tool is refused with an explanatory message (HTTP 503), and the web app marks those formats and examples as unavailable.

Tool Needed for Debian/Ubuntu packages Location setting
LibreOffice Writer .doc .docx .odt .rtf libreoffice-writer SOFFICE_BIN
Ghostscript .ps .eps ghostscript GS_BIN

Installing LibreOffice and Ghostscript

Docker – nothing to install: the image already contains both, so docker compose up gives a server that handles every format.

macOS (with Homebrew):

brew install --cask libreoffice  # for .doc/.docx/.odt/.rtf
brew install ghostscript         # for .ps/.eps

LibreOffice is found in /Applications/LibreOffice.app automatically.

Debian / Ubuntu (and Windows with WSL):

sudo apt-get update
sudo apt-get install libreoffice-writer ghostscript libgl1 libglib2.0-0

(libgl1 and libglib2.0-0 are needed by OpenCV, which the OCR uses.)

Fedora / RHEL / Rocky:

sudo dnf install libreoffice-writer ghostscript mesa-libGL

Windows without WSL: use Docker Desktop and the Docker image (above).

Then restart the OnTheFly server (it detects the programs at start-up) and check:

gs --version && soffice --version
curl -s http://localhost:8080/api/config   # "converters": {"libreoffice": true, "ocr": true, "ghostscript": true}

If a program is installed somewhere unusual, point the server to it, e.g. SOFFICE_BIN=/opt/libreoffice/program/soffice or GS_BIN=/opt/ghostscript/bin/gs.

Without them, OnTheFly still handles PDF files (scanned ones too), images, spreadsheets (.xlsx, .xls, .ods), .txt, .tsv, .csv, .xml and pasted text: these are read in Python, with bundled fonts and the built-in OCR.

Configuration

Environment variables of the server:

Variable Default Meaning
ONTHEFLY_MAX_FILE_MB 50 largest accepted file (and pasted text)
ONTHEFLY_MAX_FILES 30 documents open at a time in the web app
ONTHEFLY_STORAGE_DIR system temp dir + /onthefly (/data in Docker) uploaded files and their PDFs
ONTHEFLY_RETENTION_HOURS 24 documents are deleted after this many hours
ONTHEFLY_MAX_STORAGE_MB 10240 storage quota: new documents are refused (HTTP 507) while the storage directory is full
ONTHEFLY_CONVERT_TIMEOUT_S 180 time limit of one conversion (all its steps together, OCR included)
ONTHEFLY_MAX_PDF_MB 100 largest converted PDF that is kept (conversion output can be larger than the input)
ONTHEFLY_STATIC_DIR ../frontend/dist (/app/frontend/dist in Docker) built web app, served if present
ONTHEFLY_EXAMPLES_DIR ../examples (/app/examples in Docker) bundled example files
TAGGER_URL https://tagger.jensenlab.org JensenLab tagger
STRING_URL https://string-db.org STRING (gene/protein names)
FLAME_URL https://flame-enrich.org Flame 3.0
FLAME_PUBLIC_URL – public address of Flame, when FLAME_URL is an internal address; workspace links returned by Flame must point to one of the two
SOFFICE_BIN, GS_BIN soffice, gs converter programs
ONTHEFLY_WORKER_MEMORY_MB 2048 address-space limit (Linux) of the worker process that parses PDFs and spreadsheets
ONTHEFLY_OCR_MEMORY_MB 8192 address-space limit (Linux) of the OCR worker (ONNX Runtime reserves much more virtual memory than it uses; image size is capped separately at 60 megapixels)
ONTHEFLY_OCR_THREADS 2 CPU threads of one OCR process (at most 3 conversions run at once)
ONTHEFLY_OCR_MODEL_DIR RapidOCR's package folder where the OCR model files are (checked against pinned SHA-256)
ONTHEFLY_RATE_LIMITS 1 per-client limits on conversions and requests; 0 turns them off (e.g. for a private server used by scripts)
ONTHEFLY_API_DOCS 0 1 serves interactive API documentation at /api/docs (it loads Swagger UI from a CDN)
FORWARDED_ALLOW_IPS 127.0.0.1 addresses of the reverse proxy whose X-Forwarded-For is trusted (read by uvicorn)

Relative paths are resolved against the backend/ folder. docker-compose.yml also reads ONTHEFLY_HTTP_PORT (host port, default 8080), ONTHEFLY_BIND (host address, default 127.0.0.1), ONTHEFLY_MEM_LIMIT (default 6g) and ONTHEFLY_CPUS (default 4).

Security and resource limits

Uploaded files are treated as untrusted. The server limits what one file or one request can cost (details in docs/ARCHITECTURE.md):

  • PDF decompression caps: pypdf reads untrusted PDFs with strict limits (at most 20 MB of output per decoded stream or image, 50 MB declared stream length), and zip-based files (.docx, .xlsx, .odt, .ods) may unpack to at most 300 MB, so "zip bombs" are refused. PDFs may have up to 5,000 pages.
  • Rendered text: documents that OnTheFly lays out itself (text, CSV/TSV, XML, pasted text, spreadsheets) are capped at about 2,000 pages (and 3,000,000 characters); longer inputs are cut with a warning.
  • Tables: at most 60,000 cells and 200 columns per table; workbooks at most 50 sheets and 250,000 cells.
  • XML: files up to 1,500,000 characters are pretty-printed; larger ones are shown as they are.
  • Isolated parsing: PDFs and spreadsheets are parsed in a separate worker process with a time limit and a memory limit (ONTHEFLY_WORKER_MEMORY_MB, default 2048).
  • JSON request bodies are checked before they are parsed (HTTP 413 above the limit): /api/annotate at most 3,000,000 characters of text per request (the web app sends long documents in several requests), /api/resolve 512 KB, /api/flame 8 MB; pasted text is limited like a file (ONTHEFLY_MAX_FILE_MB).
  • Storage quota: ONTHEFLY_MAX_STORAGE_MB (default 10240) caps the disk used by documents; when it is full, new documents are refused with HTTP 507 until expired documents are removed by the periodic cleanup.
  • Tagger: at most 3 requests to the JensenLab tagger are in flight for the whole server (all users together), with retries and back-off, and each annotation request has a 150-second deadline, after which it returns what it has with a warning.
  • Conversions: at most 3 at a time on the server, with one overall time limit per conversion (ONTHEFLY_CONVERT_TIMEOUT_S); a conversion stops as soon as its client disconnects (closed tab, cancelled upload). Converters run with argument lists (never through a shell) in the document's own directory, and uploaded file names are never used as paths.
  • OCR: 2 threads per OCR process, at most 200 pages and 300 megapixels per document (later pages are kept without recognised text, with a warning), and models checked against pinned SHA-256 checksums.
  • Per-client limits (HTTP 429 with Retry-After): at most 6 conversions in flight (queued or running) per address, and per 10 minutes 120 conversions (uploads, pasted texts, examples), 600 annotation and 600 name requests and 60 Flame requests. ONTHEFLY_RATE_LIMITS=0 turns them off.
  • Browser protections: requests from other web sites (Sec-Fetch-Site: cross-site, or a foreign Origin) cannot create, delete or annotate documents (HTTP 403), and pasted text must be sent as JSON. Every response has X-Content-Type-Options: nosniff, Referrer-Policy: no-referrer and a Content-Security-Policy (scripts only from the server; no framing); document PDFs are served sandboxed and are not cached. Multi-range requests are answered with the whole file.

REST API

The web app uses a small JSON API, which can also be called directly. Errors are returned as {"detail": "<message>"} with a 4xx/5xx status (429 with Retry-After when a per-client limit is reached). Scripts (curl, Python) are not affected by the cross-site checks, which apply to browsers only. The request and response shapes are defined in frontend/src/types.ts.

Method & path Purpose
GET /api/config limits, accepted extensions, installed converters, version
GET /api/organisms organisms that can be tagged (and whether Flame supports them)
POST /api/documents upload a file (multipart field file); returns the document's id, PDF link and, for spreadsheets, its sheets (sections)
POST /api/documents/text create a document from text: {"name": "...", "text": "..."} (Content-Type: application/json)
GET /api/documents/{id}/pdf the converted PDF
DELETE /api/documents/{id} delete a document
GET /api/examples the bundled example files, with label, group, size and whether this server can open them
GET /api/examples/{file} download one example file
POST /api/examples/{file}/load open an example as a new document (same result as uploading it)
POST /api/annotate tag page texts (at most 3,000,000 characters per request; pageOffset numbers the pages of later parts in warnings); returns match offsets and the candidate entities of each match
POST /api/resolve gene/protein names and descriptions from STRING
POST /api/flame send one or more gene lists to Flame 3.0 in one call; returns the workspace link
GET /api/health {"status": "ok"}

Find the genes and chemicals in a text (offsets are JavaScript string indices into each page string; a match key with more than one candidate in entities is ambiguous):

curl -s http://localhost:8080/api/annotate \
  -H 'Content-Type: application/json' \
  -d '{"taxid": 9606, "categories": ["protein", "chemical"],
       "pages": ["Aspirin reduces COX-2 expression and activates p53."]}'

Open the multi-sheet Excel example as a document (the response lists its worksheets in sections):

curl -s -X POST http://localhost:8080/api/examples/excel_multi_sheet.xlsx/load

Send two gene lists to Flame 3.0 for human (taxid 9606) and get the link of the new Flame workspace:

curl -s http://localhost:8080/api/flame \
  -H 'Content-Type: application/json' \
  -d '{"organism": 9606,
       "lists": [{"name": "paper1", "genes": ["ENSP00000269305", "ENSP00000256078"]},
                 {"name": "paper2", "genes": ["ENSP00000269305", "ENSP00000275493"]}]}'

Project layout

backend/              Python server (FastAPI), managed with uv
  onthefly/           main.py (routes), config.py, storage.py, convert.py (conversion to PDF),
                      tagger.py (JensenLab tagger), resolve.py (STRING), flame.py (Flame 3.0 client),
                      data/organisms.json, fonts/
  tests/              pytest
frontend/             web app (React + TypeScript, Vite, pdf.js)
  public/             logos
  src/                types.ts, api.ts, categories.ts, links.ts, sections.ts (shared contract)
                      viewer/ (document viewer, highlights, popups), tables/ (grouping, entity tables),
                      flame/ (Send to Flame), pages/ (Help, About), components/
examples/             the 13 bundled example files
docs/                 ARCHITECTURE.md (design, API, categories, grouping, hardening), images/
Supplementary_Material/  supplementary material of the OnTheFly 2.0 paper
Dockerfile, docker-compose.yml

See docs/ARCHITECTURE.md for how annotation, offsets, grouping, sheets and the Flame hand-off work.

Tests

cd backend && uv run pytest      # server
cd frontend && npm test          # web app (vitest)

Citation

If you use OnTheFly, please cite:

  • Baltoumas F.A., Zafeiropoulou S., Karatzas E., Paragkamian S., Thanati F., Iliopoulos I., Eliopoulos A.G., Schneider R., Jensen L.J., Pafilis E., Pavlopoulos G.A. (2021) OnTheFly2.0: a text-mining web application for automated biomedical entity recognition, document annotation, network and functional enrichment analysis. NAR Genomics and Bioinformatics 3(4):lqab090. doi: 10.1093/nargab/lqab090

If you analyse your genes with Flame, please also cite:

  • Karatzas E., Baltoumas F.A., Aplakidou E., Kontou P.I., Stathopoulos P., Stefanis L., Bagos P.G., Pavlopoulos G.A. (2023) Flame (v2.0): advanced integration and interpretation of functional enrichment results from multiple sources. Bioinformatics 39(8):btad490. doi: 10.1093/bioinformatics/btad490
  • Thanati F., Karatzas E., Baltoumas F.A., Stravopodis D.J., Eliopoulos A.G., Pavlopoulos G.A. (2021) FLAME: a web tool for functional and literature enrichment analysis of multiple gene lists. Biology 10(7):665. doi: 10.3390/biology10070665

Entity recognition is done by the JensenLab tagger (https://tagger.jensenlab.org).

License

OnTheFly is licensed under the GNU General Public License v3.0 (GPL-3). See LICENSE.

About

A text-mining web application for automated named entity recognition, document annotation, network and functional enrichment analysis

Topics

Resources

Stars

7 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages