Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy app to vector-editor.oquinterol.com

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test
- run: pnpm app:build
- uses: actions/upload-pages-artifact@v3
with:
path: app-dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
dist/
app-dist/
*.tgz
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ cff-version: 1.2.0
message: "Si usas este software, por favor cítalo así. / If you use this software, please cite it as below."
title: "Vector editor: in-browser cloning simulator with REBASE enzymes"
type: software
version: 0.2.1
version: 0.3.0
authors:
- family-names: "Quintero López"
given-names: "Oscar Alexis"
orcid: "https://orcid.org/0000-0001-8926-6400"
repository-code: "https://github.com/oquinterol/vector-editor"
url: "https://oquinterol.com/en/tools/vector-editor/"
url: "https://vector-editor.oquinterol.com/"
license: MIT
keywords:
- plasmid
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Simulador de clonación en el navegador: elige enzimas de restricción comerciales o propias, digiere vector e inserto, liga, y obtén en vivo el FASTA y el mapa circular del plásmido resultante.
*In-browser cloning simulator: choose commercial or custom restriction enzymes, digest vector and insert, ligate, and get a live FASTA and circular map of the resulting plasmid.*

**Usarlo / Use it:** [oquinterol.com/es/tools/vector-editor](https://oquinterol.com/es/tools/vector-editor/) · [oquinterol.com/en/tools/vector-editor](https://oquinterol.com/en/tools/vector-editor/)
**Usarlo / Use it:** [vector-editor.oquinterol.com](https://vector-editor.oquinterol.com/) · también en / also at [oquinterol.com/es/tools/vector-editor](https://oquinterol.com/es/tools/vector-editor/)

> **Estado / Status: prototipo / prototype.** Verifica los resultados antes de usarlos en el laboratorio. / Check results before using them at the bench.

Expand All @@ -18,6 +18,8 @@ Simulador de clonación en el navegador: elige enzimas de restricción comercial
- **Archivos**: FASTA, GenBank y SnapGene (`.dna`), leídos localmente con [seqparse](https://github.com/Lattice-Automation/seqparse).
- **Mapa y FASTA vinculados**: el FASTA se colorea igual que el mapa circular ([SeqViz](https://github.com/Lattice-Automation/seqviz)) — vector, inserto y sitios de corte —; seleccionar bases en el FASTA marca el arco en el mapa, hacer clic en el mapa o en la leyenda resalta y lleva a esa secuencia. Copia o descarga el FASTA completo o solo la selección.
- **Búsqueda de enzimas** en un desplegable con teclado (↑ ↓ Enter Esc), filtrable por proveedor y por si cortan vector e inserto.
- **Exporta GenBank anotado** (vector, inserto con su orientación y sitios de restricción), listo para SnapGene, Benchling, ApE o Biopython, además de FASTA.
- **Atajos**: `/` buscar enzima · `C` copiar (la selección si hay una) · `D` FASTA · `G` GenBank · `Esc` quitar selección.
- **Privado**: todo corre en el navegador; las secuencias no se envían a ningún servidor.

## English
Expand All @@ -29,6 +31,8 @@ Simulador de clonación en el navegador: elige enzimas de restricción comercial
- **Files**: FASTA, GenBank and SnapGene (`.dna`), parsed locally with [seqparse](https://github.com/Lattice-Automation/seqparse).
- **Linked map and FASTA**: the FASTA is coloured like the circular map ([SeqViz](https://github.com/Lattice-Automation/seqviz)) — vector, insert and cut sites —; selecting bases in the FASTA marks the arc on the map, and clicking the map or the legend highlights and scrolls to that sequence. Copy or download the whole FASTA or just the selection.
- **Enzyme search** in a keyboard-friendly dropdown (↑ ↓ Enter Esc), filterable by supplier and by whether enzymes cut vector and insert.
- **Annotated GenBank export** (vector, insert with its orientation and restriction sites), ready for SnapGene, Benchling, ApE or Biopython, plus FASTA.
- **Shortcuts**: `/` search enzyme · `C` copy (the selection if any) · `D` FASTA · `G` GenBank · `Esc` clear selection.
- **Private**: everything runs in the browser; sequences are never sent to a server.

## Uso como librería / Library use
Expand All @@ -37,7 +41,8 @@ Simulador de clonación en el navegador: elige enzimas de restricción comercial
import { VectorEditor, labelsEs } from '@oquinterol/vector-editor'
import '@oquinterol/vector-editor/styles.css'

<VectorEditor labels={labelsEs} />
<VectorEditor labels={labelsEs} /> // dentro de una página / inside a page
<VectorEditor labels={labelsEs} layout='app' /> // pantalla completa / full screen
```

El núcleo (sin React) está en `@oquinterol/vector-editor/core`: `findCuts`, `digest`, `ligate`, `parseEnzyme`, `toFasta`…
Expand All @@ -50,6 +55,7 @@ pnpm install
pnpm test # núcleo con pruebas / tested core (vitest)
pnpm build # dist/
pnpm enzymes # regenerar el catálogo desde REBASE / rebuild the catalogue from REBASE
pnpm app:dev # app independiente / standalone app (vector-editor.oquinterol.com)
```

## Se apoya en / Builds on
Expand Down
140 changes: 140 additions & 0 deletions app/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
/* Standalone app: biopunk palette (shared with oquinterol.com), no external fonts. */
:root {
--bp-void: #030504;
--bp-ink: #070a09;
--bp-lab: #101713;
--bp-membrane: #17211b;
--bp-tissue: #26332a;
--bp-boundary: #4d6354;
--bp-sterile: #d9e4de;
--bp-bone: #b7c5bd;
--bp-muted: #87968d;
--bp-bio: #a4e66d;
--bp-pink: #ff6b9a;
--bp-toxic: #e2d36b;
color-scheme: dark;
}
html,
body,
#root {
height: 100%;
margin: 0;
}
body {
background: var(--bp-ink);
color: var(--bp-sterile);
font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
::selection {
background: var(--bp-bio);
color: var(--bp-ink);
}
.app-shell {
display: grid;
grid-template-rows: minmax(0, 1fr) auto;
height: 100%;
}
.ve {
--ve-theme-bg: var(--bp-ink);
--ve-theme-surface: var(--bp-lab);
--ve-theme-raised: var(--bp-membrane);
--ve-theme-ink: var(--bp-sterile);
--ve-theme-muted: var(--bp-muted);
--ve-theme-line: var(--bp-tissue);
--ve-theme-accent: var(--bp-bio);
--ve-theme-accent-ink: var(--bp-ink);
--ve-theme-warn: var(--bp-toxic);
--ve-theme-error: #ff6577;
--ve-theme-mono: 'FiraCode Nerd Font Mono', 'Fira Code', ui-monospace, 'SFMono-Regular', monospace;
--ve-theme-map-bg: var(--bp-ink);
--ve-theme-map-ink: var(--bp-sterile);
--ve-theme-map-muted: var(--bp-boundary);
--ve-theme-map-cut: var(--bp-pink);
--ve-theme-map-selection: rgb(164 230 109 / 0.16);
}
/* The map as a specimen under the microscope: reticle grid, vignette, glowing arcs. */
.ve-map {
background:
radial-gradient(circle at center, transparent 42%, var(--bp-void) 96%),
linear-gradient(var(--bp-tissue) 1px, transparent 1px) 0 0 / 100% 1.5rem,
linear-gradient(90deg, var(--bp-tissue) 1px, transparent 1px) 0 0 / 1.5rem 100%,
var(--bp-ink) !important;
}
.ve-map .la-vz-annotation {
filter: drop-shadow(0 0 6px currentColor);
}
.ve-map .la-vz-annotation[fill='#5ed9d1'] {
color: rgb(94 217 209 / 0.55);
}
.ve-map .la-vz-annotation[fill='#a4e66d'] {
color: rgb(164 230 109 / 0.55);
}
.ve-map .la-vz-circular-label[id$='-fwd'],
.ve-map .la-vz-circular-label[id$='-rev'] {
fill: var(--bp-pink) !important;
}
.app-brand {
display: flex;
align-items: center;
gap: 0.6rem;
padding-right: 0.6rem;
border-right: 1px solid var(--bp-tissue);
}
.app-brand strong {
font-weight: 700;
letter-spacing: -0.01em;
}
.app-tagline {
color: var(--bp-muted);
font-size: 0.8rem;
}
.app-lang {
display: inline-flex;
margin-left: 0.4rem;
border: 1px solid var(--bp-tissue);
border-radius: 6px;
overflow: hidden;
}
.app-lang button {
min-width: 2.4rem;
min-height: 2rem;
border: 0;
background: transparent;
color: var(--bp-muted);
font: inherit;
font-size: 0.72rem;
font-weight: 700;
cursor: pointer;
}
.app-lang button[aria-pressed='true'] {
background: var(--bp-membrane);
color: var(--bp-bio);
}
.app-footer {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0.3rem 0.7rem;
padding: 0.45rem 1rem;
border-top: 1px solid var(--bp-tissue);
background: var(--bp-void);
color: var(--bp-muted);
font-size: 0.72rem;
}
.app-footer a {
color: var(--bp-bone);
text-underline-offset: 0.2em;
}
.app-footer a:hover {
color: var(--bp-bio);
}
@media (max-width: 1100px) {
/* On smaller screens the page scrolls instead of fitting the viewport. */
.app-shell {
height: auto;
min-height: 100%;
}
.ve--app {
height: auto;
}
}
25 changes: 25 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Vector Editor — simulador de clonación</title>
<meta
name="description"
content="Prueba tu clonación antes de tocar la pipeta: enzimas REBASE o propias, extremos reales y el plásmido resultante en mapa y FASTA vinculados. / Try your cloning before the bench."
/>
<meta name="theme-color" content="#070a09" />
<meta name="color-scheme" content="dark" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="canonical" href="https://vector-editor.oquinterol.com/" />
<meta property="og:title" content="Vector Editor" />
<meta property="og:description" content="Try your cloning before the bench: REBASE or custom enzymes, real sticky ends, and the resulting plasmid in a linked map and FASTA." />
<meta property="og:url" content="https://vector-editor.oquinterol.com/" />
</head>
<body>
<div id="root">
<noscript>Vector Editor needs JavaScript: everything runs in your browser. / Necesita JavaScript.</noscript>
</div>
<script type="module" src="./main.tsx"></script>
</body>
</html>
78 changes: 78 additions & 0 deletions app/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import React, { useEffect, useState } from 'react'
import { createRoot } from 'react-dom/client'
import { VectorEditor, labelsEn, labelsEs } from '../src'
import '../src/ui/styles.css'
import './app.css'

type Lang = 'es' | 'en'

const initialLang = (): Lang => {
try {
const stored = localStorage.getItem('vector-editor.lang')
if (stored === 'es' || stored === 'en') return stored
} catch {
/* Storage is optional. */
}
return navigator.language.toLowerCase().startsWith('es') ? 'es' : 'en'
}

const copy = {
es: {
tagline: 'simulador de clonación',
source: 'Código abierto (MIT)',
by: 'Hecho por',
data: 'Enzimas: REBASE'
},
en: {
tagline: 'cloning simulator',
source: 'Open source (MIT)',
by: 'Made by',
data: 'Enzymes: REBASE'
}
} as const

function App() {
const [lang, setLang] = useState<Lang>(initialLang)
const t = copy[lang]
useEffect(() => {
document.documentElement.lang = lang
try {
localStorage.setItem('vector-editor.lang', lang)
} catch {
/* Storage is optional. */
}
}, [lang])

const brand = (
<div className='app-brand'>
<img src='/favicon.svg' alt='' width='22' height='22' />
<span>
<strong>Vector Editor</strong> <span className='app-tagline'>{t.tagline}</span>
</span>
<div className='app-lang' role='group' aria-label='Language / Idioma'>
{(['es', 'en'] as const).map((code) => (
<button key={code} type='button' aria-pressed={lang === code} onClick={() => setLang(code)}>
{code.toUpperCase()}
</button>
))}
</div>
</div>
)

return (
<div className='app-shell'>
<VectorEditor layout='app' labels={lang === 'es' ? labelsEs : labelsEn} brand={brand} />
<footer className='app-footer'>
<a href='https://github.com/oquinterol/vector-editor'>{t.source}</a>
<span aria-hidden='true'>·</span>
<a href='http://rebase.neb.com'>{t.data}</a>
<span aria-hidden='true'>·</span>
<span>
{t.by} <a href='https://oquinterol.com'>Oscar Quintero — oquinterol.com</a>
</span>
</footer>
</div>
)
}

createRoot(document.getElementById('root')!).render(<App />)
1 change: 1 addition & 0 deletions app/public/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vector-editor.oquinterol.com
1 change: 1 addition & 0 deletions app/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@oquinterol/vector-editor",
"version": "0.2.1",
"version": "0.3.0",
"description": "In-browser cloning simulator: choose commercial or custom restriction enzymes, digest and ligate, and get a live FASTA and plasmid map.",
"license": "MIT",
"author": "Oscar Alexis Quintero López (https://oquinterol.com)",
"repository": {
"type": "git",
"url": "git+https://github.com/oquinterol/vector-editor.git"
},
"homepage": "https://oquinterol.com/en/tools/vector-editor/",
"homepage": "https://vector-editor.oquinterol.com/",
"keywords": [
"plasmid",
"cloning",
Expand Down Expand Up @@ -43,7 +43,9 @@
"build": "tsup && cp src/ui/styles.css dist/styles.css",
"test": "vitest run",
"typecheck": "tsc --noEmit",
"enzymes": "node scripts/build-enzymes.mjs"
"enzymes": "node scripts/build-enzymes.mjs",
"app:dev": "vite",
"app:build": "vite build"
},
"peerDependencies": {
"react": "^18.0.0 || ^19.0.0",
Expand All @@ -56,10 +58,12 @@
"devDependencies": {
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^5.2.0",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"tsup": "^8.5.1",
"typescript": "~5.9.3",
"vite": "^7.3.6",
"vitest": "^5.0.3"
},
"packageManager": "pnpm@11.2.2"
Expand Down
Loading
Loading