statgen / locuszoom

A Javascript/d3 embeddable plugin for interactively visualizing statistical genetic data from customizable sources.
https://statgen.github.io/locuszoom/
MIT License
156 stars 29 forks source link

plot with values not log10 transformation #82

Closed JPingAMMS closed 7 years ago

JPingAMMS commented 7 years ago

LocusZoom is really a good tool to plot regional genome.

And I tried to plot with other values but P-values, which is expected to plot with the direct values rather than the -log10 transformation values.

How LocusZoom do this?

Thank you in advance.

Frencil commented 7 years ago

@JPingAMMS - Take a look at the layout in your LocusZoom instance. Presumably if you're mapping other data fields to a panel you would have made minor edits to the layout (e.g. to identify the new data field and map it to the y-axis).

There are various ways to edit a layout so if you're comfortable posting a sample of your source code that would be helpful.

Essentially after you define your data source but before you call LocusZoom.populate() I recommend you create a layout variable to pass to populate(). You can create your layout from an existing layout and just change the few things you need, like so:

var layout = LocusZoom.layouts.get("plot","standard_association"); // get a vanilla standard association layout
layout.panels[0].axes.y1.label = "new y1 label";
layout.panels[0].data_layers[2].fields = [...]; // define your data fields here

var lz = LocusZoom.populate("#plot", data_sources, layout);

See the Layouts Documentation for reference. Again, if you're having trouble feel free to post code samples and provide more detail about what you're trying to do and I can help you get it working.

JPingAMMS commented 7 years ago

I am not familiar with JS. Sorry for not able to give a pull. And feel grateful for your patience. Now I made it work with a little trick... namely, do 10^(-value) transformation before use locuszoom... Thank you!

Frencil commented 7 years ago

Resolved here.