Answers.Body: <p>This is easy. If you set</p>
  <pre><code>expect=1000,
  </code></pre>
  <p>to</p>
  <pre><code>expect=100,
  </code></pre>
  <p>It will work. NCBI servers impose a tighter restriction on the CLI whilst the web restriction is 5000.</p>
  <p>If you require a <code>1000</code> restriction then out of (US) hours blasting is required, e.g. weekends.</p>
  <hr />
  <p>The Perl Blast API is here
  <a href="https://blast.ncbi.nlm.nih.gov/docs/web_blast.pl" rel="nofollow noreferrer">https://blast.ncbi.nlm.nih.gov/docs/web_blast.pl</a></p>
  <p>The documentation is here <a href="https://ncbi.github.io/blast-cloud/dev/api.html" rel="nofollow noreferrer">https://ncbi.github.io/blast-cloud/dev/api.html</a></p>
  <p>Normally you need to modify it, that would be a separate question. This will work in default mode.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-01T17:40:36.633Z
Answers.Text: I will try this straight away, I am curious if that was documented anywhere though? as I didn't recall any mention of that in the doc of NCBIWWW's function (could have missed it).
Answers.UserDisplayName: Bas Jansen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-01T18:03:05.993Z
Answers.Text: This would also mean that the short_query parameter can only be run on the weekends, as it sets expect to a 1000 *ponder*.
Answers.UserDisplayName: Bas Jansen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-01T18:16:47.260Z
Answers.Text: I have raised the issue. If this doesn't work there is a direct Perl API that definitely works for 100.
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-01T18:29:52.580Z
Answers.Text: I am still waiting for a response of the snippet, for well over 10 minutes, as such I can't say if it is working, yet.
Answers.UserDisplayName: Bas Jansen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-02T16:16:43.057Z
Answers.Text: @BasJansen the Perl Api is at the web address posted above.
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-02T19:48:06.657Z
Answers.Text: Much appreciated, the expect was indeed the issue it seems.
Answers.UserDisplayName: Bas Jansen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-02T20:06:16.440Z
Answers.Text: Many thanks, glad its worked
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-01T17:29:59.197Z
Answers.LastActivityDate: 2023-11-02T16:16:06.957Z
Answers.LastEditDate: 2023-11-02T16:16:06.957Z
Answers.UserDisplayName: M__
Body: <p>I am trying to create a simple pipeline that takes a file containing various short sequences, and run them through blast. I have an example sequence;</p>
  <pre><code>&gt;some_random_sequence
  AAGGTTCGGTCCAAATTGAA
  </code></pre>
  <p>which returns a hit for FUT3 (using the RefSeq_Gene DB and using grch38 as an entrez_query). However, when I try to run this using NCBIWWW (Biopython) I don't get any results and I would like to figure out why.</p>
  <p>A snippet that contains the call that I am using, is listed here;</p>
  <pre class="lang-py prettyprint-override"><code>from Bio.Blast import NCBIWWW
  from io import StringIO
  
  sequence=['&gt;some_random_sequence\n','AAGGTTCGGTCCAAATTGAA']
  
  lines = &quot;&quot;.join(sequence)
  file = StringIO(lines)
  results = NCBIWWW.qblast(
      program=&quot;blastn&quot;,
      database=&quot;RefSeq_Gene&quot;,
      entrez_query=&quot;grch38&quot;,
      sequence=file.read(),
      # Manually setting the parameters because short_query checks the length
      # of the sequence, but for some reason includes the name (resulting in
      # a length of 42, and thus defeating the entire purpose of using
      # short_query (which does a if len(sequence) &lt; 31).
      expect=1000,
      word_size=7,
      nucl_reward=1,
      filter=None,
      lcase_mask=None,
      # short_query=True,
  )
  with open('test_output.xml', 'w') as save_file:
      blast_results = results.read()
      save_file.write(blast_results)
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-11-03T03:52:10.350Z
Comments.Text: This seems like it might be an [XY problem](https://en.wikipedia.org/wiki/XY_problem). Could you please add some more context around the question that you're asking? What are you trying to do with BLAST? What do you plan to do with the BLAST results once you see them?
Comments.UserDisplayName: gringer
Tags: <blast><biopython>
Title: Blastn through NCBIWWW not giving any results, as opposed to the online BLAST
ThreadText: # Blastn through NCBIWWW not giving any results, as opposed to the online BLAST
  
  (Asked by: username_0 on 2023-11-01)
  
  I am trying to create a simple pipeline that takes a file containing various short sequences, and run them through blast. I have an example sequence;
  
  ```
  >some_random_sequence
  AAGGTTCGGTCCAAATTGAA
  
  ```
  
  which returns a hit for FUT3 (using the RefSeq\_Gene DB and using grch38 as an entrez\_query). However, when I try to run this using NCBIWWW (Biopython) I don't get any results and I would like to figure out why.
  
  A snippet that contains the call that I am using, is listed here;
  
  ```py
  from Bio.Blast import NCBIWWW
  from io import StringIO
  
  sequence=['>some_random_sequence\n','AAGGTTCGGTCCAAATTGAA']
  
  lines = "".join(sequence)
  file = StringIO(lines)
  results = NCBIWWW.qblast(
      program="blastn",
      database="RefSeq_Gene",
      entrez_query="grch38",
      sequence=file.read(),
      # Manually setting the parameters because short_query checks the length
      # of the sequence, but for some reason includes the name (resulting in
      # a length of 42, and thus defeating the entire purpose of using
      # short_query (which does a if len(sequence) < 31).
      expect=1000,
      word_size=7,
      nucl_reward=1,
      filter=None,
      lcase_mask=None,
      # short_query=True,
  )
  with open('test_output.xml', 'w') as save_file:
      blast_results = results.read()
      save_file.write(blast_results)
  
  ```
  
  **Tags:** blast, biopython
  
  > **Comments:**
  > **username_1**: This seems like it might be an [XY problem](https://en.wikipedia.org/wiki/XY_problem). Could you please add some more context around the question that you're asking? What are you trying to do with BLAST? What do you plan to do with the BLAST results once you see them?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2023-11-01. Score: 2 | Accepted answer
  
  This is easy. If you set
  
  ```
  expect=1000,
  
  ```
  
  to
  
  ```
  expect=100,
  
  ```
  
  It will work. NCBI servers impose a tighter restriction on the CLI whilst the web restriction is 5000.
  
  If you require a `1000` restriction then out of (US) hours blasting is required, e.g. weekends.
  
  ---
  
  The Perl Blast API is here
  <https://blast.ncbi.nlm.nih.gov/docs/web_blast.pl>
  
  The documentation is here <https://ncbi.github.io/blast-cloud/dev/api.html>
  
  Normally you need to modify it, that would be a separate question. This will work in default mode.
  
  > **Comments:**
  > **username_0**: I will try this straight away, I am curious if that was documented anywhere though? as I didn't recall any mention of that in the doc of NCBIWWW's function (could have missed it).  
  > **username_0**: This would also mean that the short_query parameter can only be run on the weekends, as it sets expect to a 1000 *ponder*.  
  > **username_2**: I have raised the issue. If this doesn't work there is a direct Perl API that definitely works for 100.  
  > **username_0**: I am still waiting for a response of the snippet, for well over 10 minutes, as such I can't say if it is working, yet.  
  > **username_2**: @username_0 the Perl Api is at the web address posted above.  
  > **username_0**: Much appreciated, the expect was indeed the issue it seems.  
  > **username_2**: Many thanks, glad its worked  
  
  ---
  
  