pmc2info
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/bin to PATH so xtract, transmute, and related EDirect helpers are available
When To Use This Tool
- Convert PMC full-text XML into
PMCInfo XML for archive or indexing workflows.
- Extract normalized article metadata and sectioned text from PMC articles.
- Process PMC XML fetched by
efetch -db pmc -format xml or extracted from open-access tar archives.
- Use this when you need PMC full text; do not use it for PubMed
PubmedArticle XML.
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 xml or an extracted OA archive payload.
- Activate the bio environment or export the EDirect bin directory into
PATH before invoking the wrapper.
- Inspect one converted article first to verify the expected
PMCInfo structure, 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 -help still 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 of xtract: command not found and transmute: command not found messages.
- 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 PubMed PubmedArticle or DocumentSummary XML.
- Section normalization is driven by an internal title map for common headings such as
introduction, results, discussion, materials and methods, and statistical analysis. Unmapped headings pass through less cleanly.
1---2name: pmc2info3description: Use when converting PubMed Central article XML into normalized PMCInfo XML for local archive building or section-aware downstream parsing.4---5
6# pmc2info
7
8EDirect 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.
9
10## Quick Start
11
12- **Command:** `pmc2info`
13- **Local executable:** `/home/vimalinx/miniforge3/envs/bio/bin/pmc2info`
14- **Environment prerequisite:** add `/home/vimalinx/miniforge3/envs/bio/bin` to `PATH` so `xtract`, `transmute`, and related EDirect helpers are available
15
16## When To Use This Tool
17
18- Convert PMC full-text XML into `PMCInfo` XML for archive or indexing workflows.
19- Extract normalized article metadata and sectioned text from PMC articles.
20- Process PMC XML fetched by `efetch -db pmc -format xml` or extracted from open-access tar archives.
21- Use this when you need PMC full text; do not use it for PubMed `PubmedArticle` XML.
22
23## Common Patterns
24
25```bash
26# 1) Convert one PMC article fetched live from NCBI
27export PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH
28
29efetch -db pmc -id 6260607 -format xml | pmc2info > article.pmcinfo.xml
30```
31
32```bash
33# 2) Convert PMC article XML streamed from an OA archive tarball
34export PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH
35
36tar -xOzf oa_bundle.tar.gz --to-stdout | pmc2info > batch.pmcinfo.xml
37```
38
39```bash
40# 3) Inspect the first part of the normalized PMCInfo output
41export PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH
42
43efetch -db pmc -id 6260607 -format xml | pmc2info | sed -n '1,40p'
44```
45
46## Recommended Workflow
47
481. Start from PMC article XML, either via `efetch -db pmc -format xml` or an extracted OA archive payload.
492. Activate the bio environment or export the EDirect bin directory into `PATH` before invoking the wrapper.
503. Inspect one converted article first to verify the expected `PMCInfo` structure, citation block, and normalized passage labels.
514. Scale to bulk conversion only after confirming the section mapping and output schema meet your downstream parser's expectations.
52
53## Guardrails
54
55- There is no real help mode. With dependencies available, `pmc2info -help` still runs the pipeline and errors only because no XML input was supplied.
56- Without the bio bin directory on `PATH`, the live failure is a series of `xtract: command not found` and `transmute: command not found` messages.
57- With dependencies available but no XML input, the live failure is `No data supplied to xtract from stdin or file`.
58- This script expects PMC `<article>` XML, not PubMed `PubmedArticle` or DocumentSummary XML.
59- Section normalization is driven by an internal title map for common headings such as `introduction`, `results`, `discussion`, `materials and methods`, and `statistical analysis`. Unmapped headings pass through less cleanly.