BradyAJohnston / plasmapR

Creating plasmid maps inside ggplot.
https://bradyajohnston.github.io/plasmapR/
Other
79 stars 8 forks source link

Change in package without detailed documentation; Unable to modify $features to plot relevant ones only #5

Closed barrel0luck closed 1 year ago

barrel0luck commented 1 year ago

Hi,

First of all thanks for developing this package. I have for long wished to see a ggplot compatible plasmid mapping package for R. I've been using this package for a while. The documentation is a bit lacking so it's hard to tell how to use it to achieve what you want. Nevertheless I was able to use it and get it to work. However, after the current change my workflow has been completely disrupted and I'm not able to pull it back together. The problem is not as simple as replacing "parse_plasmid" etc with the new terms.

The main issue I'm having is that earlier it was possible to get rid of unnecessary features since $features was a dataframe within the parse_plasmid list. So I could easily manipulate that and keep only necessary features and plot a beautiful minimalistic plasmid. But now the structure has completely changed and I just can't seem to understand it. Manipulating the features dataframe has become really difficult and maybe impossible.

Can you suggest how to do that?

Thanks in advance!

BradyAJohnston commented 1 year ago

Hello! Thanks for your interest in the package. I mainly created it for my personal use, so the documentation certainly needs some work. It seems like it's starting to get kind of popular.

I did make some breaking changes with a complete re-write.

I just made some changes in #6 which will enable you to pass a data.frame object to plot_plasmid().

fl <- system.file('extdata', 'petm20.gb', package = "plasmapR")

plasmid <- fl |> 
  read_gb()

dat <- plasmid |> 
  as.data.frame()

dat[dat$type == "CDS", ] |> 
  plot_plasmid(name = "pETM-20")
barrel0luck commented 1 year ago

Thank you very much for this change! I very much appreciate it!

Also, if I can make one more suggestion, I'd suggest you keep the pipe operator the same that is used in tidyverse. This is because RStudio has a built in shortcut to type the pipe character, so it's very easy to write code (Ctrl + Shift + M, the M maybe stands for the magrittr package).

BradyAJohnston commented 1 year ago

You can pretty much just replace the base pipe with the {magrittr} pipe if you prefer it. Are you meaning just the documentation or somewhere inside the package?

The tidyverse team is moving towards the base pipe as well. You can change the setting in R studio so that same shortcut places the base pipe |> instead of %>% if you wish (that's how I have mine set up).

barrel0luck commented 1 year ago

No not documentation, you understood me correctly. Thank you for telling me that, I had no idea tidyverse was changing their pipe character as well. I had no idea the shortcut could be changed, so thanks for telling me that as well.

BradyAJohnston commented 1 year ago

Glad I could help out! I do want to get around to developing and expanding this package more at some point. If you have specific feature requests or things that you would like to see, please do open an issue / feature request :)