LegumeFederation / DSCensor

Visualization and Organization for Assembly and Annotation Data
MIT License
0 stars 0 forks source link

multiqc synchronization (or lack thereof) of sorting #35

Closed adf-ncgr closed 4 years ago

adf-ncgr commented 4 years ago

@ctcncgr I was doing some stuff with multiqc in a non-LIS capacity and discovered that although you can turn some of the flat plots into interactive versions, they don't thereby respond to sorting of the general stats table. This is a feature of DSCensor that I will miss if we can't figure out how to inject it into MultiQC. Not a deal-breaker, but I just thought I should mention it so you can be thinking about it.

ctcncgr commented 4 years ago

Hey Andrew,

I will look into this a bit. I currently don't have a firm understanding of the way that figures interact in these reports.

adf-ncgr commented 4 years ago

OK, my impression is that as currently implemented, plots don't interact with each other but filtering/highlighting events are driven from the side panel. I could imagine approaching sorting this way, although it certainly feels more natural to do it from the tabular context. Of course, this is all just my subjective impression as a casual user...

ctcncgr commented 4 years ago

Hey Andrew,

Each module has its own assets directory if it has features that extend into the various multiQC events.

I think I can code the BUSCO stuff and the basic stats to interact using the existing libraries similar to how FastQC has done this, but it needs to be in its own module for the time being.

Look at the following:

https://github.com/ewels/MultiQC/blob/master/multiqc/modules/fastqc/assets/js/multiqc_fastqc.js

it interacts with a number of methods in the multiQC plotting library using 'mqc_hidesamples' such as:

multiqc_env/lib/python3.6/site-packages/multiqc/templates/default/assets/js/multiqc_tables.js

$(document).on('mqc_hidesamples', function(e, f_texts, regex_mode){

      // Hide rows in MultiQC tables
      $(".mqc_table tbody th").each(function(){

I'm pretty sure I just need to write some assets for the BUSCO which currently has none. I'm going to just do this for my own module as I now understand how to use the plotting and table libs in multiQC and no longer require the busco mode itself.

I added my own table to the existing BUSCO plot by adding a call to the table creator. I can basically add whatever plots I want to whatever objects now.

ctcncgr commented 4 years ago

One other thing. The MultiQC views use SVGs and canvas for basically everything so it will be interesting to see if things like below are required for row identification:


// Find the position of the mouse cursor over the canvas
// http://stackoverflow.com/questions/6735470/get-pixel-color-from-canvas-on-mouseover
function findPos(obj) {
    var curleft = 0, curtop = 0;
    if (obj.offsetParent) {
        do {
            curleft += obj.offsetLeft;
            curtop += obj.offsetTop;
        } while (obj = obj.offsetParent);
        return { x: curleft, y: curtop };
    }
    return undefined;
}
adf-ncgr commented 4 years ago

OK thanks. I'll note I wasn't really thinking in particular about BUSCO when I made this issue so it might be worth some discussion about whether starting somewhere else would be easier as a proof of concept for this. unrelated, but that snippet of code takes me back to Java Swing coding days....

ctcncgr commented 4 years ago

This has been fixed. I should probably fork multiQC and add some sort of functionality for this to the base charting facilities.