igvteam / igv

Integrative Genomics Viewer. Fast, efficient, scalable visualization tool for genomics data and annotations
https://igv.org
MIT License
647 stars 386 forks source link

Right-Click mode #1575

Closed minw2828 closed 2 months ago

minw2828 commented 2 months ago

Hello,

I'm sorry in advance if the following question has already been asked before. I searched but could not find a similar topic through browsing the subject line.

When I opened the IGV app through the manual approach and right-clicked the alignment track, I saw the following:

Figure1

But when I opened a session file that I generated, I saw the following when I right-clicked the alignment track.

Figure2

When I compared the session file from the manual approach with my coded session file, both files started with

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Session genome="hg38" version="8">

The rest of the files had the same structure that defined the content of the session files. Hence, I could not identify the cause of the difference in the right-click mode from the session files.

Could you advise why the right-click modes are different and how I might be able to fix it please?

Many thanks, Min

jrobinso commented 2 months ago

According to the popup you have 3 tracks selected. The menu presented are items that are common to all 3 track types. I can't determine from the popup what the other 2 tracks are.

To deselect all tracks just hit the escape key.

minw2828 commented 2 months ago

Hello @jrobinso,

Thank you for your quick reply.

My puzzle wasn't about what tracks being selected. I would like to understand why I saw two different right-click panels from the two session files.

Was it because my session file was not generated from your API, but from the python library, xml.etree.ElementTree?

Does "your API" refer to igvteam/igv.js here? Sorry that I did not know much about this area.

Many thanks, Min

jrobinso commented 2 months ago

I don't think it has anything to do with sessions, rather how many and what type of tracks you have selected. If you have a heterogenous collection of tracks selected you will see the second menu. Without knowing exactly what is selected I really can't say.

I don't understand the comment about "your API", what are you referring to?

minw2828 commented 2 months ago

Hello @jrobinso,

Thank you for patiently debugging this through with me. :)

I aim to code a session file (my_session.xml) that is the same as the one saved from manual input (saved_session.xml).

To do this, I viewed what saved_session.xml looked like and used the Python library xml.etree.ElementTree to construct each component/record in saved_session.xml.

In both session files, I loaded three VCF files to the variant panel, one normal bam file to one alignment panel, and one tumour bam file to the other alignment panel.

In the saved_session.xml, a junction track was hidden (visible="false") for each alignment panel, and the coverage track was listed as a separate record from the alignment track. Hence, I coded my_session.xml accordingly.

❓Does the above fall into your definition of "a heterogenous collection of tracks"?

Because I loaded the same files/tracks to my_session.xml and saved_session.xml, I am puzzled as to why the right-click panel in saved_session.xml (the first screenshot in my first msg above) is different from that in my_session.xml (the second screenshot).

Perhaps you are right that the difference between right-click panels has nothing to do with sessions.

Perhaps by defining each track in my_session.xml, I have selected "a heterogenous collection of tracks". Whereas in saved_session.xml, by manually loading three VCF files and two bam files into the IGV app, the backend rendered saved_session.xml differently?

It will be great to hear your thoughts on this.

Many thanks, Min

jrobinso commented 2 months ago

Hi,

When I said selected heteorgeneous files I mean manually clicking on the name panels to select them before right clicking. This has nothing to do with session files.

Secondly, I can't really comment on session files unless you post them. If you think a session file is causing this behavior I really need to see one that I can load. If you can reproduce this behavior with public files please post the zipped XML here. You can find public files for the hg19 assembly under "File > Load from Server..."