Skip to content

DGE helper function - p-value formatting#22

Open
dtm2451 wants to merge 4 commits into
sc-dge-functionsfrom
sc-dge-pval
Open

DGE helper function - p-value formatting#22
dtm2451 wants to merge 4 commits into
sc-dge-functionsfrom
sc-dge-pval

Conversation

@dtm2451

@dtm2451 dtm2451 commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Initializes a helper function that can transform a vector of p-values into various alternative labeling formats. It can also be used for simply rounding without that rounding causing, e.g., a 0.05 to then show as 0.0500. Summary formats include the below, but are quite tweak-able both in terms of style and the numeric cutoffs.

  • NS, *, **, ***
  • NS, padj = <pval> (which can be re-styled to NS, <pval>, or NS, p:<pval>)
  • NS, padj = <pval>, padj < 0.001, padj < 0.0001 (which can be re-styled to NS, <pval>, <0.001, <0.0001)

Among others -- fully documented in the code -- this 'padj' element is adjustable to 'p', something else, or removed altogether via the value_style_p_string input.

@dtm2451

dtm2451 commented May 8, 2026

Copy link
Copy Markdown
Collaborator Author

Some notes:

  • The current design inputs/outputs a simple vector of p-values, not data.frame including them
    • Rationale: This allows for flexibility in usage or column naming for how the output might get added to a data.frame afterwards.
    • Down-side: It precludes trimming inside the function of data.frame rows with non-significant p-values, because the full data.frame is not provided.

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

Successfully merging this pull request may close these issues.

1 participant