Coder Social home page Coder Social logo

Comments (8)

cmdcolin avatar cmdcolin commented on September 27, 2024

Hi @lidaof

I am glad you are interested in this module! Sorry it is under-documented at the moment. The reason you saw this error is because it was trying to open your url as a "LocalFile" using nodejs functions, which don't exist in the webbrowser

I have published a new version of this module to npm that contains a "url" argument instead of "path" that can be used with remote url files

This module is under active development for use in JBrowse 2 and but I hope it can serve a function for you!

from bbi-js.

lidaof avatar lidaof commented on September 27, 2024

Thank you so much for fast response @cmdcolin .
Do you think it will be easy to implement support of accept file Blob as input as well? since you can use web form to 'upload' a local bigwig file.

from bbi-js.

cmdcolin avatar cmdcolin commented on September 27, 2024

Yes, that should be possible as well. Ideally concept of filehandles should ideally be abstracted into some module. Currently you could make a class that basically implemets a read method like this for the blob file object https://github.com/GMOD/bbi-js/blob/master/src/localFile.ts#L22-L37

This is done in the jbrowse source code using something like this https://github.com/GMOD/jbrowse/blob/master/src/JBrowse/Model/FileBlob.js

Ideally there would be a nice npm module for abstracting this...if you know of one let me know

from bbi-js.

cmdcolin avatar cmdcolin commented on September 27, 2024

Then essentially you can pass your custom blob filehandle class with new BigWig({ filehandle: yourfilehandle_for_blob })

It should match the interface for this read function instead of the callback method from the FileBlob I listed https://github.com/GMOD/bbi-js/blob/master/src/localFile.ts#L22-L37

from bbi-js.

lidaof avatar lidaof commented on September 27, 2024

Thank you @cmdcolin , the links are very helpful. I will do some tests my side see if I could figure it out.
Thanks again.

from bbi-js.

cmdcolin avatar cmdcolin commented on September 27, 2024

Sounds good. If there is any new issue feel free to open a new thread

from bbi-js.

cmdcolin avatar cmdcolin commented on September 27, 2024

@lidaof just FYI we are now making this module with common filehandles and it has a concept of a BlobFile https://www.npmjs.com/package/generic-filehandle !

from bbi-js.

lidaof avatar lidaof commented on September 27, 2024

Hi @cmdcolin this is very good. Thank you for the hard work!

from bbi-js.

Related Issues (20)

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.