Arcadia-Science / sourmashconsumr

Working with the outputs of sourmash in R
https://arcadia-science.github.io/sourmashconsumr/
Other
24 stars 3 forks source link

allow users to choose to name from filename or name from query name when plotting things that have multiple samples #54

Open taylorreiter opened 1 year ago

taylorreiter commented 1 year ago

because some people won't use the --name flag in sketch and it will be empty

taylorreiter commented 1 year ago

Looking at this more in depth, it's going to be a pretty big lift/add a lot of complexity to the code that I'm not sure is worth it at the moment. What I'm going to do instead is add explicit instructions to the vignette that this is how the plots are built as well as an example of how to add query name from filename or whatever else when it isn't already there.

Although...thinking about this more, I could make a make_query_name() function for all of the read*() functions, built from something like basename(filename), and add using that as an optional param in all of the read functions.

so it would look something like this:

read_taxonomy_annotate(file = Sys.glob("path/to/my/results/*with-lineages.csv"), calculate_query_name = T)

going to think on it a little longer