GithubHelp home page GithubHelp logo

multimeric / unipressed Goto Github PK

View Code? Open in Web Editor NEW
36.0 3.0 5.0 1.02 MB

Comprehensive Python client for the Uniprot REST API

Home Page: https://multimeric.github.io/Unipressed/

License: MIT License

Python 99.67% Shell 0.33%
api-client bioinformatics python uniprot uniprotkb

unipressed's People

Contributors

godotgildor avatar multimeric avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unipressed's Issues

idmapping sleep/ wait

Hello,

I'd like to use the idmappingclient but I have to get lucky to not end up with the error
UniProt has not yet processed the results, consider using time.sleep() to wait until they are complete.

I have reduced the size of my query lists quite a bit but at some point in my loop, I will get the error. I have added time.sleep() before I call request.each_result() but I don't know how long to set it for to ensure I don't run into the error.

I see there is a "waiting" module but I'm not sure how to incorporate it into this so I can wait indefinitely for the results to be returned.

Thank you for this package.

Dan

Error calling get_status() on IdMappingClient request

Hello there,

I am using the example given in the main README to get the ID mappings:

from unipressed import IdMappingClient
request = IdMappingClient.submit(
    source="UniProtKB_AC-ID", dest="Gene_Name", ids={"A1L190", "A0JP26", "A0PK11"}
)
list(request.each_result())

But I want to check the status before obtaining the results, so I call request.get_status() and obtain the following error:


Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/usr/local/lib/python3.10/dist-packages/unipressed/id_mapping/core.py", line 52, in get_status
    return requests.get(
KeyError: 'jobStatus'

I hope you can help me to know what I am doing wrong.

Investigate using Pydantic models

In theory we could replace all the TypedDict with pydantic models.

Advantages:

  • Could implement advanced validation like regex etc
  • Could have low level models for things like ranges

Disadvantages:

  • More dependencies, so larger installation
  • Much more verbose queries. You would now have to import the appropriate models instead of just using built-in Python constructs

Document Literal entries

There doesn't seem to be a way to add docstrings to Literal, but perhaps they could be converted to enums with docstrings.

Add `include_isoform` parameter

def search(
cls,
query: QueryType,
format: FormatType | Literal["json"] = "json",
fields: Iterable[FieldsType] | None = None,
size: int = 500,
) -> Search[QueryType, JsonResultType, FieldsType, FormatType]:

The Search dataclass has a include_isoform member variable, but the search method of the UniprotkbClient class does not expose this as a parameter.

Can we add this as a parameter?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.