molbiodiv / biojs-io-biom

Parses biom files
MIT License
2 stars 1 forks source link

datatables pseudo-serverside getters #7

Open iimog opened 8 years ago

iimog commented 8 years ago

A function that simulates a server side datatables request. It takes an object of parameters as generated by datatables. It returns the requested slice of data while adhering to sorting, pagination, etc. This is necessary as data can not directly be used in this way:

var biom = new Biom({/*biom object containing data*/});
var dt_data = biom.data;

One problem is that data can be in sparse or dense format. Datatables needs dense format. Converting might not be convenient for the user. The second problem is that there can be huge amounts of data and datatables will be very slow if confronted with the full dataset. The way around this is using server side data where only the required data (and information about the total amount) is available and displayed. The required slice of data can be calculated quickly and returned by this function.