bsmp2info
Quick Start
- Command:
... | bsmp2info - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/bsmp2info - Output: formatted
BioSampleInfoXML
When To Use This Tool
- Extract a compact XML summary from BioSample docsum records.
- Preserve accession, title, link IDs, and harmonized BioSample attributes in a simpler structure.
- Normalize attribute tag names to lowercase before downstream parsing.
- Keep BioSample extraction inside an EDirect XML pipeline.
Common Patterns
# 1) Convert a local BioSample DocumentSummary XML snippet
cat biosample_docsum.xml | bsmp2info
# 2) End-to-end after obtaining BioSample docsum XML
esearch -db biosample -query 'SAMN38051082[ACCN]' |
efetch -format docsum |
bsmp2info
# 3) Pull selected fields from the simplified XML
... | bsmp2info | xtract -pattern BioSampleInfo -element Accession,organism,tissue
Recommended Workflow
- Start from BioSample
DocumentSummaryXML, whether from a local file or an EDirect fetch. - Pipe that XML into
bsmp2infoto collapse it to the key fields you actually need. - Inspect the emitted XML and confirm that expected harmonized attributes are present.
- Continue with
xtractor another XML-aware consumer instead of reparsing the original larger docsum structure.
Guardrails
- The wrapper expects BioSample
DocumentSummaryXML on stdin; it does not accept a bare accession or identifier list. - Only attributes carrying
harmonized_nameare emitted, and their tag names are lowercased. - Multiple
Links/Linkvalues are collapsed into one pipe-delimitedLinkelement such as123|456. - There is no real help or version interface.
- Live BioSample EDirect requests may hit NCBI rate limits, so local fixture-based validation can be more reliable than repeated network probing.