Forge Tools nsides_offsides

nsides_offsides read

scidex.forge.nsides_offsides

Query nSIDES (nsides.io) for post-marketing adverse drug event signals. Uses two datasets: OFFSIDES (single-drug statistical enrichment from FAERS) and TWOSIDES (drug-drug interaction signals). Returns adverse event terms with Proportional Reporting Ratio (PRR), reporting odds ratio, and report counts. Complements DrugBank mechanism-of-action data with real-world pharmacovigilance evidence. REST API: https://nsides.io/api — free, no auth. Single-drug query: drug_2=None → OFFSIDES. Drug-drug query: drug_2 set → TWOSIDES.

HTTP: POST /api/scidex/forge/nsides_offsides

Invoke

Calls scidex.tool.invoke on the substrate with this tool name. Edit the JSON below — it must match the input schema. The substrate runs the tool, records the call in substrate_tool_calls, and returns a structured envelope.

Sign in to invoke this tool. Schema and curl snippet are visible to anyone.

Schemas

Input schema
{
  "additionalProperties": false,
  "description": "Input schema for ``scidex.forge.nsides_offsides``.",
  "properties": {
    "drug": {
      "description": "Primary drug name (generic or brand name). Required.",
      "maxLength": 200,
      "title": "Drug",
      "type": "string"
    },
    "drug_2": {
      "anyOf": [
        {
          "maxLength": 200,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Second drug name for a drug-drug interaction query (TWOSIDES). When None, performs a single-drug OFFSIDES lookup. When set, queries TWOSIDES for interaction-specific adverse events.",
      "title": "Drug 2"
    },
    "limit": {
      "default": 50,
      "description": "Maximum number of effect records to return (default 50, max 200).",
      "maximum": 200,
      "minimum": 1,
      "title": "Limit",
      "type": "integer"
    }
  },
  "required": [
    "drug"
  ],
  "title": "ForgeNsidesOffsidesIn",
  "type": "object"
}
Output schema
{
  "$defs": {
    "NSidesEffect": {
      "description": "One adverse-event record from nSIDES OFFSIDES or TWOSIDES.",
      "properties": {
        "term": {
          "description": "Adverse event term (MedDRA preferred term or verbatim).",
          "title": "Term",
          "type": "string"
        },
        "effect_type": {
          "default": "",
          "description": "Effect type: 'OFFSIDES' for single-drug signals, 'TWOSIDES' for drug-drug interaction signals.",
          "title": "Effect Type",
          "type": "string"
        },
        "prr": {
          "default": 0,
          "description": "Proportional Reporting Ratio — enrichment score; values > 1 indicate the event is reported more often than expected for this drug(s).",
          "title": "Prr",
          "type": "number"
        },
        "reporting_odds_ratio": {
          "default": 0,
          "description": "Reporting odds ratio for the adverse event signal.",
          "title": "Reporting Odds Ratio",
          "type": "number"
        },
        "count": {
          "default": 0,
          "description": "Total number of FAERS reports supporting this signal.",
          "title": "Count",
          "type": "integer"
        },
        "drug1": {
          "default": "",
          "description": "First drug in the pair (for TWOSIDES; same as queried drug for OFFSIDES).",
          "title": "Drug1",
          "type": "string"
        },
        "drug2": {
          "default": "",
          "description": "Second drug in the pair (empty for OFFSIDES single-drug queries).",
          "title": "Drug2",
          "type": "string"
        },
        "source": {
          "default": "nSIDES",
          "description": "Data source — always 'nSIDES' for this verb.",
          "title": "Source",
          "type": "string"
        }
      },
      "required": [
        "term"
      ],
      "title": "NSidesEffect",
      "type": "object"
    }
  },
  "description": "Response shape for ``scidex.forge.nsides_offsides``.",
  "properties": {
    "query": {
      "description": "The primary drug name that was queried.",
      "title": "Query",
      "type": "string"
    },
    "query_drug_2": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The second drug name that was queried, or None for OFFSIDES.",
      "title": "Query Drug 2"
    },
    "effect_type": {
      "description": "'OFFSIDES' for single-drug queries, 'TWOSIDES' for drug-drug queries.",
      "title": "Effect Type",
      "type": "string"
    },
    "effects": {
      "description": "Adverse event records from nSIDES matching the query.",
      "items": {
        "$ref": "#/$defs/NSidesEffect"
      },
      "title": "Effects",
      "type": "array"
    },
    "not_found": {
      "default": false,
      "description": "True when nSIDES returned no matching effect records.",
      "title": "Not Found",
      "type": "boolean"
    },
    "source": {
      "default": "nSIDES",
      "description": "Data source identifier ('nSIDES').",
      "title": "Source",
      "type": "string"
    },
    "took_ms": {
      "description": "Wall-clock time for upstream API calls in ms.",
      "title": "Took Ms",
      "type": "integer"
    }
  },
  "required": [
    "query",
    "query_drug_2",
    "effect_type",
    "took_ms"
  ],
  "title": "ForgeNsidesOffsidesOut",
  "type": "object"
}

curl snippet

Replace $SCIDEX_JWT with a valid bearer token. Read verbs are usually accessible without auth in dev; production requires a JWT.

curl -sS -X POST '/api/scidex/forge/nsides_offsides' \
  -H 'authorization: Bearer $SCIDEX_JWT' \
  -H 'content-type: application/json' \
  -d '{
  "drug": ""
}'

Discussion

Posting anonymously. Sign in for attribution.

No comments yet — be the first.