Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 250,000+ scientists worldwide. 177 ready-to-use validated skills plus 100+ scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard.
Python agent-skillsai-scientistbioinformaticschemoinformaticsclaudeclaude-skillsclaudecodeclinical-researchcomputational-biologydata-analysisdrug-discoverygenomicsmaterials-sciencemetabolomicsproteomicsscientific-computingscientific-visualization
Add combined database-lookup skill
Timothy Kassis909323b5f77e
diff --git a/scientific-skills/database-lookup/SKILL.md b/scientific-skills/database-lookup/SKILL.mdnew file mode 100644index 00000000..b54f5b3d--- /dev/null+++ b/scientific-skills/database-lookup/SKILL.md@@ -0,0 +1,480 @@+---+name: database-lookup+description: Search 78 public scientific, biomedical, materials science, and economic databases via their REST APIs and return structured JSON results. Covers physics/astronomy (NASA, NIST, SDSS, SIMBAD, Exoplanet Archive), earth/environment (USGS, NOAA, EPA, OpenWeatherMap), chemistry/drugs (PubChem, ChEMBL, DrugBank, FDA, KEGG, DailyMed, ZINC, BindingDB), materials science (Materials Project, COD), biology/genomics (Reactome, BRENDA, UniProt, STRING, Ensembl, NCBI Gene, GEO, GTEx, PDB, AlphaFold, InterPro, ChEBI, BioGRID, Gene Ontology, QuickGO, NCBI Protein/Taxonomy, dbSNP, SRA, ENA, gnomAD, UCSC Genome, ENCODE, JASPAR, MouseMine, PRIDE, LINCS L1000, Human Protein Atlas, Human Cell Atlas, RummaGEO, Metabolomics Workbench, EMDB, Addgene), disease/clinical (COSMIC, Open Targets, ClinPGx, ClinicalTrials.gov, OMIM, ClinVar, GDC/TCGA, cBioPortal, DisGeNET, GWAS Catalog, Monarch, HPO), regulatory (FDA, USPTO, SEC EDGAR), economics/finance (FRED, BEA, BLS, Federal Reserve, World Bank, ECB, US Treasury, Alpha Vantage, Data Commons), and demographics (US Census, Eurostat, WHO). Use this skill whenever the user wants to look up compounds, drugs, proteins, genes, pathways, enzymes, gene expression, variants, clinical trials, patents, SEC filings, economic indicators, crystal structures, astronomical objects, earthquakes, weather, or any data from a public database API. Also trigger when the user mentions any database by name or asks about molecular properties, drug-target interactions, binding affinities, protein interactions, pathway membership, pharmacogenomics, economic time series, materials properties, commercially available compounds, virtual screening, compound purchasability, chemical libraries, building blocks, cancer genomics, somatic mutations, tumor mutation profiles, nucleotide sequences, genome assemblies, sequencing reads, ENA accessions, INSDC data, or wants to cross-reference entities across sources.+metadata:+ skill-author: K-Dense Inc.+---++# Database Lookup++You have access to 78 public databases through their REST APIs. Your job is to figure out which database(s) are relevant to the user's question, query them, and return the raw JSON results along with which databases you used.++## Core Workflow++1. **Understand the query** — What is the user looking for? A compound? A gene? A pathway? A patent? Expression data? An economic indicator? This determines which database(s) to hit.++2. **Select database(s)** — Use the database selection guide below. When in doubt, search multiple databases — it's better to cast a wide net than to miss relevant data.++3. **Read the reference file** — Each database has a reference file in `references/` with endpoint details, query formats, and example calls. Read the relevant file(s) before making API calls.++4. **Make the API call(s)** — See the **Making API Calls** section below for which HTTP fetch tool to use on your platform.++5. **Return results** — Always return:+ - The **raw JSON** response from each database+ - A **list of databases queried** with the specific endpoints used+ - If a query returned no results, say so explicitly rather than omitting it++## Database Selection Guide++Match the user's intent to the right database(s). Many queries benefit from hitting multiple databases.++### Physics & Astronomy+| User is asking about... | Primary database(s) | Also consider |+|---|---|---|+| Near-Earth objects, asteroids | NASA (NeoWs) | — |+| Mars rover images | NASA (Mars Rover Photos) | — |+| Exoplanets, orbital parameters | NASA Exoplanet Archive | — |+| Astronomical objects by name/coordinates | SIMBAD | SDSS |+| Galaxy/star spectra, photometry | SDSS | SIMBAD |+| Physical constants | NIST | — |+| Atomic spectra, spectral lines | NIST (ASD) | — |++### Earth & Environmental Sciences+| User is asking about... | Primary database(s) | Also consider |+|---|---|---|+| Earthquakes, seismic events | USGS Earthquakes | — |+| Water data, streamflow, groundwater | USGS Water Services | — |+| Weather (current, forecast, historical) | OpenWeatherMap | NOAA |+| Climate data, historical weather stations | NOAA (CDO) | — |+| Air quality, toxic releases | EPA (Envirofacts) | — |++### Chemistry & Drugs+| User is asking about... | Primary database(s) | Also consider |+|---|---|---|+| Chemical compounds, molecules | PubChem | ChEMBL |+| Molecular properties (weight, formula, SMILES) | PubChem | — |+| Drug synonyms, CAS numbers | PubChem (synonyms) | DrugBank |+| Bioactivity data, IC50, binding assays | ChEMBL | BindingDB, PubChem |+| Drug binding affinities (Ki, IC50, Kd) | ChEMBL, BindingDB | PubChem |+| Drug-target interactions | ChEMBL, DrugBank | BindingDB, Open Targets |+| Ligands for a protein target (by UniProt) | BindingDB | ChEMBL |+| Target identification from compound structure | BindingDB (SMILES similarity) | ChEMBL |+| Drug labels, adverse events, recalls | FDA (OpenFDA) | DailyMed |+| Drug labels (structured product labels) | DailyMed | FDA (OpenFDA) |+| Drug pharmacology, indications | DrugBank | FDA |+| Chemical cross-referencing | PubChem (xrefs) | ChEMBL |+| Commercially available compounds for screening | ZINC | PubChem |+| Similarity/substructure search (purchasable) | ZINC | PubChem, ChEMBL |+| Drug-like compound libraries, building blocks | ZINC | — |+| FDA-approved drug structures | ZINC (fda subset) | PubChem, FDA |+| Compound purchasability, vendor catalogs | ZINC | — |++### Materials Science & Crystallography+| User is asking about... | Primary database(s) | Also consider |+|---|---|---|+| Materials by formula or elements | Materials Project | COD |+| Band gap, electronic structure | Materials Project | — |+| Crystal structures, CIF files | COD | Materials Project |+| Elastic/mechanical properties | Materials Project | — |+| Formation energy, thermodynamics | Materials Project | — |+| Cell parameters, space groups | COD | Materials Project |++### Biology & Genomics+| User is asking about... | Primary database(s) | Also consider |+|---|---|---|+| Biological pathways | Reactome, KEGG | — |+| What pathways a gene/protein is in | Reactome (mapping), KEGG | — |+| Enzyme kinetics, catalytic activity | BRENDA | KEGG |+| Metabolomics studies, metabolite profiles | Metabolomics Workbench | PubChem |+| m/z or exact mass lookup | Metabolomics Workbench (moverz/exactmass) | PubChem |+| Protein sequence, function, annotation | UniProt | Ensembl |+| Protein-protein interactions | STRING | BioGRID |+| Gene information, genomic location | NCBI Gene | Ensembl |+| Genome sequences, variants, transcripts | Ensembl | NCBI Gene |+| Gene expression datasets | GEO (NCBI E-utilities) | — |+| Gene expression across tissues | GTEx | Human Protein Atlas |+| Gene expression signatures (CMap/L1000) | LINCS L1000 | GEO |+| Gene set enrichment vs GEO | RummaGEO | GEO |+| Protein sequences (NCBI) | NCBI Protein | UniProt |+| Taxonomic classification | NCBI Taxonomy | — |+| SNP/variant data (dbSNP) | dbSNP | ClinVar, gnomAD |+| Population variant frequencies | gnomAD | dbSNP |+| Sequencing run metadata | SRA | ENA, GEO |+| Nucleotide sequences (European archive) | ENA | SRA, NCBI Gene |+| Genome assemblies, raw reads (European) | ENA | SRA, Ensembl |+| Cross-references from sequence accessions | ENA (xref) | NCBI Gene, UniProt |+| Genome annotations, tracks | UCSC Genome Browser | Ensembl |+| 3D protein structures (experimental) | PDB (RCSB) | EMDB |+| 3D protein structures (predicted) | AlphaFold DB | PDB |+| EM maps, cryo-EM structures | EMDB | PDB |+| Protein families, domains | InterPro | UniProt |+| Chemical entities (biological) | ChEBI | PubChem |+| Protein/genetic interactions | BioGRID | STRING |+| Gene function annotations (GO terms) | QuickGO | Gene Ontology |+| Regulatory elements, ChIP-seq, ATAC-seq | ENCODE | — |+| TF binding profiles/motifs | JASPAR | ENCODE |+| Protein expression across tissues | Human Protein Atlas | UniProt |+| Single-cell atlas projects | Human Cell Atlas | — |+| Proteomics datasets | PRIDE | — |+| Mouse gene data | MouseMine | NCBI Gene |+| Plasmid repository | Addgene | — |++**Organism/species matters.** Most biology databases cover multiple organisms. If the user's query is about a specific organism, pass it explicitly — don't assume human. Common patterns: Ensembl uses `{species}` in the URL path (e.g. `homo_sapiens`), STRING/BioGRID/QuickGO use NCBI taxon IDs (`species=9606` for human, `10090` for mouse), UniProt uses `organism_id:9606` in search queries, KEGG uses organism codes (`hsa`, `mmu`). GTEx and Human Protein Atlas are human-only. Check the reference file for each database's specific parameter.++### Disease & Clinical+| User is asking about... | Primary database(s) | Also consider |+|---|---|---|+| Somatic mutations in cancer | COSMIC | Open Targets, cBioPortal |+| Cancer genomics (TCGA) | GDC (TCGA) | COSMIC, cBioPortal |+| Cancer study mutations, CNA, expression | cBioPortal | GDC (TCGA), COSMIC |+| Tumor clinical data (survival, staging) | cBioPortal | GDC (TCGA) |+| Drug-target-disease associations | Open Targets | ChEMBL |+| Gene-disease associations | DisGeNET | Open Targets, Monarch |+| Mendelian disease-gene relationships | OMIM | NCBI Gene |+| Variant clinical significance | ClinVar (NCBI) | OMIM |+| GWAS SNP-trait associations | GWAS Catalog | — |+| Disease-phenotype-gene links | Monarch Initiative | HPO |+| Phenotype ontology, HPO terms | HPO | Monarch |+| Pharmacogenomics, drug-gene interactions | ClinPGx (PharmGKB) | DrugBank |+| Clinical trials for a drug/disease | ClinicalTrials.gov | FDA |+| Disease-related expression data | GEO | Open Targets |++### Patents & Regulatory+| User is asking about... | Primary database(s) | Also consider |+|---|---|---|+| Patents by keyword or technology | USPTO (PatentsView) | — |+| Patents by inventor or assignee | USPTO (PatentsView) | — |+| Patent prosecution status | USPTO (PEDS) | — |+| Trademark lookup | USPTO (TSDR) | — |+| SEC company filings, 10-K, 10-Q | SEC EDGAR | — |++### Economics & Finance+| User is asking about... | Primary database(s) | Also consider |+|---|---|---|+| US economic time series (GDP, CPI, rates) | FRED | BEA |+| Employment, wages, labor statistics | BLS | FRED |+| GDP, national accounts | BEA | FRED, World Bank |+| International development indicators | World Bank | FRED |+| Interest rates, money supply | Federal Reserve | FRED |+| Euro exchange rates, ECB monetary stats | ECB | — |+| US debt, yield curves, fiscal data | US Treasury | FRED |+| Stock prices, forex, crypto | Alpha Vantage | — |+| Statistical data across many topics | Data Commons | — |++### Social Sciences & Demographics+| User is asking about... | Primary database(s) | Also consider |+|---|---|---|+| US population, housing, income data | US Census | Data Commons |+| EU statistics (economy, trade, health) | Eurostat | World Bank |+| Global health indicators (mortality, disease) | WHO GHO | World Bank |++### Cross-domain queries+| User is asking about... | Primary database(s) | Also consider |+|---|---|---|+| Everything about a compound | PubChem + ChEMBL + DrugBank | BindingDB, ZINC, Reactome, FDA |+| Everything about a gene | NCBI Gene + UniProt + Ensembl | Reactome, STRING, COSMIC, cBioPortal, ENA |+| Everything about a variant | dbSNP + ClinVar + gnomAD | GWAS Catalog, COSMIC, cBioPortal |+| Drug target pathways | ChEMBL + Reactome | Open Targets, GEO |+| Prior art for a chemical invention | USPTO + PubChem | ChEMBL |+| Everything about a material | Materials Project + COD | — |+| US economic overview | FRED + BLS + BEA | Federal Reserve |++When the user's query spans multiple domains (e.g. "what do we know about aspirin" or "find everything about BRCA1"), query all relevant databases in parallel.++## Common Identifier Formats++Different databases use different identifier systems. If a query fails, the identifier format may be wrong. Here's a quick reference:++| Identifier | Format | Example | Used by |+|---|---|---|---|+| UniProt accession | `P#####` or `Q#####` | `P04637` (TP53) | UniProt, STRING, AlphaFold, Reactome mapping |+| Ensembl gene ID | `ENSG###########` | `ENSG00000141510` | Ensembl, Open Targets, GTEx |+| NCBI Gene ID | Integer | `7157` (TP53) | NCBI Gene, GEO, DisGeNET, HPO |+| HGNC ID | `HGNC:#####` | `HGNC:11998` | Monarch |+| PubChem CID | Integer | `2244` (aspirin) | PubChem |+| ZINC ID | `ZINC` + 15 digits | `ZINC000000000053` (aspirin) | ZINC |+| ENA Project | `PRJEB` + digits | `PRJEB40665` | ENA |+| ENA Run | `ERR` + digits | `ERR1234567` | ENA |+| ENA Experiment | `ERX` + digits | `ERX1234567` | ENA |+| ENA Sample | `ERS` + digits | `ERS1234567` | ENA |+| ChEMBL ID | `CHEMBL####` | `CHEMBL25` (aspirin) | ChEMBL |+| Reactome stable ID | `R-HSA-######` | `R-HSA-109581` | Reactome |+| HP term | `HP:#######` | `HP:0001250` (seizure) | HPO (URL-encode colon as %3A) |+| MONDO disease | `MONDO:#######` | `MONDO:0007947` | Monarch |+| GO term | `GO:#######` | `GO:0008150` | QuickGO, Gene Ontology |+| dbSNP rsID | `rs########` | `rs334` | dbSNP, GWAS Catalog, gnomAD |+| GENCODE ID | `ENSG###.##` (versioned) | `ENSG00000139618.17` | GTEx (requires version suffix) |++### Identifier Resolution++When a database doesn't recognize an identifier, convert it using these workflows:++**Genes**: Symbol (e.g. "TP53") → look up in **NCBI Gene** (esearch by symbol) → get NCBI Gene ID → convert to Ensembl ID via **Ensembl** `/xrefs/symbol/homo_sapiens/{symbol}`, or to UniProt accession via **UniProt** search (`gene_exact:{symbol} AND organism_id:9606`).++**Compounds**: Name → **PubChem** `/compound/name/{name}/cids/JSON` → get CID → convert to ChEMBL ID via **UniChem** or **ChEMBL** molecule search. If name lookup fails, try SMILES, InChIKey, or CAS number.++**Variants**: rsID (e.g. "rs334") works directly in **dbSNP**, **ClinVar**, **GWAS Catalog**, **gnomAD**. For genomic coordinates, use **Ensembl** VEP to get consequence annotations and linked rsIDs.++**Diseases**: Name → **Open Targets** or **Monarch** search → get EFO or MONDO ID → use in downstream queries.++## POST-Only APIs++These databases require HTTP POST and **will not work with WebFetch** (GET-only). Use `curl` via your platform's shell tool instead:++| Database | Why POST needed | Example |+|---|---|---|+| Open Targets | GraphQL endpoint | `curl -X POST -H "Content-Type: application/json" -d '{"query":"..."}' https://api.platform.opentargets.org/api/v4/graphql` |+| gnomAD | GraphQL endpoint | `curl -X POST -H "Content-Type: application/json" -d '{"query":"..."}' https://gnomad.broadinstitute.org/api` |+| RummaGEO | POST-only enrichment | `curl -X POST -H "Content-Type: application/json" -d '{"genes":["..."]}' https://rummageo.com/api/enrich` |+| GDC/TCGA | Complex filter queries | `curl -X POST -H "Content-Type: application/json" -d '{"filters":...}' https://api.gdc.cancer.gov/ssms` |+| SEC EDGAR | Requires User-Agent header | `curl -H "User-Agent: YourApp [email protected]" https://efts.sec.gov/LATEST/search-index?q=...` |++## API Keys and Access Restrictions++Some databases require API keys or have access restrictions. When an API key is needed:++1. **Check the current environment first** — the key may already be exported as a shell environment variable (e.g. `$FRED_API_KEY`). Read it directly from the environment.+2. **Fall back to `.env`** — if the variable isn't in the environment, check the `.env` file in the current working directory.+3. **If neither has it** — proceed without the key (most APIs still work at lower rate limits) and tell the user which key is missing and how to get one.++### Databases requiring API keys (free registration)++| Database | Env Variable | Registration URL |+|---|---|---|+| FRED | `FRED_API_KEY` | https://fred.stlouisfed.org/docs/api/api_key.html |+| BEA | `BEA_API_KEY` | https://apps.bea.gov/API/signup/ |+| BLS | `BLS_API_KEY` | https://data.bls.gov/registrationEngine/ |+| NCBI (GEO, Gene) | `NCBI_API_KEY` | https://www.ncbi.nlm.nih.gov/account/settings/ |+| OpenFDA | `OPENFDA_API_KEY` | https://open.fda.gov/apis/authentication/ |+| USPTO (PatentsView) | `PATENTSVIEW_API_KEY` | https://patentsview.org/apis/keyrequest |+| Data Commons | `DATACOMMONS_API_KEY` | Google Cloud Console |+| Materials Project | `MP_API_KEY` | https://materialsproject.org (free account) |+| NASA | `NASA_API_KEY` | https://api.nasa.gov (free, DEMO_KEY available) |+| NOAA (CDO) | `NOAA_API_KEY` | https://www.ncdc.noaa.gov/cdo-web/token |+| OpenWeatherMap | `OPENWEATHERMAP_API_KEY` | https://openweathermap.org/appid |+| OMIM | `OMIM_API_KEY` | https://omim.org/api (free academic) |+| BioGRID | `BIOGRID_API_KEY` | https://webservice.thebiogrid.org (free) |+| Alpha Vantage | `ALPHAVANTAGE_API_KEY` | https://www.alphavantage.co/support/#api-key |+| US Census | `CENSUS_API_KEY` | https://api.census.gov/data/key_signup.html |+| DisGeNET | `DISGENET_API_KEY` | https://www.disgenet.org (free academic) |+| Addgene | `ADDGENE_API_KEY` | https://www.addgene.org (free account) |+| LINCS L1000 (CLUE) | `CLUE_API_KEY` | https://clue.io (free academic) |++These are all free to obtain. The APIs work without keys but have lower rate limits. Always try with a key first — if the env variable isn't set, proceed without the key and note in your response that rate limits may be lower.++### Databases with paid or restricted access++| Database | Restriction | Free alternative |+|---|---|---|+| DrugBank | Paid API license required | Use **ChEMBL** + **PubChem** + **OpenFDA** instead |+| COSMIC | Free academic registration required (JWT auth) | Use **Open Targets** for cancer mutation data |+| BRENDA | Free registration required (SOAP, not REST) | Use **KEGG** for enzyme/pathway data |++When a database requires paid access or registration the user hasn't set up:+1. **Fall back to a free alternative** that can answer the same question+2. **Tell the user** which database you couldn't access, why, and what you used instead+3. If the user specifically requests a restricted database, explain the access requirements so they can set it up++### Loading API keys++**Step 1 — Check the current environment.** The key may already be exported as a shell variable. For example, in Claude Code you can check with Bash: `echo $FRED_API_KEY`. If the variable is set and non-empty, use it.++**Step 2 — Check `.env` file.** If the environment variable isn't set, read `.env` from the current working directory. Format:+```+FRED_API_KEY=your_key_here+BEA_API_KEY=your_key_here+```++**Step 3 — Proceed without.** If neither source has the key, proceed without it (most APIs still work at lower rate limits) and mention this to the user.++## Making API Calls++Use your environment's HTTP fetch tool to call REST endpoints. The tool name varies by platform:++| Platform | HTTP Fetch Tool | Fallback |+|---|---|---|+| Claude Code | `WebFetch` | `curl` via Bash |+| Gemini CLI | `web_fetch` | `curl` via shell |+| Windsurf | `read_url_content` | `curl` via terminal |+| Cursor | No dedicated fetch tool | `curl` via `run_terminal_cmd` |+| Codex CLI | No dedicated fetch tool | `curl` via `shell` |+| Cline | No dedicated fetch tool | `curl` via `execute_command` |++If you don't recognize your platform or the fetch tool fails, fall back to `curl` via whatever shell/terminal tool is available. Example:+```bash+curl -s -H "Accept: application/json" "https://api.example.com/endpoint"+```++### Request guidelines++- Set `Accept: application/json` header where supported+- URL-encode special characters in query parameters — SMILES strings (`/`, `#`, `=`, `@`), compound names with parentheses, and ontology terms with colons (`HP:0001250` → `HP%3A0001250`) are common sources of failures. With `curl`, use `--data-urlencode` for safety.+- **Parallel OK**: When querying *different* databases (e.g., PubChem + ChEMBL + Reactome), run them in parallel — most APIs have generous rate limits.+- **Serialize requests to rate-limited APIs**: NCBI APIs (Gene, GEO, Protein, Taxonomy, dbSNP, SRA) at 3 req/sec without key, 10 with key. Also watch: Ensembl (15 req/sec), BLS v1 (25 req/day without key), SEC EDGAR (10 req/sec), NOAA (5 req/sec with token).+- If you get a rate-limit error (HTTP 429 or 503), wait briefly and retry once++### Error recovery++If an API returns an error or empty results:+1. **Check the identifier format** — use the Common Identifier Formats table above. A gene symbol may need to be converted to NCBI Gene ID or Ensembl ID first.+2. **Try alternative identifiers** — if a compound name fails in PubChem, try SMILES, InChIKey, or CID. If a gene symbol fails, try the NCBI Gene ID.+3. **Try a different database** — if one database is down or returns nothing, check the "Also consider" column in the selection guide for alternatives.+4. **Report the failure** — tell the user which database failed, the error, and what you tried instead.++### Pagination++Many APIs return paginated results — if you only read the first page, you may miss data. Common patterns:++- **Offset/Limit**: `offset=0&limit=100` → increment offset by limit for the next page (ChEMBL, FRED, NOAA, USGS, NCBI E-utilities, ENA, GDC, FDA)+- **Cursor-based**: Response includes a `nextPageToken` or `cursor` value — pass it in the next request (ClinicalTrials.gov, UniProt)+- **Page number**: `page=1&per_page=50` → increment page (World Bank, cBioPortal, ZINC)++Check the reference file for each database's specific pagination parameters. If a response includes `total`, `totalCount`, or `next` and the number of returned results is less than the total, there are more pages.++For targeted lookups (single gene, single compound), the first page is usually sufficient. Paginate when the user needs comprehensive results (e.g., "all clinical trials for X" or "all known variants in gene Y").++## Output Format++Structure your response like this:++```+## Databases Queried+- **PubChem** — /compound/name/aspirin/property/...+- **Reactome** — /search/query?query=aspirin++## Results++### PubChem+[raw JSON response]++### Reactome+[raw JSON response]+```++If results are very large, present the most relevant portion and note that additional data is available. But default to showing the full raw JSON — the user asked for it.++## Adding New Databases++This skill is designed to grow. Each database is a self-contained reference file in `references/`. To add a new database:++1. Create `references/<database-name>.md` following the same format as existing files+2. Add an entry to the database selection guide above+3. The reference file should include: base URL, key endpoints, query parameter formats, example calls, rate limits, and response structure++## Available Databases++Read the relevant reference file before making any API call.++### Physics & Astronomy+| Database | Reference File | What it covers |+|---|---|---|+| NASA | `references/nasa.md` | NEO asteroids, Mars rover, APOD |+| NASA Exoplanet Archive | `references/nasa-exoplanet-archive.md` | Exoplanets, orbital parameters |+| NIST | `references/nist.md` | Physical constants, atomic spectra |+| SDSS | `references/sdss.md` | Galaxy/star spectra, photometry |+| SIMBAD | `references/simbad.md` | Astronomical object catalog |++### Earth & Environmental Sciences+| Database | Reference File | What it covers |+|---|---|---|+| USGS | `references/usgs.md` | Earthquakes, water data |+| NOAA | `references/noaa.md` | Climate, weather station data |+| EPA | `references/epa.md` | Air quality, toxic releases |+| OpenWeatherMap | `references/openweathermap.md` | Weather current/forecast |++### Chemistry & Drugs+| Database | Reference File | What it covers |+|---|---|---|+| PubChem | `references/pubchem.md` | Compounds, properties, synonyms |+| ChEMBL | `references/chembl.md` | Bioactivity, drug discovery |+| DrugBank | `references/drugbank.md` | Drug data, interactions (paid) |+| FDA (OpenFDA) | `references/fda.md` | Drug labels, adverse events, recalls |+| DailyMed | `references/dailymed.md` | Drug labels (NIH/NLM) |+| KEGG | `references/kegg.md` | Pathways, genes, compounds |+| ChEBI | `references/chebi.md` | Chemical entities of biological interest |+| ZINC | `references/zinc.md` | Commercially available compounds, virtual screening |+| BindingDB | `references/bindingdb.md` | Experimentally measured binding affinities |++### Materials Science+| Database | Reference File | What it covers |+|---|---|---|+| Materials Project | `references/materials-project.md` | Band gaps, elastic properties, crystal structures |+| COD | `references/cod.md` | Crystal structures, CIF files |++### Biology & Genomics+| Database | Reference File | What it covers |+|---|---|---|+| Reactome | `references/reactome.md` | Biological pathways, reactions |+| BRENDA | `references/brenda.md` | Enzyme kinetics, catalysis (SOAP) |+| UniProt | `references/uniprot.md` | Protein sequences, function |+| STRING | `references/string.md` | Protein-protein interactions |+| Ensembl | `references/ensembl.md` | Genomes, variants, sequences |+| NCBI Gene | `references/ncbi-gene.md` | Gene information, links |+| NCBI Protein | `references/ncbi-protein.md` | Protein sequences, records |+| NCBI Taxonomy | `references/ncbi-taxonomy.md` | Taxonomic classification |+| GEO (NCBI) | `references/geo.md` | Gene expression datasets |+| GTEx | `references/gtex.md` | Gene expression across tissues |+| PDB | `references/pdb.md` | Protein 3D structures |+| AlphaFold DB | `references/alphafold.md` | Predicted protein structures |+| EMDB | `references/emdb.md` | Electron microscopy maps |+| InterPro | `references/interpro.md` | Protein families, domains |+| BioGRID | `references/biogrid.md` | Protein/genetic interactions |+| Gene Ontology | `references/gene-ontology.md` | GO terms, gene annotations |+| QuickGO | `references/quickgo.md` | GO annotations (EBI, recommended) |+| dbSNP | `references/dbsnp.md` | SNP/variant data |+| SRA | `references/sra.md` | Sequencing run metadata |+| gnomAD | `references/gnomad.md` | Population variant frequencies (POST) |+| UCSC Genome Browser | `references/ucsc-genome.md` | Genome annotations, tracks |+| ENCODE | `references/encode.md` | DNA elements, ChIP-seq, ATAC-seq |+| JASPAR | `references/jaspar.md` | TF binding profiles/motifs |+| Human Protein Atlas | `references/human-protein-atlas.md` | Protein expression across tissues |+| Human Cell Atlas | `references/hca.md` | Single-cell atlas data |+| LINCS L1000 | `references/lincs-l1000.md` | Gene expression signatures (CMap) |+| RummaGEO | `references/rummageo.md` | GEO gene set enrichment (POST) |+| PRIDE | `references/pride.md` | Proteomics data repository |+| Metabolomics Workbench | `references/metabolomics-workbench.md` | Metabolomics studies, metabolites |+| MouseMine | `references/mousemine.md` | Mouse genome informatics |+| ENA | `references/ena.md` | Nucleotide sequences, reads, assemblies, taxonomy (EMBL-EBI) |+| Addgene | `references/addgene.md` | Plasmid repository |++### Disease & Clinical+| Database | Reference File | What it covers |+|---|---|---|+| Open Targets | `references/opentargets.md` | Target-disease associations (POST) |+| COSMIC | `references/cosmic.md` | Somatic mutations in cancer |+| ClinPGx (PharmGKB) | `references/clinpgx.md` | Pharmacogenomics |+| ClinicalTrials.gov | `references/clinicaltrials.md` | Clinical trial registry |+| OMIM | `references/omim.md` | Mendelian disease-gene data |+| ClinVar | `references/clinvar.md` | Variant clinical significance |+| GDC (TCGA) | `references/tcga-gdc.md` | Cancer genomics, mutations (POST) |+| cBioPortal | `references/cbioportal.md` | Cancer study mutations, CNA, expression, clinical data |+| DisGeNET | `references/disgenet.md` | Gene-disease associations |+| GWAS Catalog | `references/gwas-catalog.md` | GWAS SNP-trait associations |+| Monarch Initiative | `references/monarch.md` | Disease-phenotype-gene links |+| HPO | `references/hpo.md` | Human Phenotype Ontology |++### Patents & Regulatory+| Database | Reference File | What it covers |+|---|---|---|+| USPTO | `references/uspto.md` | Patents, trademarks |+| SEC EDGAR | `references/sec-edgar.md` | Company filings (needs User-Agent header) |++### Economics & Finance+| Database | Reference File | What it covers |+|---|---|---|+| FRED | `references/fred.md` | US economic time series |+| Federal Reserve | `references/federal-reserve.md` | Monetary/financial data |+| BEA | `references/bea.md` | GDP, national accounts |+| BLS | `references/bls.md` | Employment, wages, CPI |+| World Bank | `references/worldbank.md` | Development indicators |+| ECB | `references/ecb.md` | Euro exchange rates, monetary stats |+| US Treasury | `references/treasury.md` | Debt, yield curves, fiscal data |+| Alpha Vantage | `references/alphavantage.md` | Stocks, forex, crypto |+| Data Commons | `references/datacommons.md` | Statistical knowledge graph |++### Social Sciences & Demographics+| Database | Reference File | What it covers |+|---|---|---|+| US Census | `references/census.md` | Population, housing, economic surveys |+| Eurostat | `references/eurostat.md` | EU statistics |+| WHO GHO | `references/who.md` | Global health indicators |diff --git a/scientific-skills/database-lookup/references/addgene.md b/scientific-skills/database-lookup/references/addgene.mdnew file mode 100644index 00000000..61feb4c4--- /dev/null+++ b/scientific-skills/database-lookup/references/addgene.md@@ -0,0 +1,38 @@+# Addgene (Plasmid Repository)++## Base URL+```+https://www.addgene.org/api/+```++## Auth+API key required. Register at addgene.org and request API access.+Pass as: `Authorization: Token <your_api_key>`++Load from `.env` as `ADDGENE_API_KEY`.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/plasmids/{addgene_id}/` | Get plasmid details by ID |+| `/plasmids/search/?q={query}` | Search plasmids by keyword |+| `/depositors/{id}/` | Depositor information |+| `/articles/{id}/` | Associated publications |++## Example Calls+```+# Get plasmid details (e.g., pSpCas9)+GET https://www.addgene.org/api/plasmids/12260/+Authorization: Token YOUR_KEY++# Search plasmids+GET https://www.addgene.org/api/plasmids/search/?q=GFP+Authorization: Token YOUR_KEY+```++## Response Format+JSON with plasmid name, backbone, inserts, resistance markers, depositor, sequences, publications.++## Rate Limits+No published limits. Reasonable use expected.diff --git a/scientific-skills/database-lookup/references/alphafold.md b/scientific-skills/database-lookup/references/alphafold.mdnew file mode 100644index 00000000..4e301193--- /dev/null+++ b/scientific-skills/database-lookup/references/alphafold.md@@ -0,0 +1,40 @@+# AlphaFold DB (Predicted Protein Structures)++## Base URL+```+https://alphafold.ebi.ac.uk/api/+```++## Auth+No auth required.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/prediction/{uniprot_accession}` | Prediction metadata by UniProt ID |++## Structure File URLs (direct download)+```+https://alphafold.ebi.ac.uk/files/AF-{UNIPROT}-F1-model_v4.pdb+https://alphafold.ebi.ac.uk/files/AF-{UNIPROT}-F1-model_v4.cif+https://alphafold.ebi.ac.uk/files/AF-{UNIPROT}-F1-predicted_aligned_error_v4.json+```++## Example Calls+```+# Get prediction metadata for EGFR+https://alphafold.ebi.ac.uk/api/prediction/P00533++# Download PDB structure+https://alphafold.ebi.ac.uk/files/AF-P00533-F1-model_v4.pdb++# Download PAE (predicted aligned error)+https://alphafold.ebi.ac.uk/files/AF-P00533-F1-predicted_aligned_error_v4.json+```++## Response Format+JSON for metadata. PDB/mmCIF for structures. PAE as JSON matrix.++## Rate Limits+No strict limits. Use FTP/Cloud for bulk downloads (~200M+ structures).diff --git a/scientific-skills/database-lookup/references/alphavantage.md b/scientific-skills/database-lookup/references/alphavantage.mdnew file mode 100644index 00000000..990f5915--- /dev/null+++ b/scientific-skills/database-lookup/references/alphavantage.md@@ -0,0 +1,261 @@+# Alpha Vantage API Reference++## Overview+Alpha Vantage provides free APIs for real-time and historical stock prices, forex rates, cryptocurrency data, technical indicators, and fundamental data (earnings, balance sheets, income statements). Covers global equities, ETFs, mutual funds, and commodities.++## Base URL+```+https://www.alphavantage.co/query+```++All requests use a single endpoint with `function` parameter to select the data type.++## Authentication+- **API Key: REQUIRED.** Get a free key at https://www.alphavantage.co/support/#api-key+- Pass as query parameter: `&apikey=YOUR_KEY`++## Rate Limits+- **Free tier:** 25 requests per day. 5 calls per minute (as of late 2024; previously was 5/min + 500/day).+- **Premium tiers** available for higher limits (30, 75, 150+ calls/min).+- Exceeding limits returns a polite JSON message, not an error code.++---++## Key Endpoints (by `function` parameter)++### 1. Stock Time Series++#### Intraday+```+GET /query?function=TIME_SERIES_INTRADAY&symbol={symbol}&interval={interval}&apikey={key}+```+| Parameter | Required | Values |+|-----------|----------|--------|+| `symbol` | Yes | Ticker symbol (e.g., `AAPL`, `MSFT`) |+| `interval` | Yes | `1min`, `5min`, `15min`, `30min`, `60min` |+| `outputsize` | No | `compact` (last 100 points, default) or `full` (full history) |+| `adjusted` | No | `true` (default) or `false` |+| `datatype` | No | `json` (default) or `csv` |++**Example:**+```+https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=AAPL&interval=5min&apikey=YOUR_KEY+```++#### Daily+```+GET /query?function=TIME_SERIES_DAILY&symbol=AAPL&apikey=YOUR_KEY+```++#### Daily (Adjusted for splits/dividends)+```+GET /query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=AAPL&outputsize=full&apikey=YOUR_KEY+```++#### Weekly / Monthly+```+GET /query?function=TIME_SERIES_WEEKLY_ADJUSTED&symbol=AAPL&apikey=YOUR_KEY+GET /query?function=TIME_SERIES_MONTHLY_ADJUSTED&symbol=AAPL&apikey=YOUR_KEY+```++**Response (Daily):**+```json+{+ "Meta Data": {+ "1. Information": "Daily Prices (open, high, low, close) and Volumes",+ "2. Symbol": "AAPL",+ "3. Last Refreshed": "2024-11-01",+ "4. Output Size": "Compact",+ "5. Time Zone": "US/Eastern"+ },+ "Time Series (Daily)": {+ "2024-11-01": {+ "1. open": "228.6900",+ "2. high": "229.8600",+ "3. low": "225.8200",+ "4. close": "228.5200",+ "5. volume": "50423432"+ },+ "2024-10-31": {+ "1. open": "229.3400",+ "2. high": "230.2000",+ "3. low": "226.3700",+ "4. close": "227.5500",+ "5. volume": "51235678"+ }+ }+}+```++---++### 2. Stock Search (Symbol Lookup)+```+GET /query?function=SYMBOL_SEARCH&keywords={query}&apikey={key}+```++**Example:**+```+https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=microsoft&apikey=YOUR_KEY+```++**Response:**+```json+{+ "bestMatches": [+ {+ "1. symbol": "MSFT",+ "2. name": "Microsoft Corporation",+ "3. type": "Equity",+ "4. region": "United States",+ "5. marketOpen": "09:30",+ "6. marketClose": "16:00",+ "7. timezone": "UTC-04",+ "8. currency": "USD",+ "9. matchScore": "1.0000"+ }+ ]+}+```++---++### 3. Global Quote (Real-Time Price)+```+GET /query?function=GLOBAL_QUOTE&symbol=AAPL&apikey=YOUR_KEY+```++Returns latest price, volume, change, change percent for a single symbol.++---++### 4. Forex (FX) Rates++#### Real-Time Exchange Rate+```+GET /query?function=CURRENCY_EXCHANGE_RATE&from_currency=USD&to_currency=EUR&apikey=YOUR_KEY+```++#### FX Time Series+```+GET /query?function=FX_DAILY&from_symbol=EUR&to_symbol=USD&apikey=YOUR_KEY+GET /query?function=FX_WEEKLY&from_symbol=EUR&to_symbol=USD&apikey=YOUR_KEY+GET /query?function=FX_MONTHLY&from_symbol=EUR&to_symbol=USD&apikey=YOUR_KEY+GET /query?function=FX_INTRADAY&from_symbol=EUR&to_symbol=USD&interval=5min&apikey=YOUR_KEY+```++---++### 5. Cryptocurrency++#### Real-Time Exchange Rate+```+GET /query?function=CURRENCY_EXCHANGE_RATE&from_currency=BTC&to_currency=USD&apikey=YOUR_KEY+```++#### Crypto Time Series+```+GET /query?function=DIGITAL_CURRENCY_DAILY&symbol=BTC&market=USD&apikey=YOUR_KEY+GET /query?function=DIGITAL_CURRENCY_WEEKLY&symbol=BTC&market=USD&apikey=YOUR_KEY+GET /query?function=DIGITAL_CURRENCY_MONTHLY&symbol=BTC&market=USD&apikey=YOUR_KEY+```++---++### 6. Technical Indicators+```+GET /query?function={INDICATOR}&symbol={symbol}&interval={interval}&time_period={n}&series_type={type}&apikey={key}+```++| Parameter | Required | Description |+|-----------|----------|-------------|+| `function` | Yes | Indicator name (see list below) |+| `symbol` | Yes | Ticker symbol |+| `interval` | Yes | `1min`, `5min`, `15min`, `30min`, `60min`, `daily`, `weekly`, `monthly` |+| `time_period` | Yes* | Number of data points for calculation (e.g., 14 for RSI) |+| `series_type` | Yes* | `close`, `open`, `high`, `low` |++*Required for most indicators; some (like MACD, BBANDS) have additional parameters.++**Common Indicator Functions:**+`SMA`, `EMA`, `WMA`, `DEMA`, `TEMA`, `VWAP`, `RSI`, `MACD`, `STOCH`, `ADX`, `CCI`, `AROON`, `BBANDS`, `AD`, `OBV`, `ATR`, `WILLR`, `MOM`++**Example -- RSI (14-day):**+```+https://www.alphavantage.co/query?function=RSI&symbol=AAPL&interval=daily&time_period=14&series_type=close&apikey=YOUR_KEY+```++**Example -- MACD:**+```+https://www.alphavantage.co/query?function=MACD&symbol=AAPL&interval=daily&series_type=close&apikey=YOUR_KEY+```++---++### 7. Fundamental Data++#### Company Overview+```+GET /query?function=OVERVIEW&symbol=AAPL&apikey=YOUR_KEY+```+Returns: market cap, PE ratio, EPS, dividend yield, 52-week high/low, sector, description, and ~60 other fields.++#### Income Statement+```+GET /query?function=INCOME_STATEMENT&symbol=AAPL&apikey=YOUR_KEY+```++#### Balance Sheet+```+GET /query?function=BALANCE_SHEET&symbol=AAPL&apikey=YOUR_KEY+```++#### Cash Flow+```+GET /query?function=CASH_FLOW&symbol=AAPL&apikey=YOUR_KEY+```++#### Earnings+```+GET /query?function=EARNINGS&symbol=AAPL&apikey=YOUR_KEY+```++Returns both annual and quarterly earnings (EPS, estimated EPS, surprise).++---++### 8. Commodities & Economic Indicators+```+GET /query?function=WTI&interval=monthly&apikey=YOUR_KEY+GET /query?function=BRENT&interval=monthly&apikey=YOUR_KEY+GET /query?function=NATURAL_GAS&interval=monthly&apikey=YOUR_KEY+GET /query?function=COPPER&interval=monthly&apikey=YOUR_KEY+GET /query?function=ALUMINUM&interval=monthly&apikey=YOUR_KEY+GET /query?function=WHEAT&interval=monthly&apikey=YOUR_KEY+GET /query?function=CORN&interval=monthly&apikey=YOUR_KEY+GET /query?function=COTTON&interval=monthly&apikey=YOUR_KEY+GET /query?function=SUGAR&interval=monthly&apikey=YOUR_KEY+GET /query?function=COFFEE&interval=monthly&apikey=YOUR_KEY+```++Economic indicators:+```+GET /query?function=REAL_GDP&interval=quarterly&apikey=YOUR_KEY+GET /query?function=CPI&interval=monthly&apikey=YOUR_KEY+GET /query?function=INFLATION&apikey=YOUR_KEY+GET /query?function=RETAIL_SALES&apikey=YOUR_KEY+GET /query?function=UNEMPLOYMENT&apikey=YOUR_KEY+GET /query?function=FEDERAL_FUNDS_RATE&interval=monthly&apikey=YOUR_KEY+GET /query?function=TREASURY_YIELD&interval=monthly&maturity=10year&apikey=YOUR_KEY+```++---++## Notes+- All values are returned as strings in JSON.+- JSON keys use numbered prefixes (e.g., `"1. open"`, `"2. high"`).+- Time series data is keyed by date/timestamp strings, not arrays.+- When rate limited, the API returns: `{"Note": "Thank you for using Alpha Vantage! ..."}`+- For `outputsize=full`, daily data goes back 20+ years.+- The `datatype=csv` option returns simpler CSV output for any endpoint.+- Free tier is very restrictive (25/day). For production use, a premium key is recommended.diff --git a/scientific-skills/database-lookup/references/bea.md b/scientific-skills/database-lookup/references/bea.mdnew file mode 100644index 00000000..0ffcfa23--- /dev/null+++ b/scientific-skills/database-lookup/references/bea.md@@ -0,0 +1,409 @@+# BEA (Bureau of Economic Analysis) API Reference++## Overview+The Bureau of Economic Analysis API provides access to U.S. economic accounts data including GDP (national income and product accounts -- NIPA), personal income, international trade, industry accounts, and regional economic data. Structured as a single endpoint with dataset-specific parameters.++## Base URL+```+https://apps.bea.gov/api/data+```++## Authentication+- **API Key: REQUIRED.** Register at https://apps.bea.gov/API/signup/+- Pass as query parameter: `&UserID=YOUR_API_KEY`++## Rate Limits+- **100 requests per minute** per API key.+- **100 MB of data per minute** per API key.+- **30 errors per minute** -- exceeding triggers a temporary lockout.+- Daily and monthly limits are not formally published but BEA may throttle heavy use.++## Common Parameters (all requests)+| Parameter | Type | Required | Description |+|-----------|--------|----------|-------------|+| `UserID` | string | Yes | Your BEA API key. |+| `method` | string | Yes | API method (see below). |+| `ResultFormat` | string | No | `JSON` (default) or `XML`. |++---++## Methods++### 1. GetDataSetList+Lists all available datasets.++#### `GET /api/data?method=GetDataSetList&UserID=YOUR_KEY&ResultFormat=JSON`++**Example:**+```+https://apps.bea.gov/api/data?method=GetDataSetList&UserID=YOUR_KEY&ResultFormat=JSON+```++**Response:**+```json+{+ "BEAAPI": {+ "Request": {+ "RequestParam": [+ {"ParameterName": "METHOD", "ParameterValue": "GETDATASETLIST"},+ {"ParameterName": "RESULTFORMAT", "ParameterValue": "JSON"}+ ]+ },+ "Results": {+ "Dataset": [+ {"DatasetName": "NIPA", "DatasetDescription": "Standard NIPA tables"},+ {"DatasetName": "NIUnderlyingDetail", "DatasetDescription": "National Income and Product Accounts Underlying Detail"},+ {"DatasetName": "MNE", "DatasetDescription": "Multinational Enterprises"},+ {"DatasetName": "FixedAssets", "DatasetDescription": "Fixed Assets"},+ {"DatasetName": "ITA", "DatasetDescription": "International Transactions"},+ {"DatasetName": "IIP", "DatasetDescription": "International Investment Position"},+ {"DatasetName": "GDPbyIndustry", "DatasetDescription": "GDP by Industry"},+ {"DatasetName": "Regional", "DatasetDescription": "Regional data"},+ {"DatasetName": "UnderlyingGDPbyIndustry", "DatasetDescription": "Underlying GDP by Industry"},+ {"DatasetName": "InputOutput", "DatasetDescription": "Input-Output Statistics"}+ ]+ }+ }+}+```++---++### 2. GetParameterList+Lists parameters for a specific dataset.++#### `GET /api/data?method=GetParameterList&DatasetName={dataset}&UserID=YOUR_KEY&ResultFormat=JSON`++**Example:**+```+https://apps.bea.gov/api/data?method=GetParameterList&DatasetName=NIPA&UserID=YOUR_KEY&ResultFormat=JSON+```++**Response:**+```json+{+ "BEAAPI": {+ "Results": {+ "Parameter": [+ {+ "ParameterName": "TableName",+ "ParameterDataType": "string",+ "ParameterDescription": "The standard NIPA table identifier",+ "ParameterIsRequiredFlag": "1",+ "ParameterDefaultValue": ""+ },+ {+ "ParameterName": "Frequency",+ "ParameterDataType": "string",+ "ParameterDescription": "A - Annual, Q - Quarterly, M - Monthly",+ "ParameterIsRequiredFlag": "1",+ "ParameterDefaultValue": ""+ },+ {+ "ParameterName": "Year",+ "ParameterDataType": "string",+ "ParameterDescription": "List of year(s) of data to retrieve",+ "ParameterIsRequiredFlag": "1",+ "ParameterDefaultValue": ""+ }+ ]+ }+ }+}+```++---++### 3. GetParameterValues+Lists valid values for a parameter.++#### `GET /api/data?method=GetParameterValues&DatasetName={dataset}&ParameterName={param}&UserID=YOUR_KEY&ResultFormat=JSON`++**Example (list NIPA tables):**+```+https://apps.bea.gov/api/data?method=GetParameterValues&DatasetName=NIPA&ParameterName=TableName&UserID=YOUR_KEY&ResultFormat=JSON+```++**Response (abbreviated):**+```json+{+ "BEAAPI": {+ "Results": {+ "ParamValue": [+ {"TableName": "T10101", "Description": "Table 1.1.1. Percent Change From Preceding Period in Real Gross Domestic Product"},+ {"TableName": "T10106", "Description": "Table 1.1.6. Real Gross Domestic Product, Chained Dollars"},+ {"TableName": "T10105", "Description": "Table 1.1.5. Gross Domestic Product"},+ {"TableName": "T20100", "Description": "Table 2.1. Personal Income and Its Disposition"},+ {"TableName": "T30100", "Description": "Table 3.1. Government Current Receipts and Expenditures"}+ ]+ }+ }+}+```++---++### 4. GetData+The main data retrieval method. Parameters vary by dataset.++#### `GET /api/data?method=GetData&DatasetName={dataset}&{params}&UserID=YOUR_KEY&ResultFormat=JSON`++---++## Dataset-Specific Parameters & Examples++### A. NIPA (National Income and Product Accounts)++**Parameters:**+| Parameter | Type | Required | Description |+|------------|--------|----------|-------------|+| `TableName`| string | Yes | NIPA table identifier (e.g., `T10101`). |+| `Frequency`| string | Yes | `A` (annual), `Q` (quarterly), `M` (monthly). |+| `Year` | string | Yes | Comma-separated years, or `ALL`, or `X` for latest. |++**Example (Real GDP percent change, quarterly, 2022-2024):**+```+https://apps.bea.gov/api/data?method=GetData&DatasetName=NIPA&TableName=T10101&Frequency=Q&Year=2022,2023,2024&UserID=YOUR_KEY&ResultFormat=JSON+```++**Example (GDP levels, annual, all years):**+```+https://apps.bea.gov/api/data?method=GetData&DatasetName=NIPA&TableName=T10105&Frequency=A&Year=ALL&UserID=YOUR_KEY&ResultFormat=JSON+```++**Response:**+```json+{+ "BEAAPI": {+ "Request": { ... },+ "Results": {+ "Statistic": "NIPA Table",+ "UTCProductionTime": "2024-11-01T13:00:00.000",+ "Dimensions": [+ {"Name": "TableName", "DataType": "string", "IsValue": "0"},+ {"Name": "SeriesCode", "DataType": "string", "IsValue": "0"},+ {"Name": "LineNumber", "DataType": "numeric", "IsValue": "0"},+ {"Name": "LineDescription", "DataType": "string", "IsValue": "0"},+ {"Name": "TimePeriod", "DataType": "string", "IsValue": "0"},+ {"Name": "METRIC_NAME", "DataType": "string", "IsValue": "0"},+ {"Name": "CL_UNIT", "DataType": "string", "IsValue": "0"},+ {"Name": "UNIT_MULT", "DataType": "numeric", "IsValue": "0"},+ {"Name": "DataValue", "DataType": "numeric", "IsValue": "1"}+ ],+ "Data": [+ {+ "TableName": "T10101",+ "SeriesCode": "A191RL",+ "LineNumber": "1",+ "LineDescription": "Gross domestic product",+ "TimePeriod": "2022Q1",+ "METRIC_NAME": "Fisher Quantity Index",+ "CL_UNIT": "Percent change",+ "UNIT_MULT": "0",+ "DataValue": "-1.6",+ "NoteRef": "T10101"+ },+ {+ "TableName": "T10101",+ "SeriesCode": "A191RL",+ "LineNumber": "1",+ "LineDescription": "Gross domestic product",+ "TimePeriod": "2022Q2",+ "CL_UNIT": "Percent change",+ "DataValue": "-0.6"+ }+ ],+ "Notes": [+ {"NoteRef": "T10101", "NoteText": "Table 1.1.1. Percent Change From Preceding Period..."}+ ]+ }+ }+}+```++---++### B. Regional (State, County, MSA data)++**Parameters:**+| Parameter | Type | Required | Description |+|--------------|--------|----------|-------------|+| `TableName` | string | Yes | Regional table (e.g., `CAGDP1` for GDP by state). |+| `LineCode` | int | Yes | Line number within the table (specifies the data series). |+| `GeoFips` | string | Yes | FIPS code: `STATE` (all states), `COUNTY` (all counties), `MSA` (all MSAs), or specific FIPS (e.g., `06000` for California). |+| `Year` | string | Yes | Comma-separated years or `ALL` or `LAST5`. |++**Common Regional Tables:**+| Table | Description |+|-------|-------------|+| `CAGDP1` | GDP summary by state |+| `CAGDP2` | GDP by component by state |+| `CAGDP9` | Real GDP by state |+| `CAINC1` | Personal income summary by state |+| `CAINC4` | Personal income and employment by state |+| `CAINC5N` | Personal income by type by state |+| `SAINC1` | State annual personal income |+| `SQINC1` | State quarterly personal income |++**Example (GDP by state, all states, 2020-2023):**+```+https://apps.bea.gov/api/data?method=GetData&DatasetName=Regional&TableName=CAGDP1&LineCode=1&GeoFips=STATE&Year=2020,2021,2022,2023&UserID=YOUR_KEY&ResultFormat=JSON+```++**Example (Personal income for California):**+```+https://apps.bea.gov/api/data?method=GetData&DatasetName=Regional&TableName=CAINC1&LineCode=1&GeoFips=06000&Year=LAST5&UserID=YOUR_KEY&ResultFormat=JSON+```++**Response:**+```json+{+ "BEAAPI": {+ "Results": {+ "Data": [+ {+ "GeoFips": "06000",+ "GeoName": "California",+ "Code": "CAINC1-1",+ "TimePeriod": "2023",+ "CL_UNIT": "Thousands of dollars",+ "UNIT_MULT": "3",+ "DataValue": "3,220,965,123"+ }+ ]+ }+ }+}+```++---++### C. ITA (International Transactions Accounts / Trade)++**Parameters:**+| Parameter | Type | Required | Description |+|-------------|--------|----------|-------------|+| `Indicator` | string | Yes | Indicator code (e.g., `BalGds` for goods balance). |+| `AreaOrCountry` | string | Yes | Country code: `AllCountries`, `China`, `Japan`, etc., or `All`. |+| `Frequency` | string | Yes | `A`, `Q`, `M`. |+| `Year` | string | Yes | Comma-separated years or `ALL`. |++**Common ITA Indicators:**+| Code | Description |+|------|-------------|+| `BalGds` | Balance on goods |+| `BalServ` | Balance on services |+| `BalGdsServ` | Balance on goods and services |+| `BalCurAcct` | Current account balance |+| `ExpGds` | Exports of goods |+| `ImpGds` | Imports of goods |+| `ExpServ` | Exports of services |+| `ImpServ` | Imports of services |++**Example (US trade balance in goods with China, quarterly):**+```+https://apps.bea.gov/api/data?method=GetData&DatasetName=ITA&Indicator=BalGds&AreaOrCountry=China&Frequency=Q&Year=2022,2023,2024&UserID=YOUR_KEY&ResultFormat=JSON+```++---++### D. GDPbyIndustry++**Parameters:**+| Parameter | Type | Required | Description |+|-------------|--------|----------|-------------|+| `TableID` | int | Yes | Table number (1-15). |+| `Industry` | string | Yes | Industry code: `ALL`, or specific (e.g., `11` for agriculture). |+| `Frequency` | string | Yes | `A` or `Q`. |+| `Year` | string | Yes | Comma-separated years or `ALL`. |++**Common Table IDs:**+| ID | Description |+|----|-------------|+| 1 | Value added by industry |+| 5 | Value added by industry as % of GDP |+| 6 | Real value added by industry |+| 7 | Percent change in real value added by industry |++**Example (Value added by all industries, annual):**+```+https://apps.bea.gov/api/data?method=GetData&DatasetName=GDPbyIndustry&TableID=1&Industry=ALL&Frequency=A&Year=2020,2021,2022,2023&UserID=YOUR_KEY&ResultFormat=JSON+```++---++### E. IIP (International Investment Position)++**Parameters:**+| Parameter | Type | Required | Description |+|----------------|--------|----------|-------------|+| `TypeOfInvestment` | string | Yes | `ALL`, `FinAssetsExclFinDeriv`, etc. |+| `Component` | string | Yes | `ALL` or specific component. |+| `Frequency` | string | Yes | `A` or `Q`. |+| `Year` | string | Yes | Comma-separated years or `ALL`. |++**Example:**+```+https://apps.bea.gov/api/data?method=GetData&DatasetName=IIP&TypeOfInvestment=ALL&Component=ALL&Frequency=A&Year=2020,2021,2022,2023&UserID=YOUR_KEY&ResultFormat=JSON+```++---++### F. FixedAssets++**Parameters:**+| Parameter | Type | Required | Description |+|------------|--------|----------|-------------|+| `TableName`| string | Yes | Fixed asset table ID. |+| `Year` | string | Yes | Comma-separated years or `ALL`. |++**Example:**+```+https://apps.bea.gov/api/data?method=GetData&DatasetName=FixedAssets&TableName=FAAt101&Year=ALL&UserID=YOUR_KEY&ResultFormat=JSON+```++---++## Key NIPA Table Reference++| TableName | Description |+|-----------|-------------|+| `T10101` | Percent change in real GDP |+| `T10105` | GDP (current dollars) |+| `T10106` | Real GDP (chained 2017 dollars) |+| `T10107` | GDP price index (percent change) |+| `T10110` | GDP price deflator |+| `T20100` | Personal income and its disposition |+| `T20301` | Personal consumption expenditures by type |+| `T20600` | Personal income and outlays |+| `T30100` | Government current receipts and expenditures |+| `T40100` | Foreign transactions in the national accounts |+| `T50100` | Saving and investment by sector |+| `T50105` | Saving and investment (real) |+| `T60100` | Corporate profits |+| `T70100` | GDP by major type of product |+| `T11000` | Real GDP, expanded detail |+| `T11200` | Contributions to GDP growth |++## GeoFips Reference (Common)+| FIPS | State |+|------|-------|+| `00000` | United States |+| `01000` | Alabama |+| `06000` | California |+| `12000` | Florida |+| `36000` | New York |+| `48000` | Texas |+| `STATE` | All states |+| `COUNTY` | All counties |+| `MSA` | All metropolitan statistical areas |++## Notes+- DataValue in responses is a string, sometimes with commas (e.g., `"3,220,965,123"`). Parse by removing commas.+- `Year=X` returns only the most recent year available.+- `Year=LAST5` returns the 5 most recent years.+- For NIPA tables, results contain multiple line items per table (different GDP components are different LineNumbers).+- The `GetParameterValues` method is essential for discovering valid table names, line codes, and indicator codes for each dataset.+- BEA also provides bulk download files at https://apps.bea.gov/iTable/ for interactive use.+- Time periods for quarterly data use format `2024Q1`, `2024Q2`, etc.+- All monetary values are in U.S. dollars unless otherwise specified. Units are indicated in `CL_UNIT` and `UNIT_MULT` fields.diff --git a/scientific-skills/database-lookup/references/bindingdb.md b/scientific-skills/database-lookup/references/bindingdb.mdnew file mode 100644index 00000000..c009c786--- /dev/null+++ b/scientific-skills/database-lookup/references/bindingdb.md@@ -0,0 +1,85 @@+# BindingDB REST API++## Base URLs+```+https://bindingdb.org/rest/+https://bindingdb.org/axis2/services/BDBService/+```++## Auth+No API key required. Fully open and free.++## Response Format+Default is XML. Append `&response=application/json` to any endpoint for JSON.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/rest/getLigandsByUniprot` | Ligands for a single protein target |+| `/rest/getLigandsByUniprots` | Ligands for multiple protein targets |+| `/rest/getLigandsByPDBs` | Ligands by PDB structure IDs |+| `/rest/getTargetByCompound` | Targets for a compound (SMILES similarity) |++## Endpoint Details++### Get ligands for a single target+```+GET https://bindingdb.org/rest/getLigandsByUniprot?uniprot={UNIPROT_ID};{IC50_cutoff_nM}&response=application/json+```+- `uniprot` — UniProt ID followed by `;` and affinity cutoff in nM+- Returns monomerIDs, SMILES, affinity types (IC50, Ki, Kd), and values+- Returns empty string if UniProt ID not found++Example:+```+https://bindingdb.org/rest/getLigandsByUniprot?uniprot=P35355;100&response=application/json+```++### Get ligands for multiple targets+```+GET https://bindingdb.org/rest/getLigandsByUniprots?uniprot={IDs}&cutoff={nM}&response=application/json+```+- `uniprot` — Comma-separated UniProt IDs+- `cutoff` — Affinity cutoff in nM+- Returns empty string if no matching IDs++Example:+```+https://bindingdb.org/rest/getLigandsByUniprots?uniprot=P00176,P00183&cutoff=10000&response=application/json+```++### Get ligands by PDB structure+```+GET https://bindingdb.org/rest/getLigandsByPDBs?pdb={PDBs}&cutoff={nM}&identity={percent}&response=application/json+```+- `pdb` — Comma-separated PDB IDs+- `cutoff` — Affinity cutoff in nM+- `identity` — Sequence identity cutoff (percent, e.g. 92)++Example:+```+https://bindingdb.org/rest/getLigandsByPDBs?pdb=1Q0L,3ANM&cutoff=100&identity=92&response=application/json+```++### Find targets for a compound (similarity search)+```+GET https://bindingdb.org/rest/getTargetByCompound?smiles={SMILES}&cutoff={similarity}&response=application/json+```+- `smiles` — Compound SMILES (must be URL-encoded)+- `cutoff` — Tanimoto similarity cutoff (decimal, e.g. 0.85)+- Returns similar compounds with their protein targets and affinities++Example:+```+https://bindingdb.org/rest/getTargetByCompound?smiles=CCC%5BN%2B%5D%28C%29%28C%29CCn1nncc1COc1cc%28%3DO%29n%28C%29c2ccccc12&cutoff=0.85&response=application/json+```++## Rate Limits+No documented limit. Keep requests to ~1 per second as a courtesy.++## Notes+- The API surface is small (4 endpoints) but focused on binding affinity data+- For compound-name search, resolve to SMILES first via PubChem, then use `getTargetByCompound`+- For bulk data access, use downloadable TSV/SDF files from https://www.bindingdb.org/bind/chemsearch/marvin/Download.jsp+- Contains ~3.2M binding measurements for ~1.4M compounds and ~11.4K targetsdiff --git a/scientific-skills/database-lookup/references/biogrid.md b/scientific-skills/database-lookup/references/biogrid.mdnew file mode 100644index 00000000..2c394968--- /dev/null+++ b/scientific-skills/database-lookup/references/biogrid.md@@ -0,0 +1,110 @@+# BioGRID API Reference++## Base URL+```+https://webservice.thebiogrid.org/interactions+```++## Authentication+**API key REQUIRED.** Register free at https://webservice.thebiogrid.org/ to obtain an access key.+- Pass as query parameter: `?accesskey=YOUR_ACCESS_KEY`++## Rate Limits+Not formally published. Reasonable usage expected.++## Response Format+JSON (with `&format=json`), tab-delimited (`&format=tab2`), or XML. Default is tab2.++## Key Endpoints++### 1. Search Interactions by Gene+```+GET https://webservice.thebiogrid.org/interactions?accesskey={key}&format=json&searchNames=true&geneList={gene_symbol}&taxId={taxon_id}+```+Example — get TP53 interactions in human:+```+GET https://webservice.thebiogrid.org/interactions?accesskey=YOUR_KEY&format=json&searchNames=true&geneList=TP53&taxId=9606&max=50+```++### 2. Multiple Genes+```+GET https://webservice.thebiogrid.org/interactions?accesskey={key}&format=json&geneList=BRCA1|BRCA2&taxId=9606&max=100+```+Separate gene names with `|` (pipe).++### 3. Filter by Evidence Type+```+GET https://webservice.thebiogrid.org/interactions?accesskey={key}&format=json&geneList=TP53&taxId=9606&evidenceList=physical&max=50+```+Evidence types: `physical`, `genetic`.++### 4. Filter by Experimental System+```+GET https://webservice.thebiogrid.org/interactions?accesskey={key}&format=json&geneList=TP53&taxId=9606&experimentalSystemList=Two-hybrid&max=50+```+Systems include: `Two-hybrid`, `Affinity Capture-MS`, `Co-fractionation`, `Reconstituted Complex`, `Synthetic Lethality`, `Dosage Rescue`, etc.++### 5. Search by BioGRID Interaction ID+```+GET https://webservice.thebiogrid.org/interactions/{interaction_id}?accesskey={key}&format=json+```++### 6. Search by PubMed ID+```+GET https://webservice.thebiogrid.org/interactions?accesskey={key}&format=json&pubmedList=12345678+```++### 7. Inter-species Interactions+```+GET https://webservice.thebiogrid.org/interactions?accesskey={key}&format=json&geneList=TP53&taxId=9606&interSpeciesExcluded=false+```++### 8. Include Interactor Annotations+```+GET https://webservice.thebiogrid.org/interactions?accesskey={key}&format=json&geneList=TP53&taxId=9606&includeInteractors=true&max=50+```++## Common Query Parameters+| Parameter | Description |+|-----------|-------------|+| `geneList` | Gene symbol(s), pipe-separated |+| `taxId` | NCBI taxonomy ID (9606=human, 10090=mouse, 559292=yeast) |+| `max` | Max results to return (default 10000) |+| `start` | Offset for pagination |+| `format` | `json`, `tab2`, `extendedTab2`, `count` |+| `searchNames` | `true` to match official symbols |+| `selfInteractionsExcluded` | `true` to exclude self-interactions |+| `evidenceList` | `physical` or `genetic` |+| `throughputTag` | `low` or `high` |++## JSON Response Structure+```json+{+ "12345": {+ "BIOGRID_INTERACTION_ID": 12345,+ "ENTREZ_GENE_A": "7157",+ "ENTREZ_GENE_B": "672",+ "OFFICIAL_SYMBOL_A": "TP53",+ "OFFICIAL_SYMBOL_B": "BRCA1",+ "EXPERIMENTAL_SYSTEM": "Two-hybrid",+ "EXPERIMENTAL_SYSTEM_TYPE": "physical",+ "PUBMED_ID": "9482880",+ "ORGANISM_A": 9606,+ "ORGANISM_B": 9606,+ "THROUGHPUT": "Low Throughput",+ "SCORE": "-"+ }+}+```++## Count-Only Query+```+GET https://webservice.thebiogrid.org/interactions?accesskey={key}&format=count&geneList=TP53&taxId=9606+```+Returns just the integer count.++## Notes+- BioGRID aggregates curated interaction data from literature.+- Covers physical (protein-protein) and genetic interactions.+- For bulk data, use BioGRID downloads (tab-delimited files) at https://downloads.thebiogrid.org/.+- Cross-reference with STRING for combined interaction evidence.diff --git a/scientific-skills/database-lookup/references/bls.md b/scientific-skills/database-lookup/references/bls.mdnew file mode 100644index 00000000..18aac917--- /dev/null+++ b/scientific-skills/database-lookup/references/bls.md@@ -0,0 +1,235 @@+# Bureau of Labor Statistics (BLS) Public Data API++## Base URL++```+https://api.bls.gov/publicAPI/v2+```++Version 1 (no key): `https://api.bls.gov/publicAPI/v1`++## Authentication++**API key optional but strongly recommended.** Register at https://data.bls.gov/registrationEngine/++- **V1 (no key):** Limited to 25 requests/day, 10-year date range, 25 series per query.+- **V2 (with key):** 500 requests/day, 20-year date range, 50 series per query, plus catalog data and calculations.++## Key Endpoints++### 1. Get Series Data (POST -- primary method)+```+POST /timeseries/data/+```+Content-Type: `application/json`++**Request body:**+```json+{+ "seriesid": ["CUUR0000SA0", "LNS14000000"],+ "startyear": "2020",+ "endyear": "2024",+ "registrationkey": "YOUR_KEY",+ "catalog": true,+ "calculations": true,+ "annualaverage": true,+ "aspects": true+}+```++| Field | Required | V1 | V2 | Description |+|------------------|----------|-----|-----|------------------------------------------------------|+| seriesid | Yes | Yes | Yes | Array of series IDs (max 25 v1 / 50 v2) |+| startyear | Yes | Yes | Yes | 4-digit start year |+| endyear | Yes | Yes | Yes | 4-digit end year |+| registrationkey | No | No | Yes | API key (required for v2 features) |+| catalog | No | No | Yes | `true` to include series metadata |+| calculations | No | No | Yes | `true` to include net/pct changes |+| annualaverage | No | No | Yes | `true` to include annual averages |+| aspects | No | No | Yes | `true` to include footnotes and aspects |++### 2. Get Single Series Data (GET -- convenience)+```+GET /timeseries/data/{seriesID}+```+Example:+```+https://api.bls.gov/publicAPI/v2/timeseries/data/CUUR0000SA0?registrationkey=YOUR_KEY&startyear=2022&endyear=2024+```++### 3. Latest Data (GET -- no date range)+```+GET /timeseries/data/{seriesID}+```+Without startyear/endyear, returns the most recent 3 years.++Example:+```+https://api.bls.gov/publicAPI/v2/timeseries/data/LNS14000000?registrationkey=YOUR_KEY+```++## Common Series IDs++### Consumer Price Index (CPI)+| Series ID | Description |+|-----------------|---------------------------------------------------|+| CUUR0000SA0 | CPI-U All Items, US City Avg, Not Seasonally Adj |+| CUSR0000SA0 | CPI-U All Items, US City Avg, Seasonally Adj |+| CUUR0000SAF1 | CPI-U Food, US City Avg |+| CUUR0000SETB01 | CPI-U Gasoline (all types) |+| CUUR0000SAH1 | CPI-U Shelter |+| CUUR0000SAM | CPI-U Medical Care |++CPI series ID structure: `CU` + `U/S` (unadj/adj) + `R/S` (revision) + area code + item code++### Employment / Unemployment (Current Population Survey)+| Series ID | Description |+|-----------------|---------------------------------------------------|+| LNS14000000 | Unemployment Rate (seasonally adjusted) |+| LNS11000000 | Civilian Labor Force Level |+| LNS12000000 | Employment Level |+| LNS13000000 | Unemployment Level |+| LNS14000006 | Unemployment Rate - Black or African American |+| LNS14000009 | Unemployment Rate - Hispanic or Latino |++### Employment (Current Employment Statistics / Nonfarm Payrolls)+| Series ID | Description |+|-----------------|---------------------------------------------------|+| CES0000000001 | Total Nonfarm Employment (seasonally adj) |+| CES0500000003 | Average Hourly Earnings, Total Private |+| CES0500000002 | Average Weekly Hours, Total Private |++### Producer Price Index (PPI)+| Series ID | Description |+|-----------------|---------------------------------------------------|+| WPSFD4 | PPI Final Demand |+| WPUFD49104 | PPI Final Demand less Foods & Energy |++### Employment Cost Index (ECI)+| Series ID | Description |+|-----------------|---------------------------------------------------|+| CIU1010000000000A | ECI Total Compensation, All Civilians |++### Occupational Employment & Wage Statistics (OEWS)+| Series ID Pattern | Description |+|-------------------|-------------------------------------------------|+| OEUM003342000000011-0000 | Example: specific occupation/area combo |++OEWS series IDs are complex. Use the BLS Series ID finder: https://data.bls.gov/cgi-bin/srgate++## Series ID Structure++BLS series IDs encode survey, seasonal adjustment, area, industry, and item information. Key survey prefixes:++| Prefix | Survey |+|--------|------------------------------------------------|+| CU | Consumer Price Index |+| LN | Current Population Survey (Labor Force) |+| CE | Current Employment Statistics |+| WP | Producer Price Index |+| EI | Employment Cost Index / National Compensation |+| OE | Occupational Employment & Wage Statistics |+| LA | Local Area Unemployment Statistics |+| SM | State and Metro Area Employment (CES) |+| JT | Job Openings and Labor Turnover (JOLTS) |++## Response Format++### Standard response+```json+{+ "status": "REQUEST_SUCCEEDED",+ "responseTime": 85,+ "message": [],+ "Results": {+ "series": [+ {+ "seriesID": "CUUR0000SA0",+ "catalog": {+ "series_title": "All items in U.S. city average, all urban consumers, not seasonally adjusted",+ "series_id": "CUUR0000SA0",+ "seasonality": "Not Seasonally Adjusted",+ "survey_name": "Consumer Price Index - All Urban Consumers",+ "survey_abbreviation": "CU",+ "measure_data_type": "All items",+ "area": "U.S. city average",+ "item": "All items"+ },+ "data": [+ {+ "year": "2024",+ "period": "M01",+ "periodName": "January",+ "latest": "true",+ "value": "308.417",+ "footnotes": [{}],+ "calculations": {+ "net_changes": {+ "1": "0.5",+ "3": "1.2",+ "6": "2.1",+ "12": "3.1"+ },+ "pct_changes": {+ "1": "0.2",+ "3": "0.4",+ "6": "0.7",+ "12": "3.1"+ }+ }+ },+ {+ "year": "2023",+ "period": "M12",+ "periodName": "December",+ "value": "306.746",+ "footnotes": [{}]+ }+ ]+ }+ ]+ }+}+```++### Key fields in data objects+- `year`: 4-digit year string+- `period`: `M01`-`M12` (monthly), `Q01`-`Q05` (quarterly), `A01` (annual), `S01`-`S03` (semi-annual)+- `periodName`: Human-readable period name+- `value`: String (convert to float for calculations)+- `latest`: `"true"` on the most recent observation only+- `calculations`: Only present when `calculations: true` in request (V2). Contains `net_changes` and `pct_changes` over 1, 3, 6, 12 month spans.+- `footnotes`: Array of footnote objects++### Error response+```json+{+ "status": "REQUEST_NOT_PROCESSED",+ "responseTime": 10,+ "message": ["No data available for the given series and date range."],+ "Results": {+ "series": []+ }+}+```++## Rate Limits++| Feature | V1 (no key) | V2 (with key) |+|---------------------|-----------------|------------------|+| Daily query limit | 25 requests | 500 requests |+| Series per query | 25 | 50 |+| Years per query | 10 | 20 |+| Catalog data | No | Yes |+| Calculations | No | Yes |+| Annual averages | No | Yes |+| Net/pct changes | No | Yes |++## Notes++- BLS strongly prefers POST requests for data retrieval. The GET endpoint is a convenience wrapper.+- Period `M13` represents the annual average (only present when `annualaverage: true`).+- All `value` fields are strings. Missing data is typically omitted (the observation simply won't appear).+- For CPI percent change (inflation rate), you can either calculate from raw index values or use the V2 `calculations` feature which provides pre-computed 12-month percent changes.+- The BLS website has a Series ID finder tool for constructing IDs: https://data.bls.gov/cgi-bin/srgate+- Bulk data is available for download at https://download.bls.gov/pub/time.series/ organized by survey prefix.diff --git a/scientific-skills/database-lookup/references/brenda.md b/scientific-skills/database-lookup/references/brenda.mdnew file mode 100644index 00000000..bed1aff8--- /dev/null+++ b/scientific-skills/database-lookup/references/brenda.md@@ -0,0 +1,71 @@+# BRENDA Enzyme Database (SOAP API)++## Important: BRENDA uses SOAP, not REST. Requires Python with `zeep` library.++## SOAP Endpoint+```+https://www.brenda-enzymes.org/soap/brenda_zeep.wsdl+```++## Auth+Free registration required at https://www.brenda-enzymes.org/register.php+Credentials (email + SHA-256 hashed password) passed with every call.++## Key SOAP Methods++All methods take `email`, `password` (SHA-256), and `ecNumber` as base parameters.++| Method | Description |+|--------|-------------|+| `getKmValue` | Michaelis constant (Km) |+| `getTurnoverNumber` | Turnover number (kcat) |+| `getKcatKmValue` | Catalytic efficiency (kcat/Km) |+| `getKiValue` | Inhibition constant (Ki) |+| `getIc50Value` | IC50 values |+| `getSpecificActivity` | Specific activity |+| `getPhOptimum` | pH optimum |+| `getTemperatureOptimum` | Temperature optimum |+| `getSubstrate` | Substrates |+| `getProduct` | Products |+| `getInhibitors` | Inhibitors |+| `getCofactor` | Cofactors |+| `getOrganism` | Source organisms |+| `getReaction` | Reaction equations |+| `getSequence` | Protein sequences |+| `getDisease` | Associated diseases |++## Parameter Syntax+`fieldName*value` format. Empty value = return all.++```+ecNumber*1.1.1.1 # Required: EC number+organism*Homo sapiens # Optional: filter by organism+substrate*ethanol # Optional: filter by substrate+kmValue* # Return field (empty = all)+```++## Python Example+```python+import hashlib+from zeep import Client++client = Client("https://www.brenda-enzymes.org/soap/brenda_zeep.wsdl")+email = "[email protected]"+password = hashlib.sha256("your_password".encode()).hexdigest()++# Get Km values for alcohol dehydrogenase+result = client.service.getKmValue(+ email, password,+ "ecNumber*1.1.1.1", "organism*Homo sapiens",+ "kmValue*", "substrate*", "literature*"+)+```++## Response Format+Returns string parsed with `!` (record separator) and `#`/`*` (field separators). Must be parsed manually.++## Rate Limits+No published limits. SOAP responses can take 1-5 seconds. Be respectful — free academic service.++## Note for this skill+Since BRENDA uses SOAP (not REST), making calls requires writing and executing a Python script with `zeep`. Use Bash to run the script rather than WebFetch.diff --git a/scientific-skills/database-lookup/references/cbioportal.md b/scientific-skills/database-lookup/references/cbioportal.mdnew file mode 100644index 00000000..697f09a0--- /dev/null+++ b/scientific-skills/database-lookup/references/cbioportal.md@@ -0,0 +1,206 @@+# cBioPortal API++## Base URL+```+https://www.cbioportal.org/api+```++## Auth+No authentication for the public instance. Private/institutional instances (e.g. `genie.cbioportal.org`) require a data access token via `Authorization: Bearer <token>` header.++## Common Headers+```+Accept: application/json+Content-Type: application/json+```++## Common Query Parameters++Most list endpoints support these:++| Parameter | Type | Description | Default |+|---|---|---|---|+| `projection` | string | Detail level: `ID`, `SUMMARY`, `DETAILED`, `META` | `SUMMARY` |+| `pageNumber` | int | Zero-based page index | `0` |+| `pageSize` | int | Results per page | `10000000` |+| `sortBy` | string | Property to sort by | varies |+| `direction` | string | `ASC` or `DESC` | `ASC` |++## Key Endpoints++### Studies++| Method | Endpoint | Description |+|---|---|---|+| GET | `/studies` | List all cancer studies |+| GET | `/studies/{studyId}` | Get a single study |+| POST | `/studies/fetch` | Fetch multiple studies by ID |++Example:+```+GET https://www.cbioportal.org/api/studies?projection=SUMMARY&pageSize=10+GET https://www.cbioportal.org/api/studies/brca_tcga+```++Response fields: `studyId`, `name`, `description`, `cancerTypeId`, `pmid`, `citation`, `allSampleCount`, `referenceGenome`, `publicStudy`, `importDate`++### Cancer Types++| Method | Endpoint | Description |+|---|---|---|+| GET | `/cancer-types` | List all cancer types |+| GET | `/cancer-types/{cancerTypeId}` | Get one cancer type |++Response fields: `cancerTypeId`, `name`, `shortName`, `dedicatedColor`, `parent`++### Genes++| Method | Endpoint | Description |+|---|---|---|+| GET | `/genes` | List all genes (paginated) |+| GET | `/genes/{geneId}` | Gene by Hugo symbol or Entrez ID |+| GET | `/genes/{geneId}/aliases` | Gene aliases |+| POST | `/genes/fetch` | Fetch multiple genes |++Example:+```+GET https://www.cbioportal.org/api/genes/TP53+```+Response: `{"entrezGeneId": 7157, "hugoGeneSymbol": "TP53", "type": "protein-coding"}`++### Molecular Profiles++| Method | Endpoint | Description |+|---|---|---|+| GET | `/molecular-profiles` | All profiles across all studies |+| GET | `/studies/{studyId}/molecular-profiles` | Profiles in a study |+| GET | `/molecular-profiles/{molecularProfileId}` | Single profile |++Profile types (`molecularAlterationType`): `MUTATION_EXTENDED`, `COPY_NUMBER_ALTERATION`, `MRNA_EXPRESSION`, `PROTEIN_LEVEL`, `METHYLATION`++Example:+```+GET https://www.cbioportal.org/api/studies/brca_tcga/molecular-profiles+```++### Mutations++| Method | Endpoint | Description |+|---|---|---|+| GET | `/molecular-profiles/{profileId}/mutations` | Mutations in a profile |+| POST | `/molecular-profiles/{profileId}/mutations/fetch` | Filtered mutation query |+| POST | `/mutations/fetch` | Multi-profile mutation fetch |++Parameters for GET:+| Parameter | Type | Description |+|---|---|---|+| `sampleListId` | string | Sample list to query (e.g. `brca_tcga_all`) |+| `entrezGeneId` | int | Filter by gene |+| `projection` | string | `SUMMARY`, `DETAILED`, `ID`, `META` |++Example — TP53 mutations in TCGA breast cancer:+```+GET https://www.cbioportal.org/api/molecular-profiles/brca_tcga_mutations/mutations?sampleListId=brca_tcga_all&entrezGeneId=7157&projection=DETAILED+```++POST body for multi-gene fetch:+```json+{+ "sampleListId": "brca_tcga_all",+ "entrezGeneIds": [7157, 672]+}+```++Response fields: `entrezGeneId`, `sampleId`, `patientId`, `proteinChange`, `mutationType`, `mutationStatus`, `chr`, `startPosition`, `endPosition`, `referenceAllele`, `variantAllele`, `variantType`, `ncbiBuild`, `tumorAltCount`, `tumorRefCount`++### Copy Number Alterations++| Method | Endpoint | Description |+|---|---|---|+| GET | `/molecular-profiles/{profileId}/discrete-copy-number` | CNA data |+| POST | `/molecular-profiles/{profileId}/discrete-copy-number/fetch` | Filtered CNA query |+| POST | `/discrete-copy-number/fetch` | Multi-profile CNA fetch |++### Molecular Data (expression, methylation)++| Method | Endpoint | Description |+|---|---|---|+| GET | `/molecular-profiles/{profileId}/molecular-data` | Expression/methylation data |+| POST | `/molecular-data/fetch` | Multi-profile molecular data fetch |++### Clinical Data++| Method | Endpoint | Description |+|---|---|---|+| GET | `/studies/{studyId}/clinical-data` | Clinical data for a study |+| POST | `/clinical-data/fetch` | Multi-study clinical data |+| GET | `/studies/{studyId}/clinical-attributes` | Available clinical attributes |++Parameters for GET:+| Parameter | Type | Description |+|---|---|---|+| `clinicalDataType` | string | `PATIENT` or `SAMPLE` |+| `attributeId` | string | e.g. `OS_STATUS`, `OS_MONTHS`, `CANCER_TYPE` |++Example:+```+GET https://www.cbioportal.org/api/studies/brca_tcga/clinical-data?clinicalDataType=PATIENT&attributeId=OS_STATUS&projection=SUMMARY+```++### Patients & Samples++| Method | Endpoint | Description |+|---|---|---|+| GET | `/studies/{studyId}/patients` | Patients in a study |+| GET | `/studies/{studyId}/samples` | Samples in a study |+| POST | `/patients/fetch` | Multi-study patient fetch |+| POST | `/samples/fetch` | Multi-study sample fetch |++### Sample Lists++| Method | Endpoint | Description |+|---|---|---|+| GET | `/studies/{studyId}/sample-lists` | Predefined sample groups |+| GET | `/sample-lists/{sampleListId}` | Single sample list |++### Gene Panels++| Method | Endpoint | Description |+|---|---|---|+| GET | `/gene-panels` | All gene panels |+| GET | `/gene-panels/{genePanelId}` | Panel details with gene list |+| POST | `/gene-panel-data/fetch` | Which panels cover which samples |++### Treatments++| Method | Endpoint | Description |+|---|---|---|+| POST | `/treatments/patient` | Patient-level treatment data |+| POST | `/treatments/sample` | Sample-level treatment data |++### System++| Method | Endpoint | Description |+|---|---|---|+| GET | `/health` | Server health check |+| GET | `/info` | Portal version, DB schema version |++## Typical Workflow++1. **Find studies**: `GET /studies` — browse available cancer studies, get `studyId` values+2. **Get molecular profiles**: `GET /studies/{studyId}/molecular-profiles` — find profile IDs (e.g. `brca_tcga_mutations`, `brca_tcga_gistic`)+3. **Get sample lists**: `GET /studies/{studyId}/sample-lists` — find sample list IDs (e.g. `brca_tcga_all`, `brca_tcga_sequenced`)+4. **Query data**: Use the profile ID and sample list ID to fetch mutations, CNA, expression, or clinical data++## Rate Limits++No published rate limits. Be courteous — avoid hammering with many concurrent requests. For bulk data needs, cBioPortal offers downloadable datasets at https://docs.cbioportal.org/downloads/.++## Tips++- **Study IDs** follow a pattern: `{cancer_type}_{source}` (e.g. `brca_tcga`, `luad_tcga`, `prad_mskcc_2017`)+- **Molecular profile IDs** extend the study ID: `{studyId}_mutations`, `{studyId}_gistic`, `{studyId}_rna_seq_v2_mrna`+- Use `projection=DETAILED` to get the richest response including nested objects+- POST `/fetch` endpoints are for batch queries across multiple studies, genes, or samples — they're the most flexible way to query+- Gene lookup accepts both Hugo symbols (`TP53`) and Entrez IDs (`7157`)+- The Swagger UI at https://www.cbioportal.org/api/swagger-ui/index.html documents every endpoint interactivelydiff --git a/scientific-skills/database-lookup/references/census.md b/scientific-skills/database-lookup/references/census.mdnew file mode 100644index 00000000..a6835659--- /dev/null+++ b/scientific-skills/database-lookup/references/census.md@@ -0,0 +1,251 @@+# US Census Bureau API Reference++## Overview+The US Census Bureau API provides access to hundreds of datasets including the American Community Survey (ACS), Decennial Census, Economic Census, Population Estimates, and more. It is the primary source for US demographic, social, economic, and housing data.++## Base URL+```+https://api.census.gov/data+```++## Authentication+- **API Key: REQUIRED (free).** Register at https://api.census.gov/data/key_signup.html+- Pass as query parameter: `&key=YOUR_KEY`+- Requests without a key are throttled to ~500/day. With a key, limits are much higher.++## Rate Limits+- Without key: approximately 500 requests per day.+- With key: up to 500 requests per day per IP is the documented soft limit, but in practice the key grants significantly more.+- No formal per-minute rate limit documented; keep automated requests to a few per second.++---++## Key Datasets and URL Patterns++The general URL pattern is:+```+https://api.census.gov/data/{year}/{dataset}?get={variables}&for={geography}&key=YOUR_KEY+```++### Major Dataset Paths++| Dataset | Path Segment | Description |+|---------|-------------|-------------|+| ACS 5-Year Detailed Tables | `acs/acs5` | 5-year estimates, most geographies (2009-present) |+| ACS 1-Year Detailed Tables | `acs/acs1` | 1-year estimates, areas 65k+ pop (2005-present) |+| ACS 5-Year Subject Tables | `acs/acs5/subject` | Precomputed subject tables |+| ACS 5-Year Data Profiles | `acs/acs5/profile` | Social/economic/housing profiles |+| Decennial Census (2020) | `dec/dhc` | Demographic and Housing Characteristics |+| Decennial Census (2020 PL) | `dec/pl` | Redistricting data (PL 94-171) |+| Decennial Census (2010) | `dec/sf1` | Summary File 1 |+| Population Estimates | `pep/population` | Annual population estimates |+| Economic Census | `ecnbasic` | Economic Census (2017, 2022) |+| County Business Patterns | `cbp` | Business establishment counts |+| Annual Business Survey | `abscs` | Business characteristics |++---++## Key Endpoints++### 1. ACS 5-Year Estimates (Most Common)++```+GET /data/{year}/acs/acs5?get={variables}&for={geography}&key=YOUR_KEY+```++| Parameter | Required | Description |+|-----------|----------|-------------|+| `get` | Yes | Comma-separated variable names (e.g., `NAME,B01001_001E`) |+| `for` | Yes | Target geography (e.g., `state:*`, `county:*`, `tract:*`) |+| `in` | Sometimes | Parent geography for sub-state levels |+| `key` | Yes | Your API key |++**Example (total population for all states, 2022 ACS 5-year):**+```+https://api.census.gov/data/2022/acs/acs5?get=NAME,B01001_001E&for=state:*&key=YOUR_KEY+```++**Example (median household income for all counties in California):**+```+https://api.census.gov/data/2022/acs/acs5?get=NAME,B19013_001E&for=county:*&in=state:06&key=YOUR_KEY+```++**Example (population by race for a specific tract):**+```+https://api.census.gov/data/2022/acs/acs5?get=NAME,B02001_001E,B02001_002E,B02001_003E&for=tract:000100&in=state:06&in=county:075&key=YOUR_KEY+```++**Response (JSON array of arrays, first row is headers):**+```json+[+ ["NAME", "B01001_001E", "state"],+ ["Alabama", "5024279", "01"],+ ["Alaska", "733391", "02"],+ ["Arizona", "7151502", "04"]+]+```++### 2. ACS 1-Year Estimates++```+GET /data/{year}/acs/acs1?get={variables}&for={geography}&key=YOUR_KEY+```+Same parameters as ACS 5-year. Only available for geographies with 65,000+ population.++**Example (poverty rate for all states):**+```+https://api.census.gov/data/2022/acs/acs1?get=NAME,B17001_001E,B17001_002E&for=state:*&key=YOUR_KEY+```++### 3. ACS Data Profiles++```+GET /data/{year}/acs/acs5/profile?get={variables}&for={geography}&key=YOUR_KEY+```+Uses `DP` prefix variables with precomputed percentages.++**Example (educational attainment profile):**+```+https://api.census.gov/data/2022/acs/acs5/profile?get=NAME,DP02_0068PE&for=state:*&key=YOUR_KEY+```++### 4. Decennial Census 2020++```+GET /data/2020/dec/dhc?get={variables}&for={geography}&key=YOUR_KEY+```++**Example (total population by state, 2020 Census):**+```+https://api.census.gov/data/2020/dec/dhc?get=NAME,P1_001N&for=state:*&key=YOUR_KEY+```++### 5. Decennial Census 2010++```+GET /data/2010/dec/sf1?get={variables}&for={geography}&key=YOUR_KEY+```++**Example:**+```+https://api.census.gov/data/2010/dec/sf1?get=NAME,P001001&for=state:*&key=YOUR_KEY+```++### 6. Discover Available Variables++```+GET /data/{year}/{dataset}/variables.json+```++**Example:**+```+https://api.census.gov/data/2022/acs/acs5/variables.json+```+Returns a large JSON object listing all available variables with labels and concepts.++### 7. Discover Available Geographies++```+GET /data/{year}/{dataset}/geography.json+```++**Example:**+```+https://api.census.gov/data/2022/acs/acs5/geography.json+```++### 8. List Available Datasets++```+GET /data.json+```++Returns all available datasets with their titles, years, and API endpoints.++---++## Geography Syntax++| Level | `for` syntax | `in` requirement |+|-------|-------------|-----------------|+| Nation | `us:1` or `us:*` | None |+| State | `state:06` or `state:*` | None |+| County | `county:075` or `county:*` | `in=state:06` (optional for all) |+| County Subdivision | `county subdivision:*` | `in=state:XX&in=county:YYY` |+| Census Tract | `tract:*` | `in=state:XX&in=county:YYY` |+| Block Group | `block group:*` | `in=state:XX&in=county:YYY&in=tract:ZZZZZZ` |+| Place (city) | `place:*` | `in=state:XX` |+| Metro Area (CBSA) | `metropolitan statistical area/micropolitan statistical area:*` | None |+| ZIP Code Tab Area | `zip code tabulation area:*` | None |++State FIPS codes: `01`=AL, `02`=AK, `04`=AZ, `05`=AR, `06`=CA, `08`=CO, `09`=CT, `10`=DE, `11`=DC, `12`=FL, `13`=GA, `15`=HI, `16`=ID, `17`=IL, `18`=IN, `19`=IA, `20`=KS, `21`=KY, `22`=LA, `23`=ME, `24`=MD, `25`=MA, `26`=MI, `27`=MN, `28`=MS, `29`=MO, `30`=MT, `31`=NE, `32`=NV, `33`=NH, `34`=NJ, `35`=NM, `36`=NY, `37`=NC, `38`=ND, `39`=OH, `40`=OK, `41`=OR, `42`=PA, `44`=RI, `45`=SC, `46`=SD, `47`=TN, `48`=TX, `49`=UT, `50`=VT, `51`=VA, `53`=WA, `54`=WV, `55`=WI, `56`=WY++---++## Common Variable Codes++### ACS Detailed Tables (B-tables)+| Variable | Description |+|----------|-------------|+| `B01001_001E` | Total population |+| `B01002_001E` | Median age |+| `B02001_001E` | Total (race) |+| `B02001_002E` | White alone |+| `B02001_003E` | Black or African American alone |+| `B03001_003E` | Hispanic or Latino |+| `B19013_001E` | Median household income |+| `B19001_001E` | Household income (total, for distribution) |+| `B25077_001E` | Median home value |+| `B25064_001E` | Median gross rent |+| `B17001_001E` | Poverty status (total) |+| `B17001_002E` | Poverty status (below poverty) |+| `B15003_022E` | Bachelor's degree |+| `B15003_023E` | Master's degree |+| `B15003_025E` | Doctorate degree |+| `B23025_005E` | Unemployed (civilian labor force) |+| `B25001_001E` | Total housing units |+| `B08301_001E` | Means of transportation to work (total) |++Variable naming: `B{table}_{seq}E` for estimates, `B{table}_{seq}M` for margins of error.++### ACS Data Profile Variables (DP-tables)+| Variable | Description |+|----------|-------------|+| `DP02_0068PE` | % with bachelor's degree or higher |+| `DP03_0062E` | Median household income |+| `DP03_0128PE` | % below poverty level |+| `DP04_0089E` | Median home value |+| `DP05_0001E` | Total population |++### Decennial 2020 (DHC)+| Variable | Description |+|----------|-------------|+| `P1_001N` | Total population |+| `P1_003N` | White alone |+| `P1_004N` | Black or African American alone |+| `H1_001N` | Total housing units |+| `H1_002N` | Occupied housing units |++---++## Response Format+All data responses are **JSON arrays of arrays**. The first array is always the column headers; subsequent arrays are data rows.++```json+[+ ["NAME", "B01001_001E", "B19013_001E", "state", "county"],+ ["Los Angeles County, California", "10014009", "73538", "06", "037"],+ ["San Diego County, California", "3298634", "85750", "06", "073"]+]+```++- Values are strings (even numeric ones).+- Missing or unavailable data may appear as `null`, `"-"`, or `"N"`.+- Annotation values: `"-"` (too few sample cases), `"N"` (not available), `"(X)"` (not applicable).++## Notes+- Always include `NAME` in your `get` parameter to get human-readable geography labels.+- The `E` suffix means "Estimate"; use `M` suffix for Margin of Error (e.g., `B19013_001M`).+- Variable discovery: browse https://api.census.gov/data/{year}/acs/acs5/variables.html for a searchable table.+- For ACS, 5-year estimates cover all geographies but are less current; 1-year covers only larger geographies but is more recent.+- Group endpoint: `?get=group(B01001)` retrieves all variables in a table group.diff --git a/scientific-skills/database-lookup/references/chebi.md b/scientific-skills/database-lookup/references/chebi.mdnew file mode 100644index 00000000..b0257e17--- /dev/null+++ b/scientific-skills/database-lookup/references/chebi.md@@ -0,0 +1,103 @@+# ChEBI (Chemical Entities of Biological Interest) API Reference++## Base URLs+- **OLS (Ontology Lookup Service) API**: `https://www.ebi.ac.uk/ols4/api`+- **ChEBI Web Services (SOAP)**: `https://www.ebi.ac.uk/webservices/chebi/2.0/test` (SOAP/XML only)+- **ChEBI LibChebi REST (limited)**: entity pages at `https://www.ebi.ac.uk/chebi`++## Authentication+None required. All endpoints are public.++## Rate Limits+No published hard limits. EBI general guidance: reasonable usage.++## Important Note+ChEBI's primary web service is **SOAP-based** (XML), not REST. For REST-style JSON access, use the **EBI OLS4 API** which indexes ChEBI as an ontology.++---++## OLS4 API Endpoints (Recommended for REST/JSON)++### 1. Search ChEBI Terms+```+GET https://www.ebi.ac.uk/ols4/api/search?q={query}&ontology=chebi+```+Example:+```+GET https://www.ebi.ac.uk/ols4/api/search?q=aspirin&ontology=chebi+```+Returns JSON with matching ChEBI terms, IDs, definitions, synonyms.++### 2. Lookup by ChEBI ID+```+GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_{id}+```+Example:+```+GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_15365+```+Returns full term details: name, definition, synonyms, xrefs, relationships.++### 3. Get Term by Short Form+```+GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FCHEBI_{id}+```+(Double-encoded IRI in path.)++### 4. Term Hierarchy — Parents+```+GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FCHEBI_{id}/parents+```++### 5. Term Hierarchy — Children+```+GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FCHEBI_{id}/children+```++### 6. Ontology Metadata+```+GET https://www.ebi.ac.uk/ols4/api/ontologies/chebi+```++## OLS Search Response Format+```json+{+ "response": {+ "numFound": 5,+ "docs": [+ {+ "id": "chebi:15365",+ "iri": "http://purl.obolibrary.org/obo/CHEBI_15365",+ "label": "aspirin",+ "description": ["A member of the class of benzoic acids..."],+ "short_form": "CHEBI_15365",+ "obo_id": "CHEBI:15365",+ "ontology_name": "chebi",+ "type": "class"+ }+ ]+ }+}+```++## ChEBI SOAP Web Service (Alternative)+If you need chemical-specific data (formula, mass, structure, InChI), use the SOAP service:+- WSDL: `https://www.ebi.ac.uk/webservices/chebi/2.0/webservice?wsdl`+- Operations: `getCompleteEntity`, `getLiteEntity`, `getStructureSearch`, `getOntologyChildren`, `getOntologyParents`+- Returns XML only.++Example SOAP request for `getCompleteEntity`:+```xml+<soapenv:Body>+ <chebi:getCompleteEntity>+ <chebi:chebiId>CHEBI:15365</chebi:chebiId>+ </chebi:getCompleteEntity>+</soapenv:Body>+```+Returns: formula, mass, charge, InChI, InChIKey, SMILES, synonyms, database links, ontology parents/children.++## Notes+- For programmatic REST access, OLS4 is the easiest path.+- For chemical structure searches (by InChI, SMILES, substructure), the SOAP service is required.+- ChEBI IDs are numeric (e.g., 15365) but referenced as "CHEBI:15365" in OBO format.+- PubChem and UniChem can cross-reference ChEBI IDs to other chemical databases.diff --git a/scientific-skills/database-lookup/references/chembl.md b/scientific-skills/database-lookup/references/chembl.mdnew file mode 100644index 00000000..1cc60c3b--- /dev/null+++ b/scientific-skills/database-lookup/references/chembl.md@@ -0,0 +1,80 @@+# ChEMBL REST API++## Base URL+```+https://www.ebi.ac.uk/chembl/api/data+```++## Auth+No API key required. Fully open and free.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/molecule/{chembl_id}` | Get molecule by ChEMBL ID |+| `/molecule/search?q={query}` | Free-text molecule search |+| `/target/{chembl_id}` | Get target by ChEMBL ID |+| `/target/search?q={query}` | Free-text target search |+| `/activity?molecule_chembl_id={id}` | Activities for a molecule |+| `/activity?target_chembl_id={id}` | Activities for a target |+| `/mechanism?molecule_chembl_id={id}` | Mechanism of action |+| `/drug_indication?molecule_chembl_id={id}` | Drug indications |+| `/similarity/{smiles}/{threshold}` | Similarity search (threshold 40-100) |+| `/substructure/{smiles}` | Substructure search |++## Common Parameters++- `format=json` — response format (default json)+- `limit` — results per page (default 20, max 1000)+- `offset` — pagination offset+- `order_by` — sort field (prefix `-` for descending)+- `only` — return only specified fields (comma-separated)++### Filtering operators (append to field names)+`__exact`, `__icontains`, `__gt`, `__gte`, `__lt`, `__lte`, `__in`, `__isnull`, `__startswith`, `__range`, `__regex`++## Example Calls++```+# Get molecule by ID+/molecule/CHEMBL25.json++# Search molecules by name+/molecule/search?q=aspirin&format=json++# Activities for a target with potency filter+/activity?target_chembl_id=CHEMBL240&pchembl_value__gte=6&format=json&limit=100++# Similarity search (80% threshold)+/similarity/CC(%3DO)Oc1ccccc1C(%3DO)O/80.json++# Approved drugs only+/molecule?max_phase=4&format=json++# Mechanism of action+/mechanism?molecule_chembl_id=CHEMBL25&format=json+```++## Response Format (molecule)+```json+{+ "page_meta": {"limit": 20, "offset": 0, "total_count": 150},+ "molecules": [{+ "molecule_chembl_id": "CHEMBL25",+ "pref_name": "ASPIRIN",+ "max_phase": 4,+ "molecule_properties": {+ "full_mwt": 180.16, "full_molformula": "C9H8O4",+ "alogp": 1.31, "hba": 3, "hbd": 1, "psa": 63.60+ },+ "molecule_structures": {+ "canonical_smiles": "CC(=O)Oc1ccccc1C(=O)O",+ "standard_inchi_key": "BSYNRYMUTXBXSQ-UHFFFAOYSA-N"+ }+ }]+}+```++## Rate Limits+No strict limit. Keep under ~10 req/sec. No auth required.diff --git a/scientific-skills/database-lookup/references/clinicaltrials.md b/scientific-skills/database-lookup/references/clinicaltrials.mdnew file mode 100644index 00000000..e2d2b745--- /dev/null+++ b/scientific-skills/database-lookup/references/clinicaltrials.md@@ -0,0 +1,77 @@+# ClinicalTrials.gov (v2 API)++## Base URL+```+https://clinicaltrials.gov/api/v2/+```++## Auth+No API key required. Fully public.++## Key Endpoints++### Search studies+```+GET /studies+```++Key parameters:+- `query.cond` — condition/disease (e.g. `breast cancer`)+- `query.intr` — intervention/treatment (e.g. `pembrolizumab`)+- `query.term` — general search terms+- `query.spons` — sponsor+- `query.id` — NCT ID+- `filter.overallStatus` — pipe-delimited: `RECRUITING|COMPLETED|ACTIVE_NOT_RECRUITING|...`+- `filter.phase` — `PHASE1|PHASE2|PHASE3|PHASE4|NA`+- `filter.geo` — `distance(lat,lon,dist)` e.g. `distance(38.89,-77.03,50mi)`+- `fields` — comma-separated field list to reduce payload+- `sort` — e.g. `LastUpdatePostDate:desc`+- `pageSize` — results per page (default 10, max 1000)+- `pageToken` — cursor for next page (from `nextPageToken` in response)+- `countTotal=true` — include total count++Example — recruiting Phase 3 breast cancer trials:+```+/studies?query.cond=breast+cancer&filter.overallStatus=RECRUITING&filter.phase=PHASE3&pageSize=5&countTotal=true+```++Response structure:+```json+{+ "totalCount": 1234,+ "studies": [+ {+ "protocolSection": {+ "identificationModule": {"nctId": "NCT05123456", "briefTitle": "..."},+ "statusModule": {"overallStatus": "RECRUITING"},+ "designModule": {"phases": ["PHASE3"], "enrollmentInfo": {"count": 500}},+ "conditionsModule": {"conditions": ["Breast Cancer"]},+ "eligibilityModule": {"minimumAge": "18 Years", "sex": "ALL"}+ }+ }+ ],+ "nextPageToken": "CAYQAg"+}+```++### Single study by NCT ID+```+GET /studies/{nctId}+```+Example: `/studies/NCT05123456`++### Study count+```+GET /stats/size?query.cond={condition}&filter.overallStatus=RECRUITING+```++### Field metadata+```+GET /studies/metadata+```++## Pagination+Uses cursor-based pagination via `pageToken` (NOT numeric offsets). Include `countTotal=true` on first request to get total.++## Rate Limits+No API key. Be reasonable — a few requests per second. Bulk: https://clinicaltrials.gov/AllAPIJSON.zipdiff --git a/scientific-skills/database-lookup/references/clinpgx.md b/scientific-skills/database-lookup/references/clinpgx.mdnew file mode 100644index 00000000..e4dbebc4--- /dev/null+++ b/scientific-skills/database-lookup/references/clinpgx.md@@ -0,0 +1,64 @@+# PharmGKB (Clinical Pharmacogenomics)++## Base URL+```+https://api.pharmgkb.org/v1/data/+```++## Auth+No API key required for read-only access.++## Key Endpoints++### General search+```+GET https://api.pharmgkb.org/v1/search?q={term}&page=0&size=10+```++### Gene data+```+GET /gene?symbol={symbol}+```+Example: `/gene?symbol=CYP2D6`++Response includes: id, symbol, chromosome, hasGuideline, hasClinicalAnnotation, cpicGene++### Drug data+```+GET /drug?name={name}+```+Example: `/drug?name=warfarin`++Response includes: id, name, genericNames, tradeNames, rxNormId, atcCodes++### Clinical annotations (drug-gene interactions)+```+GET /clinicalAnnotation?gene={symbol}&drug={name}&level={level}+```++Evidence levels: `1A`, `1B`, `2A`, `2B`, `3`, `4`++Example:+```+/clinicalAnnotation?gene=CYP2C19&drug=clopidogrel&level=1A+```++Response includes: level, gene, drug, phenotype, significance, variants, url++### CPIC/DPWG guidelines+```+GET /guideline?gene={symbol}&drug={name}&source=CPIC+```++### Pharmacokinetic pathways+```+GET /pathway?drug={name}+```++### Drug labels (FDA, EMA)+```+GET /drugLabel?drug={name}&source=FDA+```++## Rate Limits+No hard published limit. Be reasonable. Bulk data via PharmGKB download page.diff --git a/scientific-skills/database-lookup/references/clinvar.md b/scientific-skills/database-lookup/references/clinvar.mdnew file mode 100644index 00000000..fde00008--- /dev/null+++ b/scientific-skills/database-lookup/references/clinvar.md@@ -0,0 +1,91 @@+# ClinVar API Reference++## Base URLs+- **NCBI E-utilities**: `https://eutils.ncbi.nlm.nih.gov/entrez/eutils`+- **ClinVar web API (VCV)**: `https://www.ncbi.nlm.nih.gov/clinvar`+- **NCBI Variation Services**: `https://api.ncbi.nlm.nih.gov/variation/v0`++## Authentication+- E-utilities: No key required, but **strongly recommended**. Register at https://www.ncbi.nlm.nih.gov/account/ to get an `api_key`.+- Without key: 3 requests/second. With key: 10 requests/second.+- Append `&api_key=YOUR_KEY` to all E-utility requests.++## Rate Limits+- Without API key: 3 req/sec+- With API key: 10 req/sec++## Key Endpoints++### 1. Search ClinVar (esearch)+```+GET https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=clinvar&term={query}&retmode=json+```+Example — search for BRCA1 pathogenic variants:+```+GET https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=clinvar&term=BRCA1[gene]+AND+pathogenic[clinical_significance]&retmode=json&retmax=10+```+Returns JSON with `idlist` of ClinVar Variation IDs.++### 2. Fetch ClinVar Records (esummary)+```+GET https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=clinvar&id={id_list}&retmode=json+```+Example:+```+GET https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=clinvar&id=37088,37087&retmode=json+```+Returns JSON with clinical significance, variant name, gene, conditions, review status.++### 3. Full Record (efetch)+```+GET https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=clinvar&id={id}&rettype=vcv&is_variationid&retmode=xml+```+Note: ClinVar efetch returns **XML only** (no JSON for efetch).++### 4. Variation Services API — SPDI/HGVS Lookup+```+GET https://api.ncbi.nlm.nih.gov/variation/v0/spdi/{spdi_expression}/clinvar+GET https://api.ncbi.nlm.nih.gov/variation/v0/hgvs/{hgvs_expression}/clinvar+```+Example:+```+GET https://api.ncbi.nlm.nih.gov/variation/v0/hgvs/NM_007294.4%3Ac.5266dupC/clinvar+```++### 5. ClinVar VCV/RCV Direct Access+```+GET https://www.ncbi.nlm.nih.gov/clinvar/variation/{variation_id}/?redir=vcv+```+This returns HTML. For programmatic access, use E-utilities or the Variation Services API.++## Useful Search Qualifiers+- `[gene]` — gene symbol (e.g., `BRCA1[gene]`)+- `[clinical_significance]` — pathogenic, likely_pathogenic, benign, uncertain_significance+- `[molecular_consequence]` — missense, nonsense, frameshift, etc.+- `[review_status]` — criteria_provided_single_submitter, reviewed_by_expert_panel, etc.+- `[condition]` — disease name++## Response Format+- esearch/esummary: JSON (with `retmode=json`)+- efetch: XML only for ClinVar+- Variation Services: JSON++## esummary Response Key Fields+```json+{+ "result": {+ "37088": {+ "uid": "37088",+ "title": "NM_007294.4(BRCA1):c.5266dupC (p.Gln1756Profs*74)",+ "clinical_significance": { "description": "Pathogenic" },+ "genes": [{"symbol": "BRCA1", "geneid": 672}],+ "variation_set": [...],+ "trait_set": [{"trait_name": "Hereditary breast and ovarian cancer syndrome"}]+ }+ }+}+```++## Notes+- Combine esearch + esummary for search-then-fetch workflows.+- For bulk downloads, use ClinVar FTP: https://ftp.ncbi.nlm.nih.gov/pub/clinvar/diff --git a/scientific-skills/database-lookup/references/cod.md b/scientific-skills/database-lookup/references/cod.mdnew file mode 100644index 00000000..5d1292f9--- /dev/null+++ b/scientific-skills/database-lookup/references/cod.md@@ -0,0 +1,121 @@+# Crystallography Open Database (COD) API++## Base URL++```+https://www.crystallography.net/cod+```++## Authentication++**None required.** COD is fully open-access with no API key needed.++## Key Endpoints++### Search by formula++```+GET /result?formula=Fe2%20O3&format=json+```++Formula format uses spaces between elements: `Fe2 O3`, `Si O2`, `C6 H12 O6`. URL-encode spaces as `%20`.++### Search by elements++```+GET /result?el1=Fe&el2=O&format=json+```++Use `el1`, `el2`, `el3`, etc. for element filters. Use `nel=2` to restrict to exactly 2 elements.++### Search by cell parameters++```+GET /result?a_min=5.0&a_max=6.0&b_min=5.0&b_max=6.0&c_min=5.0&c_max=6.0&format=json+```++Cell parameter filters:+- `a_min`, `a_max` — a-axis length (Angstroms)+- `b_min`, `b_max` — b-axis length+- `c_min`, `c_max` — c-axis length+- `alpha_min`, `alpha_max` — alpha angle (degrees)+- `beta_min`, `beta_max` — beta angle+- `gamma_min`, `gamma_max` — gamma angle+- `vol_min`, `vol_max` — unit cell volume (A^3)++### Search by space group++```+GET /result?sg=F%20m%20-3%20m&format=json+```++### Search by text (author, journal, title)++```+GET /result?text=perovskite&format=json+```++### Combined search example++```+GET /result?el1=Ti&el2=O&nel=2&sg=P%2042/m%20n%20m&format=json+```++### Retrieve a specific CIF file++```+GET /1000000.cif+```++COD IDs are 7-digit integers. Append `.cif` for the crystallographic information file, or `.html` for the web page.++### Retrieve entry metadata as JSON++```+GET /result?id=1000000&format=json+```++### Output formats++- `format=json` — JSON array of matching entries+- `format=csv` — CSV output+- `format=lst` — list of COD IDs only+- Default (no format) — HTML page++## Response Format++```json+[+ {+ "file": "1526463",+ "a": "4.759",+ "b": "4.759",+ "c": "12.992",+ "alpha": "90",+ "beta": "90",+ "gamma": "120",+ "vol": "254.94",+ "sg": "R -3 c",+ "formula": "Fe2 O3",+ "title": "Refinement of the crystal structure of ...",+ "journal": "Zeitschrift fuer Kristallographie",+ "year": "1966",+ "authors": "Blake, R.L.; et al."+ }+]+```++The `file` field is the COD ID. Use it to fetch the CIF: `https://www.crystallography.net/cod/{file}.cif`++## Rate Limits++- No formal rate limits documented+- Be courteous: avoid bulk-downloading thousands of entries rapidly+- For bulk access, COD provides downloadable database dumps at https://www.crystallography.net/cod/archives/++## Notes++- COD contains ~500,000+ crystal structures from published literature+- All data is open-access under public domain / open licenses+- The search API returns metadata; use the CIF endpoint for full structural data+- Alternative access: MySQL database dumps and SVN access are available for bulk usediff --git a/scientific-skills/database-lookup/references/cosmic.md b/scientific-skills/database-lookup/references/cosmic.mdnew file mode 100644index 00000000..1c43b1d3--- /dev/null+++ b/scientific-skills/database-lookup/references/cosmic.md@@ -0,0 +1,59 @@+# COSMIC (Catalogue of Somatic Mutations in Cancer)++## Base URL+```+https://cancer.sanger.ac.uk/cosmic/api/v1/+```++## Auth+**Registration required.** Free academic account or paid commercial license.++Login to get JWT token:+```+POST /auth/login+Content-Type: application/json+{"email": "[email protected]", "password": "yourpassword"}+```+Pass token as: `Authorization: Bearer <token>`++## Key Endpoints++### Search mutations by gene+```+GET /mutations/search?q={gene_symbol}&page=1&page_size=5+```++### Get gene information+```+GET /genes/{gene_symbol}+```+Example: `/genes/BRAF`++Response includes: gene_symbol, gene_name, chromosome, cancer_census (bool), tier, mutation_count, sample_count++### Get specific mutation by COSMIC ID+```+GET /mutations/{cosmic_mutation_id}+```+Example: `/mutations/COSV56056643`++Response includes: gene, cds_mutation, aa_mutation, mutation_type, fathmm_prediction, genomic_coordinates, tissue_distribution++### Cancer Gene Census+```+GET /cancer-gene-census?tier=1&page_size=10+```++### Mutations by tissue/histology+```+GET /mutations/distribution/{gene_symbol}+```++## Rate Limits+Not officially published. Bulk data requires SFTP download (licensed).++## Important+- COSMIC requires authentication for all API calls+- Commercial use requires a paid license+- Bulk data access via SFTP is preferred over API for large queries+- API structure may change across COSMIC versionsdiff --git a/scientific-skills/database-lookup/references/dailymed.md b/scientific-skills/database-lookup/references/dailymed.mdnew file mode 100644index 00000000..4b62b83d--- /dev/null+++ b/scientific-skills/database-lookup/references/dailymed.md@@ -0,0 +1,65 @@+# DailyMed (NIH/NLM Drug Labels)++## Base URL+```+https://dailymed.nlm.nih.gov/dailymed/services/+```++## Auth+No API key required.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `v2/spls.json?drug_name={name}` | Search drug labels by name |+| `v2/spls/{setid}.json` | Get label metadata by SetID |+| `v2/spls/{setid}/ndcs.json` | NDC codes for a label |+| `v2/spls/{setid}/media.json` | Images/media for a label |+| `v2/drugnames.json?drug_name={prefix}` | Drug name autocomplete |+| `v2/drugclasses.json?drug_class_name={name}` | Search by pharmacologic class |+| `v2/rxcuis.json?drug_name={name}` | RxNorm CUIs for a drug |+| `v2/ndc/{ndc_code}/spls.json` | Find labels by NDC code |++## Additional filters for `/v2/spls.json`+- `drug_class` — pharmacologic class+- `labeler` — manufacturer name+- `page` / `pagesize` — pagination (max 100)++## Example Calls++```+# Search metformin labels+https://dailymed.nlm.nih.gov/dailymed/services/v2/spls.json?drug_name=metformin++# Drug name autocomplete+https://dailymed.nlm.nih.gov/dailymed/services/v2/drugnames.json?drug_name=ator++# Search by pharmacologic class+https://dailymed.nlm.nih.gov/dailymed/services/v2/spls.json?drug_class=HMG-CoA+Reductase+Inhibitor++# Full label XML (SPL content with sections)+https://dailymed.nlm.nih.gov/dailymed/services/v2/spls/{setid}/packaging.xml+```++## Response Format+```json+{+ "metadata": {+ "total_elements": 12,+ "elements_per_page": 10,+ "current_page": 1,+ "total_pages": 2+ },+ "data": [+ {+ "published_date": "2024-01-15",+ "title": "METFORMIN HYDROCHLORIDE tablet",+ "setid": "b03f295f-..."+ }+ ]+}+```++## Rate Limits+No published limits. Be reasonable.diff --git a/scientific-skills/database-lookup/references/datacommons.md b/scientific-skills/database-lookup/references/datacommons.mdnew file mode 100644index 00000000..db82f66d--- /dev/null+++ b/scientific-skills/database-lookup/references/datacommons.md@@ -0,0 +1,237 @@+# Google Data Commons API++## Base URL++```+https://api.datacommons.org+```++## Authentication++**API key required.** Obtain from the Google Cloud Console (enable the Data Commons API).++Pass as query parameter: `&key=YOUR_KEY`++Or as header: `X-API-Key: YOUR_KEY`++Note: Many endpoints work without a key for light usage, but a key is recommended for reliable access.++## Key Endpoints++### 1. Get Statistical Value (single observation)+```+GET /v2/observation+```+| Parameter | Required | Description |+|-------------|----------|------------------------------------------------------------|+| key | Yes | API key |+| entity.dcids | Yes | Place DCID(s) (e.g., `country/USA`, `geoId/06`) |+| variable.dcids| Yes | Statistical variable DCID(s) |+| date | No | Specific date or `LATEST` |+| select | No | Fields to select: `entity`, `variable`, `date`, `value` |++Example:+```+https://api.datacommons.org/v2/observation?key=YOUR_KEY&entity.dcids=country/USA&variable.dcids=Count_Person&date=LATEST&select=entity&select=variable&select=date&select=value+```++### 2. Get Statistical Time Series+```+GET /v2/observation+```+Use same endpoint but omit `date` parameter (or set `date=''`) to get the full time series.++Example (population time series for USA):+```+https://api.datacommons.org/v2/observation?key=YOUR_KEY&entity.dcids=country/USA&variable.dcids=Count_Person&select=entity&select=variable&select=date&select=value+```++### 3. Node Info (property values of an entity)+```+GET /v2/node+```+| Parameter | Required | Description |+|-----------|----------|----------------------------------------------------|+| key | Yes | API key |+| nodes | Yes | DCID(s) of the node |+| property | Yes | Property expression: `->prop` (out), `<-prop` (in)|++Example (get properties of California):+```+https://api.datacommons.org/v2/node?key=YOUR_KEY&nodes=geoId/06&property=->*+```++Example (get name of a place):+```+https://api.datacommons.org/v2/node?key=YOUR_KEY&nodes=geoId/06&property=->name+```++### 4. SPARQL Query+```+POST /v2/sparql+```+Content-Type: `application/json`++Body:+```json+{+ "query": "SELECT ?name WHERE { ?state typeOf State . ?state name ?name . ?state containedInPlace country/USA }"+}+```++Pass API key as query param or header.++Example (curl):+```+curl -X POST 'https://api.datacommons.org/v2/sparql?key=YOUR_KEY' \+ -H 'Content-Type: application/json' \+ -d '{"query": "SELECT ?name WHERE { ?place typeOf Country . ?place name ?name } LIMIT 10"}'+```++### 5. Resolve Entities (map names/coords to DCIDs)+```+GET /v2/resolve+```+| Parameter | Required | Description |+|------------|----------|------------------------------------------------|+| key | Yes | API key |+| nodes | Yes | Entity identifiers to resolve |+| property | Yes | `<-description` (name lookup) or coordinate-based |++Example (resolve by name):+```+https://api.datacommons.org/v2/resolve?key=YOUR_KEY&nodes=California&property=<-description->dcid+```++### 6. Search for Statistical Variables+```+GET /v2/variable/search+```+| Parameter | Required | Description |+|-----------|----------|------------------------|+| key | Yes | API key |+| query | Yes | Search keywords |++Example:+```+https://api.datacommons.org/v2/variable/search?key=YOUR_KEY&query=unemployment+rate+```++## Common DCIDs++### Places+| DCID | Description |+|-------------------|----------------------|+| country/USA | United States |+| country/GBR | United Kingdom |+| country/CHN | China |+| geoId/06 | California |+| geoId/0667000 | San Francisco city |+| geoId/06085 | Santa Clara County |++### Statistical Variables+| DCID | Description |+|-----------------------------------------|--------------------------------|+| Count_Person | Total population |+| Count_Person_Employed | Employed persons |+| UnemploymentRate_Person | Unemployment rate |+| Median_Income_Person | Median income |+| Amount_EconomicActivity_GrossDomesticProduction_Nominal | Nominal GDP |+| Mean_ConsumerPriceIndex | Consumer price index |+| Count_Death | Number of deaths |+| Count_Person_BelowPovertyLevelInThePast12Months | Persons in poverty |+| Median_Age_Person | Median age |++## Response Format++### Observation response+```json+{+ "byVariable": {+ "Count_Person": {+ "byEntity": {+ "country/USA": {+ "orderedFacets": [+ {+ "facetId": "2176550201",+ "observations": [+ {+ "date": "2020",+ "value": 331449281+ },+ {+ "date": "2021",+ "value": 331893745+ }+ ]+ }+ ]+ }+ }+ }+ },+ "facets": {+ "2176550201": {+ "importName": "CensusACS5YearSurvey",+ "provenanceUrl": "https://www.census.gov/",+ "measurementMethod": "CensusACS5yrSurvey"+ }+ }+}+```++### Node response+```json+{+ "data": {+ "geoId/06": {+ "arcs": {+ "name": {+ "nodes": [+ {+ "value": "California"+ }+ ]+ }+ }+ }+ }+}+```++### SPARQL response+```json+{+ "header": ["?name"],+ "rows": [+ { "cells": [{ "value": "Alabama" }] },+ { "cells": [{ "value": "Alaska" }] }+ ]+}+```++### Variable search response+```json+{+ "variables": [+ {+ "dcid": "UnemploymentRate_Person",+ "displayName": "Unemployment Rate"+ }+ ]+}+```++## Rate Limits++- Without API key: very limited (roughly a few requests per minute; may be blocked).+- With API key: not formally published, but generally generous for normal use.+- Implement client-side throttling (1-2 requests/second recommended).+- Bulk data available via the Data Commons data download for large-scale analysis.++## Notes++- The V2 API (paths starting with `/v2/`) is the current recommended version.+- Older V1 endpoints (`/v1/bulk/observations/series`, `/stat/value`, etc.) still work but are deprecated.+- DCID = Data Commons Identifier. Every entity, statistical variable, and concept has a unique DCID.+- The knowledge graph includes data from US Census, World Bank, CDC, BLS, FBI, and many other sources.diff --git a/scientific-skills/database-lookup/references/dbsnp.md b/scientific-skills/database-lookup/references/dbsnp.mdnew file mode 100644index 00000000..44aadad8--- /dev/null+++ b/scientific-skills/database-lookup/references/dbsnp.md@@ -0,0 +1,143 @@+# dbSNP API Reference++## Overview+SNP and variant data. Accessible via two APIs: NCBI E-utilities (`db=snp`) for search/metadata, and the NCBI Variation Services REST API for detailed variant annotations.++## Base URLs+```+E-utilities: https://eutils.ncbi.nlm.nih.gov/entrez/eutils/+Variation API: https://api.ncbi.nlm.nih.gov/variation/v0/+```++## Authentication+- **E-utilities**: API key recommended (`&api_key=KEY`). 3 req/sec without, 10 req/sec with key.+- **Variation API**: No auth required. Rate limits apply (undocumented; be respectful, ~1-2 req/sec).++---++## E-utilities Endpoints (db=snp)++### 1. ESearch -- Search SNPs+```+GET esearch.fcgi?db=snp&term=QUERY&retmax=N&retmode=json+```++**Example -- search SNPs in BRCA1 gene:**+```+GET esearch.fcgi?db=snp&term=BRCA1[Gene Name] AND homo sapiens[Organism]&retmax=5&retmode=json+```+Response:+```json+{+ "esearchresult": {+ "count": "12847",+ "idlist": ["80357713", "80357508", ...]+ }+}+```+Note: IDs returned are rs numbers without the "rs" prefix.++### 2. ESummary -- SNP summaries+```+GET esummary.fcgi?db=snp&id=IDS&retmode=json+```++**Example -- get summary for rs334 (sickle cell variant):**+```+GET esummary.fcgi?db=snp&id=334&retmode=json+```+Response includes: `snp_id`, `chr`, `chrpos`, `genes`, `clinical_significance`, `global_mafs`, `docsum`.++### 3. EFetch -- Fetch SNP details (XML only)+```+GET efetch.fcgi?db=snp&id=IDS&rettype=json&retmode=text+```+Note: EFetch for dbSNP returns JSON with `rettype=json`. Also supports XML with `retmode=xml`.++---++## Variation Services API++### 1. Lookup variant by rsID+```+GET /variation/v0/refsnp/{rsid}+```++**Example:**+```+GET https://api.ncbi.nlm.nih.gov/variation/v0/refsnp/334+```+Response (JSON, abbreviated):+```json+{+ "refsnp_id": "334",+ "create_date": "2000/09/19",+ "primary_snapshot_data": {+ "placements_with_allele": [...],+ "allele_annotations": [...],+ "support": [...]+ },+ "present_obs_movements": [+ {+ "component_ids": [{"type": "clinvar", "value": "..."}],+ "observation": {+ "seq_id": "NC_000011.10",+ "position": 5227002,+ "deleted_sequence": "T",+ "inserted_sequence": "A"+ }+ }+ ]+}+```++### 2. Lookup variant by SPDI notation+```+GET /variation/v0/spdi/{spdi}/rsids+```+SPDI format: `SeqID:Position:Deletion:Insertion`++**Example:**+```+GET https://api.ncbi.nlm.nih.gov/variation/v0/spdi/NC_000011.10:5227002:T:A/rsids+```++### 3. Lookup variant by HGVS+```+GET /variation/v0/hgvs/{hgvs}/contextuals+```++**Example:**+```+GET https://api.ncbi.nlm.nih.gov/variation/v0/hgvs/NC_000011.10:g.5227003T>A/contextuals+```++### 4. Batch rsID lookup (POST)+```+POST /variation/v0/refsnp/batch+Content-Type: application/json++{"refsnp_ids": ["334", "1805007", "7412"]}+```++## Common E-utilities Search Patterns+```+# By rs number+term=334[RS ID]++# Clinical significance+term=pathogenic[Clinical Significance] AND BRCA1[Gene Name]++# By chromosome position (GRCh38)+term=11[Chromosome] AND 5227002:5227002[Base Position]++# By variant type+term=missense[Function Class] AND TP53[Gene Name]++# By global minor allele frequency+term=0.01:0.05[Global MAF]+```++## Rate Limits+- E-utilities: 3 req/sec (no key), 10 req/sec (with key)+- Variation Services API: No published limit; recommend 1-2 req/secdiff --git a/scientific-skills/database-lookup/references/disgenet.md b/scientific-skills/database-lookup/references/disgenet.mdnew file mode 100644index 00000000..9a6452a8--- /dev/null+++ b/scientific-skills/database-lookup/references/disgenet.md@@ -0,0 +1,52 @@+# DisGeNET (Gene-Disease Associations)++## Base URL+```+https://www.disgenet.org/api+```++## Auth+**API key required.** Register at disgenet.org, then authenticate:+```bash+curl -X POST https://www.disgenet.org/api/auth/ \+ -d '[email protected]&password=yourpassword'+# Returns: {"token": "abc123..."}+```+Pass as: `Authorization: Bearer <token>`++Load token from `.env` as `DISGENET_API_KEY`.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/gda/gene/{gene_id}` | Gene-disease associations (NCBI gene ID) |+| `/gda/disease/{disease_id}` | Gene-disease associations (UMLS CUI) |+| `/gda/evidences/gene/{gene_id}` | Evidence-level data |+| `/vda/gene/{gene_id}` | Variant-disease associations for a gene |+| `/vda/variant/{rsid}` | Variant-disease associations (dbSNP rsID) |++## Parameters+- `source` — `CURATED`, `BEFREE`, `ALL`+- `min_score` — GDA score threshold (0-1)+- `min_ei` — evidence index threshold+- `format` — `json` or `tsv`+- `limit`, `offset` — pagination++## Example Calls+```+# Gene-disease for TP53 (gene ID 7157)+/gda/gene/7157?source=CURATED&min_score=0.3&limit=10&format=json++# Disease-gene for Breast Cancer (UMLS CUI C0006142)+/gda/disease/C0006142?limit=10++# Variant-disease for rs1042522+/vda/variant/rs1042522+```++## Rate Limits+Free academic tier: ~few hundred requests/day. Paid tiers available.++## Free alternative+If no API key: use **Open Targets** for disease-gene associations.diff --git a/scientific-skills/database-lookup/references/drugbank.md b/scientific-skills/database-lookup/references/drugbank.mdnew file mode 100644index 00000000..5f7bbba3--- /dev/null+++ b/scientific-skills/database-lookup/references/drugbank.md@@ -0,0 +1,54 @@+# DrugBank API++## Important: DrugBank's full API is commercial (paid license required)++**Free alternatives for drug data:**+- **ChEMBL** — extensive bioactivity data, free API+- **PubChem** — free compound data+- **OpenFDA** — drug labels, adverse events+- **DGIdb** (https://dgidb.org/api) — drug-gene interactions, free++## Base URL (Paid API)+```+https://api.drugbank.com/v1+```++## Auth+API key required: `Authorization: Bearer <api_key>`++## Key Endpoints (Paid API)++| Endpoint | Description |+|----------|-------------|+| `/drugs/{drugbank_id}` | Get drug by DrugBank ID |+| `/drugs?q={query}` | Search drugs |+| `/drugs/{id}/interactions` | Drug-drug interactions |+| `/drugs/{id}/targets` | Drug targets |+| `/drugs/{id}/enzymes` | Metabolizing enzymes |+| `/drugs/{id}/pathways` | Associated pathways |+| `/drugs/{id}/adverse_effects` | Adverse effects |+| `/drug_interactions?drugbank_id={id1},{id2}` | Check specific interactions |++## Example Calls+```+GET /drugs/DB00945 (aspirin)+GET /drugs?q=aspirin+GET /drugs/DB00945/interactions+GET /drugs/DB00945/targets+```++## Response Format+```json+{+ "drugbank_id": "DB00945",+ "name": "Acetylsalicylic acid",+ "cas_number": "50-78-2",+ "groups": ["approved"],+ "targets": [{"name": "Prostaglandin G/H synthase 1", "uniprot_id": "P23219", "gene_name": "PTGS1", "actions": ["inhibitor"]}],+ "external_ids": {"chembl": "CHEMBL25", "pubchem_compound": "2244"}+}+```++## Free Access Options+- **DrugBank Open Data**: ~2,500 FDA-approved drugs as XML/CSV download from https://go.drugbank.com/releases/latest+- **Academic License**: Free for non-commercial use, provides data downloads (not API)diff --git a/scientific-skills/database-lookup/references/ecb.md b/scientific-skills/database-lookup/references/ecb.mdnew file mode 100644index 00000000..3844913c--- /dev/null+++ b/scientific-skills/database-lookup/references/ecb.md@@ -0,0 +1,191 @@+# ECB Statistical Data Warehouse (SDW) REST API Reference++## Overview+The ECB SDW API provides access to European Central Bank statistical data: exchange rates, monetary aggregates, interest rates, balance of payments, banking statistics, and more. It follows the SDMX (Statistical Data and Metadata eXchange) RESTful web services standard.++## Base URL+```+https://data-api.ecb.europa.eu/service+```++Note: The legacy URL `https://sdw-wsrest.ecb.europa.eu/service` still works but the above is the current endpoint.++## Authentication+**No API key required.** The API is fully open and public.++## Rate Limits+- No formal rate limits published.+- ECB asks users to be respectful: avoid excessive parallel requests.+- For bulk downloads, use compressed responses (`Accept-Encoding: gzip`).++## Common Headers+| Header | Value | Description |+|--------|-------|-------------|+| `Accept` | `application/vnd.sdmx.data+json;version=2.0.0` | JSON format (recommended) |+| `Accept` | `application/vnd.sdmx.data+csv` | CSV format |+| `Accept` | `application/vnd.sdmx.data+xml` | SDMX-ML XML (default) |+| `Accept-Encoding` | `gzip` | Compressed response |++---++## Key Endpoints++### 1. Get Data (Time Series)++```+GET /data/{flowRef}/{key}?{parameters}+```++| Component | Description |+|-----------|-------------|+| `flowRef` | Dataflow ID (e.g., `EXR` for exchange rates, `BSI` for balance sheet items) |+| `key` | Dot-separated dimension values. Use `+` for OR, `.` to skip a dimension (wildcard). |++**Query Parameters:**+| Parameter | Required | Description |+|-----------|----------|-------------|+| `startPeriod` | No | Start date: `YYYY`, `YYYY-MM`, or `YYYY-MM-DD` |+| `endPeriod` | No | End date: same formats |+| `updatedAfter` | No | ISO 8601 timestamp; returns only data updated after this time |+| `detail` | No | `full` (default), `dataonly`, `serieskeysonly`, `nodata` |+| `firstNObservations` | No | Return only first N observations per series |+| `lastNObservations` | No | Return only last N observations per series |+| `dimensionAtObservation` | No | Typically `TIME_PERIOD` (default) |++**Exchange Rate Key Structure (EXR dataflow):**+`{frequency}.{currency}.{currency_denom}.{exr_type}.{exr_suffix}`++| Position | Dimension | Common Values |+|----------|-----------|---------------|+| 1 | Frequency | `D` (daily), `M` (monthly), `A` (annual) |+| 2 | Currency | `USD`, `GBP`, `JPY`, `CHF`, `CNY`, etc. |+| 3 | Currency denominator | `EUR` (usually) |+| 4 | Exchange rate type | `SP00` (spot), `EN00` (average) |+| 5 | Exchange rate suffix | `A` (average), `E` (end of period) |++**Example -- Daily USD/EUR spot rate, 2024:**+```+GET https://data-api.ecb.europa.eu/service/data/EXR/D.USD.EUR.SP00.A?startPeriod=2024-01-01&endPeriod=2024-12-31+Accept: application/vnd.sdmx.data+json;version=2.0.0+```++**Example -- Monthly GBP and JPY vs EUR, last 12 observations:**+```+GET https://data-api.ecb.europa.eu/service/data/EXR/M.GBP+JPY.EUR.SP00.A?lastNObservations=12+Accept: application/vnd.sdmx.data+json;version=2.0.0+```++**Example -- All daily exchange rates for a specific date (wildcard):**+```+GET https://data-api.ecb.europa.eu/service/data/EXR/D..EUR.SP00.A?startPeriod=2024-06-01&endPeriod=2024-06-01+Accept: application/vnd.sdmx.data+json;version=2.0.0+```++**JSON Response Structure (SDMX-JSON v2.0):**+```json+{+ "meta": { "schema": "...", "id": "...", "prepared": "2024-11-01T12:00:00Z" },+ "data": {+ "dataSets": [+ {+ "action": "Information",+ "series": {+ "0": {+ "attributes": [0, 0, ...],+ "observations": {+ "0": [1.0856],+ "1": [1.0791],+ "2": [1.0834]+ }+ }+ }+ }+ ],+ "structures": [+ {+ "dimensions": {+ "series": [...],+ "observation": [+ {+ "id": "TIME_PERIOD",+ "values": [+ {"id": "2024-01-02", "name": "2024-01-02"},+ {"id": "2024-01-03", "name": "2024-01-03"}+ ]+ }+ ]+ }+ }+ ]+ }+}+```++Note: Observation values are indexed arrays. Match observation index to `TIME_PERIOD` values in `structures.dimensions.observation`.++**CSV Response** (simpler to parse):+```+Accept: application/vnd.sdmx.data+csv+```+Returns standard CSV with columns: `DATAFLOW`, `FREQ`, `CURRENCY`, `CURRENCY_DENOM`, `EXR_TYPE`, `EXR_SUFFIX`, `TIME_PERIOD`, `OBS_VALUE`, etc.++---++### 2. Get Dataflow Definitions (Available Datasets)++```+GET /dataflow/{agencyID}/{resourceID}/{version}+```++**Example -- List all ECB dataflows:**+```+GET https://data-api.ecb.europa.eu/service/dataflow/ECB+Accept: application/vnd.sdmx.structure+json;version=2.0.0+```++**Example -- Get EXR dataflow definition:**+```+GET https://data-api.ecb.europa.eu/service/dataflow/ECB/EXR+Accept: application/vnd.sdmx.structure+json;version=2.0.0+```++---++### 3. Get Data Structure Definition (Dimensions & Codes)++```+GET /datastructure/{agencyID}/{resourceID}/{version}?references=children+```++**Example:**+```+GET https://data-api.ecb.europa.eu/service/datastructure/ECB/ECB_EXR1?references=children+Accept: application/vnd.sdmx.structure+json;version=2.0.0+```++This returns all dimensions, their code lists, and allowed values -- essential for constructing valid keys.++---++## Common Dataflow IDs++| Dataflow | Description |+|----------|-------------|+| `EXR` | Exchange rates |+| `BSI` | Balance sheet items (monetary financial institutions) |+| `MIR` | MFI interest rates |+| `ILM` | Internal liquidity management |+| `SEC` | Securities issues statistics |+| `BOP` | Balance of payments |+| `STP` | Structural financial indicators |+| `CBD` | Consolidated banking data |+| `ICP` | Index of consumer prices (HICP) |+| `FM` | Financial market data |+| `YC` | Yield curve data |++## Notes+- The SDMX-JSON format is verbose. For simpler parsing, use `Accept: application/vnd.sdmx.data+csv`.+- When a dimension is unknown, leave it empty (e.g., `D..EUR.SP00.A`) to get all values for that dimension.+- Use `+` to request multiple values for one dimension (e.g., `USD+GBP`).+- The `detail=dataonly` parameter omits attributes and reduces response size.+- Historical data availability varies by dataflow; exchange rates go back to 1999 (euro introduction).diff --git a/scientific-skills/database-lookup/references/emdb.md b/scientific-skills/database-lookup/references/emdb.mdnew file mode 100644index 00000000..e7ba6b31--- /dev/null+++ b/scientific-skills/database-lookup/references/emdb.md@@ -0,0 +1,37 @@+# EMDB (Electron Microscopy Data Bank)++## Base URL+```+https://www.ebi.ac.uk/emdb/api/+```++## Auth+No auth required.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/entry/{emdb_id}` | Full entry metadata (e.g. EMD-1234) |+| `/entry/map/{emdb_id}` | Map/volume metadata |+| `/entry/experiment/{emdb_id}` | Experimental details |+| `/entry/fitted/{emdb_id}` | Fitted PDB models |+| `/search/{query}?rows={n}` | Search entries by keyword |++## Example Calls+```+# Entry metadata+https://www.ebi.ac.uk/emdb/api/entry/EMD-1234++# Search for ribosome entries+https://www.ebi.ac.uk/emdb/api/search/ribosome?rows=5++# Experimental details+https://www.ebi.ac.uk/emdb/api/entry/experiment/EMD-1234+```++## Response Format+JSON. Search includes pagination and matching entry array.++## Rate Limits+EBI fair-use policy. Map files (MRC/CCP4) available via FTP for bulk access.diff --git a/scientific-skills/database-lookup/references/ena.md b/scientific-skills/database-lookup/references/ena.mdnew file mode 100644index 00000000..1d6fafa9--- /dev/null+++ b/scientific-skills/database-lookup/references/ena.md@@ -0,0 +1,372 @@+# European Nucleotide Archive (ENA) API Reference++## Overview+The ENA is Europe's primary nucleotide sequence repository, part of the International Nucleotide Sequence Database Collaboration (INSDC) alongside NCBI GenBank and DDBJ. It stores raw sequencing reads, assembled sequences, genome assemblies, and associated metadata. ENA provides five complementary APIs for different access patterns.++## 1. ENA Portal API (Advanced Search)++### Base URL+```+https://www.ebi.ac.uk/ena/portal/api+```++No authentication required. All endpoints are public.++### Key Endpoints++#### Search records+```+GET /search?result={result_type}&query={query}&fields={fields}&limit={N}&format={format}+```++| Parameter | Type | Description |+|-----------|------|-------------|+| `result` | string | **Required.** Data type to search. See Result Types below. |+| `query` | string | Search query using ENA query syntax. |+| `fields` | string | Comma-separated list of fields to return. Use `/returnFields` to see available fields per result type. |+| `limit` | int | Max results to return (default 100000). |+| `offset` | int | Pagination offset. |+| `format` | string | `json` (default), `tsv`. |++**Query syntax:**+```+tax_id=9606 AND description="*hemoglobin*"+tax_id=9606 AND library_strategy="RNA-Seq"+accession="PRJEB40665"+scientific_name="Escherichia coli" AND dataclass="STD"+country="United Kingdom" AND first_public>2024-01-01+```++Operators: `=`, `!=`, `>`, `<`, `>=`, `<=`. Use `AND`, `OR`, `NOT`. Wildcards: `*`. Enclose values with spaces in double quotes.++**Example -- search human RNA-Seq runs:**+```+https://www.ebi.ac.uk/ena/portal/api/search?result=read_run&query=tax_id%3D9606%20AND%20library_strategy%3D%22RNA-Seq%22&fields=run_accession,experiment_accession,sample_accession,study_accession,instrument_platform,library_strategy,read_count,base_count&limit=5&format=json+```++**Example -- search nucleotide sequences by organism:**+```+https://www.ebi.ac.uk/ena/portal/api/search?result=sequence&query=tax_id%3D9606%20AND%20description%3D%22*hemoglobin*%22&fields=accession,description,tax_id,scientific_name,base_count&limit=5&format=json+```++**Response:**+```json+[+ {+ "accession": "AA126503",+ "description": "zk94h05.s1 Soares_pregnant_uterus_NbHPU Homo sapiens cDNA clone ...",+ "tax_id": "9606"+ }+]+```++#### Count records+```+GET /count?result={result_type}&query={query}+```++Returns a plain integer count.++**Example:**+```+https://www.ebi.ac.uk/ena/portal/api/count?result=read_run&query=tax_id%3D9606%20AND%20library_strategy%3D%22RNA-Seq%22+```++#### List available result types+```+GET /results?format=json+```++#### List searchable fields for a result type+```+GET /searchFields?result={result_type}+```++#### List returnable fields for a result type+```+GET /returnFields?result={result_type}+```++### Result Types++| Result Type | Description |+|-------------|-------------|+| `sequence` | Nucleotide sequences |+| `coding` | Coding sequences (CDS) |+| `noncoding` | Non-coding sequences |+| `read_run` | Raw sequencing reads (runs) |+| `read_experiment` | Sequencing experiments |+| `read_study` | Studies for raw reads |+| `analysis` | Analyses |+| `analysis_study` | Studies for analyses |+| `assembly` | Genome assemblies |+| `sample` | Samples |+| `study` | Studies |+| `taxon` | Taxonomic classification |+| `wgs_set` | Genome assembly contig sets (WGS) |+| `tsa_set` | Transcriptome assembly contig sets (TSA) |+| `tls_set` | Targeted locus study contig sets (TLS) |++---++## 2. ENA Browser API (Record Retrieval)++### Base URL+```+https://www.ebi.ac.uk/ena/browser/api+```++Use this for direct retrieval of records by accession number.++### Key Endpoints++#### Retrieve record in XML format+```+GET /xml/{accession}+```++**Example:**+```+https://www.ebi.ac.uk/ena/browser/api/xml/PRJEB40665+https://www.ebi.ac.uk/ena/browser/api/xml/SRR12345678+https://www.ebi.ac.uk/ena/browser/api/xml/ERS1234567+```++#### Retrieve record in EMBL flat file format+```+GET /embl/{accession}+```++**Example:**+```+https://www.ebi.ac.uk/ena/browser/api/embl/AY585947+```++Supports `?lineLimit=N` to truncate long records.++#### Retrieve sequence in FASTA format+```+GET /fasta/{accession}+```++**Example:**+```+https://www.ebi.ac.uk/ena/browser/api/fasta/AY585947+```++### Response Formats++| Endpoint | Format | Use case |+|----------|--------|----------|+| `/xml/{accession}` | XML | Full structured metadata for studies, samples, experiments, runs |+| `/embl/{accession}` | EMBL flat file | Annotated sequences with features |+| `/fasta/{accession}` | FASTA | Raw nucleotide/protein sequences |++### Accession Types++| Prefix | Entity | Example |+|--------|--------|---------|+| `PRJEB` / `PRJNA` / `PRJDB` | Study/Project | `PRJEB40665` |+| `ERX` / `SRX` / `DRX` | Experiment | `ERX1234567` |+| `ERS` / `SRS` / `DRS` | Sample | `ERS1234567` |+| `ERR` / `SRR` / `DRR` | Run | `ERR1234567` |+| `GCA` | Genome assembly | `GCA_000001405.29` |+| Standard INSDC | Sequence | `AY585947`, `M10051` |++---++## 3. ENA Taxonomy REST API++### Base URL+```+https://www.ebi.ac.uk/ena/taxonomy/rest+```++### Key Endpoints++#### Lookup by taxonomy ID+```+GET /tax-id/{taxId}+```++**Example:**+```+https://www.ebi.ac.uk/ena/taxonomy/rest/tax-id/9606+```++**Response:**+```json+{+ "taxId": 9606,+ "scientificName": "Homo sapiens",+ "commonName": "human",+ "formalName": true,+ "rank": "species",+ "division": "HUM",+ "lineage": "Eukaryota; Metazoa; Chordata; Craniata; Vertebrata; ...; Homo; ",+ "geneticCode": "1",+ "mitochondrialGeneticCode": "2",+ "submittable": true,+ "binomial": true,+ "metagenome": false,+ "otherNames": [+ {"nameClass": "authority", "name": "Linnaeus, 1758"},+ {"nameClass": "genbank common name", "name": "human"}+ ]+}+```++#### Search by scientific name+```+GET /scientific-name/{name}+```++**Example:**+```+https://www.ebi.ac.uk/ena/taxonomy/rest/scientific-name/Homo%20sapiens+```++Returns an array of matching taxonomy records.++#### Search by common name+```+GET /any-name/{name}+```++**Example:**+```+https://www.ebi.ac.uk/ena/taxonomy/rest/any-name/human+```++#### Suggest names (autocomplete)+```+GET /suggest-for-submission/{partialName}+```++**Example:**+```+https://www.ebi.ac.uk/ena/taxonomy/rest/suggest-for-submission/Homo%20sap+```++---++## 4. ENA Cross Reference Service++### Base URL+```+https://www.ebi.ac.uk/ena/xref/rest+```++Retrieves links between ENA records and external databases (UniProt, PDB, PubMed, etc.).++### Key Endpoints++#### Search cross-references by accession+```+GET /json/search?accession={accession}+```++| Parameter | Type | Description |+|-----------|------|-------------|+| `accession` | string | ENA accession to look up cross-references for. |+| `source` | string | Filter by source database (e.g., `UniProtKB`). |+| `target` | string | Filter by target type. |+| `limit` | int | Max results. |+| `offset` | int | Pagination offset. |++**Example:**+```+https://www.ebi.ac.uk/ena/xref/rest/json/search?accession=A00145+```++**Response:**+```json+[+ {+ "Source": "EuropePMC",+ "Source Primary Accession": "PMC12345",+ "Source Secondary Accession": "",+ "Source URL": "https://europepmc.org/...",+ "Source Secondary URL": "",+ "Target": "sequence",+ "Target Primary Accession": "A00145",+ "Target Secondary Accession": "",+ "Target URL": "https://www.ebi.ac.uk/ena/...",+ "Has Inferred": "N",+ "Inferred From": ""+ }+]+```++---++## 5. CRAM Reference Registry++### Base URL+```+https://www.ebi.ac.uk/ena/cram+```++Retrieves reference sequences used in CRAM file compression.++### Key Endpoints++#### Lookup by MD5 checksum+```+GET /md5/{md5}+```++**Example:**+```+https://www.ebi.ac.uk/ena/cram/md5/b1eba5b6e4440e22e1e02f7e0febd2da+```++#### Lookup by SHA1 checksum+```+GET /sha1/{sha1}+```++Returns the reference sequence in FASTA format.++---++## Common Search Patterns++```+# All RNA-Seq runs for a species+result=read_run&query=tax_id=9606 AND library_strategy="RNA-Seq"++# WGS assemblies for an organism+result=assembly&query=tax_id=562 AND assembly_type="primary metagenome"++# Sequences by study accession+result=sequence&query=study_accession="PRJEB40665"++# Samples from a country with collection date+result=sample&query=country="Germany" AND collection_date>=2024-01-01++# Coding sequences for a gene keyword+result=coding&query=description="*BRCA1*" AND tax_id=9606++# Count available datasets+/count?result=read_run&query=tax_id=9606++# Get metadata fields available for a result type+/returnFields?result=read_run+/searchFields?result=read_run+```++## Rate Limits++- No authentication required+- No formal published rate limit, but be courteous: avoid more than ~5 concurrent requests+- Large result sets: use `limit` and `offset` for pagination+- For bulk downloads of sequence data (FASTQ, etc.), use ENA's FTP/Aspera services rather than the REST API++## Tips++- **ENA vs SRA**: ENA and NCBI SRA mirror each other's data (both are INSDC members). ENA accessions (ERR/ERX/ERS/PRJEB) and NCBI accessions (SRR/SRX/SRS/PRJNA) are cross-referenced. Use whichever API has the query features you need.+- **Portal API for search, Browser API for retrieval**: Use the Portal API when you need to search across many records with filters. Use the Browser API when you have a specific accession and want the full record.+- **JSON vs XML**: The Portal API returns JSON or TSV. The Browser API primarily returns XML, EMBL, or FASTA.+- **Field discovery**: Always check `/returnFields?result={type}` and `/searchFields?result={type}` to see what's available for each result type -- fields differ between result types.+- **Cross-references**: Use the xref service to find links from ENA records to UniProt, PDB, PubMed, and other databases.diff --git a/scientific-skills/database-lookup/references/encode.md b/scientific-skills/database-lookup/references/encode.mdnew file mode 100644index 00000000..08a13121--- /dev/null+++ b/scientific-skills/database-lookup/references/encode.md@@ -0,0 +1,47 @@+# ENCODE (Encyclopedia of DNA Elements)++## Base URL+```+https://www.encodeproject.org+```++## Auth+No auth required. Append `?format=json` or set `Accept: application/json`.++## Every portal URL returns JSON when requested with the right header.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/search/?type=Experiment&format=json` | Search experiments |+| `/experiments/{accession}/?format=json` | Specific experiment |+| `/files/{accession}/?format=json` | File metadata |+| `/biosamples/{accession}/?format=json` | Biosample info |+| `/annotations/?format=json` | Search annotations |++## Search Parameters+- `type` — Experiment, File, Biosample, Annotation, etc.+- `assay_title` — ChIP-seq, RNA-seq, ATAC-seq, etc.+- `target.label` — target protein (e.g. CTCF, H3K27ac)+- `biosample_ontology.term_name` — cell type+- `limit` — results per page+- `field` — specific fields to return++## Example Calls+```+# ChIP-seq experiments for CTCF+https://www.encodeproject.org/search/?type=Experiment&assay_title=ChIP-seq&target.label=CTCF&format=json&limit=5++# Specific experiment+https://www.encodeproject.org/experiments/ENCSR000AAA/?format=json++# Files for an experiment+https://www.encodeproject.org/search/?type=File&dataset=/experiments/ENCSR000AAA/&format=json+```++## Response Format+JSON-LD. Search: `@graph` array + `total` + `facets`. Use `frame=object` or `frame=embedded` to control depth.++## Rate Limits+No published limits. Use `limit=` and `field=` to reduce payload.diff --git a/scientific-skills/database-lookup/references/ensembl.md b/scientific-skills/database-lookup/references/ensembl.mdnew file mode 100644index 00000000..aba10a89--- /dev/null+++ b/scientific-skills/database-lookup/references/ensembl.md@@ -0,0 +1,539 @@+# Ensembl REST API++## Base URL++```+https://rest.ensembl.org+```++For the Ensembl Genomes (plants, fungi, bacteria, protists, metazoa):+```+https://rest.ensembl.org+```+(Same base; Ensembl Genomes was merged into the main REST API.)++For the GRCh37 (hg19) archive:+```+https://grch37.rest.ensembl.org+```++## Authentication++No API key required. All endpoints are public.++## Common Headers++All requests should include:+```+Content-Type: application/json+```++The API uses content negotiation. Append `?content-type=application/json` to GET requests, or set the `Accept` header.++## Key Endpoints++### 1. Gene lookup by symbol++```+GET /lookup/symbol/{species}/{symbol}?content-type=application/json+```++| Parameter | Type | Description |+|------------|--------|-------------|+| `species` | string | **Required.** Species name (e.g., `homo_sapiens`, `mus_musculus`). |+| `symbol` | string | **Required.** Gene symbol (e.g., `TP53`, `BRCA1`). |+| `expand` | int | Set to `1` to include transcripts, translations, exons. |++**Example:**+```+https://rest.ensembl.org/lookup/symbol/homo_sapiens/TP53?content-type=application/json+https://rest.ensembl.org/lookup/symbol/homo_sapiens/BRCA1?content-type=application/json;expand=1+```++**Response:**+```json+{+ "id": "ENSG00000141510",+ "display_name": "TP53",+ "description": "tumor protein p53 [Source:HGNC Symbol;Acc:HGNC:11998]",+ "species": "homo_sapiens",+ "object_type": "Gene",+ "biotype": "protein_coding",+ "assembly_name": "GRCh38",+ "seq_region_name": "17",+ "start": 7661779,+ "end": 7687538,+ "strand": -1,+ "source": "ensembl_havana",+ "logic_name": "ensembl_havana_gene_homo_sapiens",+ "version": 16,+ "Transcript": [...]+}+```++---++### 2. Gene/feature lookup by Ensembl ID++```+GET /lookup/id/{id}?content-type=application/json+```++| Parameter | Type | Description |+|-----------|--------|-------------|+| `id` | string | **Required.** Ensembl stable ID (gene, transcript, protein, exon). |+| `expand` | int | Set to `1` to include child objects (transcripts for genes, etc.). |+| `db_type` | string | Database type: `core`, `otherfeatures`, `cdna`, `rnaseq`. |++**Example:**+```+https://rest.ensembl.org/lookup/id/ENSG00000141510?content-type=application/json;expand=1+https://rest.ensembl.org/lookup/id/ENST00000269305?content-type=application/json+https://rest.ensembl.org/lookup/id/ENSP00000269305?content-type=application/json+```++---++### 3. Batch lookup (POST, up to 1000 IDs)++```+POST /lookup/id+Content-Type: application/json++{ "ids": ["ENSG00000141510", "ENSG00000012048", "ENSG00000157764"] }+```++**Example response:** Returns a map keyed by ID:+```json+{+ "ENSG00000141510": {+ "id": "ENSG00000141510",+ "display_name": "TP53",+ ...+ },+ "ENSG00000012048": { ... }+}+```++---++### 4. Sequence retrieval++```+GET /sequence/id/{id}?content-type=application/json+```++| Parameter | Type | Description |+|--------------|--------|-------------|+| `id` | string | Ensembl stable ID (gene, transcript, or protein). |+| `type` | string | `genomic`, `cdna`, `cds`, `protein`. Default varies by object type. |+| `format` | string | `json` or `fasta`. |+| `expand_3prime` | int | Expand 3' end by N bases. |+| `expand_5prime` | int | Expand 5' end by N bases. |+| `mask` | string | `soft` (lowercase repeats) or `hard` (N-mask repeats). |++**Examples:**++Protein sequence:+```+https://rest.ensembl.org/sequence/id/ENSP00000269305?content-type=application/json+```++CDS sequence:+```+https://rest.ensembl.org/sequence/id/ENST00000269305?type=cds&content-type=application/json+```++Genomic sequence with flanking:+```+https://rest.ensembl.org/sequence/id/ENSG00000141510?type=genomic&expand_5prime=1000&expand_3prime=500&content-type=application/json+```++FASTA format:+```+https://rest.ensembl.org/sequence/id/ENSP00000269305?content-type=text/x-fasta+```++**Response (JSON):**+```json+{+ "id": "ENSP00000269305",+ "seq": "MEEPQSDPSVEPPLSQETFSDL...",+ "molecule": "protein",+ "desc": "chromosome:GRCh38:17:7661779:7687538:-1"+}+```++---++### 5. Sequence by region++```+GET /sequence/region/{species}/{region}?content-type=application/json+```++Region format: `chromosome:start..end` or `chromosome:start..end:strand`++**Example:**+```+https://rest.ensembl.org/sequence/region/homo_sapiens/17:7661779..7662000:1?content-type=application/json+```++---++### 6. Variant annotation (VEP -- Variant Effect Predictor)++**By HGVS notation:**+```+GET /vep/{species}/hgvs/{hgvs_notation}?content-type=application/json+```++**Example:**+```+https://rest.ensembl.org/vep/homo_sapiens/hgvs/ENST00000269305.9:c.817C>T?content-type=application/json+https://rest.ensembl.org/vep/homo_sapiens/hgvs/17:g.7674220G>A?content-type=application/json+```++**By genomic region:**+```+GET /vep/{species}/region/{region}/{allele}?content-type=application/json+```++**Example:**+```+https://rest.ensembl.org/vep/homo_sapiens/region/17:7674220-7674220:1/A?content-type=application/json+```++**By rsID:**+```+GET /vep/{species}/id/{rsid}?content-type=application/json+```++**Example:**+```+https://rest.ensembl.org/vep/homo_sapiens/id/rs699?content-type=application/json+```++**VEP Response:**+```json+[+ {+ "input": "17:g.7674220G>A",+ "assembly_name": "GRCh38",+ "seq_region_name": "17",+ "start": 7674220,+ "end": 7674220,+ "strand": 1,+ "allele_string": "G/A",+ "most_severe_consequence": "missense_variant",+ "transcript_consequences": [+ {+ "gene_id": "ENSG00000141510",+ "gene_symbol": "TP53",+ "transcript_id": "ENST00000269305",+ "biotype": "protein_coding",+ "consequence_terms": ["missense_variant"],+ "impact": "MODERATE",+ "amino_acids": "R/H",+ "codons": "cGc/cAc",+ "protein_start": 248,+ "polyphen_prediction": "probably_damaging",+ "polyphen_score": 1.0,+ "sift_prediction": "deleterious",+ "sift_score": 0.0,+ "cadd_phred": 35.0+ }+ ],+ "colocated_variants": [+ {+ "id": "rs28934578",+ "frequencies": { ... },+ "clin_sig": ["pathogenic"]+ }+ ]+ }+]+```++**Batch VEP (POST, up to 200 variants):**+```+POST /vep/homo_sapiens/region+Content-Type: application/json++{ "variants": ["17 7674220 7674220 G/A 1", "7 140753336 140753336 A/T 1"] }+```++---++### 7. Variant (known variants by rsID)++```+GET /variation/{species}/{rsid}?content-type=application/json+```++**Example:**+```+https://rest.ensembl.org/variation/homo_sapiens/rs699?content-type=application/json+```++**Response:**+```json+{+ "name": "rs699",+ "source": "Variants (including SNPs and indels) imported from dbSNP",+ "mappings": [+ {+ "seq_region_name": "1",+ "start": 230710048,+ "end": 230710048,+ "strand": 1,+ "allele_string": "A/G",+ "assembly_name": "GRCh38",+ "location": "1:230710048-230710048"+ }+ ],+ "MAF": 0.35,+ "minor_allele": "G",+ "clinical_significance": [],+ "synonyms": [],+ "ancestral_allele": "A"+}+```++---++### 8. Overlap / features in a region++```+GET /overlap/region/{species}/{region}?feature={type}&content-type=application/json+```++| Parameter | Type | Description |+|-----------|--------|-------------|+| `region` | string | Format: `chr:start-end`. |+| `feature` | string | One or more of: `gene`, `transcript`, `cds`, `exon`, `repeat`, `simple`, `misc`, `variation`, `somatic_variation`, `structural_variation`, `regulatory`, `motif`, `chipseq`, `constrained`. Can repeat parameter for multiple. |++**Example -- get all genes in a region:**+```+https://rest.ensembl.org/overlap/region/homo_sapiens/17:7660000-7690000?feature=gene&content-type=application/json+```++**Example -- get regulatory features:**+```+https://rest.ensembl.org/overlap/region/homo_sapiens/17:7660000-7690000?feature=regulatory&content-type=application/json+```++---++### 9. Cross-references (Xrefs)++```+GET /xrefs/id/{id}?content-type=application/json+```++**Example:**+```+https://rest.ensembl.org/xrefs/id/ENSG00000141510?content-type=application/json+```++Returns links to external databases (HGNC, UniProt, NCBI Gene, RefSeq, etc.).++**Response:**+```json+[+ {+ "primary_id": "11998",+ "display_id": "TP53",+ "dbname": "HGNC",+ "db_display_name": "HGNC Symbol"+ },+ {+ "primary_id": "P04637",+ "display_id": "P53_HUMAN",+ "dbname": "Uniprot/SWISSPROT"+ },+ {+ "primary_id": "7157",+ "display_id": "TP53",+ "dbname": "EntrezGene"+ }+]+```++**Xrefs by symbol:**+```+GET /xrefs/symbol/{species}/{symbol}?content-type=application/json+```++**Example:**+```+https://rest.ensembl.org/xrefs/symbol/homo_sapiens/TP53?content-type=application/json+```++---++### 10. Comparative genomics -- Homology++```+GET /homology/id/{id}?content-type=application/json+```++| Parameter | Type | Description |+|--------------|--------|-------------|+| `id` | string | Ensembl gene ID. |+| `type` | string | `orthologues`, `paralogues`, `projections`, `all`. |+| `target_species` | string | Filter to specific species (e.g., `mus_musculus`). |+| `target_taxon` | int | Filter to NCBI taxon ID. |+| `sequence` | string | `none`, `cdna`, `protein`. Include aligned sequences. |++**Example -- get mouse orthologs of human TP53:**+```+https://rest.ensembl.org/homology/id/ENSG00000141510?type=orthologues&target_species=mus_musculus&content-type=application/json+```++**Response:**+```json+{+ "data": [+ {+ "id": "ENSG00000141510",+ "homologies": [+ {+ "type": "ortholog_one2one",+ "target": {+ "id": "ENSMUSG00000059552",+ "species": "mus_musculus",+ "protein_id": "ENSMUSP00000073359",+ "perc_id": 77.8,+ "perc_pos": 86.0+ },+ "source": {+ "id": "ENSG00000141510",+ "species": "homo_sapiens",+ "protein_id": "ENSP00000269305"+ },+ "method_link_type": "ENSEMBL_ORTHOLOGUES",+ "dn_ds": 0.15+ }+ ]+ }+ ]+}+```++**Homology by symbol:**+```+GET /homology/symbol/{species}/{symbol}?content-type=application/json+```++**Example:**+```+https://rest.ensembl.org/homology/symbol/homo_sapiens/TP53?type=orthologues&target_species=mus_musculus&content-type=application/json+```++---++### 11. Regulatory features++```+GET /regulatory/species/{species}/id/{id}?content-type=application/json+```++**Example:**+```+https://rest.ensembl.org/regulatory/species/homo_sapiens/id/ENSR00000000163?content-type=application/json+```++---++### 12. Species information++```+GET /info/species?content-type=application/json+```++Returns all available species with assembly info.++---++### 13. Assembly information++```+GET /info/assembly/{species}?content-type=application/json+```++**Example:**+```+https://rest.ensembl.org/info/assembly/homo_sapiens?content-type=application/json+```++Returns chromosome names, lengths, assembly name (GRCh38), coordinate system, etc.++---++### 14. Phenotype by gene++```+GET /phenotype/gene/{species}/{gene}?content-type=application/json+```++**Example:**+```+https://rest.ensembl.org/phenotype/gene/homo_sapiens/TP53?content-type=application/json+```++---++### 15. LD (Linkage Disequilibrium)++```+GET /ld/{species}/pairwise/{rsid1}/{rsid2}?population_name={pop}&content-type=application/json+```++**Example:**+```+https://rest.ensembl.org/ld/homo_sapiens/pairwise/rs699/rs4762?population_name=1000GENOMES:phase_3:CEU&content-type=application/json+```++---++## Common Species Names++| Species | API Name |+|---------|----------|+| Human | `homo_sapiens` |+| Mouse | `mus_musculus` |+| Rat | `rattus_norvegicus` |+| Zebrafish | `danio_rerio` |+| Fruit fly | `drosophila_melanogaster` |+| Chicken | `gallus_gallus` |+| Dog | `canis_lupus_familiaris` |+| Pig | `sus_scrofa` |++## Rate Limits++- **15 requests per second** for general users (no API key).+- If you register for an API key (optional), higher limits may be available.+- Requests exceeding the limit receive HTTP 429 with a `Retry-After` header.+- Batch endpoints (POST) count as a single request -- use them to reduce call count.+- Max 1000 IDs per batch POST for `/lookup/id`.+- Max 200 variants per batch POST for VEP.+- Rate limit headers are returned: `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`.++## Error Format++```json+{+ "error": "ID 'ENSG999' not found"+}+```++HTTP 400 for bad requests, 404 for not found, 429 for rate limiting, 503 for service unavailable.++## Tips++- Always append `?content-type=application/json` to GET requests (or set the Accept header) -- the default is XML/HTML.+- Use the GRCh37 base URL (`grch37.rest.ensembl.org`) if you need hg19 coordinates.+- The `/lookup/symbol` endpoint is the fastest way to go from gene symbol to Ensembl ID.+- For VEP, the HGVS endpoint is most convenient for single variants; the region POST endpoint is best for batch.+- Combine `/xrefs/id` with gene IDs to cross-reference to UniProt, NCBI Gene, HGNC, and other databases.diff --git a/scientific-skills/database-lookup/references/epa.md b/scientific-skills/database-lookup/references/epa.mdnew file mode 100644index 00000000..d55f807b--- /dev/null+++ b/scientific-skills/database-lookup/references/epa.md@@ -0,0 +1,232 @@+# EPA Envirofacts API Reference++## Base URL+```+https://data.epa.gov/efservice+```++Note: The legacy URL `https://enviro.epa.gov/enviro/efservice` may redirect. Use the current base URL above.++## Authentication+**None required.** Fully public, no API key needed.++## Rate Limits+- No documented per-user rate limit.+- Large result sets may time out. Use row limits and pagination.++## URL Pattern+Envirofacts uses a RESTful URL-based query pattern:+```+https://data.epa.gov/efservice/{table}/{column}/{operator}/{value}/.../rows/{start}:{end}/{format}+```++- **{table}**: Database table name (e.g. `TRI_FACILITY`, `AQS_SITES`).+- **{column}/{operator}/{value}**: Filter conditions, chained in the URL path.+- **Operators**: `=` (implicit, just use `/{column}/{value}`), `>`, `<`, `!=`, `BEGINNING` (starts with), `CONTAINING`.+- **rows/{start}:{end}**: Row range for pagination (0-based).+- **{format}**: `JSON`, `XML`, `CSV`, `EXCEL`. Appended as the last path segment.++**Multiple filters** are chained sequentially in the URL path.++---++## Key Databases and Tables++### 1. Toxics Release Inventory (TRI)++Tracks releases of toxic chemicals from industrial facilities.++**Key Tables:**+| Table | Description |+|-------|-------------|+| `TRI_FACILITY` | Facility information (name, address, coordinates). |+| `TRI_REPORTING_FORM` | Annual reporting form data. |+| `TRI_RELEASE_QTY` | Quantities of releases by media (air, water, land). |+| `TRI_TRANSFER_QTY` | Quantities transferred off-site. |+| `TRI_CHEM_INFO` | Chemical information. |++**Example -- TRI facilities in North Carolina:**+```+https://data.epa.gov/efservice/TRI_FACILITY/STATE_ABBR/NC/rows/0:9/JSON+```++**Response:**+```json+[+ {+ "TRI_FACILITY_ID": "27601MPLNT501WE",+ "FACILITY_NAME": "EXAMPLE MANUFACTURING PLANT",+ "STREET_ADDRESS": "501 WEST MAIN ST",+ "CITY_NAME": "RALEIGH",+ "COUNTY_NAME": "WAKE",+ "STATE_ABBR": "NC",+ "ZIP_CODE": "27601",+ "LATITUDE": 35.7796,+ "LONGITUDE": -78.6382,+ "FEDERAL_FACILITY_FLAG": "NO",+ "INDUSTRY_SECTOR_CODE": "325",+ "PRIMARY_SIC_CODE": "2819",+ "PRIMARY_NAICS_CODE": "325180"+ }+]+```++**Example -- TRI releases of a specific chemical in a state (2022):**+```+https://data.epa.gov/efservice/TRI_RELEASE_QTY/STATE_ABBR/TX/REPORTING_YEAR/2022/CHEM_NAME/CONTAINING/BENZENE/rows/0:24/JSON+```++### 2. Air Quality System (AQS)++Air quality monitoring data from the national monitoring network.++**Key Tables:**+| Table | Description |+|-------|-------------|+| `AQS_SITES` | Monitoring site metadata. |+| `AQS_MONITORS` | Monitor-level info (parameters measured). |+| `AQS_ANNUAL_SUMMARY` | Annual summary statistics per monitor. |+| `AQS_DAILY_SUMMARY` | Daily summary observations. |++**Example -- AQS monitoring sites in California:**+```+https://data.epa.gov/efservice/AQS_SITES/STATE_CODE/06/rows/0:9/JSON+```++**Example -- annual ozone summary for a county:**+```+https://data.epa.gov/efservice/AQS_ANNUAL_SUMMARY/STATE_CODE/06/COUNTY_CODE/037/PARAMETER_CODE/44201/rows/0:9/JSON+```++**Common AQS Parameter Codes:**+| Code | Pollutant |+|-------|-----------|+| `44201` | Ozone |+| `42401` | SO2 |+| `42101` | CO |+| `42602` | NO2 |+| `81102` | PM10 |+| `88101` | PM2.5 (FRM) |+| `88502` | PM2.5 (non-FRM) |+| `14129` | Lead (Pb) |++### 3. Facility Registry Service (FRS)++Central registry of EPA-regulated facilities.++**Key Tables:**+| Table | Description |+|-------|-------------|+| `FRS_FACILITY_SITE` | Facility location and identifiers. |+| `FRS_PROGRAM_FACILITY` | Links facilities to EPA programs. |+| `FRS_NAICS` | NAICS codes for facilities. |+| `FRS_SIC` | SIC codes for facilities. |++**Example -- EPA-regulated facilities by zip code:**+```+https://data.epa.gov/efservice/FRS_FACILITY_SITE/POSTAL_CODE/90210/rows/0:9/JSON+```++### 4. Safe Drinking Water (SDWIS)++Public drinking water system data.++**Key Tables:**+| Table | Description |+|-------|-------------|+| `WATER_SYSTEM` | Water system info. |+| `VIOLATION` | Drinking water violations. |+| `LCR_SAMPLE_RESULT` | Lead and Copper Rule sample results. |++**Example -- drinking water violations in a state:**+```+https://data.epa.gov/efservice/VIOLATION/PWSID/BEGINNING/OH/rows/0:19/JSON+```++### 5. Greenhouse Gas Reporting (GHG)++Facility-level greenhouse gas emissions data.++**Key Tables:**+| Table | Description |+|-------|-------------|+| `PUB_DIM_FACILITY` | GHG reporting facility info. |+| `PUB_FACTS_SECTOR_GHG_EMISSION` | Emissions by sector. |++**Example -- GHG facilities in a state:**+```+https://data.epa.gov/efservice/PUB_DIM_FACILITY/STATE/TX/rows/0:9/JSON+```++---++## Query Patterns++### Filtering with operators+```+# Exact match (implicit =)+/TABLE/COLUMN/VALUE/JSON++# Greater than+/TABLE/COLUMN/>/VALUE/JSON++# Less than+/TABLE/COLUMN/</VALUE/JSON++# Not equal+/TABLE/COLUMN/!=/VALUE/JSON++# Starts with+/TABLE/COLUMN/BEGINNING/VALUE/JSON++# Contains+/TABLE/COLUMN/CONTAINING/VALUE/JSON+```++### Combining filters+Chain multiple column/value pairs:+```+/TABLE/COLUMN1/VALUE1/COLUMN2/VALUE2/JSON+```++### Pagination+Use `rows/{start}:{end}` (0-based, inclusive):+```+/TABLE/rows/0:99/JSON # First 100 rows+/TABLE/rows/100:199/JSON # Next 100 rows+```+Default without `rows`: returns first 10,000 rows.++### Output format+Append format as the last path segment:+```+/TABLE/.../JSON+/TABLE/.../XML+/TABLE/.../CSV+/TABLE/.../EXCEL+```++---++## AQS Data API (Separate System)++For more granular air quality data, EPA also provides the AQS Data API at:+```+https://aqs.epa.gov/data/api+```++- **Requires:** Free account at https://aqs.epa.gov/data/api/signup?email=YOUR_EMAIL+- **Auth:** Pass `email` and `key` as query parameters.+- Key endpoints: `/dailyData/byState`, `/annualData/byState`, `/sampleData/bySite`, `/monitors/byState`.++**Example:**+```+https://aqs.epa.gov/data/api/dailyData/byState?email=YOUR_EMAIL&key=YOUR_KEY¶m=44201&bdate=20240101&edate=20240131&state=06+```++## Notes+- Table and column names are case-insensitive in the URL.+- The Envirofacts API returns all columns for a table; you cannot select specific columns.+- For joining data across tables, you must make separate requests and join client-side using shared keys (e.g. `TRI_FACILITY_ID`, `REGISTRY_ID`).+- Some tables are very large. Always use `rows/` to limit results and paginate.+- EPA data updates vary by program: TRI is annual, AQS is daily/annual, SDWIS is quarterly.diff --git a/scientific-skills/database-lookup/references/eurostat.md b/scientific-skills/database-lookup/references/eurostat.mdnew file mode 100644index 00000000..da3bdf77--- /dev/null+++ b/scientific-skills/database-lookup/references/eurostat.md@@ -0,0 +1,237 @@+# Eurostat API Reference++## Overview+Eurostat is the statistical office of the European Union, providing statistics on economy, population, trade, labor, environment, and more for EU/EEA member states and partner countries. The API follows the SDMX (Statistical Data and Metadata Exchange) standard.++## Base URL+```+https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1+```++An older JSON-stat endpoint also exists:+```+https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0+```++## Authentication+**No API key required.** The API is fully open and free.++## Rate Limits+- No formal rate limits documented.+- Eurostat may throttle aggressive scraping. Keep automated requests to 1-2 per second.+- Large datasets may time out; use filters to reduce response size.++---++## Key Endpoints (SDMX 2.1 API)++### 1. Get Dataset (Observations)++```+GET /data/{datasetCode}/{filter}+```++| Parameter | Required | Description |+|-----------|----------|-------------|+| `datasetCode` | Yes | Eurostat dataset code (e.g., `nama_10_gdp`, `demo_pjan`) |+| `filter` | No | Dot-separated dimension filter. Use `+` for multiple values in a dimension, `.` to separate dimensions, empty segment for "all". |++**Query parameters:**+| Parameter | Required | Description |+|-----------|----------|-------------|+| `format` | No | `sdmx+json` (default), `sdmx+csv`, `sdmx+xml`, `TSV` |+| `startPeriod` | No | Start year/quarter/month: `2015`, `2020-Q1`, `2020-01` |+| `endPeriod` | No | End year/quarter/month |+| `detail` | No | `full` (default), `dataonly`, `serieskeysonly`, `nodata` |+| `lang` | No | `en` (default), `fr`, `de` |++**Example (GDP at market prices for Germany and France, annual, 2018-2023):**+```+https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/nama_10_gdp/A.CP_MEUR.B1GQ.DE+FR?startPeriod=2018&endPeriod=2023+```++**Example (total population by country, annual):**+```+https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/demo_pjan/A.NR.T.TOTAL.DE+FR+IT+ES?startPeriod=2015&endPeriod=2023+```++**Example (unemployment rate, seasonally adjusted, monthly):**+```+https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/une_rt_m/M.SA.TOTAL.PC_ACT.T.EA20?startPeriod=2023-01&endPeriod=2024-12+```++**Example (HICP inflation, all items, monthly):**+```+https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/prc_hicp_mmor/M.RCH_A.CP00.DE+FR+IT?startPeriod=2023-01&endPeriod=2024-06&format=sdmx+json+```++### 2. Get Dataset as CSV++Append `?format=sdmx+csv` to any data request for a flat CSV response that is easier to parse.++**Example:**+```+https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/data/nama_10_gdp/A.CP_MEUR.B1GQ.DE+FR?startPeriod=2018&endPeriod=2023&format=sdmx+csv+```++### 3. Get Dataset Structure (Dimensions and Code Lists)++```+GET /datastructure/ESTAT/{datasetCode}+```++**Example:**+```+https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/datastructure/ESTAT/nama_10_gdp+```++Returns dimension names, positions, and code list references.++### 4. Get Code List (Dimension Values)++```+GET /codelist/ESTAT/{codelistId}+```++**Example:**+```+https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/codelist/ESTAT/GEO+```++### 5. Search/Browse Datasets (Dataflows)++```+GET /dataflow/ESTAT/all+```++Returns all available Eurostat datasets. Add `?detail=allstubs` for a lighter listing.++**Example:**+```+https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/dataflow/ESTAT/all?detail=allstubs+```++---++## JSON-stat API (Simpler Alternative)++### Base URL+```+https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data+```++### Get Data+```+GET /data/{datasetCode}?{dimension_filters}+```++Dimensions are passed as query parameters using their dimension name.++**Example (GDP for DE and FR):**+```+https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/nama_10_gdp?geo=DE&geo=FR&unit=CP_MEUR&na_item=B1GQ&freq=A&time=2020&time=2021&time=2022&lang=en+```++**Response (JSON-stat format):**+```json+{+ "version": "2.0",+ "label": "GDP and main components (output, expenditure and income)",+ "id": ["freq", "unit", "na_item", "geo", "time"],+ "size": [1, 1, 1, 2, 3],+ "dimension": {+ "geo": {+ "label": "Geopolitical entity",+ "category": {+ "index": {"DE": 0, "FR": 1},+ "label": {"DE": "Germany", "FR": "France"}+ }+ },+ "time": {+ "label": "Time",+ "category": {+ "index": {"2020": 0, "2021": 1, "2022": 2}+ }+ }+ },+ "value": {3336010.0, 3601750.0, 3876810.0, 2310420.0, 2500870.0, 2639090.0},+ "status": {}+}+```++Values are in a flat array; use dimension sizes to reshape.++---++## Common Dataset Codes++| Code | Description |+|------|-------------|+| `nama_10_gdp` | GDP and main components |+| `nama_10_pc` | GDP per capita |+| `namq_10_gdp` | GDP quarterly |+| `demo_pjan` | Population on 1 January |+| `demo_gind` | Population change (births, deaths, migration) |+| `une_rt_m` | Unemployment rate (monthly) |+| `une_rt_a` | Unemployment rate (annual) |+| `lfsi_emp_a` | Employment rate (annual) |+| `prc_hicp_manr` | HICP inflation (annual rate of change, monthly) |+| `prc_hicp_mmor` | HICP inflation (monthly rate of change) |+| `ext_lt_maineu` | EU trade by partner (main partners) |+| `ext_st_27_2020sitc` | International trade by SITC |+| `bop_c6_q` | Balance of payments (quarterly) |+| `gov_10dd_edpt1` | Government deficit/surplus |+| `gov_10a_main` | Government revenue, expenditure and main aggregates |+| `sts_inpr_m` | Industrial production (monthly) |+| `tour_occ_nim` | Tourism (nights spent at accommodation) |+| `env_air_gge` | Greenhouse gas emissions |+| `tec00114` | GDP growth rate (percentage change) |+| `tec00118` | Government debt as % of GDP |++## Common Country Codes (ISO 2-letter, Eurostat uses uppercase)++`AT` Austria, `BE` Belgium, `BG` Bulgaria, `CY` Cyprus, `CZ` Czechia, `DE` Germany, `DK` Denmark, `EE` Estonia, `EL` Greece, `ES` Spain, `FI` Finland, `FR` France, `HR` Croatia, `HU` Hungary, `IE` Ireland, `IT` Italy, `LT` Lithuania, `LU` Luxembourg, `LV` Latvia, `MT` Malta, `NL` Netherlands, `PL` Poland, `PT` Portugal, `RO` Romania, `SE` Sweden, `SI` Slovenia, `SK` Slovakia++Aggregates: `EU27_2020` (EU-27), `EA20` (Euro area 20), `EA19` (Euro area 19), `EEA30_2007` (EEA)++**Note:** Greece uses `EL` (not `GR`) in Eurostat.++## SDMX JSON Response Format++```json+{+ "header": {+ "id": "...",+ "prepared": "2024-01-15T10:00:00"+ },+ "dataSets": [+ {+ "series": {+ "0:0:0:0": {+ "observations": {+ "0": [3336010.0],+ "1": [3601750.0]+ }+ }+ }+ }+ ],+ "structure": {+ "dimensions": {+ "series": [...],+ "observation": [...]+ }+ }+}+```++In SDMX+JSON, dimension values are encoded as integer indices. The `structure.dimensions` section maps indices to codes and labels. This is compact but requires index lookup.++## Notes+- Dimension order in the filter path depends on the dataset structure. Always check `/datastructure/ESTAT/{code}` first.+- Use `+` to select multiple values in one dimension (e.g., `DE+FR+IT`).+- Leave a dimension segment empty (consecutive dots `..`) to select all values.+- CSV format (`?format=sdmx+csv`) is recommended for easier parsing -- it returns flat rows with labeled columns.+- The JSON-stat API is simpler for quick queries but the SDMX API is more powerful and complete.+- Dataset codes can be found at https://ec.europa.eu/eurostat/databrowser/ by browsing themes.+- Large unrestricted queries may time out. Always filter by country and time period.diff --git a/scientific-skills/database-lookup/references/fda.md b/scientific-skills/database-lookup/references/fda.mdnew file mode 100644index 00000000..7130ee98--- /dev/null+++ b/scientific-skills/database-lookup/references/fda.md@@ -0,0 +1,64 @@+# OpenFDA API++## Base URL+```+https://api.fda.gov+```++## Auth+Optional free API key (40 req/min without, 240 req/min with). Register at https://open.fda.gov/apis/authentication/+Pass as: `?api_key=YOUR_KEY`++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/drug/event.json` | Drug adverse events (FAERS) |+| `/drug/label.json` | Drug product labeling (SPL) |+| `/drug/ndc.json` | NDC directory |+| `/drug/drugsfda.json` | Drugs@FDA (approvals) |+| `/drug/enforcement.json` | Drug recalls |+| `/device/event.json` | Device adverse events |+| `/device/510k.json` | 510(k) clearances |+| `/food/event.json` | Food adverse events |+| `/food/enforcement.json` | Food enforcement |++## Query Parameters++- `search` — query using OpenFDA syntax+- `count` — count unique values for a field+- `limit` — results per request (max 1000)+- `skip` — pagination offset (max 25000)++### Search Syntax+- Field search: `field:"value"`+- AND: `field1:value1+AND+field2:value2`+- OR: `field1:value1+OR+field2:value2`+- Date range: `field:[20230101+TO+20231231]`+- Wildcards: `field:aspir*`+- OpenFDA harmonized fields use `openfda.` prefix++## Example Calls++```+# Adverse events for aspirin+/drug/event.json?search=patient.drug.openfda.brand_name:"aspirin"&limit=5++# Top adverse reactions for a drug+/drug/event.json?search=patient.drug.openfda.generic_name:"metformin"&count=patient.reaction.reactionmeddrapt.exact++# Drug labels by generic name+/drug/label.json?search=openfda.generic_name:"ibuprofen"&limit=3++# Drug recalls in date range+/drug/enforcement.json?search=report_date:[20230101+TO+20231231]&limit=10++# Serious adverse events only+/drug/event.json?search=patient.drug.openfda.brand_name:"warfarin"+AND+serious:1&limit=10+```++## Rate Limits+| Tier | Requests/min | Requests/day |+|------|-------------|-------------|+| No API key | 40 | 1,000 |+| With API key (free) | 240 | 120,000 |diff --git a/scientific-skills/database-lookup/references/federal-reserve.md b/scientific-skills/database-lookup/references/federal-reserve.mdnew file mode 100644index 00000000..a87821b4--- /dev/null+++ b/scientific-skills/database-lookup/references/federal-reserve.md@@ -0,0 +1,216 @@+# Federal Reserve Economic Data (FRED) API++## Base URL++```+https://api.stlouisfed.org/fred+```++## Authentication++**API key required.** Register at https://fred.stlouisfed.org/docs/api/api_key.html++Pass as query parameter: `&api_key=YOUR_KEY`++## Key Endpoints++### Get a Series (metadata)+```+GET /series+```+| Parameter | Required | Description |+|-------------|----------|------------------------------------|+| series_id | Yes | FRED series ID (e.g., `FEDFUNDS`) |+| api_key | Yes | Your API key |+| file_type | No | `json` (default), `xml` |++Example:+```+https://api.stlouisfed.org/fred/series?series_id=FEDFUNDS&api_key=YOUR_KEY&file_type=json+```++### Get Series Observations (the actual data points)+```+GET /series/observations+```+| Parameter | Required | Description |+|-------------------|----------|--------------------------------------------------------|+| series_id | Yes | FRED series ID |+| api_key | Yes | Your API key |+| file_type | No | `json`, `xml` |+| observation_start | No | `YYYY-MM-DD` start date |+| observation_end | No | `YYYY-MM-DD` end date |+| units | No | `lin` (levels), `chg`, `ch1`, `pch`, `pc1`, `pca`, `cch`, `cca`, `log` |+| frequency | No | `d`, `w`, `bw`, `m`, `q`, `sa`, `a` (daily to annual)|+| aggregation_method| No | `avg`, `sum`, `eop` |+| sort_order | No | `asc` (default), `desc` |+| limit | No | Max observations (default 100000) |+| offset | No | Pagination offset |++Example:+```+https://api.stlouisfed.org/fred/series/observations?series_id=FEDFUNDS&api_key=YOUR_KEY&file_type=json&observation_start=2023-01-01&observation_end=2024-01-01+```++### Search for Series+```+GET /series/search+```+| Parameter | Required | Description |+|---------------|----------|----------------------------------------------|+| search_text | Yes | Keywords to search |+| api_key | Yes | Your API key |+| file_type | No | `json`, `xml` |+| search_type | No | `full_text` (default), `series_id` |+| limit | No | Max results (default 1000) |+| offset | No | Pagination offset |+| order_by | No | `search_rank`, `series_id`, `title`, `units`, `frequency`, `seasonal_adjustment`, `realtime_start`, `realtime_end`, `last_updated`, `observation_start`, `observation_end`, `popularity`, `group_popularity` |+| tag_names | No | Semicolon-delimited tag filter |++Example:+```+https://api.stlouisfed.org/fred/series/search?search_text=monetary+base&api_key=YOUR_KEY&file_type=json&limit=10+```++### Get Categories for a Series+```+GET /series/categories+```+Example:+```+https://api.stlouisfed.org/fred/series/categories?series_id=FEDFUNDS&api_key=YOUR_KEY&file_type=json+```++### Browse Categories+```+GET /category+GET /category/children+GET /category/series+```+Example (root category):+```+https://api.stlouisfed.org/fred/category?category_id=0&api_key=YOUR_KEY&file_type=json+```++### Get Releases+```+GET /releases+GET /release/series+```+Example:+```+https://api.stlouisfed.org/fred/release/series?release_id=10&api_key=YOUR_KEY&file_type=json+```++### Get Tags+```+GET /tags+GET /series/tags+```++## Common Series IDs++| Series ID | Description |+|-------------|------------------------------------------|+| FEDFUNDS | Federal Funds Effective Rate |+| DFF | Federal Funds Rate (daily) |+| DGS10 | 10-Year Treasury Constant Maturity Rate |+| DGS2 | 2-Year Treasury Constant Maturity Rate |+| M2SL | M2 Money Stock |+| CPIAUCSL | Consumer Price Index (All Urban) |+| UNRATE | Unemployment Rate |+| GDP | Gross Domestic Product |+| GDPC1 | Real GDP |+| A191RL1Q225SBEA | Real GDP Growth Rate (quarterly) |+| PAYEMS | Total Nonfarm Payrolls |+| T10Y2Y | 10Y-2Y Treasury Spread |+| MORTGAGE30US| 30-Year Fixed Mortgage Rate |+| DTWEXBGS | Trade Weighted US Dollar Index |+| BOGMBASE | Monetary Base (total) |+| WALCL | Fed Total Assets |++## Response Format++### Series metadata (`/series`)+```json+{+ "realtime_start": "2024-01-01",+ "realtime_end": "2024-01-01",+ "seriess": [+ {+ "id": "FEDFUNDS",+ "realtime_start": "2024-01-01",+ "realtime_end": "2024-01-01",+ "title": "Federal Funds Effective Rate",+ "observation_start": "1954-07-01",+ "observation_end": "2024-01-01",+ "frequency": "Monthly",+ "frequency_short": "M",+ "units": "Percent",+ "units_short": "%",+ "seasonal_adjustment": "Not Seasonally Adjusted",+ "seasonal_adjustment_short": "NSA",+ "last_updated": "2024-02-01 15:51:07-06",+ "popularity": 95,+ "notes": "..."+ }+ ]+}+```++### Observations (`/series/observations`)+```json+{+ "realtime_start": "2024-01-01",+ "realtime_end": "2024-01-01",+ "observation_start": "2023-01-01",+ "observation_end": "2024-01-01",+ "units": "lin",+ "output_type": 1,+ "file_type": "json",+ "order_by": "observation_date",+ "sort_order": "asc",+ "count": 12,+ "offset": 0,+ "limit": 100000,+ "observations": [+ {+ "realtime_start": "2024-01-01",+ "realtime_end": "2024-01-01",+ "date": "2023-01-01",+ "value": "4.33"+ }+ ]+}+```++Note: `value` is always a string. Missing data appears as `"."`.++### Search results (`/series/search`)+```json+{+ "realtime_start": "...",+ "realtime_end": "...",+ "order_by": "search_rank",+ "sort_order": "desc",+ "count": 500,+ "offset": 0,+ "limit": 1000,+ "seriess": [+ {+ "id": "BOGMBASE",+ "title": "Monetary Base; Total",+ "frequency": "Bi-Weekly",+ "units": "Millions of Dollars",+ "popularity": 72,+ "notes": "..."+ }+ ]+}+```++## Rate Limits++- **120 requests per minute** per API key.+- No daily limit documented, but excessive use may be throttled.+- Responses include no rate-limit headers; implement client-side throttling.diff --git a/scientific-skills/database-lookup/references/fred.md b/scientific-skills/database-lookup/references/fred.mdnew file mode 100644index 00000000..0a467d24--- /dev/null+++ b/scientific-skills/database-lookup/references/fred.md@@ -0,0 +1,297 @@+# FRED (Federal Reserve Economic Data) API Reference++## Overview+The FRED API, provided by the Federal Reserve Bank of St. Louis, offers access to over 800,000 economic time series from 100+ sources. Covers GDP, employment, inflation, interest rates, money supply, trade, housing, and much more.++## Base URL+```+https://api.stlouisfed.org/fred+```++## Authentication+- **API Key: REQUIRED.** Register at https://fred.stlouisfed.org/docs/api/api_key.html+- Pass as query parameter: `&api_key=YOUR_KEY`++## Rate Limits+- **120 requests per minute** per API key.+- No daily limit documented, but excessive use may trigger throttling.++## Common Parameters (apply to most endpoints)+| Parameter | Type | Required | Default | Description |+|----------------|--------|----------|---------|-------------|+| `api_key` | string | Yes | - | Your FRED API key. |+| `file_type` | string | No | `xml` | Response format: `xml` or `json`. |+| `realtime_start` | string | No | today | Start of real-time period `YYYY-MM-DD`. |+| `realtime_end` | string | No | today | End of real-time period `YYYY-MM-DD`. |++---++## Key Endpoints++### 1. Series Observations (Time Series Data)++#### `GET /fred/series/observations`+Returns the data values for an economic time series.++**Parameters:**+| Parameter | Type | Required | Default | Description |+|--------------------|--------|----------|---------------|-------------|+| `series_id` | string | Yes | - | FRED series ID (e.g., `GDP`, `UNRATE`, `CPIAUCSL`). |+| `observation_start`| string | No | `1776-07-04` | Start date `YYYY-MM-DD`. |+| `observation_end` | string | No | `9999-12-31` | End date `YYYY-MM-DD`. |+| `units` | string | No | `lin` | Data transformation: `lin` (levels), `chg` (change), `ch1` (change from year ago), `pch` (% change), `pc1` (% change from year ago), `pca` (compounded annual % change), `cch` (continuously compounded rate of change), `cca` (continuously compounded annual rate), `log` (natural log). |+| `frequency` | string | No | (native) | Aggregation frequency: `d`, `w`, `bw`, `m`, `q`, `sa`, `a` (daily through annual). |+| `aggregation_method` | string | No | `avg` | `avg`, `sum`, `eop` (end of period). |+| `sort_order` | string | No | `asc` | `asc` or `desc`. |+| `limit` | int | No | 100000 | Max observations returned (max 100000). |+| `offset` | int | No | 0 | Pagination offset. |++**Example:**+```+https://api.stlouisfed.org/fred/series/observations?series_id=GDP&api_key=YOUR_KEY&file_type=json&observation_start=2020-01-01&observation_end=2024-12-31&units=pch&frequency=q+```++**Response:**+```json+{+ "realtime_start": "2024-11-01",+ "realtime_end": "2024-11-01",+ "observation_start": "2020-01-01",+ "observation_end": "2024-12-31",+ "units": "Percent Change",+ "output_type": 1,+ "file_type": "json",+ "order_by": "observation_date",+ "sort_order": "asc",+ "count": 20,+ "offset": 0,+ "limit": 100000,+ "observations": [+ {+ "realtime_start": "2024-11-01",+ "realtime_end": "2024-11-01",+ "date": "2020-01-01",+ "value": "-1.3"+ },+ {+ "realtime_start": "2024-11-01",+ "realtime_end": "2024-11-01",+ "date": "2020-04-01",+ "value": "-8.4"+ }+ ]+}+```++Note: `value` is always a string. Missing values appear as `"."`.++---++### 2. Series Info (Metadata)++#### `GET /fred/series`+Returns metadata for a series.++**Parameters:**+| Parameter | Type | Required | Description |+|------------|--------|----------|-------------|+| `series_id`| string | Yes | FRED series ID. |++**Example:**+```+https://api.stlouisfed.org/fred/series?series_id=UNRATE&api_key=YOUR_KEY&file_type=json+```++**Response:**+```json+{+ "realtime_start": "2024-11-01",+ "realtime_end": "2024-11-01",+ "seriess": [+ {+ "id": "UNRATE",+ "title": "Unemployment Rate",+ "observation_start": "1948-01-01",+ "observation_end": "2024-10-01",+ "frequency": "Monthly",+ "frequency_short": "M",+ "units": "Percent",+ "units_short": "%",+ "seasonal_adjustment": "Seasonally Adjusted",+ "seasonal_adjustment_short": "SA",+ "last_updated": "2024-11-01 07:41:02-05",+ "popularity": 95,+ "notes": "The unemployment rate represents..."+ }+ ]+}+```++---++### 3. Series Search++#### `GET /fred/series/search`+Search for series by keywords.++**Parameters:**+| Parameter | Type | Required | Default | Description |+|----------------|--------|----------|----------------|-------------|+| `search_text` | string | Yes | - | Keywords to search. |+| `search_type` | string | No | `full_text` | `full_text` or `series_id`. |+| `order_by` | string | No | `search_rank` | `search_rank`, `series_id`, `title`, `units`, `frequency`, `seasonal_adjustment`, `realtime_start`, `realtime_end`, `last_updated`, `observation_start`, `observation_end`, `popularity`, `group_popularity`. |+| `sort_order` | string | No | `asc` | `asc` or `desc`. |+| `limit` | int | No | 1000 | Max results (max 1000). |+| `offset` | int | No | 0 | Pagination offset. |+| `filter_variable` | string | No | - | `frequency`, `units`, `seasonal_adjustment`. |+| `filter_value` | string | No | - | Value to filter on (e.g., `Monthly`). |+| `tag_names` | string | No | - | Semicolon-delimited tags to filter (e.g., `gdp;quarterly`). |++**Example:**+```+https://api.stlouisfed.org/fred/series/search?search_text=consumer+price+index&api_key=YOUR_KEY&file_type=json&limit=5+```++**Response:**+```json+{+ "realtime_start": "2024-11-01",+ "realtime_end": "2024-11-01",+ "order_by": "search_rank",+ "sort_order": "asc",+ "count": 1256,+ "offset": 0,+ "limit": 5,+ "seriess": [+ {+ "id": "CPIAUCSL",+ "title": "Consumer Price Index for All Urban Consumers: All Items in U.S. City Average",+ "observation_start": "1947-01-01",+ "observation_end": "2024-09-01",+ "frequency": "Monthly",+ "units": "Index 1982-1984=100",+ "seasonal_adjustment": "Seasonally Adjusted",+ "popularity": 95+ }+ ]+}+```++---++### 4. Category Lookup++#### `GET /fred/category`+Get info for a specific category.++**Parameters:**+| Parameter | Type | Required | Description |+|-------------|------|----------|-------------|+| `category_id`| int | Yes | Category ID (0 = root). |++**Example:**+```+https://api.stlouisfed.org/fred/category?category_id=0&api_key=YOUR_KEY&file_type=json+```++#### `GET /fred/category/children`+Get child categories.++**Example:**+```+https://api.stlouisfed.org/fred/category/children?category_id=0&api_key=YOUR_KEY&file_type=json+```++#### `GET /fred/category/series`+Get all series in a category.++**Parameters:**+| Parameter | Type | Required | Description |+|-------------|------|----------|-------------|+| `category_id`| int | Yes | Category ID. |+| `limit` | int | No | Max results (max 1000). |+| `offset` | int | No | Pagination offset. |++**Example:**+```+https://api.stlouisfed.org/fred/category/series?category_id=125&api_key=YOUR_KEY&file_type=json+```++---++### 5. Releases++#### `GET /fred/releases`+Get all economic data releases.++**Example:**+```+https://api.stlouisfed.org/fred/releases?api_key=YOUR_KEY&file_type=json+```++#### `GET /fred/release/series`+Get all series in a specific release.++**Parameters:**+| Parameter | Type | Required | Description |+|------------|------|----------|-------------|+| `release_id`| int | Yes | Release ID. |++**Example:**+```+https://api.stlouisfed.org/fred/release/series?release_id=53&api_key=YOUR_KEY&file_type=json+```++---++### 6. Tags++#### `GET /fred/tags`+Get all tags and their frequency of use.++#### `GET /fred/series/search/tags`+Get tags matching a series search.++**Example:**+```+https://api.stlouisfed.org/fred/series/search/tags?series_search_text=mortgage+rate&api_key=YOUR_KEY&file_type=json+```++---++## Commonly Used Series IDs++| Series ID | Description |+|--------------|-------------|+| `GDP` | Gross Domestic Product (quarterly, billions $) |+| `GDPC1` | Real GDP (chained 2017 dollars) |+| `A191RL1Q225SBEA` | Real GDP growth rate (annualized quarterly) |+| `UNRATE` | Unemployment Rate (monthly, %) |+| `PAYEMS` | Total Nonfarm Payrolls (monthly, thousands) |+| `CPIAUCSL` | CPI All Urban Consumers (monthly, index) |+| `CPILFESL` | Core CPI (excl. food & energy) |+| `PCEPI` | PCE Price Index |+| `PCEPILFE` | Core PCE Price Index |+| `FEDFUNDS` | Federal Funds Effective Rate (monthly, %) |+| `DFF` | Federal Funds Effective Rate (daily) |+| `DGS10` | 10-Year Treasury Constant Maturity Rate (daily) |+| `DGS2` | 2-Year Treasury Rate (daily) |+| `T10Y2Y` | 10Y-2Y Treasury Spread |+| `MORTGAGE30US` | 30-Year Fixed Mortgage Rate (weekly) |+| `M2SL` | M2 Money Stock (monthly) |+| `HOUST` | Housing Starts (monthly, thousands) |+| `RSAFS` | Retail Sales (monthly, millions $) |+| `INDPRO` | Industrial Production Index |+| `UMCSENT` | U. of Michigan Consumer Sentiment |+| `SP500` | S&P 500 Index (daily) |+| `VIXCLS` | CBOE Volatility Index (daily) |+| `DEXUSEU` | USD/EUR Exchange Rate (daily) |+| `DCOILWTICO`| WTI Crude Oil Price (daily) |+| `BOPGSTB` | Trade Balance (monthly, millions $) |+| `GFDEBTN` | Federal Debt Total Public Debt |++## Notes+- Real-time periods: FRED supports vintage data. The `realtime_start`/`realtime_end` parameters let you retrieve data as it was known at a specific point in time (useful for analyzing data revisions).+- The `units` parameter for transformations is very powerful -- it avoids having to compute percent changes client-side.+- Values are returned as strings; `"."` means missing/unavailable.+- For FRED bulk data, they offer a download API at `https://api.stlouisfed.org/geofred/` for geographic/regional data.diff --git a/scientific-skills/database-lookup/references/gene-ontology.md b/scientific-skills/database-lookup/references/gene-ontology.mdnew file mode 100644index 00000000..ff1c4d89--- /dev/null+++ b/scientific-skills/database-lookup/references/gene-ontology.md@@ -0,0 +1,147 @@+# Gene Ontology (GO) API Reference++## Base URLs+- **QuickGO (EBI, recommended)**: `https://www.ebi.ac.uk/QuickGO/services` — most reliable endpoint+- **GO API**: `https://api.geneontology.org/api` — may return 403; use QuickGO as fallback+- **AmiGO / GOlr (Solr-based)**: `http://golr-aux.geneontology.org/solr`++## Authentication+None required. All endpoints are public.++## Rate Limits+No published hard limits. QuickGO recommends reasonable usage.++---++## GO API (api.geneontology.org)++### 1. GO Term Lookup+```+GET https://api.geneontology.org/api/ontology/term/{go_id}+```+Example:+```+GET https://api.geneontology.org/api/ontology/term/GO%3A0008150+```+Returns JSON with term name, definition, namespace (biological_process / molecular_function / cellular_component), synonyms.++### 2. Gene/Protein Annotations (Bioentity)+```+GET https://api.geneontology.org/api/bioentity/gene/{gene_id}/function+```+Example — GO annotations for a UniProt protein:+```+GET https://api.geneontology.org/api/bioentity/gene/UniProtKB%3AP04637/function+```+Returns GO annotations with evidence codes, qualifiers, references.++### 3. Genes Annotated to a GO Term+```+GET https://api.geneontology.org/api/bioentity/function/{go_id}/genes+```+Example:+```+GET https://api.geneontology.org/api/bioentity/function/GO%3A0006915/genes?rows=20+```+Returns genes/proteins annotated with that GO term.++### 4. Search Entities+```+GET https://api.geneontology.org/api/search/entity/{query}+```+Example:+```+GET https://api.geneontology.org/api/search/entity/apoptosis?rows=10+```++### 5. Ontology Ancestors / Descendants+```+GET https://api.geneontology.org/api/ontology/term/{go_id}/graph+```++---++## QuickGO API (EBI — recommended for robust annotation queries)++### 1. GO Term Details+```+GET https://www.ebi.ac.uk/QuickGO/services/ontology/go/terms/{go_ids}+```+Example:+```+GET https://www.ebi.ac.uk/QuickGO/services/ontology/go/terms/GO:0008150+```+Accepts comma-separated IDs (up to 25).++### 2. Search Annotations+```+GET https://www.ebi.ac.uk/QuickGO/services/annotation/search?geneProductId={uniprot_id}+```+Example — annotations for TP53:+```+GET https://www.ebi.ac.uk/QuickGO/services/annotation/search?geneProductId=P04637&limit=25+```++### 3. Annotations by GO Term+```+GET https://www.ebi.ac.uk/QuickGO/services/annotation/search?goId=GO:0006915&taxonId=9606&limit=25+```++### 4. Filter Annotations by Evidence+```+GET https://www.ebi.ac.uk/QuickGO/services/annotation/search?geneProductId=P04637&goUsage=descendants&evidenceCode=ECO:0000269&limit=25+```++### 5. GO Term Children+```+GET https://www.ebi.ac.uk/QuickGO/services/ontology/go/terms/GO:0008150/children+```++### 6. GO Term Ancestors (Chart)+```+GET https://www.ebi.ac.uk/QuickGO/services/ontology/go/terms/GO:0006915/ancestors?relations=is_a,part_of+```++### 7. Search GO Terms by Name+```+GET https://www.ebi.ac.uk/QuickGO/services/ontology/go/search?query=apoptosis&limit=10+```++## QuickGO Annotation Search Parameters+| Parameter | Description |+|-----------|-------------|+| `geneProductId` | UniProt accession (e.g., P04637) |+| `goId` | GO term (e.g., GO:0006915) |+| `goUsage` | `exact` or `descendants` (include child terms) |+| `taxonId` | NCBI taxonomy ID (9606 = human) |+| `evidenceCode` | ECO code (e.g., ECO:0000269 = experimental) |+| `aspect` | `biological_process`, `molecular_function`, `cellular_component` |+| `limit` | Results per page (max 100) |+| `page` | Page number (1-based) |++## QuickGO Response Format+```json+{+ "numberOfHits": 1234,+ "results": [+ {+ "geneProductId": "P04637",+ "symbol": "TP53",+ "goId": "GO:0006915",+ "goName": "apoptotic process",+ "evidenceCode": "ECO:0000269",+ "goAspect": "biological_process",+ "taxonId": 9606,+ "reference": "PMID:12345678",+ "assignedBy": "UniProt"+ }+ ]+}+```++## Notes+- QuickGO (EBI) is generally more robust and better documented for annotation queries.+- GO API (geneontology.org) is better for ontology structure traversal.+- GO IDs must be URL-encoded when used in paths (e.g., `GO%3A0008150` for `GO:0008150`).+- Three GO namespaces: biological_process (BP), molecular_function (MF), cellular_component (CC).+- Evidence codes: IDA (direct assay), IMP (mutant phenotype), IGI (genetic interaction), IEA (electronic annotation), etc.diff --git a/scientific-skills/database-lookup/references/geo.md b/scientific-skills/database-lookup/references/geo.mdnew file mode 100644index 00000000..4ca4756a--- /dev/null+++ b/scientific-skills/database-lookup/references/geo.md@@ -0,0 +1,130 @@+# NCBI GEO (Gene Expression Omnibus) via E-utilities++## Base URLs++| Purpose | URL |+|---|---|+| E-utilities | `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/` |+| GEO direct query | `https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi` |++## Important: The database name is `gds`++The Entrez database for GEO is `gds` (not `geo`). It contains all GEO record types: GDS datasets, GSE series, GPL platforms, GSM samples. Filter by type using `[ETYP]` in the search term.++## Key Endpoints++### eSearch — Search GEO++```+GET /esearch.fcgi?db=gds&term={query}&retmode=json&retmax={n}+```++Parameters:+- `db=gds` (required)+- `term` — search query with field tags+- `retmax` — max results (default 20)+- `retstart` — offset for pagination+- `retmode=json` — get JSON response+- `usehistory=y` — store results server-side for large queries+- `api_key` — NCBI API key (optional, raises rate limit)++#### Entry type filters (`[ETYP]`)+- `gds[ETYP]` — curated GEO DataSets+- `gse[ETYP]` — GEO Series (most common, use this by default)+- `gpl[ETYP]` — platforms+- `gsm[ETYP]` — samples++#### Other field tags+- `[Organism]` — e.g. `"Homo sapiens"[Organism]`+- `[PDAT]` — publication date+- `[Title]` — title search+- Boolean: `AND`, `OR`, `NOT` (uppercase)++Example — cancer GSE series in human:+```+/esearch.fcgi?db=gds&term=cancer+AND+gse[ETYP]+AND+"Homo+sapiens"[Organism]&retmax=10&retmode=json+```++Response:+```json+{+ "esearchresult": {+ "count": "15432",+ "retmax": "10",+ "idlist": ["200012345", "200067890"],+ "querytranslation": "cancer AND gse[ETYP]"+ }+}+```++The IDs returned are numeric UIDs (not accession numbers). For GSE records: UID = 200000000 + GSE_number.++### eSummary — Get metadata for UIDs++```+GET /esummary.fcgi?db=gds&id={uid_list}&retmode=json+```++Key response fields per record:+- `Accession` — e.g. "GSE12345"+- `title`, `summary`+- `taxon` — organism+- `entrytype` — "GDS", "GSE", "GPL", "GSM"+- `gdstype` — e.g. "Expression profiling by array"+- `n_samples` — sample count+- `pubmedids` — linked PubMed IDs+- `PDAT` — publication date+- `Samples` — array of sample objects+- `FTPLink` — data download path++Example:+```+/esummary.fcgi?db=gds&id=200012345&retmode=json+```++### GEO Direct Query — Full records by accession++```+GET https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc={accession}&form={format}&view={detail}+```++Parameters:+- `acc` — GEO accession (GSE12345, GDS1234, GPL570, GSM12345)+- `targ` — `self`, `gsm` (samples), `gpl` (platform), `gse` (series)+- `form` — `text` (SOFT format), `xml` (MINiML), `html`+- `view` — `quick`, `brief`, `full`, `data`++Example — series metadata in SOFT:+```+acc.cgi?acc=GSE53757&targ=self&form=text&view=brief+```++Note: acc.cgi does not return JSON. Use eSearch + eSummary for JSON results. Use acc.cgi when you need full SOFT/MINiML records.++### eLink — Cross-reference with other NCBI databases++```+GET /elink.fcgi?dbfrom=gds&db=pubmed&id={uid}&retmode=json+```++## Practical Workflow++For most queries, use this two-step approach:++1. **eSearch** to find UIDs matching the query+2. **eSummary** to get metadata for those UIDs++This gives you JSON throughout.++## Important Notes++- GDS records are mostly frozen — NCBI stopped curating new GDS. Use `gse[ETYP]` for comprehensive results.+- eFetch has limited support for the `gds` database. Use eSummary for metadata or acc.cgi for full records.+- URL-encode spaces as `+` and quotes as `%22`.++## Rate Limits++- **Without API key**: 3 requests/second+- **With API key**: 10 requests/second (free registration at ncbi.nlm.nih.gov/account/settings)+- Include `&[email protected]` as a courtesy+- For large result sets, use the History server (`usehistory=y` then pass `WebEnv` and `query_key` to eSummary)diff --git a/scientific-skills/database-lookup/references/gnomad.md b/scientific-skills/database-lookup/references/gnomad.mdnew file mode 100644index 00000000..87693133--- /dev/null+++ b/scientific-skills/database-lookup/references/gnomad.md@@ -0,0 +1,93 @@+# gnomAD (Genome Aggregation Database) API Reference++## Overview+gnomAD aggregates exome and genome sequencing data to provide allele frequencies+and variant annotations across diverse populations.++## API Type: GraphQL+- **Endpoint**: `https://gnomad.broadinstitute.org/api`+- **Method**: POST with JSON body containing GraphQL query+- **Auth**: None required (public, unauthenticated)+- **Response format**: JSON (`data` wrapper with GraphQL structure)++## Key Queries++### Variant lookup by variant ID+Variant IDs use format: `{chrom}-{pos}-{ref}-{alt}` (GRCh37 or GRCh38).++```+POST https://gnomad.broadinstitute.org/api+Content-Type: application/json++{+ "query": "{ variant(variantId: \"1-55516888-G-A\", dataset: gnomad_r4) { variant_id rsids chrom pos ref alt exome { ac an af } genome { ac an af } } }"+}+```++### Gene lookup+```json+{+ "query": "{ gene(gene_symbol: \"BRCA1\", reference_genome: GRCh38) { gene_id symbol chrom start stop strand } }"+}+```++### Variants in a gene+```json+{+ "query": "{ gene(gene_symbol: \"PCSK9\", reference_genome: GRCh38) { variants(dataset: gnomad_r4) { variant_id consequence rsids exome { ac an af } genome { ac an af } } } }"+}+```++### Variants in a region+```json+{+ "query": "{ region(chrom: \"1\", start: 55505222, stop: 55530526, reference_genome: GRCh38) { variants(dataset: gnomad_r4) { variant_id rsids consequence exome { ac af } genome { ac af } } } }"+}+```++### Transcript lookup+```json+{+ "query": "{ transcript(transcript_id: \"ENST00000357654\", reference_genome: GRCh38) { transcript_id gene_id chrom start stop strand } }"+}+```++## Dataset values+- `gnomad_r4` -- gnomAD v4 (GRCh38, latest major release)+- `gnomad_r3` -- gnomAD v3.1.2 (GRCh38, genomes only)+- `gnomad_r2_1` -- gnomAD v2.1.1 (GRCh37, exomes + genomes)++## Population frequency fields+Within `exome` or `genome` objects, population-specific frequencies are available via+`populations { id ac an af }` where `id` values include: `afr`, `amr`, `asj`, `eas`,+`fin`, `mid`, `nfe`, `oth`, `sas`.++## Response example (variant)+```json+{+ "data": {+ "variant": {+ "variant_id": "1-55516888-G-A",+ "rsids": ["rs11591147"],+ "chrom": "1",+ "pos": 55516888,+ "ref": "G",+ "alt": "A",+ "exome": { "ac": 1234, "an": 250000, "af": 0.004936 },+ "genome": { "ac": 456, "an": 150000, "af": 0.00304 }+ }+ }+}+```++## Rate Limits+- No published rate limits, but aggressive querying will be throttled+- Use reasonable request pacing (~1 req/sec recommended)+- For bulk downloads, use gnomAD's Hail tables on Google Cloud or download VCFs++## Notes+- The GraphQL schema is not versioned separately; it tracks the gnomAD web interface+- Use the browser's network inspector on gnomad.broadinstitute.org to discover+ additional query fields and structures+- Structural variants (SV) have a separate query structure (`structural_variant`)+- Constraint metrics (pLI, LOEUF) are available on gene queries via `gnomad_constraint`diff --git a/scientific-skills/database-lookup/references/gtex.md b/scientific-skills/database-lookup/references/gtex.mdnew file mode 100644index 00000000..7e8b4534--- /dev/null+++ b/scientific-skills/database-lookup/references/gtex.md@@ -0,0 +1,136 @@+# GTEx (Genotype-Tissue Expression) API Reference++## Overview+GTEx catalogs gene expression levels across human tissues from postmortem donors,+enabling study of tissue-specific gene regulation and eQTLs.++## Base URL+`https://gtexportal.org/api/v2`++## Auth+None required (public, unauthenticated).++## Response Format+JSON. Most endpoints return paginated results with structure:+```json+{+ "data": [ ... ],+ "paging_info": {+ "numberOfPages": 10,+ "page": 0,+ "maxItemsPerPage": 250+ }+}+```++## Pagination Parameters (common to most endpoints)+- `page` -- 0-indexed page number (default: 0)+- `itemsPerPage` -- results per page (default: 250, max: 250)++## Key Endpoints++### Gene expression (median by tissue)+```+GET /expression/medianGeneExpression?gencodeId=ENSG00000139618.17&datasetId=gtex_v8+```+Parameters:+- `gencodeId` -- Versioned Ensembl gene ID (required)+- `datasetId` -- `gtex_v8` (required)+- `tissueSiteDetailId` -- filter to specific tissue (optional)++Returns median TPM per tissue for the gene.++### Gene expression (all, for a tissue)+```+GET /expression/medianGeneExpression?tissueSiteDetailId=Liver&datasetId=gtex_v8+```++### Single-tissue eQTLs+```+GET /association/singleTissueEqtl?gencodeId=ENSG00000139618.17&tissueSiteDetailId=Whole_Blood&datasetId=gtex_v8+```+Parameters:+- `gencodeId` -- Versioned Ensembl gene ID (required)+- `tissueSiteDetailId` -- tissue ID (required)+- `datasetId` -- `gtex_v8` (required)++### Multi-tissue eQTLs+```+GET /association/multiTissueEqtl?gencodeId=ENSG00000139618.17&datasetId=gtex_v8+```++### Gene search+```+GET /reference/gene?geneId=BRCA2&gencodeVersion=v26&genomeBuild=GRCh38/hg38+```+Parameters:+- `geneId` -- gene symbol or Ensembl ID+- `gencodeVersion` -- `v26` for GTEx v8+- `genomeBuild` -- `GRCh38/hg38`++### List tissues+```+GET /dataset/tissueSiteDetail?datasetId=gtex_v8+```+Returns all tissue site detail IDs, names, colors, sample counts.++### Exon expression+```+GET /expression/medianExonExpression?gencodeId=ENSG00000139618.17&datasetId=gtex_v8+```++### Transcript expression+```+GET /expression/medianTranscriptExpression?gencodeId=ENSG00000139618.17&datasetId=gtex_v8+```++### Top expressed genes in a tissue+```+GET /expression/topExpressedGene?tissueSiteDetailId=Brain_Cortex&datasetId=gtex_v8&filterMtGene=true+```++### Variant by location (dyadic)+```+GET /association/dyneqtl?variantId=chr1_1000000_A_G_b38&gencodeId=ENSG00000139618.17&tissueSiteDetailId=Whole_Blood&datasetId=gtex_v8+```++## Tissue ID examples+Use the underscore-separated names exactly:+- `Whole_Blood`, `Liver`, `Brain_Cortex`, `Heart_Left_Ventricle`+- `Muscle_Skeletal`, `Adipose_Subcutaneous`, `Lung`, `Skin_Sun_Exposed_Lower_leg`++## Example response (median gene expression)+```json+{+ "data": [+ {+ "datasetId": "gtex_v8",+ "gencodeId": "ENSG00000139618.17",+ "geneSymbol": "BRCA2",+ "median": 4.523,+ "tissueSiteDetailId": "Whole_Blood",+ "unit": "TPM"+ },+ {+ "datasetId": "gtex_v8",+ "gencodeId": "ENSG00000139618.17",+ "geneSymbol": "BRCA2",+ "median": 12.87,+ "tissueSiteDetailId": "Testis",+ "unit": "TPM"+ }+ ],+ "paging_info": { "numberOfPages": 1, "page": 0, "maxItemsPerPage": 250 }+}+```++## Rate Limits+- No published rate limits+- Reasonable request pacing recommended (~1-2 req/sec)+- For bulk analysis, download full datasets from the GTEx Portal downloads page++## Notes+- GTEx v8 is the primary dataset; always specify `datasetId=gtex_v8`+- Gene IDs must be versioned GENCODE IDs (e.g., ENSG00000139618.17)+- Use the gene search endpoint to resolve symbols to versioned GENCODE IDs+- `gencodeVersion=v26` corresponds to GTEx v8diff --git a/scientific-skills/database-lookup/references/gwas-catalog.md b/scientific-skills/database-lookup/references/gwas-catalog.mdnew file mode 100644index 00000000..9f137816--- /dev/null+++ b/scientific-skills/database-lookup/references/gwas-catalog.md@@ -0,0 +1,46 @@+# GWAS Catalog (EBI)++## Base URL+```+https://www.ebi.ac.uk/gwas/rest/api+```++## Auth+No API key required.++## Note: Responses use HAL+JSON format with `_links` and `_embedded` keys.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/studies/{accession}` | Single study (e.g. GCST001633) |+| `/studies/search/findByPubmedId?pubmedId={id}` | Studies by PubMed ID |+| `/singleNucleotidePolymorphisms/{rsId}` | SNP details |+| `/singleNucleotidePolymorphisms/{rsId}/associations` | Associations for a SNP |+| `/singleNucleotidePolymorphisms/search/findByRsId?rsId={rsId}` | Search by rsID |+| `/associations` | List associations |+| `/associations/{id}` | Single association |+| `/efoTraits` | List EFO traits |+| `/efoTraits/search/findByEfoTrait?trait={name}` | Search traits |++## Pagination+`?page=0&size=20` (zero-indexed, max ~500)++## Example Calls+```+# Get a study+https://www.ebi.ac.uk/gwas/rest/api/studies/GCST001633++# Associations for a SNP+https://www.ebi.ac.uk/gwas/rest/api/singleNucleotidePolymorphisms/rs7329174/associations++# Search traits+https://www.ebi.ac.uk/gwas/rest/api/efoTraits/search/findByEfoTrait?trait=diabetes&page=0&size=5+```++## Response Format+HAL+JSON. Results in `_embedded.studies[]` or `_embedded.associations[]`. Key fields: `pvalue`, `riskFrequency`, `orPerCopyNum`, `betaNum`.++## Rate Limits+No published limit. Bulk data via FTP at ftp.ebi.ac.uk/pub/databases/gwas/diff --git a/scientific-skills/database-lookup/references/hca.md b/scientific-skills/database-lookup/references/hca.mdnew file mode 100644index 00000000..d92ca186--- /dev/null+++ b/scientific-skills/database-lookup/references/hca.md@@ -0,0 +1,35 @@+# Human Cell Atlas (HCA)++## Base URL+```+https://service.azul.data.humancellatlas.org/+```++## Auth+No auth required.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/index/projects?size={n}&catalog=dcp2` | List/search projects |+| `/index/samples?size={n}&catalog=dcp2` | List/search samples |+| `/index/files?size={n}&catalog=dcp2` | List/search files |+| `/index/summary?catalog=dcp2` | Summary statistics |++## Example Calls+```+# List projects+https://service.azul.data.humancellatlas.org/index/projects?size=5&catalog=dcp2++# Summary stats+https://service.azul.data.humancellatlas.org/index/summary?catalog=dcp2+```++Supports JSON filter parameters for organ, species, library construction, etc.++## Response Format+JSON. `hits` array with project/sample/file metadata + pagination.++## Rate Limits+No published limits. Be reasonable.diff --git a/scientific-skills/database-lookup/references/hpo.md b/scientific-skills/database-lookup/references/hpo.mdnew file mode 100644index 00000000..2e94beb9--- /dev/null+++ b/scientific-skills/database-lookup/references/hpo.md@@ -0,0 +1,48 @@+# HPO (Human Phenotype Ontology)++## Base URL+```+https://ontology.jax.org/api/hp+```++## Auth+No API key required.++## Important: URL-encode colons in HP IDs — `HP:0001250` becomes `HP%3A0001250`++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/hpo/search?q={query}&max={n}` | Search HPO terms by name |+| `/hpo/term/{id}` | Term details |+| `/hpo/term/{id}/genes` | Genes associated with a phenotype |+| `/hpo/term/{id}/diseases` | Diseases associated with a phenotype |+| `/hpo/term/{id}/children` | Child terms in hierarchy |+| `/hpo/term/{id}/parents` | Parent terms |+| `/hpo/gene/{gene_id}` | Phenotypes for a gene (Entrez ID) |+| `/hpo/disease/{disease_id}` | Phenotypes for a disease (OMIM/ORPHA) |++## Example Calls+```+# Search for "seizure"+https://ontology.jax.org/api/hp/hpo/search?q=seizure&max=5++# Term details for Seizure+https://ontology.jax.org/api/hp/hpo/term/HP%3A0001250++# Genes associated with Seizure+https://ontology.jax.org/api/hp/hpo/term/HP%3A0001250/genes++# Diseases for Seizure+https://ontology.jax.org/api/hp/hpo/term/HP%3A0001250/diseases++# Phenotypes for SCN1A (Entrez 6323)+https://ontology.jax.org/api/hp/hpo/gene/6323+```++## Response Format+JSON. Terms: `id`, `name`, `definition`, `synonyms`. Gene associations: `genes[]` with `geneId`, `geneSymbol`. Diseases: `diseases[]` with `diseaseId`, `diseaseName`.++## Rate Limits+No published limits. Bulk annotation files at https://hpo.jax.org/data/annotationsdiff --git a/scientific-skills/database-lookup/references/human-protein-atlas.md b/scientific-skills/database-lookup/references/human-protein-atlas.mdnew file mode 100644index 00000000..b90368b8--- /dev/null+++ b/scientific-skills/database-lookup/references/human-protein-atlas.md@@ -0,0 +1,57 @@+# Human Protein Atlas (HPA)++## Base URL+```+https://www.proteinatlas.org+```++## Auth+No API key required.++## Key Endpoints++| Purpose | URL Pattern |+|---|---|+| Gene data by Ensembl ID | `/{ENSEMBL_ID}.json` |+| Gene data by symbol | `/{GENE_NAME}.json` |+| Search (JSON) | `/search/{QUERY}?format=json` |+| Search (XML) | `/search/{QUERY}?format=xml` |++## Example Calls++```+# Gene data by Ensembl ID+https://www.proteinatlas.org/ENSG00000141510.json++# Gene data by symbol+https://www.proteinatlas.org/TP53.json++# Search+https://www.proteinatlas.org/search/TP53?format=json+```++## Response Format (JSON, gene endpoint)+```json+{+ "Gene": "TP53",+ "Gene synonym": ["p53", "LFS1"],+ "Ensembl": "ENSG00000141510",+ "Gene description": "tumor protein p53",+ "Uniprot": ["P04637"],+ "Chromosome": "17",+ "Protein class": ["Transcription factors"],+ "RNA tissue specificity": "Low tissue specificity",+ "Subcellular location": ["Nucleoplasm"],+ "Pathology prognostics": [...]+}+```++## Bulk Downloads+For large-scale work, use TSV files from https://www.proteinatlas.org/about/download:+- `normal_tissue.tsv` — IHC tissue expression+- `rna_tissue_consensus.tsv` — RNA consensus+- `subcellular_location.tsv`+- `pathology.tsv` — cancer prognostics++## Rate Limits+No published limits. Be reasonable. Prefer bulk downloads for large queries.diff --git a/scientific-skills/database-lookup/references/interpro.md b/scientific-skills/database-lookup/references/interpro.mdnew file mode 100644index 00000000..2a4bc740--- /dev/null+++ b/scientific-skills/database-lookup/references/interpro.md@@ -0,0 +1,120 @@+# InterPro API Reference++## Base URL+```+https://www.ebi.ac.uk/interpro/api+```++## Authentication+None required. Fully public API.++## Rate Limits+No published hard limits. EBI general guidance: be reasonable, use bulk downloads for large datasets.++## Response Format+JSON by default. Some endpoints support `?format=json` explicitly.++## Key Endpoints++### 1. Entry Lookup (by accession)+```+GET https://www.ebi.ac.uk/interpro/api/entry/interpro/{accession}+```+Example:+```+GET https://www.ebi.ac.uk/interpro/api/entry/interpro/IPR000504+```+Returns JSON with entry name, type (family/domain/site/etc.), description, GO terms, literature references.++### 2. Entry Lookup by Member Database+```+GET https://www.ebi.ac.uk/interpro/api/entry/pfam/{pfam_accession}+GET https://www.ebi.ac.uk/interpro/api/entry/smart/{smart_accession}+GET https://www.ebi.ac.uk/interpro/api/entry/prosite/{prosite_accession}+```+Example:+```+GET https://www.ebi.ac.uk/interpro/api/entry/pfam/PF00076+```++### 3. Search / List Entries+```+GET https://www.ebi.ac.uk/interpro/api/entry/interpro?search={query}+```+Example:+```+GET https://www.ebi.ac.uk/interpro/api/entry/interpro?search=kinase+```+Returns paginated list of matching InterPro entries.++### 4. Protein Annotations — Get InterPro Entries for a Protein+```+GET https://www.ebi.ac.uk/interpro/api/entry/interpro/protein/uniprot/{uniprot_accession}+```+Example:+```+GET https://www.ebi.ac.uk/interpro/api/entry/interpro/protein/uniprot/P12345+```+Returns all InterPro entries annotating that protein.++### 5. Proteins with a Given Entry+```+GET https://www.ebi.ac.uk/interpro/api/protein/uniprot/entry/interpro/{accession}+```+Example:+```+GET https://www.ebi.ac.uk/interpro/api/protein/uniprot/entry/interpro/IPR000504+```+Returns paginated list of UniProt proteins annotated with that entry.++### 6. Structure Mappings+```+GET https://www.ebi.ac.uk/interpro/api/structure/pdb/entry/interpro/{accession}+```+Example:+```+GET https://www.ebi.ac.uk/interpro/api/structure/pdb/entry/interpro/IPR000504+```++### 7. Entry by Type Filter+```+GET https://www.ebi.ac.uk/interpro/api/entry/interpro?type=domain+GET https://www.ebi.ac.uk/interpro/api/entry/interpro?type=family+GET https://www.ebi.ac.uk/interpro/api/entry/interpro?type=homologous_superfamily+```++### 8. Taxonomy Cross-Reference+```+GET https://www.ebi.ac.uk/interpro/api/taxonomy/uniprot/entry/interpro/{accession}+```++## Pagination+Responses include `next` and `previous` URLs:+```json+{+ "count": 1234,+ "next": "https://www.ebi.ac.uk/interpro/api/entry/interpro?cursor=...&page_size=20",+ "previous": null,+ "results": [...]+}+```+Use `?page_size=N` to control page size (default 20).++## Entry Response Key Fields+```json+{+ "metadata": {+ "accession": "IPR000504",+ "name": "RNA recognition motif domain",+ "type": "domain",+ "source_database": "interpro",+ "member_databases": {"pfam": {"PF00076": "RRM_1"}},+ "go_terms": [{"identifier": "GO:0003723", "name": "RNA binding"}],+ "description": ["<p>The RNA recognition motif...</p>"]+ }+}+```++## Notes+- The API follows a composable URL pattern: combine entity types (entry, protein, structure, taxonomy) to create cross-reference queries.+- Member databases: pfam, smart, prosite, prints, panther, cdd, hamap, tigrfam, pirsf, sfld, ncbifam.diff --git a/scientific-skills/database-lookup/references/jaspar.md b/scientific-skills/database-lookup/references/jaspar.mdnew file mode 100644index 00000000..cc4adaa0--- /dev/null+++ b/scientific-skills/database-lookup/references/jaspar.md@@ -0,0 +1,50 @@+# JASPAR (Transcription Factor Binding Profiles)++## Base URL+```+https://jaspar.elixir.no/api/v1/+```++## Auth+No auth required.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/matrix/` | List all TF binding profiles |+| `/matrix/{matrix_id}/` | Specific profile (e.g. MA0139.1 for CTCF) |+| `/matrix/?tax_id={id}&collection=CORE` | Filter by species + collection |+| `/matrix/{id}/?format=jaspar` | Profile in JASPAR format |+| `/matrix/{id}/?format=meme` | Profile in MEME format |+| `/matrix/{id}/?format=transfac` | Profile in TRANSFAC format |+| `/taxon/` | List taxonomic groups |+| `/collection/` | List collections (CORE, CNE, etc.) |++## Filter Parameters+- `tax_id` — NCBI taxonomy ID (9606 for human)+- `collection` — CORE, CNE, PHYLOFACTS, etc.+- `tf_class` — TF structural class+- `name` — TF name search+- `page`, `page_size` — pagination++## Example Calls+```+# Get CTCF binding profile+https://jaspar.elixir.no/api/v1/matrix/MA0139.1/++# Human CORE TF profiles+https://jaspar.elixir.no/api/v1/matrix/?tax_id=9606&collection=CORE&page_size=10++# Get profile in MEME format+https://jaspar.elixir.no/api/v1/matrix/MA0139.1/?format=meme+```++## Response Format+JSON. Profiles include: `matrix_id`, `name`, `pfm` (position frequency matrix as A/C/G/T dict), `sequence_logo` URL, `species`, `class`, `family`.++## API Docs+Swagger at https://jaspar.elixir.no/api/v1/docs/++## Rate Limits+No published limits. Be reasonable.diff --git a/scientific-skills/database-lookup/references/kegg.md b/scientific-skills/database-lookup/references/kegg.mdnew file mode 100644index 00000000..ebe6eb08--- /dev/null+++ b/scientific-skills/database-lookup/references/kegg.md@@ -0,0 +1,78 @@+# KEGG REST API++## Base URL+```+https://rest.kegg.jp+```++## Auth+No API key required. Free for academic use. Commercial use requires license.++## Important: KEGG returns tab-delimited text and flat-file format, NOT JSON.++## Key Operations (URL-path-based, no query parameters)++| URL Pattern | Description |+|-------------|-------------|+| `/list/{database}` | List all entries |+| `/list/{database}/{organism}` | List entries for organism |+| `/get/{dbentries}` | Get entry data (flat-file) |+| `/get/{dbentries}/image` | Pathway image (PNG) |+| `/get/{dbentries}/kgml` | Pathway as KGML XML |+| `/find/{database}/{query}` | Search by keyword |+| `/find/{database}/{query}/formula` | Search by molecular formula |+| `/find/{database}/{value}/exact_mass` | Search by exact mass |+| `/link/{target_db}/{source_db}` | Find linked entries between databases |+| `/link/{target_db}/{dbentries}` | Links for specific IDs |+| `/conv/{target_db}/{dbentries}` | Cross-reference ID conversion |+| `/ddi/{dbentries}` | Drug-drug interactions |++## Database Codes++| Code | Database | Example ID |+|------|----------|------------|+| `pathway` | Pathways | `hsa00010` |+| `compound` | Compounds | `C00001` |+| `drug` | Drugs | `D00001` |+| `enzyme` | Enzymes | `ec:1.1.1.1` |+| `genes`/`hsa` | Genes | `hsa:10458` |+| `disease` | Diseases | `H00001` |+| `reaction` | Reactions | `R00001` |+| `ko` | KO orthologs | `K00001` |++## Example Calls++```+# List human pathways+https://rest.kegg.jp/list/pathway/hsa++# Get pathway entry+https://rest.kegg.jp/get/hsa00010++# Search compounds by name+https://rest.kegg.jp/find/compound/aspirin++# Search by molecular formula+https://rest.kegg.jp/find/compound/C9H8O4/formula++# Find pathways for a gene+https://rest.kegg.jp/link/pathway/hsa:10458++# Find diseases for a gene+https://rest.kegg.jp/link/disease/hsa:672++# Convert KEGG to PubChem IDs+https://rest.kegg.jp/conv/pubchem/C00001++# Get multiple entries (max 10, joined with +)+https://rest.kegg.jp/get/C00001+C00002+C00003++# Drug-drug interactions+https://rest.kegg.jp/ddi/D00564+D00110+```++## Response Format+Tab-delimited text for list/find/link/conv. Flat-file text for get. **No JSON support.**++## Rate Limits+No published limits. Keep to a few requests per second. Batch up to 10 IDs per `/get` with `+`. May return HTTP 403 if too many requests.diff --git a/scientific-skills/database-lookup/references/lincs-l1000.md b/scientific-skills/database-lookup/references/lincs-l1000.mdnew file mode 100644index 00000000..c706c379--- /dev/null+++ b/scientific-skills/database-lookup/references/lincs-l1000.md@@ -0,0 +1,68 @@+# LINCS L1000 (Clue.io) API Reference++## Overview+The LINCS L1000 dataset is accessible via the **Connectivity Map (CMap) API** at clue.io.++## Base URL+```+https://api.clue.io/api+```++## Authentication+- **API key required** (free registration at clue.io)+- Pass via header: `user_key: YOUR_API_KEY`++## Key Endpoints++| Endpoint | Description |+|---|---|+| `GET /perts` | Query perturbagens (compounds, gene knockdowns, overexpression) |+| `GET /genes` | Query genes (L1000 landmark + inferred) |+| `GET /cells` | Query cell lines used in L1000 |+| `GET /sigs` | Query connectivity signatures |+| `GET /profiles` | Access expression profiles (level 5 z-scores) |+| `GET /pcls` | Perturbagen classes |++## Query Parameters+All endpoints support a `filter` parameter using Loopback-style JSON:+- `where` — filter conditions+- `fields` — select specific fields+- `limit` / `skip` — pagination++## Example Calls++```bash+# Search for a compound perturbagen by name+curl -H "user_key: YOUR_API_KEY" \+ "https://api.clue.io/api/perts?filter={\"where\":{\"pert_iname\":\"vorinostat\"}}"++# Get landmark genes+curl -H "user_key: YOUR_API_KEY" \+ "https://api.clue.io/api/genes?filter={\"where\":{\"is_lm\":true},\"limit\":10}"++# Query cell lines+curl -H "user_key: YOUR_API_KEY" \+ "https://api.clue.io/api/cells?filter={\"where\":{\"cell_iname\":\"MCF7\"}}"++# Get connectivity signatures for a compound+curl -H "user_key: YOUR_API_KEY" \+ "https://api.clue.io/api/sigs?filter={\"where\":{\"pert_iname\":\"vorinostat\"},\"limit\":5}"+```++## Response Format+JSON. Example (perturbagen):+```json+[+ {+ "pert_id": "BRD-K81418486",+ "pert_iname": "vorinostat",+ "pert_type": "trt_cp",+ "moa": ["HDAC inhibitor"],+ "target": ["HDAC1","HDAC2","HDAC3","HDAC6"]+ }+]+```++## Rate Limits+- Free tier: moderate rate limiting (exact numbers not publicly documented)+- Bulk data downloads available separately via clue.io data portaldiff --git a/scientific-skills/database-lookup/references/materials-project.md b/scientific-skills/database-lookup/references/materials-project.mdnew file mode 100644index 00000000..cd81adb0--- /dev/null+++ b/scientific-skills/database-lookup/references/materials-project.md@@ -0,0 +1,123 @@+# Materials Project API++## Base URL++```+https://api.materialsproject.org+```++## Authentication++Requires a free API key. Register at https://materialsproject.org (free account).++| Env Variable | Header |+|---|---|+| `MP_API_KEY` | `X-API-KEY: your_key_here` |++All requests must include the API key header.++## API Version++The current API is **v2** (based on the `mp-api` Python client and the new MAPI endpoints). The legacy v1 REST API at `https://www.materialsproject.org/rest/v2/` is deprecated.++## Key Endpoints++### Search materials by formula or elements++```+GET /materials/summary/?formula=Fe2O3&_fields=material_id,formula_pretty,band_gap,formation_energy_per_atom+```++```+GET /materials/summary/?elements=Si,O&_fields=material_id,formula_pretty,band_gap+```++Query parameters:+- `formula` — exact chemical formula (e.g., `Fe2O3`, `SiO2`)+- `chemsys` — chemical system, dash-separated (e.g., `Fe-O`, `Li-Fe-P-O`)+- `elements` — comma-separated elements that must be present+- `band_gap_min` / `band_gap_max` — filter by band gap (eV)+- `is_stable` — `true` to return only thermodynamically stable phases+- `_fields` — comma-separated list of fields to return+- `_limit` — max results (default 10, max 1000)+- `_skip` — offset for pagination++### Get material by ID++```+GET /materials/summary/mp-149?_fields=material_id,formula_pretty,band_gap,formation_energy_per_atom,symmetry+```++Material IDs have the format `mp-NNNNN` (e.g., `mp-149` for silicon).++### Available fields (summary)++`material_id`, `formula_pretty`, `formula_anonymous`, `chemsys`, `volume`, `density`, `density_atomic`, `symmetry`, `band_gap`, `cbm`, `vbm`, `is_gap_direct`, `is_metal`, `is_magnetic`, `ordering`, `total_magnetization`, `formation_energy_per_atom`, `energy_above_hull`, `is_stable`, `equilibrium_reaction_energy_per_atom`, `nsites`, `elements`, `nelements`, `composition`, `structure`++### Crystal structure++```+GET /materials/summary/mp-149?_fields=structure+```++Returns the structure as a pymatgen-compatible JSON dict with lattice parameters and atomic sites.++### Elastic properties++```+GET /materials/elasticity/?material_id=mp-149&_fields=material_id,bulk_modulus,shear_modulus,elastic_tensor+```++### Electronic structure (band structure / DOS)++```+GET /materials/electronic_structure/bandstructure/mp-149+GET /materials/electronic_structure/dos/mp-149+```++### Thermodynamic properties++```+GET /materials/thermo/?formula=Fe2O3&_fields=material_id,formation_energy_per_atom,energy_above_hull+```++### Example: Find stable oxides with band gap > 2 eV++```+GET /materials/summary/?elements=O&band_gap_min=2&is_stable=true&_fields=material_id,formula_pretty,band_gap,formation_energy_per_atom&_limit=10+```++## Response Format++```json+{+ "data": [+ {+ "material_id": "mp-149",+ "formula_pretty": "Si",+ "band_gap": 0.6105,+ "formation_energy_per_atom": 0.0+ }+ ],+ "meta": {+ "total_doc": 1+ }+}+```++## Rate Limits++- Authenticated: ~50 requests/minute (varies by server load)+- Batch requests preferred over many individual calls+- Use `_fields` to reduce payload size and improve performance+- The Python client `mp-api` handles pagination and retries automatically++## Error Format++```json+{+ "detail": "Not authenticated"+}+```++HTTP 401 = missing or invalid API key. HTTP 404 = material not found. HTTP 429 = rate limited.diff --git a/scientific-skills/database-lookup/references/metabolomics-workbench.md b/scientific-skills/database-lookup/references/metabolomics-workbench.mdnew file mode 100644index 00000000..d2b8ef80--- /dev/null+++ b/scientific-skills/database-lookup/references/metabolomics-workbench.md@@ -0,0 +1,98 @@+# Metabolomics Workbench REST API++## Base URL+```+https://www.metabolomicsworkbench.org/rest/+```++## Auth+No API key required. Fully public.++## URL Structure+```+/rest/{context}/{input_item}/{input_value}/{output_item}+```++Contexts: `study`, `compound`, `refmet`, `gene`, `protein`, `moverz`, `exactmass`++## Key Endpoints++### Study Context+| URL Pattern | Description |+|---|---|+| `/rest/study/study_id/{ST_ID}/summary` | Study summary metadata |+| `/rest/study/study_id/{ST_ID}/metabolites` | Metabolites in a study |+| `/rest/study/study_id/{ST_ID}/analysis` | Analysis details |+| `/rest/study/study_id/{ST_ID}/factors` | Experimental factors |+| `/rest/study/study_id/{ST_ID}/data` | Named metabolite data matrix |+| `/rest/study/study_id/{ST_ID}/species` | Species information |+| `/rest/study/study_id/{ST_ID}/disease` | Disease information |+| `/rest/study/study_title/{keyword}/summary` | Search studies by title keyword |+| `/rest/study/study_type/{type}/summary` | Search by study type |+| `/rest/study/analysis_id/{AN_ID}/summary` | Summary by analysis ID |++Study IDs: `ST######` (e.g., `ST000001`). Analysis IDs: `AN######`.++### Compound Context+| URL Pattern | Description |+|---|---|+| `/rest/compound/name/{NAME}/summary` | Search compound by name |+| `/rest/compound/pubchem_cid/{CID}/summary` | Search by PubChem CID |+| `/rest/compound/hmdb_id/{HMDB_ID}/summary` | Search by HMDB ID |+| `/rest/compound/kegg_id/{KEGG_ID}/summary` | Search by KEGG ID |+| `/rest/compound/inchi_key/{KEY}/summary` | Search by InChI key |+| `/rest/compound/regno/{REGNO}/classification` | Compound classification |+| `/rest/compound/regno/{REGNO}/molfile` | MOL file (structure) |++### RefMet (Standardized Nomenclature)+| URL Pattern | Description |+|---|---|+| `/rest/refmet/name/{NAME}/all` | Full RefMet record |+| `/rest/refmet/match/{NAME}/name` | Match name to standardized RefMet name |++### Gene / Protein Context+| URL Pattern | Description |+|---|---|+| `/rest/gene/gene_symbol/{SYMBOL}/all` | Gene info by symbol |+| `/rest/gene/gene_id/{ID}/all` | Gene info by Entrez ID |+| `/rest/protein/uniprot_id/{ID}/all` | Protein by UniProt ID |++### Mass Search (MoverZ / ExactMass)+```+/rest/moverz/mz/{MZ_VALUE}/tol/{TOLERANCE}/mode/{pos|neg}+/rest/exactmass/mass/{MASS_VALUE}/tol/{TOLERANCE}+```++## Example Calls++```+# Study summary+https://www.metabolomicsworkbench.org/rest/study/study_id/ST000001/summary++# Metabolites in a study+https://www.metabolomicsworkbench.org/rest/study/study_id/ST000001/metabolites++# Search studies by title+https://www.metabolomicsworkbench.org/rest/study/study_title/diabetes/summary++# Compound by name+https://www.metabolomicsworkbench.org/rest/compound/name/glucose/summary++# Compound by PubChem CID+https://www.metabolomicsworkbench.org/rest/compound/pubchem_cid/5793/summary++# RefMet standardized name match+https://www.metabolomicsworkbench.org/rest/refmet/match/alpha-D-Glucose/name++# m/z search in positive mode+https://www.metabolomicsworkbench.org/rest/moverz/mz/175.0354/tol/0.005/mode/pos++# Exact mass search+https://www.metabolomicsworkbench.org/rest/exactmass/mass/174.0282/tol/0.005+```++## Response Format+Default is JSON. `mwtab` output returns MWTab text. `molfile` returns MOL/SDF text. No pagination — full results returned.++## Rate Limits+No published limits. Be reasonable. Add 0.5-1s delay for batch calls.diff --git a/scientific-skills/database-lookup/references/monarch.md b/scientific-skills/database-lookup/references/monarch.mdnew file mode 100644index 00000000..e46dbd11--- /dev/null+++ b/scientific-skills/database-lookup/references/monarch.md@@ -0,0 +1,46 @@+# Monarch Initiative API++## Base URL+```+https://api.monarchinitiative.org/v3/api+```++## Auth+No API key required.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/search?q={query}` | Text search across all entities |+| `/autocomplete?q={prefix}` | Autocomplete entity names |+| `/entity/{id}` | Entity details (gene, disease, phenotype) |+| `/entity/{id}/associations` | Associations for an entity |+| `/entity/{id}/associations?category={cat}` | Filtered associations |++## Entity ID Prefixes+- `MONDO:` — diseases (e.g. `MONDO:0007947`)+- `HP:` — phenotypes (e.g. `HP:0001250`)+- `HGNC:` — genes (e.g. `HGNC:3603`)+- `NCBIGene:` — genes (e.g. `NCBIGene:7157`)++## Association Categories+`biolink:GeneToPhenotypicFeatureAssociation`, `biolink:DiseaseToPhenotypicFeatureAssociation`, `biolink:GeneToDiseaseAssociation`++## Example Calls+```+# Search for Marfan syndrome+https://api.monarchinitiative.org/v3/api/search?q=Marfan+syndrome&limit=5++# Entity details for a disease+https://api.monarchinitiative.org/v3/api/entity/MONDO:0007947++# Gene-to-phenotype for FBN1+https://api.monarchinitiative.org/v3/api/entity/HGNC:3603/associations?category=biolink:GeneToPhenotypicFeatureAssociation&limit=10+```++## Response Format+JSON. Search: `items[]` with `id`, `name`, `category`. Associations: `items[]` with `subject`, `predicate`, `object`, `publications`.++## Rate Limits+No published limits. Be reasonable.diff --git a/scientific-skills/database-lookup/references/mousemine.md b/scientific-skills/database-lookup/references/mousemine.mdnew file mode 100644index 00000000..cc21b3a8--- /dev/null+++ b/scientific-skills/database-lookup/references/mousemine.md@@ -0,0 +1,40 @@+# MouseMine (Mouse Genome Informatics, InterMine-based)++## Base URL+```+https://www.mousemine.org/mousemine/service+```++## Auth+No auth for most queries. Free account token needed for saved lists.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/search?q={query}&format=json` | Keyword search across all objects |+| `/template/results?name={template}&op1=LOOKUP&value1={value}&format=json` | Run pre-built template query |+| `/query/results` (POST) | Run custom PathQuery (XML) |+| `/model` | Retrieve data model |++## Example Calls+```+# Keyword search for Brca1+https://www.mousemine.org/mousemine/service/search?q=Brca1&format=json++# Template: Gene → GO terms+https://www.mousemine.org/mousemine/service/template/results?name=Gene_GO&op1=LOOKUP&value1=Pax6&format=json+```++## Custom Query (POST)+```+POST /query/results+Content-Type: application/x-www-form-urlencoded+query=<query model="genomic" view="Gene.symbol Gene.name" sortOrder="Gene.symbol asc"><constraint path="Gene.organism.name" op="=" value="Mus musculus"/></query>&format=json+```++## Response Format+JSON: `{"results": [...], "statusCode": 200}`. Also supports XML, TSV, CSV via `format` param.++## Rate Limits+No published limits. Be reasonable.diff --git a/scientific-skills/database-lookup/references/nasa-exoplanet-archive.md b/scientific-skills/database-lookup/references/nasa-exoplanet-archive.mdnew file mode 100644index 00000000..4d2adb76--- /dev/null+++ b/scientific-skills/database-lookup/references/nasa-exoplanet-archive.md@@ -0,0 +1,112 @@+# NASA Exoplanet Archive API++## Base URL++```+https://exoplanetarchive.ipac.caltech.edu+```++## Authentication++No API key required. All endpoints are public.++## Key Endpoints++### 1. TAP Service (recommended — current method)++```+GET /TAP/sync?query={ADQL}&format={format}+```++| Parameter | Type | Description |+|-----------|--------|-------------|+| `query` | string | **Required.** ADQL query. |+| `format` | string | `json`, `csv`, `votable`, `tsv`, `ipac`. Default: `votable`. |++**Example — confirmed planets with key parameters:**+```+https://exoplanetarchive.ipac.caltech.edu/TAP/sync?query=SELECT pl_name,hostname,sy_dist,pl_orbper,pl_rade,pl_bmasse,disc_year,discoverymethod FROM ps WHERE default_flag=1 ORDER BY disc_year DESC&format=json+```++**Example — planets in habitable zone (rough estimate):**+```+https://exoplanetarchive.ipac.caltech.edu/TAP/sync?query=SELECT TOP 50 pl_name,hostname,pl_orbsmax,st_teff,pl_rade FROM ps WHERE default_flag=1 AND pl_orbsmax BETWEEN 0.8 AND 1.5 AND st_teff BETWEEN 4000 AND 7000&format=json+```++**Example — planets discovered by TESS:**+```+https://exoplanetarchive.ipac.caltech.edu/TAP/sync?query=SELECT pl_name,pl_rade,pl_orbper,disc_year FROM ps WHERE default_flag=1 AND disc_facility='Transiting Exoplanet Survey Satellite (TESS)'&format=json+```++**Example — count planets by discovery method:**+```+https://exoplanetarchive.ipac.caltech.edu/TAP/sync?query=SELECT discoverymethod, COUNT(*) as cnt FROM ps WHERE default_flag=1 GROUP BY discoverymethod ORDER BY cnt DESC&format=json+```++### 2. Legacy API (older, still functional)++```+GET /cgi-bin/nstedAPI/nph-nstedAPI?table={table}&format={format}&where={conditions}&select={columns}+```++**Example:**+```+https://exoplanetarchive.ipac.caltech.edu/cgi-bin/nstedAPI/nph-nstedAPI?table=ps&select=pl_name,pl_orbper,pl_rade&where=disc_year=2023&format=json+```++Note: The legacy API is deprecated in favor of TAP. Use TAP for new applications.++## Key TAP Tables++| Table | Description |+|--------|-------------|+| `ps` | **Planetary Systems** — one row per reference per planet. Use `default_flag=1` for the default/best parameter set. |+| `pscomppars` | **Planetary Systems Composite Parameters** — one row per planet with best-fit values from multiple references. |+| `stellarhosts` | Stellar properties of host stars. |+| `td` | Time-series data (transit curves, RV curves). |+| `keplernames` | Kepler Object of Interest cross-references. |+| `k2names` | K2 campaign cross-references. |+| `toi` | TESS Objects of Interest. |++## Key Columns (ps table)++| Column | Description |+|------------------|-------------|+| `pl_name` | Planet name (e.g., "Kepler-22 b"). |+| `hostname` | Host star name. |+| `default_flag` | 1 = default parameter set for this planet. |+| `disc_year` | Discovery year. |+| `discoverymethod` | `Transit`, `Radial Velocity`, `Imaging`, `Microlensing`, etc. |+| `pl_orbper` | Orbital period (days). |+| `pl_orbsmax` | Semi-major axis (AU). |+| `pl_rade` | Planet radius (Earth radii). |+| `pl_bmasse` | Planet mass (Earth masses). |+| `pl_eqt` | Equilibrium temperature (K). |+| `sy_dist` | Distance to system (parsecs). |+| `st_teff` | Stellar effective temperature (K). |+| `st_rad` | Stellar radius (solar radii). |+| `st_mass` | Stellar mass (solar masses). |+| `disc_facility` | Discovery facility name. |++## Response Format (TAP JSON)++```json+{+ "metadata": [+ {"name": "pl_name", "datatype": "char"},+ {"name": "pl_orbper", "datatype": "double"}+ ],+ "data": [+ ["Kepler-22 b", 289.8623]+ ]+}+```++## Rate Limits++No API key or authentication required. No formal rate limits documented, but the archive requests that users avoid excessive automated queries. Large result sets may cause timeouts; use `TOP N` in ADQL or paginate with `OFFSET` and `MAXREC`.++For very large downloads, use the bulk download interface at:+```+https://exoplanetarchive.ipac.caltech.edu/cgi-bin/TblView/nph-tblView?app=ExoTbls&config=PS+```diff --git a/scientific-skills/database-lookup/references/nasa.md b/scientific-skills/database-lookup/references/nasa.mdnew file mode 100644index 00000000..3562a62e--- /dev/null+++ b/scientific-skills/database-lookup/references/nasa.md@@ -0,0 +1,121 @@+# NASA APIs++## Base URL++```+https://api.nasa.gov+```++## Authentication++All endpoints require an API key passed as `api_key` query parameter.+- Get a free key at: https://api.nasa.gov/#signUp+- Demo key: `DEMO_KEY` (rate-limited: 30 req/hour, 50 req/day per IP)+- Registered keys: 1,000 req/hour++## Key Endpoints++### 1. APOD (Astronomy Picture of the Day)++```+GET /planetary/apod+```++**Parameters:**++| Parameter | Type | Description |+|------------|--------|-------------|+| `api_key` | string | **Required.** API key. |+| `date` | string | YYYY-MM-DD. Default: today. |+| `start_date` | string | Start of date range (YYYY-MM-DD). |+| `end_date` | string | End of date range (YYYY-MM-DD). |+| `count` | int | Return N random images (cannot combine with date/range). |+| `thumbs` | bool | Return thumbnail URL for video entries. |++**Example:**+```+https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY&date=2024-01-15+```++**Response (JSON):**+```json+{+ "date": "2024-01-15",+ "title": "...",+ "explanation": "...",+ "url": "https://apod.nasa.gov/apod/image/...",+ "hdurl": "https://apod.nasa.gov/apod/image/...",+ "media_type": "image",+ "copyright": "..."+}+```++### 2. NEO — Near Earth Objects (Asteroids NeoWs)++```+GET /neo/rest/v1/feed+```++**Parameters:**++| Parameter | Type | Description |+|--------------|--------|-------------|+| `api_key` | string | **Required.** |+| `start_date` | string | YYYY-MM-DD. Default: today. |+| `end_date` | string | YYYY-MM-DD. Max 7 days from start. |++**Example:**+```+https://api.nasa.gov/neo/rest/v1/feed?start_date=2024-01-01&end_date=2024-01-03&api_key=DEMO_KEY+```++**Lookup by asteroid ID:**+```+GET /neo/rest/v1/neo/{asteroid_id}?api_key=DEMO_KEY+```++**Browse all:**+```+GET /neo/rest/v1/neo/browse?api_key=DEMO_KEY+```++**Response structure:** `near_earth_objects` keyed by date, each containing array of objects with `name`, `nasa_jpl_url`, `estimated_diameter`, `close_approach_data`, `is_potentially_hazardous_asteroid`.++### 3. Mars Rover Photos++```+GET /mars-photos/api/v1/rovers/{rover}/photos+```++Rovers: `curiosity`, `opportunity`, `spirit`, `perseverance`++**Parameters:**++| Parameter | Type | Description |+|-----------|--------|-------------|+| `api_key` | string | **Required.** |+| `sol` | int | Martian sol (day). Use `sol` OR `earth_date`, not both. |+| `earth_date` | string | YYYY-MM-DD. |+| `camera` | string | Filter by camera: `FHAZ`, `RHAZ`, `MAST`, `CHEMCAM`, `NAVCAM`, etc. |+| `page` | int | 25 results per page. |++**Example:**+```+https://api.nasa.gov/mars-photos/api/v1/rovers/curiosity/photos?sol=1000&camera=NAVCAM&api_key=DEMO_KEY+```++**Rover manifest (mission metadata):**+```+GET /mars-photos/api/v1/manifests/{rover}?api_key=DEMO_KEY+```++**Response:** Array of `photos`, each with `id`, `sol`, `camera` (with `full_name`), `img_src`, `earth_date`, `rover`.++## Rate Limits++| Key Type | Hourly Limit | Daily Limit |+|------------|-------------|-------------|+| `DEMO_KEY` | 30/hour | 50/day |+| Registered | 1,000/hour | Unlimited |++Rate limit headers: `X-RateLimit-Limit`, `X-RateLimit-Remaining`.diff --git a/scientific-skills/database-lookup/references/ncbi-gene.md b/scientific-skills/database-lookup/references/ncbi-gene.mdnew file mode 100644index 00000000..36ebe58d--- /dev/null+++ b/scientific-skills/database-lookup/references/ncbi-gene.md@@ -0,0 +1,64 @@+# NCBI Gene (E-utilities)++## Base URL+```+https://eutils.ncbi.nlm.nih.gov/entrez/eutils/+```++## Auth+API key optional but recommended. Without key: 3 req/sec. With key: 10 req/sec.+Free key from: https://www.ncbi.nlm.nih.gov/account/settings/+Pass as: `&api_key=YOUR_KEY`++## Key Endpoints++### eSearch — Search for gene IDs+```+GET /esearch.fcgi?db=gene&term={query}&retmode=json&retmax={n}+```++Parameters:+- `db=gene` (required)+- `term` — search query (e.g. `BRCA1[gene]+AND+human[orgn]`)+- `retmode=json`+- `retmax` — max results (default 20)+- `retstart` — pagination offset++Example:+```+/esearch.fcgi?db=gene&term=BRCA1[gene]+AND+human[orgn]&retmode=json&retmax=5+```++### eSummary — Get gene metadata+```+GET /esummary.fcgi?db=gene&id={gene_ids}&retmode=json+```++Key response fields: `name`, `description`, `chromosome`, `maplocation`, `otheraliases`, `nomenclaturesymbol`, `organism`++Example:+```+/esummary.fcgi?db=gene&id=672&retmode=json+```++### eFetch — Full gene records (XML/text only, no JSON)+```+GET /efetch.fcgi?db=gene&id={gene_ids}&rettype=gene_table&retmode=text+```++### eLink — Cross-database links (gene to pathways, PubMed, OMIM)+```+GET /elink.fcgi?dbfrom=gene&db={target_db}&id={gene_id}&retmode=json+```++Target databases: `biosystems` (pathways), `pubmed`, `omim`, `nuccore`, `protein`++Example — gene to pathways:+```+/elink.fcgi?dbfrom=gene&db=biosystems&id=672&retmode=json+```++## Rate Limits+- Without API key: 3 requests/second+- With API key: 10 requests/second+- For bulk: use `usehistory=y` with eSearch, then retrieve via `query_key` and `WebEnv`diff --git a/scientific-skills/database-lookup/references/ncbi-protein.md b/scientific-skills/database-lookup/references/ncbi-protein.mdnew file mode 100644index 00000000..f293ea31--- /dev/null+++ b/scientific-skills/database-lookup/references/ncbi-protein.md@@ -0,0 +1,104 @@+# NCBI Protein API Reference++## Overview+Protein sequence records (RefSeq, GenBank, UniProt imports) accessible via NCBI E-utilities with `db=protein`.++## Base URL+```+https://eutils.ncbi.nlm.nih.gov/entrez/eutils/+```++## Authentication+- **API key** (recommended): Register at https://www.ncbi.nlm.nih.gov/account/ and append `&api_key=YOUR_KEY`.+- Without key: 3 requests/second. With key: 10 requests/second.+- Provide `tool` and `email` parameters for identification.++## Key Endpoints++### 1. ESearch -- Search protein records+```+GET esearch.fcgi?db=protein&term=QUERY&retmax=N&retmode=json+```+| Param | Description |+|-------|-------------|+| `term` | Search query (Entrez syntax). Fields: `[Protein Name]`, `[Organism]`, `[Accession]`, `[Gene Name]` |+| `retmax` | Max IDs returned (default 20, max 100000) |+| `retstart` | Offset for pagination |+| `usehistory` | `y` to store results on server (use with large sets) |++**Example -- search human insulin:**+```+GET esearch.fcgi?db=protein&term=insulin+AND+homo+sapiens[Organism]&retmax=5&retmode=json+```+Response (JSON):+```json+{+ "esearchresult": {+ "count": "1523",+ "retmax": "5",+ "idlist": ["116734704", "AAA59172.1", "NP_000198.1", ...],+ "querytranslation": "insulin AND \"Homo sapiens\"[Organism]"+ }+}+```++### 2. EFetch -- Retrieve protein records+```+GET efetch.fcgi?db=protein&id=IDS&rettype=TYPE&retmode=MODE+```+| rettype | retmode | Output |+|---------|---------|--------|+| `fasta` | `text` | FASTA sequence |+| `gp` | `text` | GenPept flat file |+| `gp` | `xml` | GenPept XML (INSDSeq) |+| `acc` | `text` | Accession list |+| `seqid` | `text` | SeqID list |+| `ft` | `text` | Feature table |++**Example -- fetch FASTA for NP_000198.1 (human insulin):**+```+GET efetch.fcgi?db=protein&id=NP_000198.1&rettype=fasta&retmode=text+```+Response:+```+>NP_000198.1 insulin preproprotein [Homo sapiens]+MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAED+LQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN+```++**Example -- fetch GenPept XML for multiple IDs:**+```+GET efetch.fcgi?db=protein&id=NP_000198.1,NP_001278826.1&rettype=gp&retmode=xml+```++### 3. ESummary -- Brief record summaries+```+GET esummary.fcgi?db=protein&id=IDS&retmode=json+```+Returns: accession, title, organism, length, taxonomy, create/update dates.++### 4. ELink -- Find related records+```+GET elink.fcgi?dbfrom=protein&db=gene&id=NP_000198.1+```+Links protein to gene, nucleotide, structure, taxonomy, etc.++## Common Search Patterns+```+# By accession+term=NP_000198.1[Accession]++# By gene name + organism+term=BRCA1[Gene Name] AND human[Organism]++# RefSeq only+term=insulin AND srcdb_refseq[Properties]++# By sequence length range+term=100:500[Sequence Length] AND kinase[Protein Name]+```++## Rate Limits+- Without API key: 3 requests/second+- With API key: 10 requests/second+- Large batch downloads: use `usehistory=y` with `WebEnv`/`query_key`, then fetch in chunks of 500diff --git a/scientific-skills/database-lookup/references/ncbi-taxonomy.md b/scientific-skills/database-lookup/references/ncbi-taxonomy.mdnew file mode 100644index 00000000..22a93db2--- /dev/null+++ b/scientific-skills/database-lookup/references/ncbi-taxonomy.md@@ -0,0 +1,121 @@+# NCBI Taxonomy API Reference++## Overview+Taxonomic classification data (names, lineages, ranks) for all organisms in NCBI databases. Accessible via E-utilities with `db=taxonomy`.++## Base URL+```+https://eutils.ncbi.nlm.nih.gov/entrez/eutils/+```++## Authentication+- **API key** (recommended): Append `&api_key=YOUR_KEY` (register at ncbi.nlm.nih.gov/account).+- Without key: 3 req/sec. With key: 10 req/sec.+- Provide `tool` and `email` parameters.++## Key Endpoints++### 1. ESearch -- Search taxonomy by name+```+GET esearch.fcgi?db=taxonomy&term=QUERY&retmode=json+```+| Param | Description |+|-------|-------------|+| `term` | Organism name, common name, or taxid. Fields: `[Scientific Name]`, `[Common Name]`, `[All Names]`, `[Rank]` |+| `retmax` | Max IDs returned (default 20) |++**Example -- search by scientific name:**+```+GET esearch.fcgi?db=taxonomy&term=Homo+sapiens[Scientific Name]&retmode=json+```+Response:+```json+{+ "esearchresult": {+ "count": "1",+ "idlist": ["9606"]+ }+}+```++**Example -- search by common name:**+```+GET esearch.fcgi?db=taxonomy&term=dog[Common Name]&retmode=json+```++### 2. EFetch -- Retrieve full taxonomy records+```+GET efetch.fcgi?db=taxonomy&id=TAXIDS&retmode=xml+```+Note: Taxonomy EFetch only supports XML output.++**Example -- fetch human taxonomy (taxid 9606):**+```+GET efetch.fcgi?db=taxonomy&id=9606&retmode=xml+```+Response (abbreviated XML):+```xml+<TaxaSet>+ <Taxon>+ <TaxId>9606</TaxId>+ <ScientificName>Homo sapiens</ScientificName>+ <OtherNames>+ <CommonName>human</CommonName>+ </OtherNames>+ <Rank>species</Rank>+ <Division>Primates</Division>+ <GeneticCode><GCId>1</GCId><GCName>Standard</GCName></GeneticCode>+ <MitoGeneticCode><MGCId>2</MGCId><MGCName>Vertebrate Mitochondrial</MGCName></MitoGeneticCode>+ <Lineage>cellular organisms; Eukaryota; Opisthokonta; Metazoa; ... ; Hominidae; Homo</Lineage>+ <LineageEx>+ <Taxon><TaxId>131567</TaxId><ScientificName>cellular organisms</ScientificName><Rank>no rank</Rank></Taxon>+ <Taxon><TaxId>2759</TaxId><ScientificName>Eukaryota</ScientificName><Rank>superkingdom</Rank></Taxon>+ <!-- ... each ancestor node ... -->+ </LineageEx>+ </Taxon>+</TaxaSet>+```++### 3. ESummary -- Brief taxonomy summaries+```+GET esummary.fcgi?db=taxonomy&id=TAXIDS&retmode=json+```+**Example -- multiple taxa:**+```+GET esummary.fcgi?db=taxonomy&id=9606,10090,7227&retmode=json+```+Response includes: `ScientificName`, `CommonName`, `Rank`, `Division`, `TaxId`, `Genus`, `Species`.++### 4. ELink -- Cross-link taxonomy to other databases+```+GET elink.fcgi?dbfrom=taxonomy&db=protein&id=9606&term=insulin+```+Find all protein records for a given taxid, optionally filtered by keyword.++## Common Search Patterns+```+# All species under a genus+term=Drosophila[Next Level] AND species[Rank]++# Search by taxid directly+term=txid9606[Organism:exp]++# By rank+term=Mammalia[Scientific Name] AND class[Rank]++# Subtree search (all descendants)+term=txid9606[Organism:exp]+```++## Useful Cross-references+| Link | Description |+|------|-------------|+| `taxonomy_protein` | All proteins for a taxon |+| `taxonomy_gene` | All genes for a taxon |+| `taxonomy_nuccore` | All nucleotide records for a taxon |+| `taxonomy_genome` | Genome assemblies for a taxon |++## Rate Limits+- Without API key: 3 requests/second+- With API key: 10 requests/second+- EFetch supports multiple taxids in a single call (comma-separated)diff --git a/scientific-skills/database-lookup/references/nist.md b/scientific-skills/database-lookup/references/nist.mdnew file mode 100644index 00000000..50e78d1b--- /dev/null+++ b/scientific-skills/database-lookup/references/nist.md@@ -0,0 +1,105 @@+# NIST Data APIs++## Overview++NIST provides several scientific databases. REST API availability varies by dataset.++## 1. NIST CODATA Fundamental Physical Constants++### Base URL+```+https://physics.nist.gov/cgi-bin/cuu+```++**No formal REST API.** Data is served via CGI scripts returning HTML. The constants can be accessed programmatically via structured URLs but responses are HTML, not JSON/XML.++**Workaround — machine-readable ASCII:**+```+https://physics.nist.gov/cuu/Constants/Table/allascii.txt+```+Returns a tab-delimited text file of all fundamental constants with values, uncertainties, and units.++**Individual constant lookup:**+```+https://physics.nist.gov/cgi-bin/cuu/Value?{constant_key}+```+Example keys: `bohrrada0` (Bohr radius), `c` (speed of light), `h` (Planck constant), `e` (electron charge), `me` (electron mass), `na` (Avogadro number), `k` (Boltzmann constant).++Example:+```+https://physics.nist.gov/cgi-bin/cuu/Value?h+```+Returns HTML page. Parse the value from the page content.++**No API key required. No rate limits documented.**++## 2. NIST Atomic Spectra Database (ASD)++### Base URL+```+https://physics.nist.gov/cgi-bin/ASD+```++**No formal REST API.** Queries are CGI-based, returning HTML. However, machine-readable output is available via specific parameters.++**Spectral lines query:**+```+https://physics.nist.gov/cgi-bin/ASD/lines1.pl?spectra={element}&low_w={min_wavelength}&upp_w={max_wavelength}&unit={unit}&format={format}+```++| Parameter | Type | Description |+|------------|--------|-------------|+| `spectra` | string | Element symbol or ion (e.g., `H`, `Fe`, `He+I`, `O+II`). |+| `low_w` | float | Lower wavelength bound. |+| `upp_w` | float | Upper wavelength bound. |+| `unit` | int | `0` = Angstroms, `1` = nm, `2` = um. |+| `format` | int | `0` = HTML, `1` = ASCII, `2` = CSV, `3` = tab-delimited. |+| `line_out` | int | `0` = all, `1` = only observed, `2` = only Ritz. |+| `show_obs_wl` | int | `1` = show observed wavelengths. |+| `show_calc_wl` | int | `1` = show Ritz wavelengths. |+| `A_out` | int | `1` = include transition probabilities. |++**Example — Hydrogen lines 3000-7000 Angstroms as CSV:**+```+https://physics.nist.gov/cgi-bin/ASD/lines1.pl?spectra=H&low_w=3000&upp_w=7000&unit=0&format=2&line_out=0&show_obs_wl=1&A_out=1+```++**Energy levels query:**+```+https://physics.nist.gov/cgi-bin/ASD/energy1.pl?spectra={element}&units={units}&format={format}+```++**No API key required. No formal rate limits but automated bulk queries are discouraged.**++## 3. NIST Chemistry WebBook++### Base URL+```+https://webbook.nist.gov/cgi/cbook.cgi+```++**No formal REST API.** CGI-based with HTML output. Structured URLs can be used.++**Search by name:**+```+https://webbook.nist.gov/cgi/cbook.cgi?Name={compound}&Units=SI+```++**Search by CAS number:**+```+https://webbook.nist.gov/cgi/cbook.cgi?ID={cas_number}&Units=SI+```++**Search by formula:**+```+https://webbook.nist.gov/cgi/cbook.cgi?Formula={formula}&Units=SI+```++**JCAMP-DX spectra (machine-readable):**+```+https://webbook.nist.gov/cgi/cbook.cgi?ID={cas_number}&Type=IR-Spec&Index=0&JCAMP=C{cas_no_dashes}+```++## Summary++NIST databases generally do **not** offer modern REST/JSON APIs. Data access is primarily through CGI endpoints returning HTML or delimited text. For programmatic use, the ASCII/CSV output options from ASD are the most practical. No authentication is required for any NIST endpoint.diff --git a/scientific-skills/database-lookup/references/noaa.md b/scientific-skills/database-lookup/references/noaa.mdnew file mode 100644index 00000000..34520943--- /dev/null+++ b/scientific-skills/database-lookup/references/noaa.md@@ -0,0 +1,199 @@+# NOAA Climate Data Online (CDO) API Reference++## Base URL+```+https://www.ncdc.noaa.gov/cdo-web/api/v2+```++## Authentication+- **API Token: REQUIRED.** Request a free token at https://www.ncdc.noaa.gov/cdo-web/token+- Pass as HTTP header: `Token: YOUR_TOKEN`++## Rate Limits+- **5 requests per second** per token.+- **10,000 requests per day** per token.+- Queries are limited to **1,000 results per request** (use `offset` for pagination).+- Date ranges limited to **1 year per request** for the `/data` endpoint.++## Common Parameters (apply to most endpoints)+| Parameter | Type | Required | Default | Description |+|---------------|--------|----------|---------|-------------|+| `datasetid` | string | Varies | - | Dataset ID (e.g. `GHCND`, `GSOM`). |+| `datatypeid` | string | No | - | Data type filter (e.g. `TMAX`, `PRCP`). |+| `locationid` | string | No | - | Location ID (e.g. `FIPS:37`, `ZIP:28801`, `CITY:US390029`). |+| `stationid` | string | No | - | Station ID (e.g. `GHCND:USW00013874`). |+| `startdate` | string | Varies | - | ISO date `YYYY-MM-DD`. |+| `enddate` | string | Varies | - | ISO date `YYYY-MM-DD`. |+| `units` | string | No | `standard` | `standard` or `metric`. |+| `limit` | int | No | 25 | Results per page (max 1000). |+| `offset` | int | No | 1 | Pagination offset (1-based). |+| `sortfield` | string | No | - | Field to sort by (e.g. `date`, `name`). |+| `sortorder` | string | No | `asc` | `asc` or `desc`. |++---++## Key Endpoints++### 1. Data (Observations)+```+GET /data+```+Returns actual observation data. This is the primary data retrieval endpoint.++**Required parameters:** `datasetid`, `startdate`, `enddate`.++**Example -- daily max temperature for a station:**+```bash+curl -H "Token: YOUR_TOKEN" \+ "https://www.ncdc.noaa.gov/cdo-web/api/v2/data?datasetid=GHCND&datatypeid=TMAX&stationid=GHCND:USW00013874&startdate=2024-01-01&enddate=2024-01-31&units=metric&limit=31"+```++**Response:**+```json+{+ "metadata": {+ "resultset": {+ "offset": 1,+ "count": 31,+ "limit": 31+ }+ },+ "results": [+ {+ "date": "2024-01-01T00:00:00",+ "datatype": "TMAX",+ "station": "GHCND:USW00013874",+ "attributes": ",,W,2400",+ "value": 12.2+ },+ {+ "date": "2024-01-02T00:00:00",+ "datatype": "TMAX",+ "station": "GHCND:USW00013874",+ "attributes": ",,W,2400",+ "value": 8.9+ }+ ]+}+```+Note: When `units=standard`, GHCND temperature values are in tenths of degrees C. With `units=metric`, they are converted to degrees C.++### 2. Datasets+```+GET /datasets+GET /datasets/{id}+```+Lists available datasets or gets details for one.++**Example:**+```bash+curl -H "Token: YOUR_TOKEN" \+ "https://www.ncdc.noaa.gov/cdo-web/api/v2/datasets?limit=10"+```++**Key Dataset IDs:**+| ID | Name | Description |+|----------|------|-------------|+| `GHCND` | Daily Summaries | Global daily station observations (TMAX, TMIN, PRCP, SNOW, etc.) |+| `GSOM` | Global Summary of the Month | Monthly aggregates |+| `GSOY` | Global Summary of the Year | Annual aggregates |+| `NORMAL_DLY` | Climate Normals Daily | 30-year daily normals |+| `NORMAL_MLY` | Climate Normals Monthly | 30-year monthly normals |+| `PRECIP_15` | Precipitation 15-Minute | Sub-hourly precipitation |+| `PRECIP_HLY` | Precipitation Hourly | Hourly precipitation |++### 3. Data Types+```+GET /datatypes+GET /datatypes/{id}+```+Lists available data types, optionally filtered by dataset.++**Example:**+```bash+curl -H "Token: YOUR_TOKEN" \+ "https://www.ncdc.noaa.gov/cdo-web/api/v2/datatypes?datasetid=GHCND&limit=50"+```++**Common GHCND Data Types:**+| ID | Description |+|--------|-------------|+| `TMAX` | Maximum temperature |+| `TMIN` | Minimum temperature |+| `TAVG` | Average temperature |+| `PRCP` | Precipitation |+| `SNOW` | Snowfall |+| `SNWD` | Snow depth |+| `AWND` | Average wind speed |+| `WSF2` | Fastest 2-minute wind speed |++### 4. Stations+```+GET /stations+GET /stations/{id}+```+Find weather stations, optionally filtered by location, dataset, or extent.++**Additional Parameters:**+| Parameter | Type | Description |+|-----------|--------|-------------|+| `extent` | string | Bounding box: `south_lat,west_lon,north_lat,east_lon`. |++**Example -- stations near Asheville, NC with daily data:**+```bash+curl -H "Token: YOUR_TOKEN" \+ "https://www.ncdc.noaa.gov/cdo-web/api/v2/stations?datasetid=GHCND&locationid=ZIP:28801&limit=10"+```++**Response:**+```json+{+ "metadata": {"resultset": {"offset": 1, "count": 5, "limit": 10}},+ "results": [+ {+ "elevation": 661.1,+ "mindate": "1893-01-01",+ "maxdate": "2024-11-15",+ "latitude": 35.5951,+ "name": "ASHEVILLE REGIONAL AIRPORT, NC US",+ "datacoverage": 1,+ "id": "GHCND:USW00013874",+ "elevationUnit": "METERS",+ "longitude": -82.5572+ }+ ]+}+```++### 5. Locations & Location Categories+```+GET /locations+GET /locations/{id}+GET /locationcategories+GET /locationcategories/{id}+```+Browse location hierarchies (countries, states, cities, zip codes, climate regions).++**Example:**+```bash+curl -H "Token: YOUR_TOKEN" \+ "https://www.ncdc.noaa.gov/cdo-web/api/v2/locations?locationcategoryid=ST&limit=52"+```++Location category IDs: `CITY`, `CLIM_DIV`, `CLIM_REG`, `CNTRY`, `CNTY`, `HYD_ACC`, `HYD_CAT`, `HYD_REG`, `HYD_SUB`, `ST`, `ZIP`.++---++## Workflow: Finding and Querying Data++1. **Find a dataset:** `GET /datasets` to list available datasets.+2. **Find a station:** `GET /stations?datasetid=GHCND&locationid=ZIP:28801` to find nearby stations.+3. **Check available data types:** `GET /datatypes?datasetid=GHCND&stationid=GHCND:USW00013874`.+4. **Query data:** `GET /data?datasetid=GHCND&stationid=GHCND:USW00013874&datatypeid=TMAX,TMIN&startdate=2024-01-01&enddate=2024-12-31&units=metric&limit=1000`.++## Notes+- The `/data` endpoint enforces a **1-year max date range** per request. For multi-year queries, make sequential requests.+- Pagination: `offset` is 1-based. Loop until `offset + limit > count` from the metadata.+- Station IDs include a dataset prefix (e.g. `GHCND:USW00013874`).+- The `attributes` field in data results contains quality flags (comma-separated). Consult dataset documentation for flag meanings.+- Token goes in the header, not as a query parameter.diff --git a/scientific-skills/database-lookup/references/omim.md b/scientific-skills/database-lookup/references/omim.mdnew file mode 100644index 00000000..629251b2--- /dev/null+++ b/scientific-skills/database-lookup/references/omim.md@@ -0,0 +1,114 @@+# OMIM (Online Mendelian Inheritance in Man) API Reference++## Base URL+```+https://api.omim.org/api+```++## Authentication+**API key REQUIRED.** Request at https://omim.org/api (free for academic/non-commercial use).+- Pass as query parameter: `?apiKey=YOUR_API_KEY`+- All requests require the key; unauthenticated requests are rejected.++## Rate Limits+Not publicly documented in detail. Reasonable usage expected per terms of service.++## Response Format+JSON (with `&format=json`) or XML (default). Always append `&format=json` for JSON responses.++## Key Endpoints++### 1. Entry Lookup (by MIM number)+```+GET https://api.omim.org/api/entry?mimNumber={mim_number}&apiKey={key}&format=json+```+Example:+```+GET https://api.omim.org/api/entry?mimNumber=141900&apiKey=YOUR_KEY&format=json+```+Returns entry with title, text, gene map, allelic variants, references.++### 2. Entry with Specific Includes+```+GET https://api.omim.org/api/entry?mimNumber=141900&include=text&include=allelicVariantList&include=geneMap&apiKey={key}&format=json+```+Include options: `text`, `clinicalSynopsis`, `geneMap`, `allelicVariantList`, `referenceList`, `existFlags`, `externalLinks`.++### 3. Search Entries+```+GET https://api.omim.org/api/entry/search?search={query}&apiKey={key}&format=json+```+Example — search for "Marfan syndrome":+```+GET https://api.omim.org/api/entry/search?search=marfan+syndrome&apiKey=YOUR_KEY&format=json&start=0&limit=10+```++### 4. Search with Filters+```+GET https://api.omim.org/api/entry/search?search={query}&filter=gene&apiKey={key}&format=json+```+Filter options: `gene`, `phenotype`, `clinical_synopsis`, etc.++### 5. Gene Map Lookup+```+GET https://api.omim.org/api/geneMap?chromosome={chrom}&apiKey={key}&format=json+```+Example:+```+GET https://api.omim.org/api/geneMap?chromosome=17&apiKey=YOUR_KEY&format=json&start=0&limit=10+```++### 6. Gene Map Search+```+GET https://api.omim.org/api/geneMap/search?search={query}&apiKey={key}&format=json+```++### 7. Clinical Synopsis Search+```+GET https://api.omim.org/api/clinicalSynopsis/search?search={query}&apiKey={key}&format=json+```++## Response Structure+```json+{+ "omim": {+ "version": "1.0",+ "entryList": [+ {+ "entry": {+ "mimNumber": 141900,+ "status": "live",+ "titles": {+ "preferredTitle": "HEMOGLOBIN S; HBS",+ "alternativeTitles": "SICKLE CELL ANEMIA"+ },+ "textSectionList": [...],+ "geneMap": {+ "chromosome": "11",+ "cytoLocation": "11p15.4",+ "geneSymbols": "HBB"+ }+ }+ }+ ]+ }+}+```++## Pagination+Use `start` and `limit` query parameters:+```+&start=0&limit=20+```++## MIM Number Types+- **Asterisk (*)**: Gene+- **Plus (+)**: Gene with known phenotype+- **Number sign (#)**: Phenotype (molecular basis known)+- **Percent (%)**: Phenotype (molecular basis unknown)+- **Null**: Other entry types++## Notes+- OMIM data is copyrighted; API access is free for academic use but requires registration.+- The API does not support bulk downloads; use OMIM downloads page with separate agreement.+- Cross-reference MIM numbers with ClinVar, NCBI Gene, and HPO for integrated disease analysis.diff --git a/scientific-skills/database-lookup/references/opentargets.md b/scientific-skills/database-lookup/references/opentargets.mdnew file mode 100644index 00000000..f26ec289--- /dev/null+++ b/scientific-skills/database-lookup/references/opentargets.md@@ -0,0 +1,459 @@+# Open Targets Platform API++## Base URLs++**GraphQL API (primary, recommended):**+```+https://api.platform.opentargets.org/api/v4/graphql+```++**Important:** The GraphQL endpoint requires HTTP POST with `Content-Type: application/json`. WebFetch (GET-only) will not work — use `curl` via shell instead:+```bash+curl -s -X POST -H "Content-Type: application/json" \+ -d '{"query":"{ target(ensemblId: \"ENSG00000157764\") { approvedSymbol approvedName } }"}' \+ https://api.platform.opentargets.org/api/v4/graphql+```++**REST API (simpler queries):**+```+https://api.platform.opentargets.org/api/v4+```++## Authentication++No API key required. All endpoints are public.++## GraphQL API++All GraphQL queries are sent as POST requests to the GraphQL endpoint.++```+POST https://api.platform.opentargets.org/api/v4/graphql+Content-Type: application/json++{+ "query": "...",+ "variables": { ... }+}+```++### 1. Target information (by Ensembl Gene ID)++```graphql+query TargetInfo($ensemblId: String!) {+ target(ensemblId: $ensemblId) {+ id+ approvedSymbol+ approvedName+ biotype+ proteinIds {+ id+ source+ }+ tractability {+ label+ modality+ value+ }+ safetyLiabilities {+ event+ effects {+ direction+ dosing+ }+ }+ pathways {+ pathway+ pathwayId+ }+ functionDescriptions+ subcellularLocations {+ location+ }+ }+}+```++**Variables:** `{ "ensemblId": "ENSG00000141510" }`++**Example as URL (GET also supported for simple queries):**+```+https://api.platform.opentargets.org/api/v4/graphql?query={target(ensemblId:"ENSG00000141510"){id approvedSymbol approvedName biotype functionDescriptions}}+```++---++### 2. Disease information (by EFO ID)++```graphql+query DiseaseInfo($efoId: String!) {+ disease(efoId: $efoId) {+ id+ name+ description+ therapeuticAreas {+ id+ name+ }+ synonyms {+ terms+ }+ }+}+```++**Variables:** `{ "efoId": "EFO_0000311" }` (cancer)++**Example as URL:**+```+https://api.platform.opentargets.org/api/v4/graphql?query={disease(efoId:"EFO_0000311"){id name description therapeuticAreas{id name}}}+```++---++### 3. Target-Disease associations++```graphql+query Associations($ensemblId: String!, $page: Pagination!) {+ target(ensemblId: $ensemblId) {+ approvedSymbol+ associatedDiseases(page: $page) {+ count+ rows {+ disease {+ id+ name+ }+ score+ datasourceScores {+ id+ score+ }+ }+ }+ }+}+```++**Variables:**+```json+{+ "ensemblId": "ENSG00000141510",+ "page": { "index": 0, "size": 10 }+}+```++**Example as URL:**+```+https://api.platform.opentargets.org/api/v4/graphql?query={target(ensemblId:"ENSG00000141510"){approvedSymbol associatedDiseases(page:{index:0,size:5}){count rows{disease{id name}score}}}}+```++---++### 4. Disease-Target associations (from disease side)++```graphql+query DiseaseAssociations($efoId: String!, $page: Pagination!) {+ disease(efoId: $efoId) {+ name+ associatedTargets(page: $page) {+ count+ rows {+ target {+ id+ approvedSymbol+ }+ score+ datasourceScores {+ id+ score+ }+ }+ }+ }+}+```++**Variables:**+```json+{+ "efoId": "EFO_0000311",+ "page": { "index": 0, "size": 10 }+}+```++---++### 5. Evidence for a target-disease pair++```graphql+query Evidence($ensemblId: String!, $efoId: String!, $size: Int!) {+ disease(efoId: $efoId) {+ evidences(ensemblIds: [$ensemblId], size: $size) {+ count+ rows {+ id+ score+ datasourceId+ datatypeId+ literature+ diseaseFromSource+ targetFromSourceId+ resourceScore+ urls {+ niceName+ url+ }+ }+ }+ }+}+```++**Variables:**+```json+{+ "ensemblId": "ENSG00000141510",+ "efoId": "EFO_0000311",+ "size": 10+}+```++---++### 6. Drug/molecule information++```graphql+query DrugInfo($chemblId: String!) {+ drug(chemblId: $chemblId) {+ id+ name+ drugType+ maximumClinicalTrialPhase+ hasBeenWithdrawn+ mechanismsOfAction {+ rows {+ mechanismOfAction+ targets {+ id+ approvedSymbol+ }+ }+ }+ indications {+ rows {+ disease {+ id+ name+ }+ maxPhaseForIndication+ }+ }+ linkedDiseases {+ count+ rows {+ id+ name+ }+ }+ linkedTargets {+ count+ rows {+ id+ approvedSymbol+ }+ }+ }+}+```++**Variables:** `{ "chemblId": "CHEMBL25" }` (aspirin)++**Example as URL:**+```+https://api.platform.opentargets.org/api/v4/graphql?query={drug(chemblId:"CHEMBL25"){id name drugType maximumClinicalTrialPhase mechanismsOfAction{rows{mechanismOfAction targets{id approvedSymbol}}}}}+```++---++### 7. Search across targets, diseases, and drugs++```graphql+query Search($queryString: String!, $entityNames: [String!], $page: Pagination!) {+ search(queryString: $queryString, entityNames: $entityNames, page: $page) {+ total+ hits {+ id+ entity+ name+ description+ score+ }+ }+}+```++**Variables:**+```json+{+ "queryString": "BRAF melanoma",+ "entityNames": ["target", "disease", "drug"],+ "page": { "index": 0, "size": 10 }+}+```++**Example as URL:**+```+https://api.platform.opentargets.org/api/v4/graphql?query={search(queryString:"BRAF",entityNames:["target"],page:{index:0,size:5}){total hits{id entity name description}}}+```++---++### 8. Known drugs for a target++```graphql+query KnownDrugs($ensemblId: String!, $size: Int!) {+ target(ensemblId: $ensemblId) {+ approvedSymbol+ knownDrugs(size: $size) {+ count+ rows {+ drug {+ id+ name+ drugType+ maximumClinicalTrialPhase+ }+ disease {+ id+ name+ }+ phase+ status+ mechanismOfAction+ urls {+ niceName+ url+ }+ }+ }+ }+}+```++**Variables:**+```json+{+ "ensemblId": "ENSG00000157764",+ "size": 10+}+```++(ENSG00000157764 = BRAF)++---++### 9. Tractability (druggability)++Included in the target query (see endpoint 1 above). Modalities include:+- `SM` (small molecule)+- `AB` (antibody)+- `PR` (PROTAC)+- `OC` (other clinical)++---++## REST API Endpoints++These are simpler alternatives for common operations.++### Search++```+GET /api/v4/search?q={query}&page=0&size=10+```++**Example:**+```+https://api.platform.opentargets.org/api/v4/search?q=TP53&size=5+```++**Response:**+```json+{+ "total": 15,+ "data": [+ {+ "id": "ENSG00000141510",+ "entity": "target",+ "name": "TP53",+ "description": "Cellular tumor antigen p53",+ "score": 142.5+ }+ ]+}+```++---++## Key Identifiers++| Entity | ID Format | Example |+|---------|-----------|---------|+| Target | Ensembl Gene ID | `ENSG00000141510` (TP53) |+| Disease | EFO/Mondo/HP/Orphanet | `EFO_0000311` (cancer), `MONDO_0007254` |+| Drug | ChEMBL ID | `CHEMBL25` (aspirin) |++## Datasource IDs (for filtering evidence)++- `ot_genetics_portal` -- Open Targets Genetics+- `eva` -- ClinVar (via EVA)+- `cancer_gene_census` -- COSMIC Cancer Gene Census+- `chembl` -- ChEMBL (clinical trials)+- `europepmc` -- Literature mining+- `expression_atlas` -- Expression Atlas+- `gene2phenotype` -- Gene2Phenotype+- `genomics_england` -- Genomics England PanelApp+- `intogen` -- IntOGen (cancer drivers)+- `ot_crispr` -- Open Targets CRISPR screens+- `progeny` -- PROGENy (pathway activity)+- `reactome` -- Reactome pathways+- `slapenrich` -- SLAPenrich+- `sysbio` -- Systems biology+- `uniprot_literature` -- UniProt literature++## Pagination++GraphQL uses `page: { index: Int, size: Int }` (0-based index).+REST uses `page` and `size` query parameters.++## Rate Limits++- No API key required.+- Fair-use rate limiting applies. No hard published limit.+- For bulk data, use the Open Targets data downloads (Parquet files on GCS/FTP) rather than API.+- Respect HTTP 429 and `Retry-After` headers.++## Error Format++GraphQL errors:+```json+{+ "errors": [+ {+ "message": "Variable '$ensemblId' expected value of type 'String!' but got: null",+ "locations": [{"line": 1, "column": 7}]+ }+ ]+}+```++REST errors return appropriate HTTP status codes with JSON error bodies.++## Tips++- Use the GraphQL API for maximum flexibility -- request only the fields you need.+- The GET method for GraphQL works for simple queries but POST is required for complex ones with variables.+- Combine target + disease queries to get association scores with evidence breakdown.+- Use `datasourceScores` in association queries to see which evidence sources contribute most.+- The Open Targets Platform web UI at `https://platform.opentargets.org` has a GraphQL playground for testing queries.diff --git a/scientific-skills/database-lookup/references/openweathermap.md b/scientific-skills/database-lookup/references/openweathermap.mdnew file mode 100644index 00000000..dc5ce6ab--- /dev/null+++ b/scientific-skills/database-lookup/references/openweathermap.md@@ -0,0 +1,255 @@+# OpenWeatherMap API Reference++## Base URL+```+https://api.openweathermap.org+```++## Authentication+- **API Key: REQUIRED.** Register for a free key at https://home.openweathermap.org/users/sign_up+- Pass as query parameter: `&appid=YOUR_KEY`+- Free tier key activates within a few hours of registration.++## Rate Limits (Free Tier)+- **60 calls per minute** (1,000 calls/day for some endpoints).+- **Current weather, 5-day forecast, geocoding:** Available on free tier.+- **One Call 3.0:** Requires subscription (1,000 free calls/day with credit card on file).+- **Historical data, air pollution history:** Requires paid plan for extended ranges.++---++## Key Endpoints++### 1. Current Weather+```+GET /data/2.5/weather+```++**Parameters:**+| Parameter | Type | Required | Default | Description |+|-----------|--------|----------|----------|-------------|+| `q` | string | Cond. | - | City name, optionally with state/country: `London`, `London,GB`, `Portland,OR,US`. |+| `lat` | float | Cond. | - | Latitude (use with `lon`). |+| `lon` | float | Cond. | - | Longitude (use with `lat`). |+| `id` | int | Cond. | - | City ID (from OWM city list). |+| `zip` | string | Cond. | - | Zip/postal code with country: `90210,US`, `SW1,GB`. |+| `units` | string | No | `standard` | `standard` (Kelvin), `metric` (Celsius), `imperial` (Fahrenheit). |+| `lang` | string | No | `en` | Language code for descriptions. |+| `appid` | string | Yes | - | API key. |++One location parameter (`q`, `lat`+`lon`, `id`, or `zip`) is required.++**Example:**+```+https://api.openweathermap.org/data/2.5/weather?lat=40.7128&lon=-74.0060&units=metric&appid=YOUR_KEY+```++**Response:**+```json+{+ "coord": {"lon": -74.006, "lat": 40.7128},+ "weather": [+ {+ "id": 800,+ "main": "Clear",+ "description": "clear sky",+ "icon": "01d"+ }+ ],+ "base": "stations",+ "main": {+ "temp": 22.5,+ "feels_like": 21.8,+ "temp_min": 20.1,+ "temp_max": 24.3,+ "pressure": 1013,+ "humidity": 55,+ "sea_level": 1013,+ "grnd_level": 1010+ },+ "visibility": 10000,+ "wind": {"speed": 3.6, "deg": 220, "gust": 5.1},+ "clouds": {"all": 0},+ "dt": 1700000000,+ "sys": {+ "country": "US",+ "sunrise": 1699960000,+ "sunset": 1699996000+ },+ "timezone": -18000,+ "id": 5128581,+ "name": "New York",+ "cod": 200+}+```++### 2. 5-Day / 3-Hour Forecast (Free)+```+GET /data/2.5/forecast+```+Returns forecast data in 3-hour intervals for 5 days (40 data points). Same location parameters as current weather.++**Additional Parameters:**+| Parameter | Type | Description |+|-----------|------|-------------|+| `cnt` | int | Number of 3-hour steps to return (max 40). |++**Example:**+```+https://api.openweathermap.org/data/2.5/forecast?q=London,GB&units=metric&cnt=8&appid=YOUR_KEY+```++**Response:**+```json+{+ "cod": "200",+ "message": 0,+ "cnt": 8,+ "list": [+ {+ "dt": 1700000000,+ "main": {+ "temp": 10.5,+ "feels_like": 8.2,+ "temp_min": 9.8,+ "temp_max": 10.5,+ "pressure": 1020,+ "humidity": 80+ },+ "weather": [{"id": 802, "main": "Clouds", "description": "scattered clouds", "icon": "03d"}],+ "clouds": {"all": 40},+ "wind": {"speed": 4.1, "deg": 250},+ "visibility": 10000,+ "pop": 0.2,+ "dt_txt": "2024-01-15 12:00:00"+ }+ ],+ "city": {+ "id": 2643743,+ "name": "London",+ "coord": {"lat": 51.5085, "lon": -0.1257},+ "country": "GB",+ "population": 1000000,+ "timezone": 0,+ "sunrise": 1699950000,+ "sunset": 1699982000+ }+}+```+`pop` is probability of precipitation (0.0 to 1.0).++### 3. Geocoding+```+GET /geo/1.0/direct+GET /geo/1.0/reverse+GET /geo/1.0/zip+```++**Direct geocoding (city name to coordinates):**+```+https://api.openweathermap.org/geo/1.0/direct?q=London,GB&limit=5&appid=YOUR_KEY+```+Returns array of `{name, lat, lon, country, state}`.++**Reverse geocoding (coordinates to city name):**+```+https://api.openweathermap.org/geo/1.0/reverse?lat=51.5085&lon=-0.1257&limit=1&appid=YOUR_KEY+```++**Zip code geocoding:**+```+https://api.openweathermap.org/geo/1.0/zip?zip=90210,US&appid=YOUR_KEY+```++### 4. One Call API 3.0 (Subscription Required)+```+GET /data/3.0/onecall+```+Comprehensive endpoint returning current, minutely (1h), hourly (48h), daily (8d), and alerts in one call.++**Parameters:**+| Parameter | Type | Required | Description |+|-----------|--------|----------|-------------|+| `lat` | float | Yes | Latitude. |+| `lon` | float | Yes | Longitude. |+| `exclude` | string | No | Comma-separated parts to exclude: `current`, `minutely`, `hourly`, `daily`, `alerts`. |+| `units` | string | No | `standard`, `metric`, `imperial`. |+| `appid` | string | Yes | API key. |++**Example:**+```+https://api.openweathermap.org/data/3.0/onecall?lat=40.7128&lon=-74.006&exclude=minutely,alerts&units=metric&appid=YOUR_KEY+```++### 5. Air Pollution+```+GET /data/2.5/air_pollution+GET /data/2.5/air_pollution/forecast+GET /data/2.5/air_pollution/history+```++**Parameters:** `lat`, `lon`, `appid` (required). For history: `start` and `end` (Unix timestamps).++**Example:**+```+https://api.openweathermap.org/data/2.5/air_pollution?lat=40.7128&lon=-74.006&appid=YOUR_KEY+```++**Response:**+```json+{+ "coord": {"lon": -74.006, "lat": 40.7128},+ "list": [+ {+ "main": {"aqi": 2},+ "components": {+ "co": 230.31,+ "no": 0.5,+ "no2": 15.0,+ "o3": 68.0,+ "so2": 2.5,+ "pm2_5": 8.1,+ "pm10": 12.3,+ "nh3": 1.0+ },+ "dt": 1700000000+ }+ ]+}+```+AQI scale: 1=Good, 2=Fair, 3=Moderate, 4=Poor, 5=Very Poor. Components in ug/m3.++---++## Weather Condition Codes+| Range | Category |+|---------|----------|+| 2xx | Thunderstorm |+| 3xx | Drizzle |+| 5xx | Rain |+| 6xx | Snow |+| 7xx | Atmosphere (fog, mist, haze) |+| 800 | Clear |+| 80x | Clouds |++Weather icons: `https://openweathermap.org/img/wn/{icon}@2x.png`++## Free Tier vs Paid Summary+| Endpoint | Free | Subscription |+|----------|------|-------------|+| Current weather | Yes | Yes |+| 5-day/3-hour forecast | Yes | Yes |+| Geocoding | Yes | Yes |+| Air pollution (current) | Yes | Yes |+| One Call 3.0 | 1000/day (credit card required) | Yes |+| Historical weather | No | Yes |+| Daily forecast 16-day | No | Yes |+| Climatic forecast 30-day | No | Yes |++## Notes+- All timestamps (`dt`, `sunrise`, `sunset`) are **Unix epoch seconds (UTC)**.+- `timezone` field is offset in seconds from UTC (e.g. -18000 = UTC-5).+- Default temperature unit is Kelvin. Always specify `units=metric` or `units=imperial`.+- City name queries (`q=`) can be ambiguous. Prefer `lat`+`lon` for precision, using geocoding first if needed.+- Weather icon URL pattern: `https://openweathermap.org/img/wn/{icon}@2x.png` (e.g. `01d` for clear day).+- Error responses return `{"cod": 401, "message": "Invalid API key"}` or similar.diff --git a/scientific-skills/database-lookup/references/pdb.md b/scientific-skills/database-lookup/references/pdb.mdnew file mode 100644index 00000000..eb960ca4--- /dev/null+++ b/scientific-skills/database-lookup/references/pdb.md@@ -0,0 +1,121 @@+# RCSB Protein Data Bank (PDB) API Reference++## Base URLs+- **Data API**: `https://data.rcsb.org/rest/v1`+- **Search API**: `https://search.rcsb.org/rcsbsearch/v2/query`+- **GraphQL**: `https://data.rcsb.org/graphql`+- **Files**: `https://files.rcsb.org`++## Authentication+None required. Fully public API.++## Rate Limits+No published hard limits; be courteous (a few requests/second). Bulk downloads available via FTP.++## Key Endpoints++### 1. Entry Lookup (Data API)+```+GET https://data.rcsb.org/rest/v1/core/entry/{entry_id}+```+Example:+```+GET https://data.rcsb.org/rest/v1/core/entry/4HHB+```+Returns JSON with resolution, method, deposition date, title, authors, etc.++### 2. Polymer Entity (chain-level info)+```+GET https://data.rcsb.org/rest/v1/core/polymer_entity/{entry_id}/{entity_id}+```+Example:+```+GET https://data.rcsb.org/rest/v1/core/polymer_entity/4HHB/1+```++### 3. Assembly Info+```+GET https://data.rcsb.org/rest/v1/core/assembly/{entry_id}/{assembly_id}+```++### 4. Full-Text and Attribute Search (Search API)+```+POST https://search.rcsb.org/rcsbsearch/v2/query+Content-Type: application/json+```+Example — search by UniProt accession:+```json+{+ "query": {+ "type": "terminal",+ "service": "text",+ "parameters": {+ "attribute": "rcsb_polymer_entity_container_identifiers.reference_sequence_identifiers.database_accession",+ "operator": "exact_match",+ "value": "P69905"+ }+ },+ "return_type": "entry"+}+```++### 5. Sequence Search (Search API)+```json+{+ "query": {+ "type": "terminal",+ "service": "sequence",+ "parameters": {+ "evalue_cutoff": 0.1,+ "identity_cutoff": 0.9,+ "sequence_type": "protein",+ "value": "MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSH"+ }+ },+ "return_type": "polymer_entity"+}+```++### 6. Structure Similarity Search+```json+{+ "query": {+ "type": "terminal",+ "service": "structure",+ "parameters": {+ "value": {"entry_id": "4HHB", "assembly_id": "1"},+ "operator": "strict_shape_match"+ }+ },+ "return_type": "assembly"+}+```++### 7. Download Structure Files+```+GET https://files.rcsb.org/download/{entry_id}.cif+GET https://files.rcsb.org/download/{entry_id}.pdb+```++### 8. GraphQL Query+```+POST https://data.rcsb.org/graphql+```+Body example:+```json+{+ "query": "{ entry(entry_id: \"4HHB\") { rcsb_entry_info { resolution_combined } struct { title } } }"+}+```++## Response Format+All REST/Search endpoints return JSON. File downloads return PDB/mmCIF text.++## Useful `return_type` Values for Search+- `entry` — PDB IDs+- `polymer_entity` — entity-level results (e.g., 4HHB_1)+- `assembly` — biological assembly results++## Notes+- Search API uses POST with a JSON query DSL. Combine queries with `"type": "group"` and `"logical_operator": "and"/"or"`.+- Pagination via `"request_options": {"paginate": {"start": 0, "rows": 25}}`.diff --git a/scientific-skills/database-lookup/references/pride.md b/scientific-skills/database-lookup/references/pride.mdnew file mode 100644index 00000000..6a2cc8fa--- /dev/null+++ b/scientific-skills/database-lookup/references/pride.md@@ -0,0 +1,74 @@+# PRIDE Archive REST API Reference++## Overview+PRIDE (PRoteomics IDEntifications Database) at EMBL-EBI provides a full public REST API for querying proteomics datasets, proteins, peptides, and spectra.++## Base URL+```+https://www.ebi.ac.uk/pride/ws/archive/v2+```+(Legacy v1 also exists but v2 is current)++## Authentication+- **No authentication required** for read access+- Open and free to use++## Key Endpoints++| Endpoint | Description |+|---|---|+| `GET /projects` | Search/list proteomics projects |+| `GET /projects/{accession}` | Get a specific project by PXD accession |+| `GET /projects/{accession}/files` | List files for a project |+| `GET /spectra` | Search spectra |+| `GET /peptideevidences` | Search peptide evidences |+| `GET /proteinevidences` | Search protein evidences |+| `GET /stats` | Database statistics |++## Query Parameters+- `keyword` — free-text search+- `filter` — field-specific filters (e.g., species, instrument, modification)+- `pageSize` — results per page (default 10, max 100)+- `page` — page number (0-indexed)+- `sortDirection` — ASC or DESC+- `sortFields` — field to sort by++## Example Calls++```bash+# Search projects by keyword+curl "https://www.ebi.ac.uk/pride/ws/archive/v2/projects?keyword=alzheimer&pageSize=5"++# Get a specific project+curl "https://www.ebi.ac.uk/pride/ws/archive/v2/projects/PXD010000"++# List files for a project+curl "https://www.ebi.ac.uk/pride/ws/archive/v2/projects/PXD010000/files?pageSize=10"++# Search by species (human = 9606)+curl "https://www.ebi.ac.uk/pride/ws/archive/v2/projects?filter=organisms_facet==9606&pageSize=5"++# Get database statistics+curl "https://www.ebi.ac.uk/pride/ws/archive/v2/stats"+```++## Response Format+JSON. Example (project):+```json+{+ "accession": "PXD010000",+ "title": "Project title here",+ "projectDescription": "...",+ "organisms": [{"accession": "9606", "name": "Homo sapiens"}],+ "instruments": [{"name": "Q Exactive"}],+ "submissionDate": "2018-05-01",+ "publicationDate": "2018-09-01",+ "numAssays": 12,+ "references": [{"pubmedId": 12345678}]+}+```++## Rate Limits+- No strict published rate limits, but standard EBI fair-use policies apply+- Recommended: limit to a few requests per second+- Bulk data available via FTP/Aspera at ftp.pride.ebi.ac.ukdiff --git a/scientific-skills/database-lookup/references/pubchem.md b/scientific-skills/database-lookup/references/pubchem.mdnew file mode 100644index 00000000..3e87cc56--- /dev/null+++ b/scientific-skills/database-lookup/references/pubchem.md@@ -0,0 +1,145 @@+# PubChem PUG REST API++## Base URL++```+https://pubchem.ncbi.nlm.nih.gov/rest/pug+```++## URL Pattern++```+/{domain}/{namespace}/{identifiers}/{operation}/{output}+```++- **domain**: `compound`, `substance`, `assay`+- **namespace**: `cid`, `name`, `smiles`, `inchi`, `inchikey`, `fastformula`+- **operation**: `record`, `property`, `synonyms`, `description`, `cids`, `xrefs`+- **output**: `JSON`, `XML`, `CSV`, `TXT`, `SDF`, `PNG`++## Key Endpoints++### Search by name+```+GET /compound/name/{name}/JSON+```+Example: `/compound/name/aspirin/JSON`++### Search by CID+```+GET /compound/cid/{cid}/JSON+```+Example: `/compound/cid/2244/JSON`++Multiple CIDs: `/compound/cid/2244,5988,3672/JSON`++### Search by SMILES+```+GET /compound/smiles/{smiles}/JSON+```+For SMILES with special characters, use POST:+```+POST /compound/smiles/JSON+Content-Type: application/x-www-form-urlencoded+smiles=CC(=O)OC1=CC=CC=C1C(=O)O+```++### Search by InChIKey+```+GET /compound/inchikey/{inchikey}/JSON+```++### Search by InChI (POST only — InChI strings are too long for URLs)+```+POST /compound/inchi/JSON+Content-Type: application/x-www-form-urlencoded+inchi=InChI=1S/C9H8O4/...+```++### Search by molecular formula+```+GET /compound/fastformula/{formula}/JSON+```+Example: `/compound/fastformula/C9H8O4/JSON`++### Property retrieval+```+GET /compound/{namespace}/{id}/property/{property_list}/JSON+```+Properties are comma-separated. Available properties:++`MolecularFormula`, `MolecularWeight`, `CanonicalSMILES`, `IsomericSMILES`, `InChI`, `InChIKey`, `IUPACName`, `XLogP`, `ExactMass`, `MonoisotopicMass`, `TPSA`, `Complexity`, `Charge`, `HBondDonorCount`, `HBondAcceptorCount`, `RotatableBondCount`, `HeavyAtomCount`, `CID`++Example:+```+/compound/cid/2244/property/MolecularFormula,MolecularWeight,CanonicalSMILES,IUPACName/JSON+```++Response:+```json+{+ "PropertyTable": {+ "Properties": [+ {+ "CID": 2244,+ "MolecularFormula": "C9H8O4",+ "MolecularWeight": 180.16,+ "IUPACName": "2-acetyloxybenzoic acid",+ "CanonicalSMILES": "CC(=O)OC1=CC=CC=C1C(O)=O"+ }+ ]+ }+}+```++### Synonym lookup+```+GET /compound/{namespace}/{id}/synonyms/JSON+```++### Compound description+```+GET /compound/cid/{cid}/description/JSON+```++### Get just CIDs from a name+```+GET /compound/name/{name}/cids/JSON+```++### Cross-references (patents, registry IDs)+```+GET /compound/cid/{cid}/xrefs/PatentID/JSON+GET /compound/cid/{cid}/xrefs/RegistryID/JSON+```++### Similarity search (POST, returns listkey for async retrieval)+```+POST /compound/fastsimilarity_2d/smiles/cids/JSON+smiles=CC(=O)OC1=CC=CC=C1C(=O)O&Threshold=90+```++### 2D structure image+```+GET /compound/cid/{cid}/PNG+GET /compound/cid/{cid}/PNG?image_size=300x300+```++## Rate Limits++- Max **5 requests per second**+- Max **400 requests per minute**+- Batch CIDs with commas (up to 100 per GET, ~10,000 per POST)+- Throttle error returns `PUGREST.ServerBusy` fault code++## Error Format++```json+{+ "Fault": {+ "Code": "PUGREST.NotFound",+ "Message": "No CID found",+ "Details": ["..."]+ }+}+```diff --git a/scientific-skills/database-lookup/references/quickgo.md b/scientific-skills/database-lookup/references/quickgo.mdnew file mode 100644index 00000000..076a3273--- /dev/null+++ b/scientific-skills/database-lookup/references/quickgo.md@@ -0,0 +1,45 @@+# QuickGO (EBI GO Annotation Browser)++## Base URL+```+https://www.ebi.ac.uk/QuickGO/services/+```++## Auth+No auth required.++## Key Endpoints++| Endpoint | Description |+|----------|-------------|+| `/ontology/go/terms/{goId}` | GO term details |+| `/ontology/go/terms/{goId}/children` | Child terms |+| `/ontology/go/terms/{goId}/ancestors` | Ancestor terms |+| `/ontology/go/search?query={term}` | Search GO terms by keyword |+| `/annotation/search` | Search annotations by gene/taxon/GO term |++## Annotation Search Parameters+- `goId` — GO term (e.g. GO:0003723)+- `taxonId` — NCBI taxonomy (e.g. 9606 for human)+- `geneProductId` — UniProt accession+- `evidence` — evidence code (e.g. ECO:0000269)+- `aspect` — biological_process, molecular_function, cellular_component+- `limit`, `page` — pagination++## Example Calls+```+# GO term details+https://www.ebi.ac.uk/QuickGO/services/ontology/go/terms/GO:0003723++# Human annotations for RNA binding+https://www.ebi.ac.uk/QuickGO/services/annotation/search?goId=GO:0003723&taxonId=9606&limit=10++# Search terms by keyword+https://www.ebi.ac.uk/QuickGO/services/ontology/go/search?query=apoptosis&limit=5+```++## Response Format+JSON. Annotations: paginated results with gene product, GO term, evidence, qualifier.++## Rate Limits+EBI fair-use policy. Use download endpoint for large result sets.diff --git a/scientific-skills/database-lookup/references/reactome.md b/scientific-skills/database-lookup/references/reactome.mdnew file mode 100644index 00000000..85b6d880--- /dev/null+++ b/scientific-skills/database-lookup/references/reactome.md@@ -0,0 +1,140 @@+# Reactome Content Service REST API++## Base URL++```+https://reactome.org/ContentService+```++No authentication required. JSON by default.++## Key Endpoints++### Search (full-text across pathways, reactions, proteins)++```+GET /search/query?query={term}+```++Parameters:+- `query` (required) — search term (e.g. "apoptosis", "TP53", "R-HSA-109581")+- `species` — filter by species (e.g. "Homo sapiens")+- `types` — filter by type: `Pathway`, `Reaction`, `Protein`, `Complex`, `SmallMolecule`+- `cluster` — boolean, cluster results (default true)+- `rows` — page size+- `Start row` — offset for pagination++Example:+```+/search/query?query=apoptosis&species=Homo+sapiens&types=Pathway+```++Response:+```json+{+ "results": [+ {+ "typeName": "Pathway",+ "rows": [+ {+ "dbId": 109581,+ "stId": "R-HSA-109581",+ "name": "Apoptosis",+ "species": ["Homo sapiens"],+ "summation": ["..."]+ }+ ]+ }+ ],+ "found": 42+}+```++### Autocomplete+```+GET /search/suggest?query={partial_term}+```++### Top-level pathways for a species+```+GET /data/pathways/top/{species}+```+Example: `/data/pathways/top/Homo+sapiens`++### Pathway details+```+GET /data/query/{id}+```+Where `{id}` is a stable ID like `R-HSA-109581` or a numeric dbId.++### Events contained in a pathway+```+GET /data/pathway/{id}/containedEvents+```++### Participants of a reaction+```+GET /data/event/{id}/participants+```++### Ancestors of an event+```+GET /data/event/{id}/ancestors+```++### Map external ID to pathways (e.g. UniProt to Reactome pathways)+```+GET /data/mapping/{resource}/{id}/pathways+```+Example — find pathways for TP53 (UniProt P04637):+```+/data/mapping/UniProt/P04637/pathways+```++### Map external ID to reactions+```+GET /data/mapping/{resource}/{id}/reactions+```++### Generic entity lookup+```+GET /data/query/{id}+```++### Reference entities for an event+```+GET /data/participants/{id}/referenceEntities+```++### All species+```+GET /data/species/all+```++### Event hierarchy for a species (large response)+```+GET /data/eventsHierarchy/{species}+```++## Stable ID Format++`R-{species_code}-{number}`++| Code | Species |+|---|---|+| HSA | Homo sapiens |+| MMU | Mus musculus |+| RNO | Rattus norvegicus |+| DME | Drosophila melanogaster |+| CEL | C. elegans |+| SCE | S. cerevisiae |++## External Resource Names for Mapping++`UniProt`, `ChEBI`, `ENSEMBL`, `miRBase`, `GeneCards`, `NCBI`++Multiple values for same parameter: repeat the parameter (e.g. `types=Pathway&types=Reaction`).++## Rate Limits++No API key required. No formal rate limit published, but be reasonable — avoid hundreds of concurrent requests. For bulk data, use Reactome's downloadable dumps (MySQL, Neo4j, BioPAX, SBML).diff --git a/scientific-skills/database-lookup/references/rummageo.md b/scientific-skills/database-lookup/references/rummageo.mdnew file mode 100644index 00000000..a93e1b72--- /dev/null+++ b/scientific-skills/database-lookup/references/rummageo.md@@ -0,0 +1,32 @@+# RummaGEO (GEO Gene Set Enrichment Search)++## Base URL+```+https://rummageo.com/+```++## Auth+No auth required.++## Key Endpoints++| Endpoint | Method | Description |+|----------|--------|-------------|+| `/api/enrich` | POST | Submit gene set for enrichment against GEO signatures |+| `/api/table` | GET | Paginated table of indexed GEO signatures |++## Example Call+```bash+curl -X POST "https://rummageo.com/api/enrich" \+ -H "Content-Type: application/json" \+ -d '{"genes": ["BRCA1","TP53","EGFR","MYC","PTEN"]}'+```++## Response Format+JSON. Ranked list of matching GEO signatures with overlap stats, p-values, source study links.++## Note+POST endpoint — use `curl` via shell, not WebFetch.++## Rate Limits+No published limits. Designed for interactive/programmatic use.diff --git a/scientific-skills/database-lookup/references/sdss.md b/scientific-skills/database-lookup/references/sdss.mdnew file mode 100644index 00000000..01f1de05--- /dev/null+++ b/scientific-skills/database-lookup/references/sdss.md@@ -0,0 +1,130 @@+# SDSS SkyServer API++## Base URL++```+https://skyserver.sdss.org/dr18/SkyServerWS+```++Replace `dr18` with the desired data release (e.g., `dr17`, `dr16`).++## Authentication++No API key required. All endpoints are public.++## Key Endpoints++### 1. SQL Search (CasJobs-style free-form SQL)++```+GET /SearchTools/SqlSearch+```++| Parameter | Type | Description |+|-----------|--------|-------------|+| `cmd` | string | **Required.** SQL query against SDSS CasJobs schema. |+| `format` | string | `json`, `xml`, `csv`, `html`, `votable`. Default: `html`. |++**Example — query 10 galaxies:**+```+https://skyserver.sdss.org/dr18/SkyServerWS/SearchTools/SqlSearch?cmd=SELECT TOP 10 objid,ra,dec,u,g,r,i,z FROM PhotoObj WHERE type=3&format=json+```++Type codes: `3` = galaxy, `6` = star.++**Response (JSON):**+```json+[+ {"Rows": [+ {"objid": 1237645941825863680, "ra": 195.123, "dec": 2.456, "u": 22.1, "g": 20.8, "r": 19.5, "i": 19.1, "z": 18.9}+ ]}+]+```++### 2. Radial Search++```+GET /SearchTools/RadialSearch+```++| Parameter | Type | Description |+|--------------|--------|-------------|+| `ra` | float | **Required.** Right ascension (degrees). |+| `dec` | float | **Required.** Declination (degrees). |+| `radius` | float | Search radius in arcminutes. Default: 1. |+| `format` | string | `json`, `xml`, `csv`. |+| `limit` | int | Max results. |+| `objtype` | string | Filter: `star`, `galaxy`, or blank for all. |++**Example — objects within 2 arcmin of RA=180, Dec=+0.5:**+```+https://skyserver.sdss.org/dr18/SkyServerWS/SearchTools/RadialSearch?ra=180&dec=0.5&radius=2&format=json&limit=10+```++### 3. Rectangular Search++```+GET /SearchTools/RectangularSearch+```++| Parameter | Type | Description |+|-----------|--------|-------------|+| `min_ra` | float | Minimum RA (degrees). |+| `max_ra` | float | Maximum RA (degrees). |+| `min_dec` | float | Minimum Dec (degrees). |+| `max_dec` | float | Maximum Dec (degrees). |+| `format` | string | `json`, `xml`, `csv`. |+| `limit` | int | Max results. |++### 4. Object Lookup by ObjID++```+GET /SearchTools/SqlSearch?cmd=SELECT * FROM PhotoObj WHERE objid={objid}&format=json+```++### 5. Spectra Search by Plate-MJD-Fiber++```+GET /SearchTools/SqlSearch?cmd=SELECT * FROM SpecObj WHERE plate={plate} AND mjd={mjd} AND fiberid={fiberid}&format=json+```++### 6. Image Cutout Service++```+GET /ImgCutout/getjpeg+```++| Parameter | Type | Description |+|-----------|--------|-------------|+| `ra` | float | **Required.** RA (degrees). |+| `dec` | float | **Required.** Dec (degrees). |+| `scale` | float | Arcsec/pixel. Default: 0.396127. |+| `width` | int | Image width in pixels. Default: 512. |+| `height` | int | Image height in pixels. Default: 512. |++**Example:**+```+https://skyserver.sdss.org/dr18/SkyServerWS/ImgCutout/getjpeg?ra=180.0&dec=0.5&scale=0.4&width=256&height=256+```++Returns JPEG image data.++### 7. Spectrum Plot/Data++Spectrum FITS files can be retrieved from the Science Archive Server:+```+https://data.sdss.org/sas/dr18/spectro/sdss/redux/{run2d}/spectra/{plate}/spec-{plate}-{mjd}-{fiberid}.fits+```++## Important SQL Tables++| Table | Description |+|-------------|-------------|+| `PhotoObj` | Photometric measurements (positions, magnitudes). |+| `SpecObj` | Spectroscopic measurements (redshifts, classifications). |+| `Galaxy` | View of PhotoObj filtered to galaxies. |+| `Star` | View of PhotoObj filtered to stars. |++## Rate Limits++No formal documented rate limits. Queries returning very large result sets may time out. Use `TOP N` in SQL queries to limit results. For bulk data, use CasJobs (https://skyserver.sdss.org/CasJobs/) with a free account.diff --git a/scientific-skills/database-lookup/references/sec-edgar.md b/scientific-skills/database-lookup/references/sec-edgar.mdnew file mode 100644index 00000000..079670bd--- /dev/null+++ b/scientific-skills/database-lookup/references/sec-edgar.md@@ -0,0 +1,315 @@+# SEC EDGAR API Reference++## Overview+SEC's Electronic Data Gathering, Analysis, and Retrieval system. Provides free access to corporate filings, company data, and XBRL financial data. No API key required, but a User-Agent header identifying you is mandatory.++## Base URLs+- **EFTS (Full-Text Search):** `https://efts.sec.gov/LATEST`+- **Company/Filings Data:** `https://data.sec.gov`+- **EDGAR Website/Archives:** `https://www.sec.gov`+- **XBRL API:** `https://data.sec.gov/api/xbrl`++## Authentication+- **API Key:** Not required.+- **User-Agent Header:** REQUIRED on every request. Must contain company/person name and email.+ ```+ User-Agent: MyCompany [email protected]+ ```+ Requests without a proper User-Agent are blocked (403).++## Rate Limits+- **10 requests per second** per source IP.+- Exceeding this results in temporary IP-based throttling (HTTP 429).+- SEC asks users to make requests outside market hours (9:00 PM - 6:00 AM ET) when possible for bulk downloads.++---++## Key Endpoints++### 1. Full-Text Search (EFTS)++#### `GET https://efts.sec.gov/LATEST/search-index`+Search across the full text of all EDGAR filings.++**Parameters:**+| Parameter | Type | Required | Description |+|-------------|--------|----------|-------------|+| `q` | string | Yes | Search query text. Supports boolean operators (`AND`, `OR`, `NOT`), exact phrases in quotes. |+| `dateRange` | string | No | `custom` to enable date filtering. |+| `startdt` | string | No | Start date `YYYY-MM-DD`. |+| `enddt` | string | No | End date `YYYY-MM-DD`. |+| `forms` | string | No | Comma-separated form types, e.g. `10-K,10-Q,8-K`. |+| `from` | int | No | Pagination offset (default 0). |+| `size` | int | No | Results per page (default 10, max varies). |++**Example:**+```+https://efts.sec.gov/LATEST/search-index?q=%22artificial+intelligence%22&forms=10-K&startdt=2024-01-01&enddt=2024-12-31+```++**Response:**+```json+{+ "hits": {+ "hits": [+ {+ "_id": "0001234567-24-000123:filing.htm",+ "_source": {+ "file_date": "2024-03-15",+ "display_date_filed": "2024-03-15",+ "entity_name": "EXAMPLE CORP",+ "file_num": "001-12345",+ "form_type": "10-K",+ "file_description": "Annual report",+ "period_of_report": "2023-12-31"+ }+ }+ ],+ "total": { "value": 150 }+ }+}+```++### 2. EDGAR Full-Text Search (Preferred newer endpoint)++#### `GET https://efts.sec.gov/LATEST/search-index` (also accessible as below)++#### `GET https://efts.sec.gov/LATEST/search-index?q=...`++Note: The EDGAR full-text search has also been exposed under a simpler URL:++#### `GET https://efts.sec.gov/LATEST/search-index`++The above is the canonical endpoint. Some documentation also references the EDGAR search UI which hits the same backend.++---++### 3. Company Tickers & CIK Lookup++#### `GET https://www.sec.gov/cgi-bin/browse-edgar`+Legacy EDGAR company search.++**Parameters:**+| Parameter | Type | Required | Description |+|-----------|--------|----------|-------------|+| `company` | string | No | Company name search. |+| `CIK` | string | No | CIK number or ticker symbol. |+| `type` | string | No | Filing type filter (e.g., `10-K`). |+| `dateb` | string | No | Filed before date `YYYY-MM-DD`. |+| `owner` | string | No | `include`, `exclude`, or `only`. |+| `count` | int | No | Number of results (max 100). |+| `action` | string | Yes | `getcompany` for company search. |+| `output` | string | No | `atom` for XML/Atom feed. |++**Example:**+```+https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=AAPL&type=10-K&dateb=&owner=include&count=10&output=atom+```++#### `GET https://www.sec.gov/files/company_tickers.json`+Returns a JSON mapping of all company tickers to CIK numbers.++**Response:**+```json+{+ "0": {"cik_str": 320193, "ticker": "AAPL", "title": "Apple Inc."},+ "1": {"cik_str": 789019, "ticker": "MSFT", "title": "MICROSOFT CORP"},+ ...+}+```++#### `GET https://www.sec.gov/files/company_tickers_exchange.json`+Includes exchange information for each ticker.++---++### 4. Company Filings & Submissions++#### `GET https://data.sec.gov/submissions/CIK{cik_padded}.json`+Returns company metadata and recent filings for a given CIK (zero-padded to 10 digits).++**Example:**+```+https://data.sec.gov/submissions/CIK0000320193.json+```++**Response:**+```json+{+ "cik": "320193",+ "entityType": "operating",+ "sic": "3571",+ "sicDescription": "Electronic Computers",+ "name": "Apple Inc.",+ "tickers": ["AAPL"],+ "exchanges": ["Nasdaq"],+ "filings": {+ "recent": {+ "accessionNumber": ["0000320193-24-000123", ...],+ "filingDate": ["2024-11-01", ...],+ "reportDate": ["2024-09-28", ...],+ "form": ["10-K", ...],+ "primaryDocument": ["aapl-20240928.htm", ...],+ "primaryDocDescription": ["10-K", ...]+ },+ "files": [+ {"name": "CIK0000320193-submissions-001.json", "filingCount": 1000}+ ]+ }+}+```++The `filings.recent` object contains the most recent ~1000 filings. Older filings are in separate paginated files referenced by `filings.files`.++---++### 5. Company Concept (XBRL Data)++#### `GET https://data.sec.gov/api/xbrl/companyconcept/CIK{cik}/{taxonomy}/{tag}.json`+Returns all values reported by a company for a specific XBRL tag across all filings.++**Path Parameters:**+| Parameter | Description |+|------------|-------------|+| `cik` | Zero-padded CIK (10 digits). |+| `taxonomy` | XBRL taxonomy: `us-gaap`, `ifrs-full`, `dei`, `srt`. |+| `tag` | XBRL concept tag, e.g., `Revenue`, `Assets`, `AccountsPayableCurrent`. |++**Example:**+```+https://data.sec.gov/api/xbrl/companyconcept/CIK0000320193/us-gaap/Revenue.json+```++**Response:**+```json+{+ "cik": 320193,+ "taxonomy": "us-gaap",+ "tag": "Revenue",+ "label": "Revenue",+ "description": "Amount of revenue recognized...",+ "entityName": "Apple Inc.",+ "units": {+ "USD": [+ {+ "start": "2023-10-01",+ "end": "2024-09-28",+ "val": 391035000000,+ "accn": "0000320193-24-000123",+ "fy": 2024,+ "fp": "FY",+ "form": "10-K",+ "filed": "2024-11-01"+ }+ ]+ }+}+```++---++### 6. Company Facts (All XBRL for one company)++#### `GET https://data.sec.gov/api/xbrl/companyfacts/CIK{cik}.json`+Returns ALL XBRL concepts reported by a company across all filings.++**Example:**+```+https://data.sec.gov/api/xbrl/companyfacts/CIK0000320193.json+```++**Response:** Same structure as companyconcept but with all tags nested under `facts.us-gaap`, `facts.dei`, etc.++```json+{+ "cik": 320193,+ "entityName": "Apple Inc.",+ "facts": {+ "dei": {+ "EntityCommonStockSharesOutstanding": { "units": { "shares": [...] } }+ },+ "us-gaap": {+ "Revenue": { "units": { "USD": [...] } },+ "Assets": { "units": { "USD": [...] } }+ }+ }+}+```++---++### 7. Frames (Cross-Company XBRL for a period)++#### `GET https://data.sec.gov/api/xbrl/frames/{taxonomy}/{tag}/{unit}/{period}.json`+Returns a specific XBRL concept value for ALL companies for a given reporting period.++**Path Parameters:**+| Parameter | Description |+|------------|-------------|+| `taxonomy` | `us-gaap`, `ifrs-full`, `dei`, `srt`. |+| `tag` | XBRL tag, e.g., `Assets`. |+| `unit` | `USD`, `shares`, `pure`, etc. |+| `period` | Instant: `CY2023Q4I`; Duration: `CY2023`, `CY2023Q1`. |++**Period format:**+- `CY2023` = calendar year 2023 (full year duration)+- `CY2023Q1` = Q1 2023 duration+- `CY2023Q4I` = instant at end of Q4 2023 (balance sheet items)++**Example:**+```+https://data.sec.gov/api/xbrl/frames/us-gaap/Assets/USD/CY2023Q4I.json+```++**Response:**+```json+{+ "taxonomy": "us-gaap",+ "tag": "Assets",+ "ccp": "CY2023Q4I",+ "uom": "USD",+ "label": "Assets",+ "description": "Sum of the carrying amounts...",+ "pts": 8500,+ "data": [+ {"accn": "0000320193-24-000123", "cik": 320193, "entityName": "Apple Inc.", "loc": "US-CA", "end": "2023-12-30", "val": 352583000000}+ ]+}+```++---++### 8. Filing Archives (Direct Document Access)++#### `GET https://www.sec.gov/Archives/edgar/data/{cik}/{accession_number_no_dashes}/{filename}`+Direct access to any filing document.++**Example:**+```+https://www.sec.gov/Archives/edgar/data/320193/000032019324000123/aapl-20240928.htm+```++The accession number format in the URL is stripped of dashes: `0000320193-24-000123` becomes `000032019324000123`.++---++## Common XBRL Tags Reference+| Tag | Description |+|-----|-------------|+| `Revenue` / `Revenues` | Total revenue |+| `NetIncomeLoss` | Net income |+| `Assets` | Total assets |+| `Liabilities` | Total liabilities |+| `StockholdersEquity` | Total equity |+| `EarningsPerShareBasic` | Basic EPS |+| `EarningsPerShareDiluted` | Diluted EPS |+| `OperatingIncomeLoss` | Operating income |+| `CashAndCashEquivalentsAtCarryingValue` | Cash and equivalents |+| `LongTermDebt` | Long-term debt |+| `CommonStockSharesOutstanding` | Shares outstanding |++## Notes+- CIK numbers must be zero-padded to 10 digits in `data.sec.gov` URLs.+- The EFTS full-text search indexes the text content of filings, not XBRL data.+- For bulk downloads, SEC provides index files at `https://www.sec.gov/Archives/edgar/full-index/`.+- All responses are JSON unless otherwise noted. Filing documents can be HTML, XML, or plain text.diff --git a/scientific-skills/database-lookup/references/simbad.md b/scientific-skills/database-lookup/references/simbad.mdnew file mode 100644index 00000000..5274970a--- /dev/null+++ b/scientific-skills/database-lookup/references/simbad.md@@ -0,0 +1,131 @@+# SIMBAD Astronomical Database (CDS Strasbourg)++## Base URLs++**TAP endpoint (recommended):**+```+https://simbad.cds.unistra.fr/simbad/sim-tap/sync+```++**Legacy script interface:**+```+https://simbad.cds.unistra.fr/simbad/sim-script+```++**Simple query endpoints:**+```+https://simbad.cds.unistra.fr/simbad/sim-id+https://simbad.cds.unistra.fr/simbad/sim-coo+```++## Authentication++No API key required. All endpoints are public.++## Key Endpoints++### 1. TAP Queries (ADQL — recommended for programmatic use)++```+GET /simbad/sim-tap/sync?request=doQuery&lang=adql&format={format}&query={ADQL}+```++| Parameter | Type | Description |+|-----------|--------|-------------|+| `request` | string | `doQuery` |+| `lang` | string | `adql` |+| `format` | string | `json`, `votable`, `csv`, `tsv`. |+| `query` | string | **Required.** ADQL query. |++**Example — look up object by name:**+```+https://simbad.cds.unistra.fr/simbad/sim-tap/sync?request=doQuery&lang=adql&format=json&query=SELECT basic.OID, ra, dec, main_id, otype FROM basic JOIN ident ON oid = ident.oidref WHERE id = 'M31'+```++**Example — cone search (objects within 5 arcmin of coordinates):**+```+https://simbad.cds.unistra.fr/simbad/sim-tap/sync?request=doQuery&lang=adql&format=json&query=SELECT TOP 50 main_id, ra, dec, otype FROM basic WHERE CONTAINS(POINT('ICRS', ra, dec), CIRCLE('ICRS', 10.684, 41.269, 0.083)) = 1+```+Note: radius in CIRCLE is in degrees (5 arcmin = 0.083 deg).++**Example — objects by type (e.g., all pulsars):**+```+https://simbad.cds.unistra.fr/simbad/sim-tap/sync?request=doQuery&lang=adql&format=json&query=SELECT TOP 100 main_id, ra, dec, otype FROM basic WHERE otype = 'Pulsar'+```++### 2. Identifier Query (simple lookup)++```+GET /simbad/sim-id?Ident={name}&output.format=votable+```++| Parameter | Type | Description |+|------------------|--------|-------------|+| `Ident` | string | **Required.** Object name (e.g., `M31`, `Sirius`, `NGC 1275`). |+| `output.format` | string | `votable`, `html`. |++**Example:**+```+https://simbad.cds.unistra.fr/simbad/sim-id?Ident=M31&output.format=votable+```++### 3. Coordinate Query++```+GET /simbad/sim-coo?Coord={coords}&Radius={radius}&Radius.unit={unit}&output.format=votable+```++| Parameter | Type | Description |+|----------------|--------|-------------|+| `Coord` | string | **Required.** Coordinates, e.g., `10.684 +41.269` or `00 42 44 +41 16 09`. |+| `Radius` | float | Search radius. Default: 2. |+| `Radius.unit` | string | `arcmin`, `arcsec`, `deg`. Default: `arcmin`. |+| `output.format`| string | `votable`, `html`. |++**Example:**+```+https://simbad.cds.unistra.fr/simbad/sim-coo?Coord=10.684+%2B41.269&Radius=5&Radius.unit=arcmin&output.format=votable+```++### 4. Script Interface (for multi-command queries)++```+POST /simbad/sim-script+Content-Type: application/x-www-form-urlencoded+script=format+object+"%MAIN_ID+|+%RA+|+%DEC+|+%OTYPE"\nquery+id+M31+```++## Key TAP Tables++| Table | Description |+|-----------------|-------------|+| `basic` | Core data: coordinates, main_id, object type. |+| `ident` | All known identifiers for objects. |+| `flux` | Flux/magnitude measurements. |+| `mesVelocities` | Radial velocity measurements. |+| `mesDistance` | Distance measurements. |+| `otypedef` | Object type definitions/labels. |+| `allfluxes` | All flux data joined. |++## Common Object Types (otype)++`Star`, `Galaxy`, `Pulsar`, `QSO`, `Nebula`, `GlobCluster`, `RadioSource`, `X-raySource`, `SNRemnant`++## Response Format (TAP JSON)++```json+{+ "metadata": [+ {"name": "main_id", "datatype": "char"},+ {"name": "ra", "datatype": "double"},+ {"name": "dec", "datatype": "double"}+ ],+ "data": [+ ["M 31", 10.6847, 41.2687]+ ]+}+```++## Rate Limits++No formal rate limits documented. SIMBAD requests that automated scripts include reasonable delays between queries. Very large TAP queries may time out; use `TOP N` to limit results or switch to async TAP at `/simbad/sim-tap/async`.diff --git a/scientific-skills/database-lookup/references/sra.md b/scientific-skills/database-lookup/references/sra.mdnew file mode 100644index 00000000..871621ab--- /dev/null+++ b/scientific-skills/database-lookup/references/sra.md@@ -0,0 +1,149 @@+# SRA (Sequence Read Archive) API Reference++## Overview+Sequencing run metadata: experiments, samples, studies, and runs. Accessible via E-utilities with `db=sra`. Returns XML metadata describing sequencing experiments, platforms, library strategies, and sample attributes.++## Base URL+```+https://eutils.ncbi.nlm.nih.gov/entrez/eutils/+```++## Authentication+- **API key** (recommended): Append `&api_key=YOUR_KEY`.+- Without key: 3 req/sec. With key: 10 req/sec.+- Provide `tool` and `email` parameters.++## Key Endpoints++### 1. ESearch -- Search SRA records+```+GET esearch.fcgi?db=sra&term=QUERY&retmax=N&retmode=json+```++**Example -- search RNA-seq experiments in human:**+```+GET esearch.fcgi?db=sra&term=RNA-seq[Strategy] AND Homo sapiens[Organism]&retmax=5&retmode=json+```+Response:+```json+{+ "esearchresult": {+ "count": "584231",+ "retmax": "5",+ "idlist": ["28574913", "28574912", "28574911", ...]+ }+}+```++**Example -- search by accession:**+```+GET esearch.fcgi?db=sra&term=SRP123456[Accession] OR SRR123456[Accession]&retmode=json+```++### 2. EFetch -- Retrieve full SRA metadata (XML only)+```+GET efetch.fcgi?db=sra&id=IDS&rettype=full&retmode=xml+```++**Example -- fetch metadata for an SRA record:**+```+GET efetch.fcgi?db=sra&id=28574913&rettype=full&retmode=xml+```+Response (abbreviated XML):+```xml+<EXPERIMENT_PACKAGE_SET>+ <EXPERIMENT_PACKAGE>+ <EXPERIMENT accession="SRX12345" alias="...">+ <TITLE>RNA-seq of human liver tissue</TITLE>+ <STUDY_REF accession="SRP12345"/>+ <DESIGN>+ <LIBRARY_DESCRIPTOR>+ <LIBRARY_STRATEGY>RNA-Seq</LIBRARY_STRATEGY>+ <LIBRARY_SOURCE>TRANSCRIPTOMIC</LIBRARY_SOURCE>+ <LIBRARY_SELECTION>cDNA</LIBRARY_SELECTION>+ <LIBRARY_LAYOUT><PAIRED/></LIBRARY_LAYOUT>+ </LIBRARY_DESCRIPTOR>+ </DESIGN>+ <PLATFORM>+ <ILLUMINA><INSTRUMENT_MODEL>Illumina NovaSeq 6000</INSTRUMENT_MODEL></ILLUMINA>+ </PLATFORM>+ </EXPERIMENT>+ <SUBMISSION accession="SRA12345" center_name="GEO"/>+ <Organization><Name>Some Institute</Name></Organization>+ <STUDY accession="SRP12345">+ <DESCRIPTOR>+ <STUDY_TITLE>Transcriptomic analysis of human tissues</STUDY_TITLE>+ <STUDY_TYPE existing_study_type="Transcriptome Analysis"/>+ </DESCRIPTOR>+ </STUDY>+ <SAMPLE accession="SRS12345">+ <TITLE>Human liver RNA</TITLE>+ <SAMPLE_ATTRIBUTES>+ <SAMPLE_ATTRIBUTE><TAG>tissue</TAG><VALUE>liver</VALUE></SAMPLE_ATTRIBUTE>+ <SAMPLE_ATTRIBUTE><TAG>cell_type</TAG><VALUE>hepatocyte</VALUE></SAMPLE_ATTRIBUTE>+ </SAMPLE_ATTRIBUTES>+ </SAMPLE>+ <RUN_SET>+ <RUN accession="SRR12345" total_spots="45000000" total_bases="9000000000">+ <Statistics nreads="2">+ <Read average="150" count="45000000"/>+ </Statistics>+ </RUN>+ </RUN_SET>+ </EXPERIMENT_PACKAGE>+</EXPERIMENT_PACKAGE_SET>+```++### 3. ESummary -- Brief SRA summaries+```+GET esummary.fcgi?db=sra&id=IDS&retmode=json+```+Returns: experiment title, platform, total runs/spots/bases, create date, study/sample accessions as an XML string in the `expxml` and `runs` fields.++### 4. ELink -- Cross-link to other NCBI databases+```+GET elink.fcgi?dbfrom=sra&db=biosample&id=SRA_UID+GET elink.fcgi?dbfrom=sra&db=gds&id=SRA_UID+```++## SRA Accession Types+| Prefix | Entity |+|--------|--------|+| `SRP` / `ERP` / `DRP` | Study |+| `SRX` / `ERX` / `DRX` | Experiment |+| `SRS` / `ERS` / `DRS` | Sample |+| `SRR` / `ERR` / `DRR` | Run |+| `SRA` | Submission |++## Common Search Patterns+```+# By organism and strategy+term=Mus musculus[Organism] AND WGS[Strategy]++# By platform+term=Illumina[Platform] AND ATAC-seq[Strategy] AND human[Organism]++# By study accession+term=SRP123456[Accession]++# By BioProject+term=PRJNA123456[BioProject]++# By date range+term=("2024/01/01"[Publication Date] : "2024/12/31"[Publication Date])++# By library source+term=GENOMIC[Source] AND ChIP-Seq[Strategy] AND cancer[Text Word]++# By read count range+term=10000000:100000000[ReadLength]++# Combined complex query+term=(RNA-Seq[Strategy] AND paired[Layout] AND Homo sapiens[Organism] AND Illumina[Platform])+```++## Rate Limits+- Without API key: 3 requests/second+- With API key: 10 requests/second+- For bulk metadata: use `usehistory=y` with `WebEnv`/`query_key`, fetch in batches+- Actual sequence data (FASTQ) is NOT available via E-utilities; use SRA Toolkit (`fastq-dump`/`fasterq-dump`) or the SRA cloud URLsdiff --git a/scientific-skills/database-lookup/references/string.md b/scientific-skills/database-lookup/references/string.mdnew file mode 100644index 00000000..6810c613--- /dev/null+++ b/scientific-skills/database-lookup/references/string.md@@ -0,0 +1,283 @@+# STRING REST API++## Base URL++```+https://string-db.org/api+```++## URL Pattern++```+/api/{output_format}/{method}+```++- **output_format**: `json`, `tsv`, `tsv-no-header`, `image`, `svg` (not all formats for all endpoints)+- **method**: endpoint name (see below)++## Authentication++No API key required. All endpoints are public.++## Key Endpoints++### 1. Resolve protein identifiers++Map protein names/identifiers to STRING internal IDs. Always do this first to get canonical STRING IDs.++```+GET /api/json/resolve?identifier={query}&species={taxid}+```++| Parameter | Type | Description |+|-------------|--------|-------------|+| `identifier` | string | **Required.** Protein name, gene symbol, or external ID. |+| `species` | int | NCBI taxonomy ID (9606 = human, 10090 = mouse). Recommended to avoid ambiguity. |++**Example:**+```+https://string-db.org/api/json/resolve?identifier=TP53&species=9606+```++**Response:**+```json+[+ {+ "stringId": "9606.ENSP00000269305",+ "preferredName": "TP53",+ "ncbiTaxonId": 9606,+ "taxonName": "Homo sapiens",+ "annotation": "Cellular tumor antigen p53; ..."+ }+]+```++---++### 2. Get interaction partners (network)++```+GET /api/json/interaction_partners?identifiers={proteins}&species={taxid}+```++| Parameter | Type | Description |+|--------------------|--------|-------------|+| `identifiers` | string | **Required.** Protein name(s). Use `%0d` (newline) to separate multiple. |+| `species` | int | NCBI taxonomy ID. |+| `limit` | int | Max number of interaction partners to return (per input protein). |+| `required_score` | int | Minimum combined score (0-1000). Default: 400. Common thresholds: 400 (medium), 700 (high), 900 (highest). |+| `network_type` | string | `functional` (default, all associations) or `physical` (physical binding only). |++**Example:**+```+https://string-db.org/api/json/interaction_partners?identifiers=TP53&species=9606&limit=10&required_score=900+```++**Response:**+```json+[+ {+ "stringId_A": "9606.ENSP00000269305",+ "stringId_B": "9606.ENSP00000261842",+ "preferredName_A": "TP53",+ "preferredName_B": "MDM2",+ "ncbiTaxonId": 9606,+ "score": 0.999,+ "nscore": 0,+ "fscore": 0,+ "pscore": 0,+ "ascore": 0.93,+ "escore": 0.994,+ "dscore": 0.9,+ "tscore": 0.981+ }+]+```++Score channels: `nscore` (neighborhood), `fscore` (fusion), `pscore` (phylogenetic co-occurrence), `ascore` (co-expression), `escore` (experimental), `dscore` (database/curated), `tscore` (text mining).++---++### 3. Get network interactions between a set of proteins++```+GET /api/json/network?identifiers={proteins}&species={taxid}+```++| Parameter | Type | Description |+|------------------|--------|-------------|+| `identifiers` | string | **Required.** Protein names separated by `%0d` (newline-encoded). |+| `species` | int | NCBI taxonomy ID. |+| `required_score` | int | Minimum combined score (0-1000). |+| `network_type` | string | `functional` or `physical`. |+| `add_nodes` | int | Number of additional interactors to add (expands the network). |++**Example — network among a set of proteins:**+```+https://string-db.org/api/json/network?identifiers=TP53%0dBRCA1%0dATM%0dCHEK2%0dMDM2&species=9606&required_score=700+```++Returns all pairwise interactions among the input set.++---++### 4. Network image++```+GET /api/image/network?identifiers={proteins}&species={taxid}+GET /api/svg/network?identifiers={proteins}&species={taxid}+```++Returns a PNG image or SVG of the interaction network.++**Example:**+```+https://string-db.org/api/image/network?identifiers=TP53%0dBRCA1%0dMDM2&species=9606+```++---++### 5. Functional enrichment analysis++Perform Gene Ontology, KEGG pathway, and other enrichment analysis on a set of proteins.++```+GET /api/json/enrichment?identifiers={proteins}&species={taxid}+```++| Parameter | Type | Description |+|--------------|--------|-------------|+| `identifiers` | string | **Required.** Newline-separated (`%0d`) protein names. |+| `species` | int | NCBI taxonomy ID. |++**Example:**+```+https://string-db.org/api/json/enrichment?identifiers=TP53%0dBRCA1%0dATM%0dCHEK2%0dCDK2%0dCDKN1A&species=9606+```++**Response:**+```json+[+ {+ "category": "Process",+ "term": "GO:0006974",+ "description": "cellular response to DNA damage stimulus",+ "number_of_genes": 6,+ "number_of_genes_in_background": 781,+ "ncbiTaxonId": 9606,+ "inputGenes": "TP53,BRCA1,ATM,CHEK2,CDK2,CDKN1A",+ "preferredNames": "TP53,BRCA1,ATM,CHEK2,CDK2,CDKN1A",+ "p_value": 1.2e-12,+ "fdr": 5.6e-10+ }+]+```++Categories include: `Process` (GO Biological Process), `Function` (GO Molecular Function), `Component` (GO Cellular Component), `KEGG`, `Pfam`, `InterPro`, `SMART`, `Keyword` (UniProt), `Reactome`, `WikiPathways`, `HPO` (Human Phenotype Ontology).++---++### 6. Get protein annotations/info++```+GET /api/json/get_string_ids?identifiers={proteins}&species={taxid}+```++Maps arbitrary names to STRING IDs with annotation text.++**Example:**+```+https://string-db.org/api/json/get_string_ids?identifiers=CDK2%0dp53&species=9606+```++**Response:**+```json+[+ {+ "queryIndex": 0,+ "queryItem": "CDK2",+ "stringId": "9606.ENSP00000266970",+ "ncbiTaxonId": 9606,+ "taxonName": "Homo sapiens",+ "preferredName": "CDK2",+ "annotation": "Cyclin-dependent kinase 2; ..."+ }+]+```++---++### 7. Get homology / best-hit in another species++```+GET /api/json/homology?identifiers={proteins}&species={taxid}&species_b={taxid_b}+```++| Parameter | Type | Description |+|------------|------|-------------|+| `identifiers` | string | Source protein(s). |+| `species` | int | Source species. |+| `species_b` | int | Target species for homolog lookup. |++**Example:**+```+https://string-db.org/api/json/homology?identifiers=TP53&species=9606&species_b=10090+```++---++### 8. PPI enrichment (is my set more connected than expected?)++```+GET /api/json/ppi_enrichment?identifiers={proteins}&species={taxid}+```++**Example:**+```+https://string-db.org/api/json/ppi_enrichment?identifiers=TP53%0dBRCA1%0dATM%0dCHEK2&species=9606+```++**Response:**+```json+[+ {+ "number_of_nodes": 4,+ "number_of_edges": 6,+ "average_node_degree": 3.0,+ "local_clustering_coefficient": 1.0,+ "expected_number_of_edges": 1,+ "p_value": 0.000123+ }+]+```++---++## Common Species Taxonomy IDs++| Species | Taxon ID |+|---------|----------|+| Homo sapiens (human) | 9606 |+| Mus musculus (mouse) | 10090 |+| Rattus norvegicus (rat) | 10116 |+| Drosophila melanogaster (fruit fly) | 7227 |+| Saccharomyces cerevisiae (yeast) | 4932 |+| Caenorhabditis elegans (worm) | 6239 |+| Danio rerio (zebrafish) | 7955 |+| Escherichia coli K12 | 511145 |+| Arabidopsis thaliana | 3702 |++## Rate Limits++- No published hard rate limit, but the API is intended for programmatic access at moderate rates.+- Recommended: **max 1 request per second**.+- For large-scale data downloads, use the flat-file downloads on the STRING website instead.+- If you send too many requests, you may receive HTTP 429 or temporary blocking.+- Multiple identifiers per request is strongly preferred over multiple single-identifier requests.++## Error Handling++- Returns HTTP 400 for malformed requests.+- Returns HTTP 404 if no matching protein is found.+- Empty JSON array `[]` if the query is valid but returns no results (e.g., no interactions above the threshold).+- Include `species` parameter whenever possible to avoid ambiguous identifier resolution.diff --git a/scientific-skills/database-lookup/references/tcga-gdc.md b/scientific-skills/database-lookup/references/tcga-gdc.mdnew file mode 100644index 00000000..1493d42d--- /dev/null+++ b/scientific-skills/database-lookup/references/tcga-gdc.md@@ -0,0 +1,58 @@+# TCGA / GDC Data Portal API++## Base URL+```+https://api.gdc.cancer.gov+```++## Auth+No auth for public data. Token needed only for controlled-access downloads.++## Key Endpoints++All search endpoints accept GET or POST (POST preferred for complex filters).++| Endpoint | Description |+|----------|-------------|+| `/projects` | List/filter cancer projects (e.g. TCGA-BRCA) |+| `/cases` | Search cases (patients/samples) |+| `/files` | Search/filter files (BAM, VCF, expression) |+| `/genes` | Search gene-level data |+| `/ssms` | Search simple somatic mutations |+| `/ssm_occurrences` | Mutation occurrences across cases |+| `/files/{uuid}` | File metadata by UUID |+| `/data/{uuid}` | Download file by UUID |++## Filter Syntax (POST body)+```json+{+ "filters": {+ "op": "in",+ "content": {"field": "cases.project.project_id", "value": ["TCGA-BRCA"]}+ },+ "fields": "file_id,file_name,data_type",+ "format": "JSON",+ "size": 10+}+```+Operators: `in`, `=`, `!=`, `>`, `<`, `>=`, `<=`, `is`, `not`, `and`, `or`++## Example Calls+```+# List projects+https://api.gdc.cancer.gov/projects?size=5&fields=project_id,name,primary_site++# BRCA1 mutations (POST)+curl -X POST https://api.gdc.cancer.gov/ssms \+ -H "Content-Type: application/json" \+ -d '{"filters":{"op":"in","content":{"field":"consequence.transcript.gene.symbol","value":["BRCA1"]}},"fields":"ssm_id,genomic_dna_change","size":5}'++# Cases in TCGA-LUAD+https://api.gdc.cancer.gov/cases?filters=%7B%22op%22%3A%22in%22%2C%22content%22%3A%7B%22field%22%3A%22project.project_id%22%2C%22value%22%3A%5B%22TCGA-LUAD%22%5D%7D%7D&size=3&fields=submitter_id,disease_type+```++## Pagination+`from` (offset) and `size` (limit, max 10000). Default size is 10.++## Rate Limits+No strict limit for metadata queries. Use GDC Transfer Tool for bulk file downloads.diff --git a/scientific-skills/database-lookup/references/treasury.md b/scientific-skills/database-lookup/references/treasury.mdnew file mode 100644index 00000000..bffcbeec--- /dev/null+++ b/scientific-skills/database-lookup/references/treasury.md@@ -0,0 +1,215 @@+# US Treasury Fiscal Data API Reference++## Overview+The US Treasury's Fiscal Data API provides machine-readable access to federal financial data: national debt, treasury securities, interest rates, yield curves, revenue, spending, and more. Maintained by the Bureau of the Fiscal Service.++## Base URL+```+https://api.fiscaldata.treasury.gov/services/api/fiscal_service+```++## Authentication+**No API key required.** The API is fully open and public.++## Rate Limits+- **No formal rate limits published.**+- Reasonable use expected; no authentication or throttling documented.+- For bulk data, use pagination with large page sizes.++---++## Key Endpoints++### URL Pattern+All dataset endpoints follow:+```+GET /services/api/fiscal_service/{endpoint}?{parameters}+```++### Common Query Parameters (apply to all endpoints)+| Parameter | Type | Description |+|-----------|------|-------------|+| `fields` | string | Comma-separated list of fields to return |+| `filter` | string | Filter expression: `field:operator:value` (e.g., `record_date:gte:2024-01-01`) |+| `sort` | string | Sort fields: `field` (asc) or `-field` (desc); comma-separated |+| `page[number]` | int | Page number (default 1) |+| `page[size]` | int | Results per page (default 100, max 10000) |+| `format` | string | `json` (default) or `csv` |++**Filter Operators:**+`eq` (equals), `lt`, `lte`, `gt`, `gte`, `in` (comma-separated values)++---++### 1. Treasury Yield Curve Rates (Daily)+```+GET /v2/accounting/od/avg_interest_rates+```++**Better endpoint for yield curves:**+```+GET /v1/accounting/od/rates_of_exchange+```++**Daily Treasury Par Yield Curve Rates:**+Note: Daily yield curve rates are published at `https://home.treasury.gov/resource-center/data-chart-center/interest-rates/` and available via the TreasuryDirect API. For programmatic access via Fiscal Data:++```+GET /v2/accounting/od/avg_interest_rates+```++**Example -- Average interest rates on Treasury securities:**+```+https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?filter=record_date:gte:2024-01-01&sort=-record_date&page[size]=100+```++**Response:**+```json+{+ "data": [+ {+ "record_date": "2024-10-31",+ "security_type_desc": "Treasury Bills",+ "security_desc": "Treasury Bills",+ "avg_interest_rate_amt": "5.223",+ "src_line_nbr": "1",+ "record_fiscal_year": "2025",+ "record_fiscal_quarter": "1",+ "record_calendar_year": "2024",+ "record_calendar_quarter": "4",+ "record_calendar_month": "10",+ "record_calendar_day": "31"+ }+ ],+ "meta": {+ "count": 100,+ "labels": { ... },+ "dataTypes": { ... },+ "dataFormats": { ... },+ "total-count": 1234,+ "total-pages": 13+ },+ "links": {+ "self": "&page%5Bnumber%5D=1&page%5Bsize%5D=100",+ "first": "&page%5Bnumber%5D=1&page%5Bsize%5D=100",+ "prev": null,+ "next": "&page%5Bnumber%5D=2&page%5Bsize%5D=100",+ "last": "&page%5Bnumber%5D=13&page%5Bsize%5D=100"+ }+}+```++---++### 2. Debt to the Penny (Daily National Debt)+```+GET /v2/accounting/od/debt_to_penny+```++**Example -- Debt since 2024:**+```+https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny?filter=record_date:gte:2024-01-01&sort=-record_date&page[size]=10+```++**Key Fields:** `record_date`, `tot_pub_debt_out_amt`, `intragov_hold_amt`, `debt_held_public_amt`++---++### 3. Treasury Securities Auctions+```+GET /v1/accounting/od/auctions_query+```++**Example -- Recent T-Bill auctions:**+```+https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/auctions_query?filter=security_type:eq:Bill&sort=-auction_date&page[size]=10+```++**Key Fields:** `cusip`, `security_type`, `security_term`, `auction_date`, `issue_date`, `maturity_date`, `high_yield`, `high_discount_rate`, `bid_to_cover_ratio`, `total_accepted`++---++### 4. Monthly Treasury Statement (Revenue & Outlays)+```+GET /v1/accounting/mts/mts_table_5+```++**Example -- Federal receipts/outlays:**+```+https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/mts/mts_table_5?filter=record_date:gte:2024-01-01&sort=-record_date&page[size]=50+```++---++### 5. Federal Spending by Category+```+GET /v1/accounting/mts/mts_table_9+```++**Example:**+```+https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/mts/mts_table_9?filter=record_date:gte:2024-01-01&sort=-record_date+```++---++### 6. Treasury Reporting Rates of Exchange+```+GET /v1/accounting/od/rates_of_exchange+```++**Example -- Exchange rates for a quarter:**+```+https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/rates_of_exchange?filter=record_date:eq:2024-09-30&page[size]=200+```++**Key Fields:** `country_currency_desc`, `exchange_rate`, `record_date`, `effective_date`++---++### 7. Interest Expense on the Debt+```+GET /v2/accounting/od/interest_expense+```++**Example:**+```+https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/interest_expense?filter=record_fiscal_year:eq:2024&sort=-record_date+```++---++### 8. Savings Bonds Rates+```+GET /v2/accounting/od/sb_value+```++---++## Common Endpoint Paths++| Endpoint | Description |+|----------|-------------|+| `v2/accounting/od/debt_to_penny` | Daily total public debt outstanding |+| `v2/accounting/od/avg_interest_rates` | Average interest rates on Treasury securities |+| `v1/accounting/od/auctions_query` | Treasury securities auction results |+| `v1/accounting/od/rates_of_exchange` | Treasury reporting rates of exchange |+| `v2/accounting/od/interest_expense` | Interest expense on the public debt |+| `v1/accounting/mts/mts_table_5` | Monthly Treasury statement: receipts/outlays |+| `v1/accounting/mts/mts_table_9` | Monthly Treasury statement: outlays by function |+| `v2/accounting/od/statement_net_cost` | Statement of net cost |+| `v2/accounting/od/debt_outstanding` | Historical debt outstanding (annual) |++## Response Format+All JSON responses share the same envelope:+- `data`: Array of result objects+- `meta`: Contains `count`, `total-count`, `total-pages`, field labels and data types+- `links`: Pagination links (`self`, `first`, `prev`, `next`, `last`)++## Notes+- All monetary amounts are returned as strings to preserve precision.+- Dates use `YYYY-MM-DD` format in the `record_date` field.+- The `filter` parameter supports chaining: `filter=field1:eq:val1,field2:gte:val2`.+- Use `fields=` to reduce response size by requesting only needed columns.+- The API documentation and dataset explorer is at: https://fiscaldata.treasury.gov/api-documentation/+- For Treasury yield curve rates specifically, FRED series `DGS1`, `DGS2`, `DGS5`, `DGS10`, `DGS30` may be more convenient.diff --git a/scientific-skills/database-lookup/references/ucsc-genome.md b/scientific-skills/database-lookup/references/ucsc-genome.mdnew file mode 100644index 00000000..650745ce--- /dev/null+++ b/scientific-skills/database-lookup/references/ucsc-genome.md@@ -0,0 +1,135 @@+# UCSC Genome Browser REST API Reference++## Overview+Provides programmatic access to genome annotations, gene tracks, sequence data,+and other resources from the UCSC Genome Browser database.++## Base URL+`https://api.genome.ucsc.edu`++## Auth+None required (public, unauthenticated).++## Response Format+JSON for all endpoints.++## Key Endpoints++### List available genomes+```+GET /list/ucscGenomes+```+Returns all genome assemblies (hg38, mm39, etc.) with descriptions.++### List tracks for a genome+```+GET /list/tracks?genome=hg38+```+Returns all annotation tracks available for the specified assembly.++### List chromosomes/contigs+```+GET /list/chromosomes?genome=hg38+```+Optional: add `&track=<trackName>` to limit to chroms with data in that track.++### List tables in a track+```+GET /list/schema?genome=hg38&track=knownGene+```+Returns table schema including field names, types, and SQL create statement.++### Get track data (annotations)+```+GET /getData/track?genome=hg38&track=knownGene&chrom=chr1&start=11873&end=14409+```+Parameters:+- `genome` -- assembly name (required)+- `track` -- track name (required)+- `chrom` -- chromosome (optional, limits to one chrom)+- `start`, `end` -- 0-based half-open coordinates (optional, requires chrom)+- `maxItemsOutput` -- limit number of items returned (default 1000 for some tracks)++### Get sequence+```+GET /getData/sequence?genome=hg38&chrom=chr1&start=11873&end=11893+```+Returns DNA sequence for the specified region. Coordinates are 0-based half-open.++### Search for a term+```+GET /search?search=BRCA1&genome=hg38+```+Returns matching positions across tracks (gene names, accessions, etc.).++### Get hub genome data+```+GET /list/hubGenomes?hubUrl=<hubURL>+```+Lists genomes available in a track hub.++## Example calls++### Get RefSeq gene annotations in a region+```+GET https://api.genome.ucsc.edu/getData/track?genome=hg38&track=ncbiRefSeq&chrom=chr17&start=43044295&end=43125483+```++### Get DNA sequence+```+GET https://api.genome.ucsc.edu/getData/sequence?genome=hg38&chrom=chr7&start=117119148&end=117119178+```++### Response example (sequence)+```json+{+ "genome": "hg38",+ "chrom": "chr7",+ "start": 117119148,+ "end": 117119178,+ "dna": "atgcagatatcagcgatgcagatcgatcg..."+}+```++### Response example (track data)+```json+{+ "genome": "hg38",+ "track": "ncbiRefSeq",+ "chrom": "chr17",+ "start": 43044295,+ "end": 43125483,+ "ncbiRefSeq": [+ {+ "chrom": "chr17",+ "chromStart": 43044295,+ "chromEnd": 43125483,+ "name": "NM_007294.4",+ "strand": "-",+ "name2": "BRCA1",+ "exonCount": 23,+ "exonStarts": "43044295,43047642,...",+ "exonEnds": "43045802,43047703,..."+ }+ ]+}+```++## Coordinate system+All coordinates are **0-based, half-open** (standard BED format). This means+`start` is inclusive and `end` is exclusive.++## Rate Limits+- No published hard rate limits+- The API is intended for moderate programmatic use; bulk downloads should use+ the MySQL public server (genome-mysql.soe.ucsc.edu) or BigBed/BigWig file downloads+- Requests returning very large result sets may be truncated via `maxItemsOutput`++## Common genome values+- `hg38` -- Human GRCh38 (current)+- `hg19` -- Human GRCh37+- `mm39` -- Mouse GRCm39+- `mm10` -- Mouse GRCm38+- `dm6` -- Drosophila+- `danRer11` -- Zebrafish+- `sacCer3` -- Yeastdiff --git a/scientific-skills/database-lookup/references/uniprot.md b/scientific-skills/database-lookup/references/uniprot.mdnew file mode 100644index 00000000..83c8fd19--- /dev/null+++ b/scientific-skills/database-lookup/references/uniprot.md@@ -0,0 +1,283 @@+# UniProt REST API++## Base URL++```+https://rest.uniprot.org+```++## Authentication++No API key required. All endpoints are public.++## Key Endpoints++### 1. Search proteins++```+GET /uniprotkb/search+```++**Parameters:**++| Parameter | Type | Description |+|-----------|--------|-------------|+| `query` | string | **Required.** Search query using UniProt query syntax (field:value pairs, boolean operators). |+| `format` | string | `json` (default), `tsv`, `fasta`, `xml`, `list`, `xlsx`, `obo` |+| `fields` | string | Comma-separated list of columns to return. Key fields: `accession`, `id`, `protein_name`, `gene_names`, `organism_name`, `organism_id`, `length`, `sequence`, `cc_function`, `go_id`, `go`, `xref_pdb`, `reviewed`, `ec`, `cc_subcellular_location`, `ft_domain`, `lineage` |+| `size` | int | Results per page (max 500, default 25) |+| `cursor` | string | Pagination cursor (returned in `Link` response header) |+| `sort` | string | Sort field and direction, e.g. `gene asc`, `length desc`, `annotation_score desc` |++**Example calls:**++Search for reviewed human TP53:+```+https://rest.uniprot.org/uniprotkb/search?query=(gene:TP53) AND (organism_id:9606) AND (reviewed:true)&format=json&fields=accession,protein_name,gene_names,organism_name,length,cc_function&size=10+```++Search by protein name keyword:+```+https://rest.uniprot.org/uniprotkb/search?query=(protein_name:insulin) AND (reviewed:true)&format=json&size=5+```++Search by EC number (enzyme classification):+```+https://rest.uniprot.org/uniprotkb/search?query=(ec:2.7.11.1) AND (organism_id:9606)&format=json&size=25+```++Search by Gene Ontology:+```+https://rest.uniprot.org/uniprotkb/search?query=(go:0006915) AND (organism_id:9606) AND (reviewed:true)&format=json&size=25+```++**Response (JSON):**+```json+{+ "results": [+ {+ "entryType": "UniProtKB reviewed (Swiss-Prot)",+ "primaryAccession": "P04637",+ "uniProtkbId": "P53_HUMAN",+ "organism": {+ "scientificName": "Homo sapiens",+ "taxonId": 9606+ },+ "proteinDescription": {+ "recommendedName": {+ "fullName": { "value": "Cellular tumor antigen p53" }+ }+ },+ "genes": [+ {+ "geneName": { "value": "TP53" },+ "synonyms": [{ "value": "P53" }]+ }+ ],+ "sequence": {+ "value": "MEEPQSDP...",+ "length": 393,+ "molWeight": 43653,+ "crc64": "..."+ },+ "comments": [...],+ "features": [...],+ "references": [...]+ }+ ]+}+```++**Pagination:** The `Link` response header contains the next page URL with the cursor parameter. Follow it to get subsequent pages.++---++### 2. Fetch single entry by accession++```+GET /uniprotkb/{accession}+```++**Parameters:**++| Parameter | Type | Description |+|-----------|--------|-------------|+| `format` | string | `json`, `tsv`, `fasta`, `xml`, `gff` |++**Example calls:**++```+https://rest.uniprot.org/uniprotkb/P04637?format=json+https://rest.uniprot.org/uniprotkb/P04637.fasta+```++---++### 3. FASTA sequence retrieval++Append `.fasta` to the accession or use `format=fasta`:++```+https://rest.uniprot.org/uniprotkb/P04637.fasta+```++Batch FASTA from search:+```+https://rest.uniprot.org/uniprotkb/search?query=(gene:BRCA1) AND (organism_id:9606) AND (reviewed:true)&format=fasta+```++---++### 4. ID Mapping (convert between ID types)++ID mapping is a two-step async process.++**Step 1: Submit job**+```+POST /idmapping/run+Content-Type: application/x-www-form-urlencoded++from={dbFrom}&to={dbTo}&ids={comma-separated-ids}+```++Common `from`/`to` database names:+- `UniProtKB_AC-ID` (UniProt accession)+- `Gene_Name`+- `GeneID` (NCBI Gene / Entrez Gene)+- `Ensembl`, `Ensembl_Genomes`+- `RefSeq_Protein`+- `PDB`+- `ChEMBL`+- `EMBL-GenBank-DDBJ`+- `STRING`++Returns:+```json+{ "jobId": "abc123def456" }+```++**Step 2: Poll and retrieve results**+```+GET /idmapping/status/{jobId}+```+When complete, redirects to:+```+GET /idmapping/results/{jobId}?format=json&size=500+```++**Example:**++Map Ensembl gene IDs to UniProt accessions:+```+POST /idmapping/run+from=Ensembl&to=UniProtKB_AC-ID&ids=ENSG00000141510,ENSG00000012048+```++Map UniProt to PDB:+```+POST /idmapping/run+from=UniProtKB_AC-ID&to=PDB&ids=P04637,P38398+```++**Response (results):**+```json+{+ "results": [+ {+ "from": "ENSG00000141510",+ "to": {+ "primaryAccession": "P04637",+ "uniProtkbId": "P53_HUMAN",+ ...+ }+ }+ ]+}+```++---++### 5. UniRef (clustered sequences)++```+GET /uniref/search?query={query}&format=json+GET /uniref/{id}+```++Cluster IDs: `UniRef100_P04637`, `UniRef90_P04637`, `UniRef50_P04637`++---++### 6. UniParc (sequence archive)++```+GET /uniparc/search?query={query}&format=json+GET /uniparc/{upi}+```++---++### 7. Proteomes++```+GET /proteomes/search?query=(organism_id:9606)&format=json+GET /proteomes/{upid}+```++Example — human reference proteome:+```+https://rest.uniprot.org/proteomes/UP000005640?format=json+```++---++### 8. Taxonomy++```+GET /taxonomy/search?query={query}&format=json+GET /taxonomy/{taxonId}+```++---++## Query Syntax++UniProt search queries support field:value syntax with boolean operators:++- `(gene:TP53)` -- gene name+- `(organism_id:9606)` -- NCBI taxonomy ID (9606 = human, 10090 = mouse)+- `(organism_name:"Homo sapiens")` -- organism name+- `(reviewed:true)` -- Swiss-Prot only (manually reviewed)+- `(protein_name:kinase)` -- protein name contains keyword+- `(ec:2.7.11.1)` -- enzyme classification+- `(go:0006915)` -- Gene Ontology term ID+- `(xref:pdb-P04637)` -- cross-reference+- `(length:[100 TO 300])` -- sequence length range+- `(cc_disease:cancer)` -- disease involvement+- `(ft_domain:SH2)` -- domain annotation+- `(cc_subcellular_location:nucleus)` -- subcellular location+- `(date_modified:[2024-01-01 TO *])` -- modification date++Combine with `AND`, `OR`, `NOT`:+```+(gene:BRCA1) AND (organism_id:9606) AND (reviewed:true)+```++## Rate Limits++- No hard published rate limit, but excessive requests will be throttled.+- Use pagination (`size` + `cursor`) to batch results.+- Batch ID mapping jobs instead of one-at-a-time lookups.+- For large downloads, use the streaming endpoints or FTP site.+- Respect `Retry-After` headers if you receive HTTP 429.++## Error Format++```json+{+ "url": "https://rest.uniprot.org/...",+ "messages": ["Error message here"]+}+```++HTTP 400 for bad queries, 404 for not found, 429 for rate limiting, 500 for server errors.diff --git a/scientific-skills/database-lookup/references/usgs.md b/scientific-skills/database-lookup/references/usgs.mdnew file mode 100644index 00000000..73849ed9--- /dev/null+++ b/scientific-skills/database-lookup/references/usgs.md@@ -0,0 +1,260 @@+# USGS API Reference (Earthquake Hazards + Water Services)++## Part A: Earthquake Hazards Program++### Base URL+```+https://earthquake.usgs.gov/fdsnws/event/1+```++### Authentication+**None required.** Fully public, no API key needed.++### Rate Limits+- No documented per-user rate limit, but USGS asks users to limit automated queries to avoid overloading the service.+- Requests returning very large result sets (>20,000 events) will be rejected. Use pagination or narrow your query.++### Key Endpoints++#### 1. Query Earthquakes+```+GET /query+```+Returns earthquake events matching search criteria. This is the primary endpoint.++**Parameters:**+| Parameter | Type | Required | Default | Description |+|--------------|--------|----------|------------|-------------|+| `format` | string | No | `quakeml` | `geojson`, `csv`, `quakeml`, `text`, `kml`. Use `geojson` for JSON. |+| `starttime` | string | No | (now - 30d)| ISO8601 date, e.g. `2024-01-01`. |+| `endtime` | string | No | (now) | ISO8601 date. |+| `minmagnitude`| float | No | - | Minimum magnitude (e.g. `4.5`). |+| `maxmagnitude`| float | No | - | Maximum magnitude. |+| `mindepth` | float | No | - | Minimum depth in km. |+| `maxdepth` | float | No | - | Maximum depth in km. |+| `latitude` | float | No | - | Center latitude for circle search (-90 to 90). |+| `longitude` | float | No | - | Center longitude for circle search (-180 to 180). |+| `maxradiuskm`| float | No | - | Max radius in km (with lat/lon). |+| `minlatitude`| float | No | - | Bounding box south edge. |+| `maxlatitude`| float | No | - | Bounding box north edge. |+| `minlongitude`| float | No | - | Bounding box west edge. |+| `maxlongitude`| float | No | - | Bounding box east edge. |+| `limit` | int | No | - | Max events returned (max 20000). |+| `offset` | int | No | 1 | Pagination offset (1-based). |+| `orderby` | string | No | `time` | `time`, `time-asc`, `magnitude`, `magnitude-asc`. |+| `alertlevel` | string | No | - | PAGER alert: `green`, `yellow`, `orange`, `red`. |+| `eventtype` | string | No | - | e.g. `earthquake`, `quarry blast`. |++**Example -- significant earthquakes in a region:**+```+https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2024-01-01&endtime=2024-12-31&minmagnitude=5.0&minlatitude=30&maxlatitude=45&minlongitude=-125&maxlongitude=-110&orderby=magnitude+```++**GeoJSON Response:**+```json+{+ "type": "FeatureCollection",+ "metadata": {+ "generated": 1700000000000,+ "url": "https://earthquake.usgs.gov/fdsnws/event/1/query?...",+ "title": "USGS Earthquakes",+ "status": 200,+ "api": "1.14.1",+ "count": 42+ },+ "features": [+ {+ "type": "Feature",+ "properties": {+ "mag": 6.2,+ "place": "15 km NNE of Ridgecrest, CA",+ "time": 1700000000000,+ "updated": 1700100000000,+ "tz": null,+ "url": "https://earthquake.usgs.gov/earthquakes/eventpage/ci00000001",+ "detail": "https://earthquake.usgs.gov/fdsnws/event/1/query?eventid=ci00000001&format=geojson",+ "felt": 1500,+ "cdi": 7.1,+ "mmi": 6.5,+ "alert": "yellow",+ "status": "reviewed",+ "tsunami": 0,+ "sig": 800,+ "net": "ci",+ "code": "00000001",+ "type": "earthquake",+ "title": "M 6.2 - 15 km NNE of Ridgecrest, CA"+ },+ "geometry": {+ "type": "Point",+ "coordinates": [-117.5, 35.8, 10.5]+ },+ "id": "ci00000001"+ }+ ]+}+```+Note: `geometry.coordinates` is `[longitude, latitude, depth_km]`.++#### 2. Event Detail+```+GET /query?eventid={EVENTID}&format=geojson+```+Returns detailed info for a single event, including moment tensor, focal mechanism, and nearby cities.++#### 3. Event Count+```+GET /count+```+Same parameters as `/query`, returns just the count of matching events. Useful for checking result size before querying.++**Example:**+```+https://earthquake.usgs.gov/fdsnws/event/1/count?starttime=2024-01-01&endtime=2024-12-31&minmagnitude=4.5+```++#### 4. Real-Time Feeds (no parameters)+Pre-built GeoJSON feeds updated every minute/5 min/15 min/hour:+```+https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_month.geojson+https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.geojson+https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson+https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.geojson+```+Pattern: `{significance}_{timeperiod}.geojson` where significance is `significant`, `4.5`, `2.5`, `1.0`, `all` and timeperiod is `hour`, `day`, `week`, `month`.++---++## Part B: Water Services++### Base URL+```+https://waterservices.usgs.gov/nwis+```++### Authentication+**None required.** Fully public, no API key needed.++### Rate Limits+- No strict per-user limit, but USGS recommends limiting automated requests. Large queries may time out.++### Key Endpoints++#### 1. Instantaneous Values (Real-Time Data)+```+GET /iv/+```+Returns the most recent sensor readings (typically 15-minute intervals).++**Parameters:**+| Parameter | Type | Required | Default | Description |+|----------------|--------|----------|---------|-------------|+| `format` | string | No | `wml` | `json`, `xml`, `wml,1.1`, `wml,2.0`, `rdb`. Use `json` for JSON. |+| `sites` | string | Cond. | - | Comma-separated USGS site numbers (e.g. `01646500`). |+| `stateCd` | string | Cond. | - | 2-letter state code (e.g. `NY`). |+| `huc` | string | Cond. | - | Hydrologic Unit Code(s). |+| `bBox` | string | Cond. | - | Bounding box: `west,south,east,north` (decimal degrees). |+| `countyCd` | string | Cond. | - | 5-digit FIPS county code(s). |+| `parameterCd` | string | No | `00060` | Parameter code(s). `00060`=streamflow, `00065`=gage height, `00010`=water temp. |+| `period` | string | No | - | ISO8601 duration, e.g. `P7D` (past 7 days). |+| `startDT` | string | No | - | Start datetime (ISO8601). |+| `endDT` | string | No | - | End datetime (ISO8601). |+| `siteType` | string | No | - | e.g. `ST` (stream), `GW` (groundwater), `LK` (lake). |+| `siteStatus` | string | No | `all` | `active`, `inactive`, `all`. |++At least one location parameter (`sites`, `stateCd`, `huc`, `bBox`, or `countyCd`) is required.++**Example -- real-time streamflow for a site:**+```+https://waterservices.usgs.gov/nwis/iv/?format=json&sites=01646500¶meterCd=00060&period=P1D+```++**JSON Response (abbreviated):**+```json+{+ "name": "ns1:timeSeriesResponseType",+ "declaredType": "org.cuahsi.waterml.TimeSeriesResponseType",+ "value": {+ "timeSeries": [+ {+ "sourceInfo": {+ "siteName": "Potomac River near Wash, DC Little Falls Pump Sta",+ "siteCode": [{"value": "01646500", "agencyCode": "USGS"}],+ "geoLocation": {+ "geogLocation": {"latitude": 38.94977778, "longitude": -77.12763889}+ }+ },+ "variable": {+ "variableCode": [{"value": "00060"}],+ "variableName": "Streamflow, ft³/s",+ "unit": {"unitCode": "ft3/s"}+ },+ "values": [+ {+ "value": [+ {"value": "5280", "dateTime": "2024-01-15T00:00:00.000-05:00"},+ {"value": "5310", "dateTime": "2024-01-15T00:15:00.000-05:00"}+ ]+ }+ ]+ }+ ]+ }+}+```++#### 2. Daily Values (Historical Aggregates)+```+GET /dv/+```+Returns daily statistical values (mean, max, min). Same location parameters as `/iv/`.++**Additional Parameters:**+| Parameter | Type | Description |+|-----------|--------|-------------|+| `statCd` | string | Statistic code: `00001`=max, `00002`=min, `00003`=mean, `00006`=sum. Default `00003`. |++**Example -- daily mean streamflow, 1 year:**+```+https://waterservices.usgs.gov/nwis/dv/?format=json&sites=01646500¶meterCd=00060&statCd=00003&startDT=2023-01-01&endDT=2023-12-31+```++#### 3. Site Information+```+GET /site/+```+Returns metadata about monitoring sites. Same location parameters apply.++**Example -- active stream sites in Virginia:**+```+https://waterservices.usgs.gov/nwis/site/?format=rdb&stateCd=VA&siteType=ST&siteStatus=active&hasDataTypeCd=iv+```++#### 4. Statistics (Pre-computed)+```+GET /stat/+```+Returns pre-computed statistics (percentiles, mean, median) for daily values, useful for comparing current conditions to historical norms.++**Example:**+```+https://waterservices.usgs.gov/nwis/stat/?format=rdb&sites=01646500¶meterCd=00060&statReportType=daily&statTypeCd=mean,p05,p25,p50,p75,p95+```++### Common Parameter Codes+| Code | Description |+|---------|-------------|+| `00060` | Discharge/streamflow (ft3/s) |+| `00065` | Gage height (ft) |+| `00010` | Water temperature (C) |+| `00045` | Precipitation (in) |+| `00400` | pH |+| `00300` | Dissolved oxygen (mg/L) |+| `00095` | Specific conductance (uS/cm) |+| `72019` | Groundwater level depth below land surface (ft) |++## Notes+- Earthquake API returns coordinates as `[lon, lat, depth]` (note: longitude first).+- Water Services JSON wraps data in a verbose WaterML-like structure. The `rdb` (tab-delimited) format is simpler for tabular data.+- USGS site numbers are typically 8 digits for surface water, 15 for groundwater.+- Both APIs are free, public, and require no authentication.diff --git a/scientific-skills/database-lookup/references/uspto.md b/scientific-skills/database-lookup/references/uspto.mdnew file mode 100644index 00000000..1c2aa602--- /dev/null+++ b/scientific-skills/database-lookup/references/uspto.md@@ -0,0 +1,130 @@+# USPTO Public APIs++## 1. PatentsView API (Primary Patent Search)++The newer Elasticsearch-based API is the recommended endpoint.++### Base URL++```+https://search.patentsview.org/api/v1/+```++**API key required** — register at `https://patentsview.org/apis/keyrequest`++Pass as query parameter: `?api_key=YOUR_KEY`++### Key Endpoints++#### Search patents+```+GET or POST /patent/+```++Query parameter `q` accepts a JSON query object.++Operators: `_eq`, `_neq`, `_gt`, `_gte`, `_lt`, `_lte`, `_begins`, `_contains`, `_text_any`, `_text_all`, `_text_phrase`, `_and`, `_or`, `_not`++Parameters:+- `q` — JSON query+- `f` — fields to return (JSON array)+- `o` — options: `{"size": 25}` for pagination+- `s` — sort: `[{"patent_date": "desc"}]`++#### Search by keyword+```+GET /patent/?q={"_text_any":{"patent_abstract":"autonomous vehicle"}}&f=["patent_id","patent_title","patent_date"]&o={"size":5}&api_key=KEY+```++#### Search by inventor+```+GET /patent/?q={"inventors.inventor_name_last":"Tesla"}&f=["patent_id","patent_title","patent_date"]&api_key=KEY+```++#### Search by assignee+```+GET /patent/?q={"assignees.assignee_organization":"Google LLC"}&f=["patent_id","patent_title","patent_date","assignees"]&api_key=KEY+```++#### Lookup by patent number+```+GET /patent/{patent_number}/?api_key=KEY+```++#### Other entity endpoints+```+/inventor/+/assignee/+/cpc_group/+```++### Response Structure++```json+{+ "patents": [+ {+ "patent_id": "11234567",+ "patent_title": "...",+ "patent_date": "2022-03-15",+ "patent_abstract": "...",+ "assignees": [{"assignee_organization": "..."}],+ "inventors": [{"inventor_name_first": "...", "inventor_name_last": "..."}]+ }+ ],+ "count": 1,+ "total_hits": 8923+}+```++### Rate Limits++~45 requests per minute per API key.++### Important Note++The user must have a PatentsView API key for this endpoint. If they don't have one, let them know they need to register at `https://patentsview.org/apis/keyrequest`. Load the key from `.env` as `PATENTSVIEW_API_KEY`.++**Note:** The legacy API at `api.patentsview.org` has been decommissioned (returns 410 Gone). Only the new API above works.++## 3. PEDS — Patent Examination Data System++**URL**: `https://ped.uspto.gov/api/queries`++**Method**: POST++For patent prosecution data (application status, filing dates, examiner info).++```json+{+ "searchText": "applicationNumberText:16123456",+ "fl": "*",+ "mm": "100%",+ "df": "patentTitle",+ "facet": "false",+ "sort": "applId asc",+ "start": 0+}+```++No API key required but heavily rate limited. Availability can be unreliable.++## 4. TSDR — Trademark Status & Document Retrieval++For trademark lookup by serial or registration number (not full-text search).++```+GET https://tsdr.uspto.gov/documentxml/status/{serial_number}+GET https://tsdr.uspto.gov/documentxml/status/rn{registration_number}+```++Returns XML with mark details, status, owner, goods/services, prosecution history.++No API key. Rate limited. No JSON endpoint — responses are XML.++## 5. Limitations++- **No public REST API for trademark full-text search** (TESS is web-only)+- PatentsView new API requires registration for an API key+- PEDS availability is inconsistent+- TSDR requires knowing the serial/registration number alreadydiff --git a/scientific-skills/database-lookup/references/who.md b/scientific-skills/database-lookup/references/who.mdnew file mode 100644index 00000000..37d0d9bc--- /dev/null+++ b/scientific-skills/database-lookup/references/who.md@@ -0,0 +1,283 @@+# WHO Global Health Observatory (GHO) API Reference++## Overview+The WHO Global Health Observatory (GHO) OData API provides access to health statistics for 194 WHO member states. It covers over 2000 indicators including life expectancy, disease burden, mortality, immunization coverage, health workforce, air pollution, water/sanitation, and the Sustainable Development Goal (SDG) health indicators.++## Base URL+```+https://ghoapi.azureedge.net/api+```++## Authentication+**No API key required.** The API is fully open and free.++## Rate Limits+- No formal rate limits documented.+- The API is served via Azure CDN and handles moderate loads well.+- Be respectful with automated requests; 1-2 per second recommended.++---++## Key Endpoints++The API follows the OData v4 protocol. Standard OData query parameters work: `$filter`, `$select`, `$orderby`, `$top`, `$skip`, `$count`.++### 1. List All Indicators++```+GET /Indicator+```++**Example:**+```+https://ghoapi.azureedge.net/api/Indicator+```++**Response:**+```json+{+ "@odata.context": "...",+ "value": [+ {+ "IndicatorCode": "WHOSIS_000001",+ "IndicatorName": "Life expectancy at birth (years)",+ "Language": "EN"+ },+ {+ "IndicatorCode": "WHOSIS_000002",+ "IndicatorName": "Healthy life expectancy (HALE) at birth (years)",+ "Language": "EN"+ },+ {+ "IndicatorCode": "WHS4_100",+ "IndicatorName": "Measles (MCV1) immunization coverage among 1-year-olds (%)",+ "Language": "EN"+ }+ ]+}+```++### 2. Get Data for a Specific Indicator++```+GET /{IndicatorCode}+```++**Example (life expectancy at birth):**+```+https://ghoapi.azureedge.net/api/WHOSIS_000001+```++**Response:**+```json+{+ "@odata.context": "...",+ "value": [+ {+ "Id": 12345,+ "IndicatorCode": "WHOSIS_000001",+ "SpatialDim": "USA",+ "SpatialDimType": "COUNTRY",+ "TimeDim": 2019,+ "TimeDimType": "YEAR",+ "Dim1": "SEX",+ "Dim1Type": "BTSX",+ "Dim2": null,+ "Dim2Type": null,+ "Dim3": null,+ "Dim3Type": null,+ "DataSourceDim": null,+ "Value": "78.5",+ "NumericValue": 78.5,+ "Low": 78.2,+ "High": 78.8,+ "Comments": "",+ "Date": "2024-01-15T00:00:00+00:00",+ "TimeDimensionValue": "2019",+ "TimeDimensionBegin": "2019-01-01T00:00:00+00:00",+ "TimeDimensionEnd": "2019-12-31T00:00:00+00:00"+ }+ ]+}+```++### 3. Filter by Country++Use OData `$filter` to restrict results by country (SpatialDim).++**Example (life expectancy for USA only):**+```+https://ghoapi.azureedge.net/api/WHOSIS_000001?$filter=SpatialDim eq 'USA'+```++**Example (life expectancy for multiple countries):**+```+https://ghoapi.azureedge.net/api/WHOSIS_000001?$filter=SpatialDim eq 'USA' or SpatialDim eq 'GBR' or SpatialDim eq 'JPN'+```++### 4. Filter by Year++**Example (life expectancy in 2019):**+```+https://ghoapi.azureedge.net/api/WHOSIS_000001?$filter=TimeDim eq 2019+```++**Example (life expectancy for USA since 2015):**+```+https://ghoapi.azureedge.net/api/WHOSIS_000001?$filter=SpatialDim eq 'USA' and TimeDim ge 2015+```++### 5. Filter by Sex/Dimension++**Example (life expectancy, both sexes, USA, 2015+):**+```+https://ghoapi.azureedge.net/api/WHOSIS_000001?$filter=SpatialDim eq 'USA' and TimeDim ge 2015 and Dim1 eq 'BTSX'+```++Dim1 sex values: `BTSX` (both sexes), `MLE` (male), `FMLE` (female).++### 6. Pagination and Limiting++**Example (first 10 results):**+```+https://ghoapi.azureedge.net/api/WHOSIS_000001?$top=10+```++**Example (skip first 100, get next 50):**+```+https://ghoapi.azureedge.net/api/WHOSIS_000001?$top=50&$skip=100+```++### 7. Select Specific Fields++```+https://ghoapi.azureedge.net/api/WHOSIS_000001?$filter=SpatialDim eq 'USA'&$select=SpatialDim,TimeDim,NumericValue,Dim1+```++### 8. Order Results++```+https://ghoapi.azureedge.net/api/WHOSIS_000001?$filter=SpatialDim eq 'USA'&$orderby=TimeDim desc+```++### 9. List Dimension Values++```+GET /DIMENSION/{DimensionType}/DimensionValues+```++**Example (list all countries):**+```+https://ghoapi.azureedge.net/api/DIMENSION/COUNTRY/DimensionValues+```++**Example (list all regions):**+```+https://ghoapi.azureedge.net/api/DIMENSION/REGION/DimensionValues+```++**Example (list sex dimension values):**+```+https://ghoapi.azureedge.net/api/DIMENSION/SEX/DimensionValues+```++---++## Common Indicator Codes++### Life Expectancy & Mortality+| Code | Description |+|------|-------------|+| `WHOSIS_000001` | Life expectancy at birth (years) |+| `WHOSIS_000002` | Healthy life expectancy (HALE) at birth (years) |+| `WHOSIS_000004` | Neonatal mortality rate (per 1000 live births) |+| `MDG_0000000001` | Infant mortality rate (per 1000 live births) |+| `MDG_0000000007` | Under-five mortality rate (per 1000 live births) |+| `MORT_MATERNALNUM` | Number of maternal deaths |+| `MDG_0000000026` | Maternal mortality ratio (per 100000 live births) |+| `NCDMORT3070` | Probability of dying from NCDs between ages 30-70 |+| `LIFE_0000000029` | Adult mortality rate (probability of dying 15-60) |++### Communicable Diseases+| Code | Description |+|------|-------------|+| `WHS3_49` | HIV prevalence (% of population ages 15-49) |+| `MDG_0000000029` | Tuberculosis incidence (per 100,000) |+| `MALARIA_EST_INCIDENCE` | Malaria incidence (per 1000 population at risk) |+| `WHS3_62` | New HIV infections (per 1000 uninfected population) |++### Immunization+| Code | Description |+|------|-------------|+| `WHS4_100` | Measles (MCV1) immunization (% of 1-year-olds) |+| `WHS4_117` | DTP3 immunization (% of 1-year-olds) |+| `WHS4_129` | Hepatitis B (HepB3) immunization (%) |+| `WHS4_543` | Polio (Pol3) immunization (% of 1-year-olds) |++### Non-Communicable Diseases & Risk Factors+| Code | Description |+|------|-------------|+| `NCD_BMI_30A` | Prevalence of obesity (BMI >= 30), age-standardized |+| `NCD_HYP_PREVALENCE_A` | Prevalence of raised blood pressure |+| `NCD_GLUC_04` | Prevalence of diabetes (% of population) |+| `M_Est_smk_curr_std` | Prevalence of current tobacco smoking |+| `SA_0000001462` | Total alcohol per capita consumption (litres) |++### Health Systems+| Code | Description |+|------|-------------|+| `HWF_0001` | Medical doctors (per 10,000 population) |+| `HWF_0006` | Nursing and midwifery personnel (per 10,000) |+| `WHS7_104` | Hospital beds (per 10,000 population) |+| `GHED_CHE_pc_US_SHA2011` | Current health expenditure per capita (USD) |+| `UHC_INDEX_REPORTED` | UHC service coverage index |++### Environmental Health+| Code | Description |+|------|-------------|+| `SDGPM25` | PM2.5 air pollution, mean annual exposure (ug/m3) |+| `WSH_SANITATION_SAFELY_MANAGED` | Safely managed sanitation services (%) |+| `WSH_WATER_SAFELY_MANAGED` | Safely managed drinking water services (%) |++---++## Country Codes (ISO 3166-1 alpha-3)++The GHO API uses **ISO 3-letter codes** for countries in the `SpatialDim` field.++`USA` (United States), `GBR` (United Kingdom), `DEU` (Germany), `FRA` (France), `JPN` (Japan), `CHN` (China), `IND` (India), `BRA` (Brazil), `ZAF` (South Africa), `NGA` (Nigeria), `AUS` (Australia), `CAN` (Canada), `KOR` (Republic of Korea), `MEX` (Mexico), `RUS` (Russian Federation)++WHO Regions: `AFR` (Africa), `AMR` (Americas), `SEAR` (South-East Asia), `EUR` (Europe), `EMR` (Eastern Mediterranean), `WPR` (Western Pacific), `GLOBAL` (Global)++---++## Response Format+All responses are JSON following OData v4 conventions:++```json+{+ "@odata.context": "https://ghoapi.azureedge.net/api/$metadata#...",+ "value": [+ { ... observation object ... },+ { ... observation object ... }+ ]+}+```++Key fields in each observation:+- `SpatialDim`: Country/region code (ISO alpha-3)+- `TimeDim`: Year (integer)+- `NumericValue`: The numeric data value (float or null)+- `Value`: String representation of the value+- `Low` / `High`: Confidence interval bounds (when available)+- `Dim1`: First additional dimension (often sex: `BTSX`, `MLE`, `FMLE`)+- `Dim2`, `Dim3`: Additional dimensions (age group, etc.)++## Notes+- The API uses OData v4 syntax. Filter operators: `eq`, `ne`, `gt`, `ge`, `lt`, `le`, `and`, `or`, `not`. String values must be in single quotes.+- Not all indicators have data for all countries or years. Check data availability before building dependent workflows.+- `NumericValue` is preferred over `Value` for numeric analysis; `Value` is a string and may contain qualifiers.+- Many indicators are disaggregated by sex (`Dim1`) and/or age group (`Dim2`). Use the dimension values endpoint to discover valid codes.+- Data may have multi-year lag, especially for lower-income countries.+- The `Low` and `High` fields provide uncertainty intervals from WHO estimation processes (not all indicators have these).+- For bulk exploration, the GHO data portal at https://www.who.int/data/gho provides a browsable interface to find indicator codes.diff --git a/scientific-skills/database-lookup/references/worldbank.md b/scientific-skills/database-lookup/references/worldbank.mdnew file mode 100644index 00000000..3e95a715--- /dev/null+++ b/scientific-skills/database-lookup/references/worldbank.md@@ -0,0 +1,239 @@+# World Bank Open Data API++## Base URL++```+https://api.worldbank.org/v2+```++## Authentication++**No API key required.** The API is fully open.++## Key Endpoints++### 1. Get Indicator Data for a Country+```+GET /country/{country_code}/indicator/{indicator_code}+```+| Parameter | Required | Description |+|-----------|----------|----------------------------------------------------|+| format | No | `json`, `xml` (default), `jsonP` |+| date | No | Year range: `2010:2023`, single year: `2020` |+| page | No | Page number (default 1) |+| per_page | No | Results per page (default 50, max 32500) |+| MRV | No | Most recent values: number of recent data points |+| gapfill | No | `Y` to fill gaps with most recent value |+| frequency | No | `M` (monthly), `Q` (quarterly), `Y` (yearly) |+| source | No | Source ID number |++Example (GDP for USA, 2015-2023):+```+https://api.worldbank.org/v2/country/US/indicator/NY.GDP.MKTP.CD?format=json&date=2015:2023+```++Example (most recent 5 values):+```+https://api.worldbank.org/v2/country/US/indicator/NY.GDP.MKTP.CD?format=json&MRV=5+```++### 2. Get Indicator Data for Multiple Countries+```+GET /country/{code1};{code2};{code3}/indicator/{indicator_code}+```+Example:+```+https://api.worldbank.org/v2/country/US;GB;CN;IN/indicator/SP.POP.TOTL?format=json&date=2020:2023+```++### 3. Get Indicator Data for All Countries+```+GET /country/all/indicator/{indicator_code}+```+Example:+```+https://api.worldbank.org/v2/country/all/indicator/SI.POV.DDAY?format=json&date=2020&per_page=300+```++### 4. Get Indicator Data by Region/Income Group+```+GET /country/{aggregate_code}/indicator/{indicator_code}+```+Aggregate codes: `EAS` (East Asia), `ECS` (Europe & Central Asia), `LIC` (Low Income), `HIC` (High Income), `WLD` (World), etc.++Example:+```+https://api.worldbank.org/v2/country/WLD/indicator/NY.GDP.MKTP.CD?format=json&date=2020:2023+```++### 5. List All Countries+```+GET /country+```+Example:+```+https://api.worldbank.org/v2/country?format=json&per_page=300+```++### 6. Get Country Info+```+GET /country/{country_code}+```+Example:+```+https://api.worldbank.org/v2/country/US?format=json+```++### 7. List All Indicators+```+GET /indicator+```+Example:+```+https://api.worldbank.org/v2/indicator?format=json&per_page=100+```++### 8. Search Indicators+```+GET /indicator+```+Use the query string directly in the URL path or filter by topic/source.++By topic:+```+https://api.worldbank.org/v2/topic/3/indicator?format=json+```++By source:+```+https://api.worldbank.org/v2/source/2/indicator?format=json&per_page=50+```++### 9. List Topics+```+GET /topic+```+Example:+```+https://api.worldbank.org/v2/topic?format=json+```++### 10. List Sources+```+GET /source+```+Example:+```+https://api.worldbank.org/v2/source?format=json+```++## Common Indicator Codes++| Indicator Code | Description |+|------------------------|-------------------------------------------------|+| NY.GDP.MKTP.CD | GDP (current US$) |+| NY.GDP.MKTP.KD.ZG | GDP growth (annual %) |+| NY.GDP.PCAP.CD | GDP per capita (current US$) |+| NY.GDP.PCAP.PP.CD | GDP per capita, PPP (current intl $) |+| SP.POP.TOTL | Population, total |+| SP.POP.GROW | Population growth (annual %) |+| SP.DYN.LE00.IN | Life expectancy at birth (years) |+| SP.DYN.TFRT.IN | Fertility rate (births per woman) |+| SL.UEM.TOTL.ZS | Unemployment (% of total labor force) |+| FP.CPI.TOTL.ZG | Inflation, consumer prices (annual %) |+| SI.POV.DDAY | Poverty headcount at $2.15/day (% of pop) |+| SI.POV.GINI | Gini index |+| BX.KLT.DINV.CD.WD | Foreign direct investment, net inflows (BoP, US$)|+| NE.EXP.GNFS.ZS | Exports of goods and services (% of GDP) |+| EN.ATM.CO2E.PC | CO2 emissions (metric tons per capita) |+| SE.ADT.LITR.ZS | Literacy rate, adult (% ages 15+) |+| SH.XPD.CHEX.PC.CD | Current health expenditure per capita (US$) |+| IT.NET.USER.ZS | Individuals using the Internet (% of pop) |++## Common Country Codes (ISO 3166-1 alpha-2)++`US` (USA), `GB` (UK), `CN` (China), `IN` (India), `JP` (Japan), `DE` (Germany), `FR` (France), `BR` (Brazil), `ZA` (South Africa), `NG` (Nigeria), `AU` (Australia), `CA` (Canada)++## Response Format++**Important:** JSON responses are returned as a **two-element array**. The first element is pagination metadata; the second is the data array.++### Indicator observations+```json+[+ {+ "page": 1,+ "pages": 1,+ "per_page": 50,+ "total": 9,+ "sourceid": "2",+ "lastupdated": "2024-03-28"+ },+ [+ {+ "indicator": {+ "id": "NY.GDP.MKTP.CD",+ "value": "GDP (current US$)"+ },+ "country": {+ "id": "US",+ "value": "United States"+ },+ "countryiso3code": "USA",+ "date": "2023",+ "value": 27360935000000,+ "unit": "",+ "obs_status": "",+ "decimal": 0+ },+ {+ "indicator": { "id": "NY.GDP.MKTP.CD", "value": "GDP (current US$)" },+ "country": { "id": "US", "value": "United States" },+ "countryiso3code": "USA",+ "date": "2022",+ "value": 25462700000000,+ "unit": "",+ "obs_status": "",+ "decimal": 0+ }+ ]+]+```++Note: `value` is `null` when data is unavailable for that year.++### Country info+```json+[+ { "page": 1, "pages": 1, "per_page": 50, "total": 1 },+ [+ {+ "id": "US",+ "iso2Code": "US",+ "name": "United States",+ "region": { "id": "NAC", "iso2code": "XU", "value": "North America" },+ "adminregion": { "id": "", "iso2code": "", "value": "" },+ "incomeLevel": { "id": "HIC", "iso2code": "XD", "value": "High income" },+ "lendingType": { "id": "LNX", "iso2code": "XX", "value": "Not classified" },+ "capitalCity": "Washington D.C.",+ "longitude": "-77.032",+ "latitude": "38.8895"+ }+ ]+]+```++## Rate Limits++- No formal rate limits published; the API is open and generous.+- For bulk downloads, use `per_page=32500` to minimize requests.+- Be respectful: 1-2 requests/second for automated scripts.+- For very large datasets, consider the World Bank bulk download facility.++## Notes++- Always include `format=json` -- the default is XML.+- Results are returned in **descending** date order by default.+- `null` values are common for recent years (data not yet published) or for indicators with sparse coverage.+- Pagination: check `pages` in the metadata; iterate `page=1`, `page=2`, etc.+- Country codes follow ISO 3166-1 alpha-2 (2-letter) in the URL path. The response also includes `countryiso3code`.diff --git a/scientific-skills/database-lookup/references/zinc.md b/scientific-skills/database-lookup/references/zinc.mdnew file mode 100644index 00000000..d808f021--- /dev/null+++ b/scientific-skills/database-lookup/references/zinc.md@@ -0,0 +1,202 @@+# ZINC Database API++## Base URL++```+https://zinc.docking.org+```++## Auth++No API key required. Fully open public API.++## URL Pattern++Resources follow a uniform pattern with format specified by file extension:++```+/{resource}.{format}+/{resource}/{id}.{format}+/{resource}/subsets/{subset}.{format}+```++Supported formats: `.json`, `.csv`, `.txt`, `.smi`, `.sdf`, `.mol2`, `.xml`, `.png`++Field selection (return only specific fields):+```+/{resource}.json:field1+field2+field3+```++## Key Endpoints++### Substance lookup by ZINC ID+```+GET /substances/ZINC000000000053.json+```++### Search by name+```+GET /substances.json?preferred_name=aspirin+```++### Search by InChIKey+```+GET /substances.json?inchikey=BSYNRYMUTXBXSQ-UHFFFAOYSA-N+```++### Search by molecular formula+```+GET /substances.json?mol_formula=C9H8O4+```++### Substructure search (SMILES)+```+GET /substances.json?sub_id-matches=c1ccccc1&count=10+```++### Substructure search (SMARTS)+```+GET /substances.json?sub_id-matches-sma=[ND1]&count=10+```++### Similarity search (Tanimoto, ECFP4 fingerprints)++The threshold (e.g., 40 = 40%) is part of the parameter name. Value can be SMILES or a ZINC ID number.+```+GET /substances/?ecfp4_fp-tanimoto-40=c1ccccc1O+GET /substances/?ecfp4_fp-tanimoto-70=ZINC000000000053+```++### Browse subsets++Filter by purchasability, drug status, reactivity, or origin:+```+GET /substances/subsets/fda.json # FDA-approved drugs+GET /substances/subsets/in-stock.json # In-stock compounds+GET /substances/subsets/metabolites.json # Metabolites+GET /substances/subsets/fda+in-stock.json # Combine subsets with ++```++Key subsets:+- **Purchasability**: `in-stock`, `on-demand`, `for-sale`, `bb` (building blocks)+- **Drug status**: `fda`, `world`, `in-trials`, `in-man`, `in-vivo`, `in-vitro`+- **Origin**: `biogenic`, `metabolites`, `natural-products`, `endogenous`+- **Reactivity**: `anodyne`, `clean`, `standard`, `reactive`++### Substances for a gene target+```+GET /genes/ACHE/substances.json?count=10+```++### Catalogs+```+GET /catalogs.json # List all vendor catalogs+GET /catalogs/cmcd/substances.json # Substances in a catalog+```++### 2D structure image (300x300 PNG)+```+GET /substances/ZINC000000000053.png+```++### Molecule format conversion+```+GET /apps/mol/convert?from=CC(=O)Oc1ccccc1C(=O)O&to=inchikey+```+Returns the InChIKey as plain text. Supports conversions between SMILES, InChI, and InChIKey.++### Batch resolution (POST)++Resolve multiple names, ZINC IDs, or SMILES at once:+```+POST /substances/resolved/+Content-Type: application/x-www-form-urlencoded++paste=aspirin%0Aibuprofen%0AZINC000000000053&identifiers=y&structures=y&names=y&output_format=json+```++## Query Parameters++### Pagination+- `count=N` — results per page (use `count=all` cautiously on large sets)+- `page=N` — page number (1-indexed)++### Sorting+- `sort=mwt` — ascending by field+- `sort=-mwt` — descending (prefix with `-`)+- `sort=no` — disable sorting for faster bulk queries++### Property filters (comparison operators)+- `mwt-le=500` — molecular weight <= 500+- `logp-ge=2` — LogP >= 2+- `hbd-le=5` — H-bond donors <= 5+- Operators: `-le` (<=), `-ge` (>=), `-lt` (<), `-gt` (>), `-eq` (=)++### Searchable substance attributes++Molecular properties: `mwt`, `logp`, `hba`, `hbd`, `tpsa`, `rb` (rotatable bonds), `num_rings`, `num_aromatic_rings`, `num_heavy_atoms`, `num_chiral_centers`, `fractioncsp3`++Identifiers: `zinc_id`, `smiles`, `inchikey`, `mol_formula`, `preferred_name`, `cas_numbers`++Status: `purchasable`, `reactive`, `bb` (building block)++## Example Calls++### Get properties for a compound+```+GET /substances/ZINC000000000053.json:zinc_id+smiles+mwt+logp+hba+hbd+tpsa+mol_formula+preferred_name+```++### FDA drugs sorted by molecular weight+```+GET /substances/subsets/fda.json:zinc_id+preferred_name+mwt?sort=mwt&count=10+```++### Drug-like compounds (Lipinski filters)+```+GET /substances/subsets/for-sale.json?mwt-le=500&logp-le=5&hbd-le=5&hba-le=10&count=20+```++### Find compounds targeting a specific gene+```+GET /genes/EGFR/substances.json:zinc_id+preferred_name+smiles?count=10+```++## Response Format++```json+[+ {+ "zinc_id": "ZINC000000000053",+ "smiles": "CC(=O)Oc1ccccc1C(=O)O",+ "preferred_name": "aspirin",+ "mwt": 180.159,+ "logp": 1.31,+ "hba": 3,+ "hbd": 1,+ "tpsa": 63,+ "mol_formula": "C9H8O4",+ "inchikey": "BSYNRYMUTXBXSQ-UHFFFAOYSA-N",+ "purchasable": 5+ }+]+```++Responses are JSON arrays. Single-record lookups (by ZINC ID) return a JSON object.++## Rate Limits++No documented rate limits. The API is publicly funded (NIH NIGMS GM71896). Be respectful:+- Use `count=` to limit result sizes+- Use `sort=no` for faster bulk queries+- Similarity and substructure searches are computationally expensive — expect slower responses+- Avoid `count=all` on large result sets++## Special Notes++- ZINC contains **2+ billion** commercially available compounds — always use `count=` to limit results+- ZINC IDs have the format `ZINC000000000053` (15-digit zero-padded after "ZINC")+- The `.smi` format returns SMILES strings, useful for cheminformatics pipelines+- The `.sdf` format returns 3D structures suitable for docking software+- Subsets can be combined with `+` (e.g., `fda+in-stock` = FDA-approved AND in-stock)+- For virtual screening workflows, use tranches (`/tranches/`) to partition by molecular weight and LogP