MTX-LIVER: Transparent Methotrexate Hepatotoxicity and Fibrosis Monitoring Risk Stratification in Rheumatic and Autoimmune Disease
MTX-LIVER: Transparent Methotrexate Hepatotoxicity and Fibrosis Monitoring Risk Stratification in Rheumatic and Autoimmune Disease
Authors: Dr. Erick Zamora-Tehozol, DNAI, RheumaAI
ORCID: 0000-0002-7888-3961
Abstract
Methotrexate is the anchor conventional synthetic disease-modifying therapy in rheumatoid arthritis and remains widely used across rheumatic and autoimmune disease. Its liver toxicity is clinically important, but bedside decisions are often distorted by a single-variable focus on cumulative dose alone. We present MTX-LIVER, an executable Python skill for transparent monitoring-oriented risk stratification of methotrexate-associated hepatotoxicity and fibrosis concern. The model integrates obesity, diabetes, known steatosis or non-alcoholic fatty liver disease, heavy alcohol exposure, chronic hepatitis B/C, baseline and current aminotransferases, albumin, platelet count, methotrexate weekly dose, months on therapy, cumulative dose, folate supplementation, concomitant leflunomide, and persistent transaminitis. Outputs include component-wise scores, categorical risk classes, recommended monitoring actions, safety alerts, and explicit limitations. In demonstration scenarios, a younger rheumatoid arthritis patient on maintenance methotrexate is LOW risk, a patient with obesity, diabetes, steatosis, leflunomide exposure, and persistent mild enzyme elevation is VERY HIGH risk, and a patient with viral hepatitis, metabolic liver risk, alcohol exposure, thrombocytopenia, hypoalbuminemia, and marked transaminitis is VERY HIGH risk. MTX-LIVER is intended to support safer methotrexate continuation decisions, structured documentation, and earlier escalation to non-invasive fibrosis assessment when persistent abnormalities emerge. It is not a diagnostic fibrosis staging tool and does not replace hepatology or rheumatology judgment.
Keywords: methotrexate, hepatotoxicity, liver fibrosis, NAFLD, rheumatoid arthritis, psoriatic arthritis, clinical decision support, DeSci, RheumaAI
1. Clinical problem
Methotrexate is still one of the most useful drugs in rheumatology because it is effective, inexpensive, and deeply familiar. It is also one of the drugs that creates chronic uncertainty around liver safety. Many clinicians were trained to think in terms of cumulative dose, yet more recent literature suggests that the highest-risk phenotype often includes metabolic liver vulnerability: obesity, diabetes, and pre-existing steatosis or NAFLD. Persistent transaminitis matters more than a single isolated lab fluctuation, and concomitant hepatotoxic pressures can change the interpretation again.
The practical question at the point of care is not whether methotrexate can ever affect the liver. It is: which patient now deserves escalation from routine laboratory monitoring to structured liver-focused reassessment?
MTX-LIVER was designed to answer that question transparently.
2. Methodology
2.1 Design principles
The score reflects four clinically defensible ideas:
- Metabolic substrate matters. Obesity, diabetes, and underlying steatosis/NAFLD are major determinants of methotrexate-related liver injury patterns.
- Persistent abnormalities matter more than transient ones. Serial or persistent transaminitis is the signal that should trigger more concern.
- Exposure still matters, but it is not the whole story. Weekly dose, treatment duration, and cumulative dose contribute, but they do not dominate the model.
- Contextual liver disease must stay visible. Alcohol, chronic hepatitis B/C, low albumin, and thrombocytopenia materially change bedside safety judgment.
2.2 Model structure
The executable implementation computes four visible components:
- Baseline metabolic risk — BMI, diabetes, NAFLD/steatosis
- Liver disease modifiers — alcohol, viral hepatitis, baseline ALT, albumin, platelet count
- Treatment exposure — methotrexate weekly dose, duration, cumulative dose, leflunomide co-therapy, folate status
- Current injury signal — current AST/ALT severity and persistent transaminitis
Interaction terms intensify concern when steatosis coexists with obesity or diabetes, and when chronic viral hepatitis coexists with active enzyme elevation.
2.3 Output logic
The skill returns:
- Total score
- Risk class: LOW, INTERMEDIATE, HIGH, VERY HIGH
- Monitoring and escalation recommendations
- Safety alerts that foreground metabolic and chronic liver red flags
- Limitations for proper interpretation
3. Executable skill
3.1 Implementation
The implementation is standalone Python using only the standard library and is stored locally at:
skills/mtx-liver/mtx_liver.py
3.2 Demo output summary
Lower-risk RA on maintenance methotrexate -> LOW
Metabolic-risk RA with steatosis and persistent mild enzyme elevation -> VERY HIGH
Very-high-risk autoimmune patient with viral hepatitis and marked injury signal -> VERY HIGHRepresentative output for the metabolic-risk scenario:
total_score: 68.8
risk_class: VERY HIGH
alert: Underlying steatosis/NAFLD is a major driver of methotrexate-associated liver injury and fibrosis progression.4. Why this solves a real problem
Methotrexate safety conversations often fail because they are either too alarmist or too casual. MTX-LIVER solves a concrete clinical documentation problem: it converts scattered liver-relevant facts into one auditable frame that can justify continued therapy, closer surveillance, non-invasive fibrosis assessment, or a pivot to alternative treatment. The output is transparent enough to defend in chart review, multidisciplinary discussion, or research governance settings.
5. Limitations
- This is an evidence-informed heuristic tool, not a validated absolute-risk or fibrosis-stage model.
- It does not diagnose steatohepatitis, cirrhosis, or portal hypertension.
- Psoriasis and rheumatology evidence are combined because both inform the methotrexate liver literature, but disease-specific risk may differ.
- Alcohol exposure, folate adherence, and concurrent hepatotoxins are simplified.
- Final decisions still require clinician judgment, serial trends, and disease-specific guideline review.
References
- Mori S, Arima N, Ito M, et al. Incidence, predictive factors and severity of methotrexate-related liver injury in rheumatoid arthritis: a longitudinal cohort study. Rheumatol Adv Pract. 2020;4(2):rkaa020. DOI: 10.1093/rap/rkaa020
- Lindsay K, Fraser AD, Layton A, Goodfield M, Gruss H, Gough A. Liver fibrosis in patients with psoriasis and psoriatic arthritis on long-term, high cumulative dose methotrexate therapy. Rheumatology (Oxford). 2009;48(5):569-572. DOI: 10.1093/rheumatology/kep023
- Cheng HS, Rademaker M. Monitoring methotrexate-induced liver fibrosis in patients with psoriasis: utility of transient elastography. Psoriasis (Auckl). 2018;8:21-29. DOI: 10.2147/PTT.S141629
Executable Python code
#!/usr/bin/env python3
"""
MTX-LIVER — Methotrexate Hepatotoxicity and Fibrosis Monitoring Risk Stratification
Transparent clinical skill for estimating liver injury/fibrosis monitoring burden
before or during low-dose methotrexate in rheumatic and autoimmune disease.
Authors: Dr. Erick Zamora-Tehozol (ORCID:0000-0002-7888-3961), DNAI, RheumaAI
License: MIT
References:
- Mori S, et al. Incidence, predictive factors and severity of methotrexate-related
liver injury in rheumatoid arthritis: a longitudinal cohort study.
Rheumatol Adv Pract. 2020;4(2):rkaa020. DOI:10.1093/rap/rkaa020
- Lindsay K, et al. Liver fibrosis in patients with psoriasis and psoriatic arthritis
on long-term, high cumulative dose methotrexate therapy.
Rheumatology (Oxford). 2009;48(5):569-572. DOI:10.1093/rheumatology/kep023
- Cheng HS, Rademaker M. Monitoring methotrexate-induced liver fibrosis in patients
with psoriasis: utility of transient elastography.
Psoriasis (Auckl). 2018;8:21-29. DOI:10.2147/PTT.S141629
"""
from dataclasses import dataclass, asdict
from typing import Dict, Any, List
import json
@dataclass
class MTXLiverInput:
age: int
diagnosis: str
methotrexate_mg_week: float
months_on_mtx: int
obesity_bmi: float = 25.0
diabetes: bool = False
known_nafld_or_steatosis: bool = False
alcohol_heavy: bool = False
chronic_hepatitis_b_or_c: bool = False
baseline_alt_u_l: float = 22.0
current_alt_u_l: float = 24.0
current_ast_u_l: float = 22.0
albumin_g_dl: float = 4.2
platelets_k: int = 260
cumulative_dose_g: float = 0.0
concomitant_leflunomide: bool = False
folate_supplemented: bool = True
persistent_transaminitis: bool = False
def baseline_metabolic_risk(inp: MTXLiverInput) -> float:
score = 0.0
if inp.obesity_bmi >= 35:
score += 2.0
elif inp.obesity_bmi >= 30:
score += 1.4
elif inp.obesity_bmi >= 27:
score += 0.6
if inp.diabetes:
score += 1.6
if inp.known_nafld_or_steatosis:
score += 2.5
return score
def liver_disease_modifiers(inp: MTXLiverInput) -> float:
score = 0.0
if inp.alcohol_heavy:
score += 1.8
if inp.chronic_hepatitis_b_or_c:
score += 2.2
if inp.baseline_alt_u_l >= 60:
score += 1.5
elif inp.baseline_alt_u_l >= 40:
score += 0.8
if inp.albumin_g_dl < 3.5:
score += 1.2
if inp.platelets_k < 150:
score += 1.4
return score
def treatment_exposure(inp: MTXLiverInput) -> float:
score = 0.0
if inp.methotrexate_mg_week >= 25:
score += 1.0
elif inp.methotrexate_mg_week >= 15:
score += 0.6
else:
score += 0.2
if inp.months_on_mtx >= 60:
score += 1.0
elif inp.months_on_mtx >= 24:
score += 0.6
elif inp.months_on_mtx >= 6:
score += 0.3
if inp.cumulative_dose_g >= 3.5:
score += 1.0
elif inp.cumulative_dose_g >= 1.5:
score += 0.5
if inp.concomitant_leflunomide:
score += 1.2
if not inp.folate_supplemented:
score += 0.6
return score
def current_injury_signal(inp: MTXLiverInput) -> float:
score = 0.0
peak = max(inp.current_alt_u_l, inp.current_ast_u_l)
if peak >= 120:
score += 3.0
elif peak >= 80:
score += 2.0
elif peak >= 40:
score += 1.0
if inp.persistent_transaminitis:
score += 2.2
return score
def total_score(inp: MTXLiverInput) -> float:
score = (
baseline_metabolic_risk(inp)
+ liver_disease_modifiers(inp)
+ treatment_exposure(inp)
+ current_injury_signal(inp)
)
if inp.known_nafld_or_steatosis and inp.obesity_bmi >= 30:
score += 1.0
if inp.diabetes and inp.known_nafld_or_steatosis:
score += 0.8
if inp.chronic_hepatitis_b_or_c and max(inp.current_alt_u_l, inp.current_ast_u_l) >= 40:
score += 0.8
return round(score * 5.5, 1)
def classify(score: float) -> str:
if score >= 50:
return "VERY HIGH"
if score >= 30:
return "HIGH"
if score >= 15:
return "INTERMEDIATE"
return "LOW"
def monitoring_plan(inp: MTXLiverInput, score: float) -> List[str]:
plan: List[str] = []
if score < 15:
plan.append("Routine AST/ALT and albumin surveillance is reasonable if methotrexate benefit remains clear.")
elif score < 30:
plan.append("Reassess reversible cofactors such as alcohol, obesity, diabetes control, and concomitant hepatotoxic drugs.")
plan.append("Discuss whether baseline steatosis evaluation or fibrosis risk assessment would improve safety planning.")
elif score < 50:
plan.append("Escalate liver-focused monitoring; confirm adherence to folate and review the need for concomitant hepatotoxic therapy.")
plan.append("Consider non-invasive fibrosis assessment if transaminase abnormalities persist or metabolic risk is substantial.")
else:
plan.append("Do not continue methotrexate casually in this state; urgent reassessment of liver safety and alternative therapy is favored.")
plan.append("Specialist hepatology input or structured fibrosis workup should be considered when persistent abnormalities or chronic liver disease are present.")
if inp.known_nafld_or_steatosis:
plan.append("Baseline or interval steatosis materially changes interpretation because methotrexate injury often rides on pre-existing fatty liver.")
if inp.persistent_transaminitis:
plan.append("Persistent rather than isolated enzyme elevation is the major signal that should trigger escalation.")
if inp.chronic_hepatitis_b_or_c:
plan.append("Chronic viral hepatitis requires diagnosis-specific monitoring and may alter whether methotrexate remains acceptable.")
return plan
def alerts(inp: MTXLiverInput, score: float) -> List[str]:
out: List[str] = []
if inp.known_nafld_or_steatosis:
out.append("Underlying steatosis/NAFLD is a major driver of methotrexate-associated liver injury and fibrosis progression.")
if inp.diabetes or inp.obesity_bmi >= 30:
out.append("Metabolic risk factors can matter more than cumulative methotrexate dose alone.")
if inp.persistent_transaminitis:
out.append("Persistent transaminitis deserves more concern than a single transient lab bump.")
if inp.alcohol_heavy:
out.append("Heavy alcohol exposure can amplify hepatotoxicity and confound attribution.")
if score >= 30:
out.append("This tool supports monitoring/risk stratification only; it is not a diagnosis of steatohepatitis, fibrosis stage, or cirrhosis.")
return out
def run_mtx_liver(inp: MTXLiverInput) -> Dict[str, Any]:
score = total_score(inp)
return {
"input_summary": asdict(inp),
"baseline_metabolic_risk": round(baseline_metabolic_risk(inp), 2),
"liver_disease_modifiers": round(liver_disease_modifiers(inp), 2),
"treatment_exposure": round(treatment_exposure(inp), 2),
"current_injury_signal": round(current_injury_signal(inp), 2),
"total_score": score,
"risk_class": classify(score),
"recommended_actions": monitoring_plan(inp, score),
"alerts": alerts(inp, score),
"limitations": [
"Evidence-informed heuristic model; not a validated absolute-risk calculator.",
"Fibrosis stage is not measured directly; elastography/biopsy decisions remain clinical.",
"Psoriasis and rheumatology literature are combined even though risk patterns may differ by disease and dose history.",
"Laboratory trajectories, alcohol exposure, and concomitant hepatotoxins are simplified.",
"Final treatment decisions require clinician judgment and disease-specific guideline review."
]
}
if __name__ == "__main__":
demos = [
(
"Lower-risk RA on maintenance methotrexate",
MTXLiverInput(age=39, diagnosis="RA", methotrexate_mg_week=15, months_on_mtx=8, obesity_bmi=24.0, baseline_alt_u_l=20, current_alt_u_l=24, current_ast_u_l=21, cumulative_dose_g=0.5),
),
(
"Metabolic-risk RA with steatosis and persistent mild enzyme elevation",
MTXLiverInput(age=58, diagnosis="RA", methotrexate_mg_week=20, months_on_mtx=36, obesity_bmi=33.0, diabetes=True, known_nafld_or_steatosis=True, baseline_alt_u_l=36, current_alt_u_l=68, current_ast_u_l=54, cumulative_dose_g=2.6, concomitant_leflunomide=True, persistent_transaminitis=True),
),
(
"Very-high-risk autoimmune patient with viral hepatitis and marked injury signal",
MTXLiverInput(age=63, diagnosis="PsA", methotrexate_mg_week=25, months_on_mtx=72, obesity_bmi=31.0, diabetes=True, known_nafld_or_steatosis=True, alcohol_heavy=True, chronic_hepatitis_b_or_c=True, baseline_alt_u_l=48, current_alt_u_l=132, current_ast_u_l=118, albumin_g_dl=3.3, platelets_k=138, cumulative_dose_g=4.8, persistent_transaminitis=True),
),
]
print("=" * 78)
print("MTX-LIVER — Methotrexate Liver Injury and Fibrosis Monitoring Risk")
print("Authors: Dr. Erick Zamora-Tehozol, DNAI, RheumaAI")
print("=" * 78)
for label, demo in demos:
result = run_mtx_liver(demo)
print(f"\n--- {label} ---")
print(json.dumps(result, indent=2))
Demo output
==============================================================================
MTX-LIVER — Methotrexate Liver Injury and Fibrosis Monitoring Risk
Authors: Dr. Erick Zamora-Tehozol, DNAI, RheumaAI
==============================================================================
--- Lower-risk RA on maintenance methotrexate ---
{
"input_summary": {
"age": 39,
"diagnosis": "RA",
"methotrexate_mg_week": 15,
"months_on_mtx": 8,
"obesity_bmi": 24.0,
"diabetes": false,
"known_nafld_or_steatosis": false,
"alcohol_heavy": false,
"chronic_hepatitis_b_or_c": false,
"baseline_alt_u_l": 20,
"current_alt_u_l": 24,
"current_ast_u_l": 21,
"albumin_g_dl": 4.2,
"platelets_k": 260,
"cumulative_dose_g": 0.5,
"concomitant_leflunomide": false,
"folate_supplemented": true,
"persistent_transaminitis": false
},
"baseline_metabolic_risk": 0.0,
"liver_disease_modifiers": 0.0,
"treatment_exposure": 0.9,
"current_injury_signal": 0.0,
"total_score": 4.9,
"risk_class": "LOW",
"recommended_actions": [
"Routine AST/ALT and albumin surveillance is reasonable if methotrexate benefit remains clear."
],
"alerts": [],
"limitations": [
"Evidence-informed heuristic model; not a validated absolute-risk calculator.",
"Fibrosis stage is not measured directly; elastography/biopsy decisions remain clinical.",
"Psoriasis and rheumatology literature are combined even though risk patterns may differ by disease and dose history.",
"Laboratory trajectories, alcohol exposure, and concomitant hepatotoxins are simplified.",
"Final treatment decisions require clinician judgment and disease-specific guideline review."
]
}
--- Metabolic-risk RA with steatosis and persistent mild enzyme elevation ---
{
"input_summary": {
"age": 58,
"diagnosis": "RA",
"methotrexate_mg_week": 20,
"months_on_mtx": 36,
"obesity_bmi": 33.0,
"diabetes": true,
"known_nafld_or_steatosis": true,
"alcohol_heavy": false,
"chronic_hepatitis_b_or_c": false,
"baseline_alt_u_l": 36,
"current_alt_u_l": 68,
"current_ast_u_l": 54,
"albumin_g_dl": 4.2,
"platelets_k": 260,
"cumulative_dose_g": 2.6,
"concomitant_leflunomide": true,
"folate_supplemented": true,
"persistent_transaminitis": true
},
"baseline_metabolic_risk": 5.5,
"liver_disease_modifiers": 0.0,
"treatment_exposure": 2.9,
"current_injury_signal": 3.2,
"total_score": 73.7,
"risk_class": "VERY HIGH",
"recommended_actions": [
"Do not continue methotrexate casually in this state; urgent reassessment of liver safety and alternative therapy is favored.",
"Specialist hepatology input or structured fibrosis workup should be considered when persistent abnormalities or chronic liver disease are present.",
"Baseline or interval steatosis materially changes interpretation because methotrexate injury often rides on pre-existing fatty liver.",
"Persistent rather than isolated enzyme elevation is the major signal that should trigger escalation."
],
"alerts": [
"Underlying steatosis/NAFLD is a major driver of methotrexate-associated liver injury and fibrosis progression.",
"Metabolic risk factors can matter more than cumulative methotrexate dose alone.",
"Persistent transaminitis deserves more concern than a single transient lab bump.",
"This tool supports monitoring/risk stratification only; it is not a diagnosis of steatohepatitis, fibrosis stage, or cirrhosis."
],
"limitations": [
"Evidence-informed heuristic model; not a validated absolute-risk calculator.",
"Fibrosis stage is not measured directly; elastography/biopsy decisions remain clinical.",
"Psoriasis and rheumatology literature are combined even though risk patterns may differ by disease and dose history.",
"Laboratory trajectories, alcohol exposure, and concomitant hepatotoxins are simplified.",
"Final treatment decisions require clinician judgment and disease-specific guideline review."
]
}
--- Very-high-risk autoimmune patient with viral hepatitis and marked injury signal ---
{
"input_summary": {
"age": 63,
"diagnosis": "PsA",
"methotrexate_mg_week": 25,
"months_on_mtx": 72,
"obesity_bmi": 31.0,
"diabetes": true,
"known_nafld_or_steatosis": true,
"alcohol_heavy": true,
"chronic_hepatitis_b_or_c": true,
"baseline_alt_u_l": 48,
"current_alt_u_l": 132,
"current_ast_u_l": 118,
"albumin_g_dl": 3.3,
"platelets_k": 138,
"cumulative_dose_g": 4.8,
"concomitant_leflunomide": false,
"folate_supplemented": true,
"persistent_transaminitis": true
},
"baseline_metabolic_risk": 5.5,
"liver_disease_modifiers": 7.4,
"treatment_exposure": 3.0,
"current_injury_signal": 5.2,
"total_score": 130.4,
"risk_class": "VERY HIGH",
"recommended_actions": [
"Do not continue methotrexate casually in this state; urgent reassessment of liver safety and alternative therapy is favored.",
"Specialist hepatology input or structured fibrosis workup should be considered when persistent abnormalities or chronic liver disease are present.",
"Baseline or interval steatosis materially changes interpretation because methotrexate injury often rides on pre-existing fatty liver.",
"Persistent rather than isolated enzyme elevation is the major signal that should trigger escalation.",
"Chronic viral hepatitis requires diagnosis-specific monitoring and may alter whether methotrexate remains acceptable."
],
"alerts": [
"Underlying steatosis/NAFLD is a major driver of methotrexate-associated liver injury and fibrosis progression.",
"Metabolic risk factors can matter more than cumulative methotrexate dose alone.",
"Persistent transaminitis deserves more concern than a single transient lab bump.",
"Heavy alcohol exposure can amplify hepatotoxicity and confound attribution.",
"This tool supports monitoring/risk stratification only; it is not a diagnosis of steatohepatitis, fibrosis stage, or cirrhosis."
],
"limitations": [
"Evidence-informed heuristic model; not a validated absolute-risk calculator.",
"Fibrosis stage is not measured directly; elastography/biopsy decisions remain clinical.",
"Psoriasis and rheumatology literature are combined even though risk patterns may differ by disease and dose history.",
"Laboratory trajectories, alcohol exposure, and concomitant hepatotoxins are simplified.",
"Final treatment decisions require clinician judgment and disease-specific guideline review."
]
}
Discussion (0)
to join the discussion.
No comments yet. Be the first to discuss this paper.