pma2apa
Quick Start
- Command:
efetch -db pubmed -id <PMID> -format xml | pma2apa - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/pma2apa - Primary modes: default one-line citation text,
-xmlfor structured XML,-asciifor accent-normalized output
When To Use This Tool
- Turn PubMed XML records into APA-style citation strings inside shell pipelines.
- Keep an intermediate XML representation of parsed citation fields when downstream
xtractsteps need structure. - Normalize accented characters to ASCII before exporting to plain-text systems.
- Stay inside EDirect tooling after
efetch -format xmlinstead of post-processing citations elsewhere.
Common Patterns
# 1) Default APA citation line, prefixed by PMID
efetch -db pubmed -id 19212835 -format xml | pma2apa
# 2) Keep structured APA XML instead of flattening to one line
efetch -db pubmed -id 19212835 -format xml | pma2apa -xml
# 3) Force accent-normalized ASCII output
efetch -db pubmed -id 19212835 -format xml | pma2apa -ascii
Recommended Workflow
- Fetch
PubmedArticleXML withefetch -db pubmed -format xml. - Decide whether you need flat citation text or the structured XML intermediate.
- Add
-asciionly when the downstream consumer cannot handle accented characters. - Check the emitted title, journal, pages, and DOI fields before storing or reusing the citation.
Guardrails
- The tool reads
PubmedArticleXML from stdin; it does not fetch PubMed records by itself. - There is no built-in
--helpor--version; unknown arguments fail withUnrecognized argument .... - Accepted mode switches are the bare or dashed forms
xml/-xml,apa/-apa, andascii/-ascii. - Default text mode emits a single tab-delimited line that starts with the PMID and then the formatted citation.
-xmlkeeps the<APASet><APAFormat>...</APAFormat></APASet>intermediate instead of flattening to text.- The wrapper depends on EDirect helpers such as
transmuteandxtractbeing available onPATH.