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

Attaching .ab1 files #4

Open
beyerh opened this issue Dec 12, 2022 · 4 comments
Open

Attaching .ab1 files #4

beyerh opened this issue Dec 12, 2022 · 4 comments

Comments

@beyerh
Copy link

beyerh commented Dec 12, 2022

Hello,

Is there a way to attach .ab1 traces (or any attachments other than .gb) using icebreaker?
Thank you very much.

@veghp
Copy link
Member

veghp commented Dec 12, 2022

Hi,
I'm not sure, but would the IceClient.requests files parameter work?

https://edinburgh-genome-foundry.github.io/icebreaker/#icebreaker.IceClient.request

I plan to review the codebase in the near future to make sure it works with the latest ICE, then can have a look into it.

@beyerh
Copy link
Author

beyerh commented Dec 12, 2022

Thank you for your feedback. I manage to do it with JSON data using IceClients.requests and PUT but not with BLOB data such as ab1 files (Object type bytes is not JSON serializable).

@veghp
Copy link
Member

veghp commented Dec 12, 2022

I see. Did you manage to add this ab1 file via the web interface? There is an attachment upload box, but when ICEbreaker was developed it was not yet available: JBEI/ice#83

This is the API docs entry I found regarding attachments: https://ice.jbei.org/apidocs/org/jbei/ice/lib/entry/attachment/Attachments.html

@beyerh
Copy link
Author

beyerh commented Dec 13, 2022

Yes, I can upload using the web interface.
My understanding is that IceClinets.requests only works with REST API, which attachments are not, right?

However, the ICEbreaker states that one can upload files using the parameter files as a dict of the form {fileId: (filename, content, mimetype)}.

I am not very sure how to do that. I have been unsuccessful so far and my naive attempts likely have several issues if it is possible at all that way:

ice.request("PUT","entry/286", files={'100': ('test.ab1', theblob[0][0], 'multipart/form-data')})

I am very unsure about the endpoint, fileId, and mimetype to use.

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

No branches or pull requests

2 participants