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

API Questions #2

Open
bbarrick opened this issue Oct 20, 2020 · 11 comments
Open

API Questions #2

bbarrick opened this issue Oct 20, 2020 · 11 comments

Comments

@bbarrick
Copy link

Hi, sorry if this isn't the right place. I'm working on a project that needs to integrate with the Ion Torrent S5 API.

I'm having trouble figuring out how to get bed files using the API. If you don't mind could you point me in the right direction?

Thank you

@sukumar-ranganathan
Copy link

Hi,
Here is the cook book for Ion Torrent : https://ion-torrent-sdk.readthedocs.io/en/v5.12/index.html
Refer below pages for:

Please let me know if you have any questions.

Thank you!
-Sukumar

@bbarrick
Copy link
Author

bbarrick commented Oct 20, 2020

HI @sukumar-ranganathan, thank you , I have been looking through the API and have built some integration that lets me get a list of the runs and individual run data. However, I didn't quite see anything about getting the bam files specifically.

@sukumar-ranganathan
Copy link

Hi @bbarrick,
Check out this API https://ion-torrent-sdk.readthedocs.io/en/v5.12/api/references_auto_generated/results.html?highlight=results
Resource URL http://mytorrentserver/rundb/api/v1/results
"bamLink": "/output/Home/CA_Combined_demo_001_007/download_links/NONE_ReportOnly_NONE_CA_Combined_demo_001.bam",

@bbarrick
Copy link
Author

bbarrick commented Nov 19, 2020

Hi @bbarrick,
Check out this API https://ion-torrent-sdk.readthedocs.io/en/v5.12/api/references_auto_generated/results.html?highlight=results
Resource URL http://mytorrentserver/rundb/api/v1/results
"bamLink": "/output/Home/CA_Combined_demo_001_007/download_links/NONE_ReportOnly_NONE_CA_Combined_demo_001.bam",

Thanks @sukumar-ranganathan,

I've tried several bam endpoints and all I get is a 404 error. Any suggestions?

/rundb/api/v1/output/Home/Auto_user_S5XL-0079-5-170424_OT2_LymphoTrack_95_tn_013/download_links/R_2017_04_26_15_33_36_user_S5XL-0079-5-170424_OT2_LymphoTrack_Auto_user_S5XL-0079-5-170424_OT2_LymphoTrack_95_tn.bam?username=ionadmin&api_key=3f2cdec72f8b1783dfc1222cb4f4164c79de53a7): failed to open stream: HTTP request failed! HTTP/1.1 404 NOT FOUND

@bbarrick
Copy link
Author

        $file_url = BASE_URL . $endpoint . '?username=' . USERNAME . '&api_key=' . APIKEY;
        $destination_path = "/file_downloads";
        $fp = fopen($destination_path, 'wb+');

        $ch = curl_init($file_url);
        curl_setopt($ch, CURLOPT_FILE, $fp);
        curl_exec($ch);
        $st_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);
        fclose($fp);

        return $st_code;

@bbarrick
Copy link
Author

bbarrick commented Nov 19, 2020

@sukumar-ranganathan I think I may have figured it out - the result endpoint by default is returning data from 2017, it's not being sorted so the files may not even be there anymore.

@sukumar-ranganathan
Copy link

sukumar-ranganathan commented Nov 19, 2020

Hi, did you try order by id? Ex: http://mytorrentsever/rundb/api/v1/results/?order_by=-id

@bbarrick
Copy link
Author

Hi, did you try order by id? Ex: http://mytorrentsever/rundb/api/v1/results/?order_by=-id

I did, I was able to order it by the timeStamp field. I'm getting a 200 response now but no file - slowly but surely getting there though. Thank you for the help.

@bbarrick
Copy link
Author

Hi, did you try order by id? Ex: http://mytorrentsever/rundb/api/v1/results/?order_by=-id

@sukumar-ranganathan So I'm looking at the response from the bamLink endpoint and this is a screenshot of the data that it returned, can you tell me what I'm looking at here?

image

@sukumar-ranganathan
Copy link

@bbarrick , hope your issue is resolved.

@bbarrick
Copy link
Author

@sukumar-ranganathan thank you, I gave up on using the API to retrieve the file. Working on just automating a transfer of the file via ssh in my project.

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