This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Cannot get efetch to download genome - what is wrong?

Hi all,

I am trying to download a genome assembly (Bioproject: PRJEB20069, assembly: GCA_900241095.1) in FASTA format using the Entrez utilities from the command line, but it continues to fail:

efetch -db=nuccore -format=fasta -id=GCA_900241095.1 > output.fa

I have tried varies things (using the BioProject number, getting information using esearch etc.) but nothing seems to work.

Can any of you see what I am doing wrong?

Thank you!

Best wishes, Birgitte

entrez genome efetch fasta

There is no such accession in nuccore:

$ wget  -q -O - "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=nuccore&term=GCA_900241095.1"


https://eutils.ncbi.nlm.nih.gov/eutils/dtd/20060628/esearch.dtd">
<eSearchResult>
  <Count>0</Count>
  <RetMax>0</RetMax>
  <RetStart>0</RetStart>
  <IdList/>
  <TranslationSet/>
  <QueryTranslation>(GCA_900241095.1[All Fields])</QueryTranslation>
  <ErrorList>
    <PhraseNotFound>GCA_900241095.1</PhraseNotFound>
  </ErrorList>
  <WarningList>
    <OutputMessage>No items found.</OutputMessage>
  </WarningList>
</eSearchResult>

3 answers

You may want to try this too

esearch -db bioproject -query "PRJEB20069" \
  | elink -target assembly \
  | efetch -format docsum \
  | xtract -pattern DocumentSummary -element FtpPath_GenBank \
  | xargs -n 1 sh -c 'wget "$0"/*fna.gz'

This is perfect! Thank you'!

That's some serious ncbi-fu stuff. I've just break it into several lines just to make it more readable.

You are right! Thanks!

I think I found a way to download it using:

esearch -db bioproject -query "PRJEB20069" | elink -target nuccore| efetch -format fasta > output.fa

I think you are downloading more than just the assembly. To download only the assembly scaffolds:

esearch -db nucleotide -query "LS041563[PACC]:LS041565[PACC]" \
  | efetch -format fasta

You are right! Thank you for noticing that! :)

Log in to answer this question.