GithubHelp home page GithubHelp logo

Comments (4)

simonbrent avatar simonbrent commented on July 4, 2024

Hi,

I don't entirely follow your description, but it sounds like you want the BIGWIG track. Rather than using a large WIG file, you can create a BIGWIG file using a conversion tool:

https://genome.ucsc.edu/goldenpath/help/bigWig.html
https://www.encodeproject.org/software/wigtobigwig/

Sorry, I can't help you with actually using the tool, as I have no experience of it.

With regard to question 2, I don't know if that is possible. What are you trying to achieve?

from genoverse.

MrKevinDC avatar MrKevinDC commented on July 4, 2024

Hi again Simon,
Well it seems now that indeed BIGWIG will be all we need as they have now provided us with genomic bams. However another track still requires accessing data from another file:

-We have a .gff with transcript IDs and positions, and on the other hand we have a .txt with transcript IDs and gene expression values (all calculated with RSEM). We have to fetch the transcript positions from the .gff so that we can plot the values of the .txt in the browser. We thought that maybe we could load both files at once similar to how the bam/bai and vcf/tbi is done, but maybe we require a more expert insight on this.
Kind regards
Kevin

from genoverse.

simonbrent avatar simonbrent commented on July 4, 2024

Yes, you can load both files at once. You will have modify the fileDrop plugin a bit (currently it treats the second file as an index, e.g. bam/bai), and create a new Track.Model.File extension, which has a getData function whose promise resolves once both files' data has been read. The following is untested code which should do what you want there.

getData: function (chr) {
  var model = this;

  if (this.isLocal && this.dataFiles) {
    return Promise.all(this.dataFiles.map(function (file) {
      return new Promise(function (resolve) {
        var reader = new FileReader();

        reader.onload = function (e) {
          resolve(e.target.result);
        };

        reader.readAsText(file);
      });    
    })).then(function (filesData) {
      // filesData is an array whose elements contain the contents of each file
      var combinedData = [ do something with filesData to turn it into an array of Genoverse-compatible features ]
      model.receiveData(combinedData, chr, 1, model.browser.getChromosomeSize(chr));
    });
  } else {
    return this.base.apply(this, arguments);
  }
},

from genoverse.

MrKevinDC avatar MrKevinDC commented on July 4, 2024

Thank you so much Simon this is what we were struggling with now but you have painted a great picture of what we have to do. You are doing a great job supporting Genoverse, thank you.
Kind regards

from genoverse.

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.