miQC: fix "undefined columns selected" if column renamed #195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Users can choose their own
percent.mt
column name to fetch from their data, and the resulting column is subsequently renamed in as"percent.mt"
inmy_data
:seurat-wrappers/R/miqc.R
Lines 57 to 58 in 8d46d6c
However, when subsetting on lines 120 & 126 (if the else if conditions of lines 117-127 are met), we get "undefined columns selected" errors if the user passed in anything other than the default to
percent.mt
– because we're subsetting using the value stored in thepercent.mt
variable:seurat-wrappers/R/miqc.R
Lines 117 to 127 in 8d46d6c
Solutions include either reassigning
percent.mt <- "percent.mt"
after line 58, or subsetting on line 120 & 126 with the character value"percent.mt"
that we've forced the column to be named as. I chose the latter of these two options.Let me know if you have any comments, and feel free to edit if necessary. Thanks!