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

How to identify gaps or critical dyads on the lower level? #65

Open
meefen opened this issue Jun 17, 2022 · 7 comments
Open

How to identify gaps or critical dyads on the lower level? #65

meefen opened this issue Jun 17, 2022 · 7 comments

Comments

@meefen
Copy link

meefen commented Jun 17, 2022

The motifr documentation does provide useful guidance on how to identify gaps and critical dyads. See example code below:

plot_critical_dyads(ml_net, "1,2[I.C]",
  level = -1,
  subset_graph = "focal", cutoff = 4, label = TRUE
)

However, I could not get it to find gaps or critical dyads on the lower level (e.g., level 0). When I tweak the level parameter, errors are often reported.

Is there a way to identify gaps or critical dyads on the lower level? Thanks.

@marioangst
Copy link
Owner

marioangst commented Jun 17, 2022

Thanks for writing in!
Given that you did not provide a reprex and no error messages, I can somewhat only guess what your trouble is.

If you could provide a reprex, that would be great so we can investigate further. Also check that the motif even exists in that configuration.

Could it be that you might be helped by specifying the levels in the motif signature? see here: https://marioangst.github.io/motifr/articles/motif_zoo.html under "A word of caution on counting: Position matching". So possibly "1:1,2:0[I.C]" would work. When in doubt, use show_motif to see that your motif label does what you expect it to do.

@meefen
Copy link
Author

meefen commented Jun 17, 2022

Thank you @marioangst for the suggestion. I was able to achieve what I hoped for by specifying the levels.

See sample code below:

plot_gaps(ml_net, "2:1,2:0[III.D]") # return level 1 gaps
plot_gaps(ml_net, "2:0,2:1[III.D]") # return level 0 gaps

I still wonder how the level parameter can be used. It specifies the "Focal level for gap analysis" and isn't it suppose to achieve the same outcome while avoiding changing the motif? Please advise.

@marioangst
Copy link
Owner

@meefen the focal level argument is only useful when you have motif where the location of the gap is not apparent. Eg. in a four-cycle, where a gap can be on either level. For triangles, the gap can only be on the level where there are two nodes. Does this make sense?

@meefen
Copy link
Author

meefen commented Jul 4, 2022

Thanks for the reply. Yes it does make sense.

For four-node motifs of two nodes for each level, is there a way to capture gaps on a specific level?

@marioangst
Copy link
Owner

Yes, in this case, the level argument should work to specify the location of the gap.

@meefen
Copy link
Author

meefen commented Jul 4, 2022

It didn't work for me even with the example dataset. I do not have access to my computer right now and can post sample code if needed.

@marioangst
Copy link
Owner

Oh that would be great, please give us a reprex so we can investigate!

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