Closed Sammi-Smith closed 3 years ago
Support has been added with the latest checkin. This has not yet been pushed to a release.
Example Use
b.roi({
"name": 'ROI set 1',
"url": 'https://s3.amazonaws.com/igv.org.test/data/roi/roi_bed_1.bed',
"indexed": False,
"color": "rgba(255, 134, 65, 0.25)"
})
If you're interested, you're welcome to check out the code, build the extension and verify that the new functionality works. Otherwise, it will probably take a couple weeks to be properly tested and released.
Fantastic, thanks for such a quick response! In the meantime, since I opened this issue, I have been experimenting with using browser.load_track()
with the Annotation track type as a temporary stand-in to display ROIs as a single track, using a call something like this:
b.load_track({
"name": "ROI: Annotations",
"type": "annotation",
"url": "path/to/my/bed/file.bed"
})
I added in a BED track line to the file to accomplish the second part of my above question regarding coloring the ROIs based on score. It looks like with the option itemRgb="On"
I can specify RGB colors for each row in the file and with useScore=1
, the scores in the score column (i.e. column 5) are used to render the track in greyscale, with higher scores showing as darker. If both are used together, like in the below example file, the color and greyscale functionalities are combined. So in this file, the first row is displayed as a very transparent red and the second row is displayed as a very dark blue. (Interestingly, a score of 0 also displays a very dark color, just like a score of 1000 does, so that may be a potential bug to look into.)
Example file content (I tried to upload it, but .bed files aren't a supported file type here in a GitHub comment):
track name="ItemRGBDemo" description="Item RGB demonstration" itemRgb="On" useScore=1
chr1 100218 117218 ROI1 1 + 105218 115218 255,0,0
chr1 206218 222218 ROI2 1000 - 209218 220218 0,0,255
Am I correct in assuming these track line options would also be supported in the b.roi()
method you just implemented?
As long as they are supported in the underlying igv.js library, they should be supported in the b.roi()
method, as that method just passes the options along to Javascript.
This update has been released to pip.
Hi,
First of all, thanks for all your all's work on this project, this is an amazingly useful tool!
I have been exploring the features available in both igv.js and igv-jupyter. I am particularly interested in the ROI feature described here: https://github.com/igvteam/igv.js/wiki/Regions-of-Interest
I tried calling the
browser.loadROI()
method on a Browser object within igv-jupyter, but ran into an error since that method doesn't exist in the igv-jupyter version. It would be extremely useful for our use case to have the ability to highlight ROIs in all tracks and/or a specific track. We would appreciate if this feature could be supported in igv-jupyter too!On a slightly related note: Is it possible to color the ROIs based on some sort of score? Our ROIs each have a score associated with them, with higher scores indicating regions that are of greater interest. Could we vary the transparency of the ROIs such that regions with higher scores are less transparent and those with lower scores are more transparent?
For example, the example method call in the Wiki looks like this:
Could the "color" argument take some sort of function to vary the transparency based on a score in the input ROI file?