Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.05 KB

README.md

File metadata and controls

32 lines (23 loc) · 1.05 KB

bs2csv

Description

Python script to extract metadata for a list of given BioSample ids from the NCBI BioSample database. Data is extracted from XML files and output to a CSV.

Note

CSV output works best when comparing metadata from different BioSamples in the same BioProject as the tag names in the XML will be consistent. Comparing runs from different BioProjects can result in a messy CSV output.

Local Usage

Setup

# [optional] create/load virtualenv
pip install -r requirements.txt

Example usage

python bs2csv.py input_ids.txt 
  • input_ids.txt is a text file containing new line separated NCBI BioSample accession ids

Example usage with flags

python bs2csv.py input_ids.txt  -o metadata_output.csv -v values.txt
  • metadata_output.csv is the name of the desired output file. Defaults to biosample_metadata.csv
  • values.txt is a text file containing new line separated values that are used when extracting metadata
    • only the information from tags found in values.txt will be stored in the output