Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Region flag is not properly handled in arc_plots_compare #29

Open
SimonFelder opened this issue Feb 16, 2024 · 4 comments
Open

Region flag is not properly handled in arc_plots_compare #29

SimonFelder opened this issue Feb 16, 2024 · 4 comments

Comments

@SimonFelder
Copy link

Using region argument when comparing arc plots, it only applies to the profile but full length sequence and arcs are still displayed.

@SimonFelder
Copy link
Author

Neither are domains in StructureCompareMany

@SimonFelder
Copy link
Author

image

@Psirving
Copy link
Member

Thanks Simon, the screenshot helps me a lot.

I don't think StructureCompareMany is affecting this. It looks like those arcs are isolated to your region. I think these two issues are related though. With either plot_arcs_compare or domains there are bars plotted along the x-axis that aren't being clipped to the region. It should be relatively simple to fix. I'll get to it this week or next.

@Psirving
Copy link
Member

Scott, Will, and Simon have all run into this issue, so I definitely need to fix something and/or add clarification in the documentation.

rnav.plot_arcs_compare is meant to display two full sequences that do not align positionally. This means that we end up with 3 coordinate systems, that of sequence 1, sequence 2, and of the actual x-axis. It is not obvious to me which of these region should apply to.

In the case where sequence 1 and 2 are the same, rnav.plot_arcs_compare adds extra clutter by showing 2 x-axes and the positional alignment between them. This alignment also removes the space where annotations would otherwise go. For Simon, Will, and Scott's cases, a better solution is to use rnav.plot_arcs, adding both samples to the same axes.

Note: this method will not align sequences or filter interactions for the second sample. I can provide code to do this if needed.

# create the plot with a single sample
plot = rnav.plot_arcs(
    samples=[my_first_sample],
    sequence="ss",
    structure="ss",
    interactions="ringmap",
    profile="shapemap",
    region=(72, 200),
    panels={
        "structure": "top",
        "interactions": "top",
        "profile": "top"
    },
)

# add a second sample to the same axes
plot.plot_data(
    ax=0,
    sequence=my_second_sample.get_data("ss"),
    interactions=my_second_sample.get_data("ringmap"),
    structure=my_second_sample.get_data("ss"),
    profile=my_second_sample.get_data("shapemap"),
    panels={
        "structure": "bottom",
        "interactions": "bottom",
        "profile": "bottom"
    }
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants