Skip to content

Add optional authentication for qblast, and email and tool variables. - #4149

Merged
mdehoon merged 3 commits into
biopython:masterfrom
mdehoon:qblast_authentication
Nov 11, 2022
Merged

mdehoon merged 3 commits into
biopython:masterfrom
mdehoon:qblast_authentication

Conversation

@mdehoon

@mdehoon mdehoon commented Nov 3, 2022

Copy link
Copy Markdown
Contributor

This PR adds tool and email variables to Bio.Blast.NCBIWWW, and optional username and password arguments to qblast. This PR supersedes #2866 and #1819, but is simpler as we only need to consider python3 now.

  • 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, have run pre-commit
    locally, and understand that continuous integration checks will be used to
    confirm the Biopython unit tests and 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.)

@MarkusPiotrowski

Copy link
Copy Markdown
Contributor

@mdehoon @sorsaffari @peterjc Has anyone of you access to an AWS instance for testing this?

@mdehoon

mdehoon commented Nov 3, 2022

Copy link
Copy Markdown
Contributor Author

Has anyone of you access to an AWS instance for testing this?

I don't.

@peterjc

peterjc commented Nov 5, 2022

Copy link
Copy Markdown
Member

Does the (old) code follow those (newly added to the docstring) usage guidelines?

@MarkusPiotrowski

Copy link
Copy Markdown
Contributor

@peterjc These rules are in the code as comments, for a long time. But more than controlling the polling (which is done in the code, only once in a minute), we cannot do much more, can we?

@peterjc

peterjc commented Nov 7, 2022

Copy link
Copy Markdown
Member

Good - I recall the same for the Entrez limits, those trivial to implement in code we do so, but best the user is aware too (e.g. for multiple instances/jobs).

@mdehoon

mdehoon commented Nov 9, 2022

Copy link
Copy Markdown
Contributor Author

Can I proceed and merge this?

@MarkusPiotrowski

Copy link
Copy Markdown
Contributor

I think I left some comments, didn't you see them?

@peterjc

peterjc commented Nov 11, 2022

Copy link
Copy Markdown
Member

@MarkusPiotrowski I don't see any comments other than a reply to my query. Might you still have an open browser tab waiting to post?

Comment thread Bio/Blast/NCBIWWW.py Outdated
megablast=None,
template_type=None,
template_length=None,
username=None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

According to https://ncbi.github.io/blast-cloud/usage/authentication.html , username is always 'blast'. So default to 'blast' here and below only check for password?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, thanks

Comment thread Bio/Blast/NCBIWWW.py

if url_base == NCBI_BLAST_URL:
parameters.update({"email": email, "tool": tool})
parameters = {key: value for key, value in parameters.items() if value is not None}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason for switching to dics instead of lists as before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It allows me to use

parameters = {key: value for key, value in parameters.items() if value is not None}

on line 248, which I found more readable than what we had before:

query = [x for x in parameters if x[1] is not None]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a matter of taste then, fine.

@MarkusPiotrowski

Copy link
Copy Markdown
Contributor

Sorry, obviously I forgot to press "submit", but I could see the comments....

@MarkusPiotrowski

Copy link
Copy Markdown
Contributor

Except the fact that we couldn't really test this on an AWS instance, I'm fine with this. Again, sorry for the delay, but it wasn't very obvious to me that you couldn't see my comments.

@mdehoon

mdehoon commented Nov 11, 2022

Copy link
Copy Markdown
Contributor Author

@MarkusPiotrowski No problem at all. Thanks for checking the PR in detail.

@mdehoon
mdehoon merged commit 1201ea2 into biopython:master Nov 11, 2022
@mdehoon
mdehoon deleted the qblast_authentication branch November 11, 2022 14:41
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.

3 participants