Skip to content
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

isoCounts for seed=TRUE is void #25

Open
bounlu opened this issue Dec 7, 2023 · 0 comments
Open

isoCounts for seed=TRUE is void #25

bounlu opened this issue Dec 7, 2023 · 0 comments

Comments

@bounlu
Copy link
Contributor

bounlu commented Dec 7, 2023

Hi,

In the isoCounts function, when seed=TRUE is specified, it does nothing:

ids_counts_all = isoCounts(ids = isomirs, all = TRUE)
ids_counts_seed = isoCounts(ids = isomirs, seed = TRUE)

identical(counts(ids_counts_all), counts(ids_counts_seed))
[1] TRUE

Here is the code:

isomiRs/R/internal.R

Lines 201 to 236 in 8f953e5

IsoCountsFromMatrix <- function(rawData, des, ref=FALSE, iso5=FALSE,
iso3=FALSE, add=FALSE,
snv=FALSE, seed=FALSE, minc=1){
is_subs = snv & rawData[["mism"]] != "0"
is_add = add & rawData[["add"]] != "0"
is_t5 = iso5 & rawData[["t5"]] != "0"
is_t3 = iso3 & rawData[["t3"]] != "0"
is_ref = ref & rawData[["mism"]] == "0" & rawData[["add"]] == "0" & rawData[["t5"]] == "0" & rawData[["t3"]] == "0"
dt <- rawData %>%
mutate(uid = mir) %>%
mutate(uid = ifelse(is_ref,
paste0(uid, paste0(";ref")),
uid)) %>%
mutate(uid = ifelse(is_subs,
paste0(uid, paste0(";iso_snp:", mism)),
uid)) %>%
mutate(uid = ifelse(is_add,
paste0(uid, paste0(";iso_add:", add)),
uid)) %>%
mutate(uid = ifelse(is_t5,
paste0(uid, paste0(";iso_5p:", t5)),
uid)) %>%
mutate(uid = ifelse(is_t3,
paste0(uid, paste0(";iso_3p:", t3)),
uid)) %>%
.[,c("uid", rownames(des))] %>%
group_by(!!sym("uid")) %>%
summarise_all(sum) %>%
as.data.frame() %>%
remove_rownames() %>%
column_to_rownames("uid") %>%
as.matrix()
if (dim(dt)[1] == 0)
warning("No miRNA found. Make sure the third column of the file has the count value different than 0.")
dt
}

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

No branches or pull requests

1 participant