Command Palette

Search for a command to run...

Back to skills
skill № 66917

bio-reporting-publication-tables

Builds publication-ready tables - descriptive Table 1, regression and differential-expression result tables, and supplementary tables - with gtsummary, gt…

FreeRuns bundled scripts
lilinjiby lilinji★ 18 GitHub stars

Install bio-reporting-publication-tables in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Version Compatibility

Reference examples tested with: gtsummary 2.0+, gt 0.10+, flextable 0.9+, kableExtra 1.4+, great_tables 0.13+, pandas 2.2+, tableone 0.9+, openpyxl 3.1+

Before using code patterns, verify installed versions match. If versions differ:

  • R: packageVersion('gtsummary') then ?tbl_summary (gtsummary had a major API refresh at v2.0)
  • Python: pip show great_tables then help(great_tables.GT.save)

If code throws an error, introspect the installed package and adapt the example to the actual API rather than retrying.

Publication-Ready Tables

"Make my Table 1" / "export this results table for the paper" -> Generate the table programmatically with the right statistics and export it to the journal's target format.

  • R: gtsummary::tbl_summary(data, by=arm) then as_flex_table() -> Word
  • Python: great_tables.GT(df) -> HTML/PNG; tableone.TableOne(...) for a descriptive table

The Load-Bearing Idea: A Table Is Structure + Precision + the Right Statistics

Three orthogonal concerns, and conflating them is where tables go wrong:

  • Structure - rows are units (subjects, genes, models), columns are variables/groups, spanners group columns, footnotes/source-notes carry the apparatus. This is the grammar of tables that gt, great_tables, and flextable all encode.
  • Precision - report to MEANINGFUL precision, not the float default. P-values to 2-3 significant figures or "<0.001"; estimates to the precision the CI supports; percentages to 0-1 decimal. A 3.14159265 mean is noise.
  • The right statistics - a table is DESCRIPTIVE (summarize the sample: n(%), mean(SD) or median(IQR)) or INFERENTIAL (estimate + CI + test statistic, with the effect size primary and the p-value never alone). Declare which.

The deepest framing, shared with figures: a table is a deterministic function of data + code. Same input + same code -> the same table, byte for byte. Manual edits in Word break this; every number must trace to a line of code. That principle dictates the tooling - generate programmatically and never hand-edit the output.

Tool Decision (by language and target format)

Target format dominates: Word for most biomedical journals, LaTeX for some genomics/physics venues, HTML for web/preprints/Quarto, CSV/Excel for machine-readable supplements.

Need Tool Path
R, descriptive Table 1 or regression results gtsummary tbl_summary / tbl_regression -> as_flex_table() / as_gt()
R, going to Word/PowerPoint flextable save_as_docx() (most reliable Word fidelity; pairs with officer)
R, going to LaTeX/PDF gt or kableExtra gtsave('x.tex') / kbl(format='latex')
R, going to HTML/Quarto gt or kableExtra as_raw_html() / save_kable()
Python, display HTML/image great_tables GT(df) -> save('x.png') / as_raw_html()
Python, going to LaTeX pandas Styler df.style.format(...).to_latex() (pandas 1.3+)
Either, classic Table 1 with SMD tableone CreateTableOne (R) / TableOne (Python)
Machine-readable supplement CSV (preferred) or Excel gene-symbol-safe export (below)

gt has the broadest R export (HTML/PNG/PDF/RTF/LaTeX/Word). great_tables.save() is image+PDF only (HTML via as_raw_html()/write_raw_html()) - NO native Word or LaTeX, a real limitation vs the R stack. DT is for interactive exploration and online-only/interactive HTML supplements - never for a static print/PDF table.

Table 1 Is Descriptive, Not Inferential

Table 1 reports baseline characteristics so the reader can judge who was studied and how comparable the groups are. It describes the sample; it is not a place to test hypotheses.

The p-value fallacy (randomized trials): adding a p-value column comparing arms in a randomized trial is discouraged by CONSORT and statisticians. In a properly randomized trial any baseline imbalance is by definition due to chance, so the test asks whether a difference could have arisen by chance when the assignment WAS by chance - it tests a null already known true. A "significant" baseline p-value is a Type I error by construction; a non-significant one tells nothing new. The right response to a worrying imbalance on a prognostic covariate is to adjust for it (pre-specified ANCOVA covariate), not test it (Senn 1994; CONSORT 2010 item 15). gtsummary's documentation cautions against add_p() on a randomized Table 1 for this reason.

  • Randomized Table 1: no p-value column. To convey balance, use standardized mean differences (SMD) - they describe the magnitude of imbalance (|SMD| > 0.1 is a common "notable" rule of thumb) without the inferential fallacy. If a journal or regulator nonetheless requires a baseline comparison column, report it but interpret per Senn: a "significant" baseline difference in a properly randomized trial is a Type I error, not evidence of confounding. Note add_difference() compares exac
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • examples/gene_table_export.py
  • examples/table1_gtsummary.R
  • usage-guide.md

FAQ

What does the bio-reporting-publication-tables skill do?

Builds publication-ready tables - descriptive Table 1, regression and differential-expression result tables, and supplementary tables - with gtsummary, gt, flextable, and kableExtra (R) or great_tables, pandas, and tableone (Python), choosing the right statistics and the right export format. Use when making a Table 1, exporting a formatted results table for a paper, or writing a gene-symbol-safe supplementary table.

How do I install the bio-reporting-publication-tables skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the bio-reporting-publication-tables skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare bio-reporting-publication-tables with