Extract NCBI's refseq assembly accession number from nuccore IDs
I have a list of nuccore IDs in a text file (let's call it file.txt), and want to append the NCBI's refseq assembly accession number next to the nuccore ID, such as this
I've tried with the following command, but only the NCBI's refseq assembly accession number shows up
for file in $(cat file.txt) ; do esearch -db nuccore -query "$file" | elink -db assembly -target assembly | esummary | xtract -pattern DocumentSummary -element Caption,AssemblyAccession,BioSample >> GCFs_nucl_accessions.txt; done
Can you help me out? Thanks!
• 94 views