Skip to content

Add optional authentication for qblast - #1819

Closed
sorsaffari wants to merge 5 commits into
biopython:masterfrom
sorsaffari:add-optional-authentication-for-qblast
Closed

sorsaffari wants to merge 5 commits into
biopython:masterfrom
sorsaffari:add-optional-authentication-for-qblast

Conversation

@sorsaffari

Copy link
Copy Markdown

NSBI BLAST on the cloud by default requires authentication.

This pull request allows the developer to pass the username and password as parameters of the qblast() method. The credentials are then used in creating an HTTPBasicAuthHandler that in turn creates and authenticated opener for requests against a BLAST instance on the cloud.

  • I hereby agree to dual licence this and any previous contributions under both
    the Biopython License Agreement AND the BSD 3-Clause License.

  • I have read the CONTRIBUTING.rst file and understand that AppVeyor and
    TravisCI will be used to confirm the Biopython unit tests and flake8 style
    checks pass with these changes.

  • I have added my name to the alphabetical contributors listings in the files
    NEWS.rst and CONTRIB.rst as part of this pull request, am listed
    already, or do not wish to be listed. (This acknowledgement is optional.)

Comment thread Bio/_py3k/__init__.py

# On Python 3 urllib, urllib2, and urlparse were merged:
from urllib.request import urlopen, Request, urlretrieve, urlparse, urlcleanup
from urllib.request import urlopen, Request, urlretrieve, urlparse, urlcleanup, HTTPPasswordMgrWithDefaultRealm, HTTPBasicAuthHandler, build_opener, install_opener

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you import these from on Python 2.7?

@sorsaffari sorsaffari Oct 3, 2018 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peterjc This is day 3 of Python for me, so I do apologise for having overlooked this one.

Looks like urllib2 of Python 2.7 takes a whole different approach in authenticating the request and relies on base64 for encoding the credentials.

Since there is the question of implementation differences, I suppose the check on Python version along with authenticating the request(s), would have to take place in the NCBIWWW.py itself? That would not be clean though 😕

@peterjc

peterjc commented Oct 4, 2018

Copy link
Copy Markdown
Member

We've been lucky so far in Python 2 vs 3 differences, but this has likely been been in part from avoiding new things in Python 3 only. I don't know enough about urllib credentials to have an expert opinion here.

peterjc added a commit to peterjc/biopython that referenced this pull request Jun 5, 2019
Closes issue biopython#1879, part of biopython#898. The original author Jeff Chang
and contributors since as recorded in version control have agreed:

 - Fábio Madeira (@biomadeira)
   biopython#898 (comment)
 - Benjamin Vaisvil (@bvaisvil)
   biopython#1613
 - Carlos Pena (@carlosp420)
   biopython#898 (comment)
 - Chang Soon Ong (@chengsoonong)
   biopython#1879 (comment)
 - Christian Brueffer (@cbrueffer)
   biopython#898 (comment)
 - Brad Chapman (@chapmanb)
   http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html
 - Christiam Camacho (@christiam)
   biopython#898 (comment)
 - Christopher Jenness (@christopherjenness)
   biopython#1535
 - Iddo Friedberg (@idoerg)
   biopython#898 (comment)
 - Jeff Chang (@jefftc)
   biopython#898 (comment)
 - Michiel de Hoon (@mdehoon)
   biopython#898 (comment)
 - Jay Bird (@mxposed)
   biopython#1470 (comment)
 - Peter Cock (@peterjc)
   biopython#898 (comment)
 - Nick Semenkovich (@semenko)
   biopython#898 (comment)
 - Sjoerd de Vries
   biopython#1879 (comment)
 - Soroush Saffari (@sorsaffari)
   biopython#1819
 - Suresh Panneerselvam (@Amrithasuresh)
   biopython#1575
 - Vincent Davis (@vincentdavis)
   biopython#898 (comment)

The one exception is Chris Wroe, who we have not been able to contact,
but their small contribution from Feb 2004 was later deprecated and
removed in 2007.
@peterjc peterjc mentioned this pull request Jun 5, 2019
3 tasks done
peterjc added a commit that referenced this pull request Jun 5, 2019
Closes issue #1879, part of #898. The original author Jeff Chang
and contributors since as recorded in version control have agreed:

 - Fábio Madeira (@biomadeira)
   #898 (comment)
 - Benjamin Vaisvil (@bvaisvil)
   #1613
 - Carlos Pena (@carlosp420)
   #898 (comment)
 - Chang Soon Ong (@chengsoonong)
   #1879 (comment)
 - Christian Brueffer (@cbrueffer)
   #898 (comment)
 - Brad Chapman (@chapmanb)
   http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html
 - Christiam Camacho (@christiam)
   #898 (comment)
 - Christopher Jenness (@christopherjenness)
   #1535
 - Iddo Friedberg (@idoerg)
   #898 (comment)
 - Jeff Chang (@jefftc)
   #898 (comment)
 - Michiel de Hoon (@mdehoon)
   #898 (comment)
 - Jay Bird (@mxposed)
   #1470 (comment)
 - Peter Cock (@peterjc)
   #898 (comment)
 - Nick Semenkovich (@semenko)
   #898 (comment)
 - Sjoerd de Vries
   #1879 (comment)
 - Soroush Saffari (@sorsaffari)
   #1819
 - Suresh Panneerselvam (@Amrithasuresh)
   #1575
 - Vincent Davis (@vincentdavis)
   #898 (comment)

The one exception is Chris Wroe, who we have not been able to contact,
but their small contribution from Feb 2004 was later deprecated and
removed in 2007.
@mdehoon

mdehoon commented Nov 2, 2022

Copy link
Copy Markdown
Contributor

It seems that remote Blast has moved to the cloud, and qblast doesn't exist any more.

This page:

https://ncbi.github.io/blast-cloud/

calls the Blast AMI deprecated and no longer supported, and python test_NCBI_qblast.py has not given me a response.

@MarkusPiotrowski

Copy link
Copy Markdown
Contributor

I think their web api is still working. Takes some time (as usual).
grafik

@mdehoon

mdehoon commented Nov 11, 2022

Copy link
Copy Markdown
Contributor

superseded by #4149

@mdehoon mdehoon closed this Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants