Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with compress in uniprot search. #249

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

ArnaudBelcour
Copy link
Contributor

Hi,

I was trying to download compressed fasta from UniProt using bioservices search. But this function did not return compressed result, instead it returns an uncompressed fasta string.

An example:

import bioservices
uniprot_bioservices = bioservices.UniProt(verbose=False)
data = uniprot_bioservices.search('P57263', database='uniprot', frmt='fasta', compress=True)

Returns:

0it [00:00, ?it/s]
>sp|P57263|NUOM_BUCAI NADH-quinone oxidoreductase subunit M OS=Buchnera aphidicola subsp. Acyrthosiphon pisum (strain APS) OX=107806 GN=nuoM PE=3 SV=1
MLLSLLIIIPFLSSFFSFFSPRLHNNFPRWIALSGIIATLLVVIQIFFQENYHIFQIRHY
PNWNCQLIVPWISRFGIEFNIALDGLSIIMLIFSSFLSIIAIICSWNEIKKNEGFFYFNF
MLVFTGIIGVFISCDLFLFFCFWEIMLIPMYFLIALWSDKTEKKKNFLAANKFFLYSQTS
GLILLSSILLLVFSHYYSTNILTFNYNLLINKPINIYVEYIVMIGFFLSFAIKMPIVPFH
GWLPDIHSRSLSCGSVEIIGVLLKTAPYALLRYNLVLFPDSTKSFSLIAVFWGIISIFYG
AWIAFSQTNIKRLIAYSSVSHMGLILIGIYSNNERALQGVVIQMLSNSLTVAALCILSGQ
IYKRFKTQDMSKMGGLWSCIYWIPGFSLFFSLANLGVPGTGNFIGEFLILSGVFEVFPLV
SILATIGIVFSSIYSLNVIQKIFYGPCKQNIKVFFINKQEVWTIIALVFTLVFLGLNPQK
IIDVSYNSIHNIQKEFNNSILKIRS

It is caused by wrong parameter and value in the search function. This Pull request should fix this issue.

Do you think that the variable compress of search function should be renamed to match compressed?
I think not as it breaks compatibility with script using this function but as the other parameters seem to be matching the ones of Uniprot, I prefer asking this.

@cokelaer
Copy link
Owner

cokelaer commented Mar 8, 2023

@ArnaudBelcour thanks for the fix. I have merged your PR. as for your question, indeed, could be renamed compressed but for back compatibility, as you mentionned, I will keep 'compress' for now. The uniprot variable is indeed called compress as well. I tend to keep the name of the services except if it is too esoteric and not meaningful.

@cokelaer cokelaer merged commit d98117c into cokelaer:main Mar 8, 2023
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.

None yet

2 participants