pmc2info
Use when converting PubMed Central article XML into normalized PMCInfo XML for local archive building or section-aware downstream parsing.
SKILL.md.claude/skills/pmc2info/SKILL.md
GitHubpmc2info
EDirect shell pipeline that converts PMC <article> XML into a normalized PMCInfo XML record set. It extracts citation metadata, title, abstract, authors, license text, and section passages, then normalizes common section titles such as introduction, results, and methods.
Quick Start
- Command:
pmc2info - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/pmc2info - Environment prerequisite: add
/home/vimalinx/miniforge3/envs/bio/bintoPATHsoxtract,transmute, and related EDirect helpers are available
When To Use This Tool
- Convert PMC full-text XML into
PMCInfoXML for archive or indexing workflows. - Extract normalized article metadata and sectioned text from PMC articles.
- Process PMC XML fetched by
efetch -db pmc -format xmlor extracted from open-access tar archives. - Use this when you need PMC full text; do not use it for PubMed
PubmedArticleXML.
Common Patterns
# 1) Convert one PMC article fetched live from NCBI
export PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH
efetch -db pmc -id 6260607 -format xml | pmc2info > article.pmcinfo.xml
# 2) Convert PMC article XML streamed from an OA archive tarball
export PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH
tar -xOzf oa_bundle.tar.gz --to-stdout | pmc2info > batch.pmcinfo.xml
# 3) Inspect the first part of the normalized PMCInfo output
export PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH
efetch -db pmc -id 6260607 -format xml | pmc2info | sed -n '1,40p'
Recommended Workflow
- Start from PMC article XML, either via
efetch -db pmc -format xmlor an extracted OA archive payload. - Activate the bio environment or export the EDirect bin directory into
PATHbefore invoking the wrapper. - Inspect one converted article first to verify the expected
PMCInfostructure, citation block, and normalized passage labels. - Scale to bulk conversion only after confirming the section mapping and output schema meet your downstream parser's expectations.
Guardrails
- There is no real help mode. With dependencies available,
pmc2info -helpstill runs the pipeline and errors only because no XML input was supplied. - Without the bio bin directory on
PATH, the live failure is a series ofxtract: command not foundandtransmute: command not foundmessages. - With dependencies available but no XML input, the live failure is
No data supplied to xtract from stdin or file. - This script expects PMC
<article>XML, not PubMedPubmedArticleor DocumentSummary XML. - Section normalization is driven by an internal title map for common headings such as
introduction,results,discussion,materials and methods, andstatistical analysis. Unmapped headings pass through less cleanly.