igvteam / igv-reports

Python application to generate self-contained pages embedding IGV visualizations, with no dependency on original input files.
MIT License
350 stars 52 forks source link

initialization configuration questions #39

Closed ghost closed 2 years ago

ghost commented 4 years ago

HI, I have tried the igv-reports and this is an amazing tool. Thanks so much for your contribution. Now I have encountered some problems:

  1. When I suppy only one variant in the vcf for the create_report, it does not load the IGV track. I change sessionDictionary["1"] to sessionDictionary["0"] and it worked. https://github.com/igvteam/igv-reports/blob/91752e65a09fea729eaf83dddfe2c6a87156dd99/igv_reports/templates/variant_template.html#L163
  2. Is there any way I can configure the track upon the track initialization? For example, I'd like each track already sorted by some rule when I open the html instead of I open the html and right-click the base and select the sorting rule from the menu. I tried to change igv.browser.loadsession to igv.browser.loadTrack as indicated by https://github.com/igvteam/igv.js/wiki/Browser-Control-2.0#loadtrack but it did not work https://github.com/igvteam/igv-reports/blob/91752e65a09fea729eaf83dddfe2c6a87156dd99/igv_reports/templates/variant_template.html#L216. So, could you please give me some hints about how to implement this?
  3. I have read the issue https://github.com/igvteam/igv-reports/issues/21#issuecomment-467963993 closed months ago. Is there any way to configure "samplingDepth" now as shown by igv.js? I think this is the same type of question as 2.
jrobinso commented 4 years ago

Hi, thanks for the input. (1) looks like a bug, I will look into it. RE (2) that is a good suggestion but not possible yet, as is (3). These amount to the same suggestion. I have considered this but surprisingly no one has requested it until now. I will leave this issue open as a request for track configuration. When 1 is fixed I'll comment here.

jrobinso commented 3 years ago

I think all these issues are now addressed.

  1. This was a bug, and your fix was the right one (should be "0")
  2. There is a new "--sort" option, see the updated README.md. Further, for single-nucleotide-variants "sort by base" is the default.
  3. You can configure any track using igv objects by supplying a file containing a json array of "track configs" as described in the igv.js documentation, in lieu of the --tracks parameter. See the new example noted in the README. When using this option do not supply the "sort" object for the track, this is controlled by the --sort command line switch.
jrobinso commented 3 years ago

Note these new options are only available if you pull from master and build, I will release it sometime in the next week.