-
Notifications
You must be signed in to change notification settings - Fork 443
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
add: variables topX and normalize to Phyloseq Bar Plot #6665
Conversation
tools/phyloseq/phyloseq_plot_bar.R
Outdated
@@ -49,14 +58,52 @@ if (is.null(opt$output) || opt$output == "") { | |||
print(paste("Trying to read:", opt$input)) | |||
physeq <- readRDS(opt$input) | |||
|
|||
print(rank_names(physeq)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
tools/phyloseq/phyloseq_plot_bar.xml
Outdated
]]></command> | ||
<inputs> | ||
<expand macro="phyloseq_input"/> | ||
<param name="x" type="text" label="X-axis variable" help="Variable for the x-axis (e.g., Sample, Phylum)" /> | ||
<param name="fill" type="text" label="Fill variable" help="Variable to color the bars (e.g., Genus, Order)" /> | ||
<param name="facet" type="text" optional="true" label="Facet by variable" help="Optional: Variable to facet the chart by (e.g., SampleType)" /> | ||
<param name="topX" type="integer" optional="true" label="Top X" help="Optional: Only show the top X values" /> | ||
<param name="keepOthers" type="boolean" optional="true" label="Keep 'Others'" help="Optional: Keep an 'Others' category for values not in the top X" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boolean parameters can't be optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MaraBesemer can you remove the optional and add a value for topX ? 10 should be a good default.
tools/phyloseq/phyloseq_plot_bar.xml
Outdated
]]></command> | ||
<inputs> | ||
<expand macro="phyloseq_input"/> | ||
<param name="x" type="text" label="X-axis variable" help="Variable for the x-axis (e.g., Sample, Phylum)" /> | ||
<param name="fill" type="text" label="Fill variable" help="Variable to color the bars (e.g., Genus, Order)" /> | ||
<param name="facet" type="text" optional="true" label="Facet by variable" help="Optional: Variable to facet the chart by (e.g., SampleType)" /> | ||
<param name="topX" type="integer" optional="true" label="Top X" help="Optional: Only show the top X values" /> | ||
<param name="keepOthers" type="boolean" optional="true" label="Keep 'Others'" help="Optional: Keep an 'Others' category for values not in the top X" /> | ||
<param name="normalize" type="boolean" optional="true" label="Normalize" help="Optional: Normalize abundances to sum to 100%" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you normalize and do not keep others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the way I wrote the script, normalization happens after pruning. Now that I think about it, the other way around makes more sense. I did to allow renormalization when unassigned OTUs are present. But now I adjusted the script to assign those cases as unassigned. MaraBesemer#2
With this update, the normalization is done first and then pruning. So if you normalize and do not keep others you get something like:
and with others:
@MaraBesemer can you also add wrapper options for
To the wrapper ? Usually one needs to play around a bit with this, device should allow at least for pdf, png and some of: https://ggplot2.tidyverse.org/reference/ggsave.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks !
FOR CONTRIBUTOR: