-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Hello, thanks for the great tool. I am using it on a set of RNA-Seq data with ~55k genes (features). I would like to use the select argument to dynamically filter the features to reduce time/resources. Here is my command and an example of my data:
# Command
pr <- propr(
counts, # rows as samples, like it should be
metric = "pcor.bshrink", # partial correlation without shrinkage "pcor" is also available
ivar = "clr", # "clr" is recommended
p = 100, # used for permutation tests
select = filtered_indices
)
# Counts matrix
> dim(counts)
[1] 294 55006
> class(counts)
[1] "matrix" "array"
# Feature indices
> length(filtered_indices)
[1] 32304
> filtered_indices[1:5]
[1] 1 2 3 4 5
I am getting this error:
> pr <- propr(
+ counts, # rows as samples, like it should be
+ metric = "pcor.bshrink", # partial correlation without shrinkage "pcor" is also available
+ ivar = "clr", # "clr" is recommended
+ p = 100, # used for permutation tests
+ select = filtered_indices
+ )
Alert: Log-ratio transform will be handled by 'bShrink'.
Alert: replacing zeros with minimun value.
Alert: Skipping built-in log-ratio transformation.
Error in if (!is.na(select)) { : the condition has length > 1
I think it is expecting select to be a single element of length 1. Which is true if it is NA. But the if statement is not vectorized so it won't work with the added argument. The docs specify select should be
"A numeric vector representing the indices of features to be used for computing the Propr matrix. This argument is optional. If provided, it reduces the data size by using only the selected features."
Is there a problem with the if statement or am I doing something wrong? Thanks so much!!
> R.version
_
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 4
minor 3.3
year 2024
month 02
day 29
svn rev 86002
language R
version.string R version 4.3.3 (2024-02-29)
nickname Angel Food Cake
> packageVersion("propr")
[1] ‘5.1.5’