Answers.Body: <p>If I put the species name in quotes, I get expected (by me) output:</p>
  <pre><code>% esearch -db nucleotide -query &quot;aminoacyl-tRNA\ hydrolase&quot; | efilter -organism &quot;Neisseria meningitidis&quot; | efetch -format fasta
  # outputs:
  &gt;NZ_JWNU01000010.1 Neisseria meningitidis strain Nm440716 Scaffold10, whole genome shotgun sequence
  GACCGCCTATTCGCTTGCCGCCGGCGGCCCCATCATGCAGGCAGGATTACACGCCTTCACACTCGTACCC
  # [snip, tons of output]
  </code></pre>
  <p>Note that filtering down to only <em>N. meningitidis</em> still leaves all of the different sequenced accessions of this species, such that you will still have a lot of different annotated copies of this gene. You will need to filter more specifically to reduce that.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-06T10:19:20.047Z
Answers.Text: This was helpful, thank you! What would you suggest I use as identifier to filter more specifically? I tried substituting "aminoacyl-tRNA\ hydrolase" with gene-ID (61281026) but that doesn't seem to work.
Answers.UserDisplayName: Vjon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-06T20:01:57.450Z
Answers.Text: @Vjon I would suggest trying an [NCBI taxid](https://www.ncbi.nlm.nih.gov/Taxonomy/TaxIdentifier/tax_identifier.cgi) in place of the species name.
Answers.UserDisplayName: Maximilian Press
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-05T21:31:48.227Z
Answers.LastActivityDate: 2022-12-05T21:31:48.227Z
Answers.UserDisplayName: Maximilian Press
Body: <p>I'm pretty new in bioinformatics.</p>
  <p>I need to download FASTA sequences of several genes. The list of genes I have assembled consists of 140 genes, so I'd rather do this through via code than download each gene manually from the NCBI database.</p>
  <p>The genes belong to 2 different organisms (bacteria) I have chosen, most of them are found in both organisms and some are specific to one or the other bacterium.</p>
  <p>I've tried running this code which I found here: <a href="https://www.ncbi.nlm.nih.gov/books/NBK179288/" rel="nofollow noreferrer">https://www.ncbi.nlm.nih.gov/books/NBK179288/</a></p>
  <pre><code>esearch -db nucleotide -query &quot;aminoacyl-tRNA\ hydrolase&quot; | efetch -format fasta
  </code></pre>
  <p>The gene of interest being aminoacyl-tRNA hydrolase here. But I don't know how to filter it for the specific organism, Neisseria meningitidis. Tried running this, without luck:</p>
  <pre><code>esearch -db nucleotide -query &quot;aminoacyl-tRNA\ hydrolase&quot; | efilter -organism [Neisseria meningitidis] | efetch -format fasta
  </code></pre>
  <p>Appreciate any help :)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-04T23:40:51.977Z
Comments.Text: Hi how does the list of 140 gene you are interested in look like? do you have gene accessions, or Ids or just gene symbols?, ie symbol: BRCA1 ; id : 
      672 ; accsession NC_000017.11 , are all the same gene.
Comments.UserDisplayName: user12256545
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-05T06:36:59.303Z
Comments.Text: what output do you get from your commands? nothing, an error, the wrong gene?
Comments.UserDisplayName: Maximilian Press
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-05T09:51:27.340Z
Comments.Text: Yes, please [edit] your question and add a few lines of your input file. Presumably, you have a list of genes, so please show us the list so we can understand the input format.
Comments.UserDisplayName: terdon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-06T09:34:52.077Z
Comments.Text: @user12256545 Right now I have the list on a word-document with locus name and gene-ID (that would be "pth" and 61281026 for aminoacyl-tRNA hydrolase). All genes seem to have the same accession nr. so that won't be useful unfortunately.
Comments.UserDisplayName: Vjon
Tags: <fasta><phylogenetics><data-download><sequence>
Title: Downloading genes from NCBI in fasta format
ThreadText: # Downloading genes from NCBI in fasta format
  
  (Asked by: username_0 on 2022-12-04)
  
  I'm pretty new in bioinformatics.
  
  I need to download FASTA sequences of several genes. The list of genes I have assembled consists of 140 genes, so I'd rather do this through via code than download each gene manually from the NCBI database.
  
  The genes belong to 2 different organisms (bacteria) I have chosen, most of them are found in both organisms and some are specific to one or the other bacterium.
  
  I've tried running this code which I found here: <https://www.ncbi.nlm.nih.gov/books/NBK179288/>
  
  ```
  esearch -db nucleotide -query "aminoacyl-tRNA\ hydrolase" | efetch -format fasta
  
  ```
  
  The gene of interest being aminoacyl-tRNA hydrolase here. But I don't know how to filter it for the specific organism, Neisseria meningitidis. Tried running this, without luck:
  
  ```
  esearch -db nucleotide -query "aminoacyl-tRNA\ hydrolase" | efilter -organism [Neisseria meningitidis] | efetch -format fasta
  
  ```
  
  Appreciate any help :)
  
  **Tags:** fasta, phylogenetics, data-download, sequence
  
  > **Comments:**
  > **username_1**: Hi how does the list of 140 gene you are interested in look like? do you have gene accessions, or Ids or just gene symbols?, ie symbol: BRCA1 ; id :      672 ; accsession NC_000017.11 , are all the same gene.  
  > **username_2**: what output do you get from your commands? nothing, an error, the wrong gene?  
  > **username_3**: Yes, please [edit] your question and add a few lines of your input file. Presumably, you have a list of genes, so please show us the list so we can understand the input format.  
  > **username_0**: @username_1 Right now I have the list on a word-document with locus name and gene-ID (that would be "pth" and 61281026 for aminoacyl-tRNA hydrolase). All genes seem to have the same accession nr. so that won't be useful unfortunately.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-12-05. Score: 2
  
  If I put the species name in quotes, I get expected (by me) output:
  
  ```
  % esearch -db nucleotide -query "aminoacyl-tRNA\ hydrolase" | efilter -organism "Neisseria meningitidis" | efetch -format fasta
  # outputs:
  >NZ_JWNU01000010.1 Neisseria meningitidis strain Nm440716 Scaffold10, whole genome shotgun sequence
  GACCGCCTATTCGCTTGCCGCCGGCGGCCCCATCATGCAGGCAGGATTACACGCCTTCACACTCGTACCC
  # [snip, tons of output]
  
  ```
  
  Note that filtering down to only *N. meningitidis* still leaves all of the different sequenced accessions of this species, such that you will still have a lot of different annotated copies of this gene. You will need to filter more specifically to reduce that.
  
  > **Comments:**
  > **username_0**: This was helpful, thank you! What would you suggest I use as identifier to filter more specifically? I tried substituting "aminoacyl-tRNA\ hydrolase" with gene-ID (61281026) but that doesn't seem to work.  
  > **username_2**: @username_0 I would suggest trying an [NCBI taxid](https://www.ncbi.nlm.nih.gov/Taxonomy/TaxIdentifier/tax_identifier.cgi) in place of the species name.  
  
  ---
  
  