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

Trouble with files on Amazon S3 #49

Closed
dzerbino opened this issue Mar 9, 2020 · 5 comments
Closed

Trouble with files on Amazon S3 #49

dzerbino opened this issue Mar 9, 2020 · 5 comments

Comments

@dzerbino
Copy link
Contributor

dzerbino commented Mar 9, 2020

Hello @dpryan79 ,

It would appear that libBigWig struggles with remote files on S3. e.g, with the following code (compiled to toto):

#include "bigWig.h"

void main(int c, char ** argv) {
bwOpen(argv[1], NULL, "r");
}

I get:

./toto https://encode-public.s3.amazonaws.com/2017/10/03/ad2c0f17-0824-4647-a749-74276daca7da/ENCFF278CUB.bigWig
Segmentation fault
wget https://encode-public.s3.amazonaws.com/2017/10/03/ad2c0f17-0824-4647-a749-74276daca7da/ENCFF278CUB.bigWig
[...]
./toto ENCFF278CUB.bigWig

Conversely, the Kent library has no issue with these remote bigWig files via CURL.

Would it be possible for libBigWig to handle these remote files on AWS?

Thank you,

@dzerbino

@diekhans
Copy link

diekhans commented Mar 9, 2020

note, kent libraries don't use CURL...

@dzerbino
Copy link
Contributor Author

dzerbino commented Mar 9, 2020

A-ha, what is used then?

@diekhans
Copy link

diekhans commented Mar 9, 2020

Kent code it yourself in C approach.

@dpryan79
Copy link
Owner

@dzerbino You forgot to run bwInit(some buffer size); first to setup curl:

#include "bigWig.h"
int main(int argc, char* argv[]) {
    int rv = bwInit(128000);
    bigWigFile_t *bw = bwOpen(argv[1], NULL, "r");
    bwClose(bw);
    bwCleanup();
    return 0;
}

128000 is the buffer size I used in pyBigWig, you can change it.

@dzerbino
Copy link
Contributor Author

Thanks @dpryan79 ! I did indeed omit bwInit, both in the example here and in my code.

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

3 participants