This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How do I retrieve bacterial isolation source from NCBI Entrez Direct for a list of RefSeq IDs?

How can I retrieve the isolation source for a list of nucleotide RefSeq IDs?

NR_178603.1 NR_116748.1

I saw the solution posted here but I'm not sure how to apply this to the nucleotide database.

refseq ncbi

1 answer

Here is one solution, you can see the fields separated by | :

$ esearch -db nuccore -query NR_178603 | esummary | xtract -pattern DocumentSummary -tab "\n" -element SubType,SubName | tr "\t" "\n"
strain|old_name|type_material|country|isolation_source|identified_by
B2|Janthinobacterium sp. B2|type strain of Massilia violaceinigra|China|soil sample|Haisheng Wang 

$ esearch -db nuccore -query NR_116748 | esummary | xtract -pattern DocumentSummary -tab "\n" -element SubType,SubName | tr "\t" "\n"
strain|culture_collection|old_name|type_material
LMG 5343|LMG:5343|Pantoea sp. LMG 5343|type strain of Pantoea brenneri

Thank you!! Does Entrez have a way to batch-submit a list of IDs instead of one at a time? Or would that be best accomplished with a for loop?

for loop would work but you can also use epost method with a file containing the accession numbers (one per line, test in example below). Be sure to sign up for NCBI API Key if you have a lot of them.

$ epost -db nuccore -format acc -input test |esummary | xtract -pattern DocumentSummary -tab "\n" -element SubType,SubName | tr "\t" "\n"
strain|old_name|type_material|country|isolation_source|identified_by
B2|Janthinobacterium sp. B2|type strain of Massilia violaceinigra|China|soil sample|Haisheng Wang
strain|culture_collection|old_name|type_material
LMG 5343|LMG:5343|Pantoea sp. LMG 5343|type strain of Pantoea brenneri

Log in to answer this question.