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

Provide easy means to export normalized Counts #17

Closed
apeltzer opened this issue Feb 19, 2020 · 5 comments
Closed

Provide easy means to export normalized Counts #17

apeltzer opened this issue Feb 19, 2020 · 5 comments
Assignees

Comments

@apeltzer
Copy link

Thanks for creating this tool / method! The Shiny App / general functionality is really an improvement and works pretty good. However, I'd like to export the data (e.g. normalized counts) to a separate TSV/CSV file to do downstream analyses with it, which is currently not very straightforward.

It would be very nice to see an export functionality - either in the Shiny App or (also good) in the R package in general. Couldn't find anything unfortunately...

@mcanouil
Copy link
Owner

mcanouil commented Feb 19, 2020

Hi,

I described how to export the counts matrix within the vignette focusing on analysis.
https://mcanouil.github.io/NACHO/articles/NACHO-analysis.html

expr_counts <- GSE70970[["nacho"]] %>% 
  filter(grepl("Endogenous", CodeClass)) %>% 
  select(IDFILE, Name, Count_Norm) %>% 
  pivot_wider(names_from = "Name", values_from = "Count_Norm") %>% # "Name" can be replaced with "Accession"
  column_to_rownames("IDFILE") %>% 
  t()

The code above could end up in a function like the following one (quick draft).

library(NACHO)
get_counts <- function(
  nacho, 
  codeclass = "Endogenous", 
  rownames = "IDFILE", 
  colnames = c("Name", "Accession")
) {
  nacho[["nacho"]] %>% 
    dplyr::filter(grepl(codeclass, .data[["CodeClass"]])) %>% 
    dplyr::select(c("IDFILE", "Name", "Count_Norm")) %>% 
    tidyr::pivot_wider(names_from = colnames[1], values_from = "Count_Norm") %>%
    tibble::column_to_rownames(rownames) %>% 
    t()
}
get_counts(GSE74821)

@mcanouil mcanouil self-assigned this Feb 19, 2020
@apeltzer
Copy link
Author

Ok, didn't see / find this intuitively - this looks great, thank you!

@apeltzer
Copy link
Author

Could be potentially cool to have some exporting functionality in the Shiny Applicaiton but from the commandline this is more than I expected and I'm absolutely happy with this 👍

@mcanouil
Copy link
Owner

mcanouil commented Feb 19, 2020

I'll think more about adding a function to ease the exportation and in that case, I'll probably add some download button using that function.

The function defined above, does not exclude bad samples nor bad "genes".
Extra filters should be applied based on quality columns (or just is_outlier column), this is why I did not implement such function, because it will have a lot of parameters for QC depending on dataset.

@apeltzer
Copy link
Author

Thats a valid and good concern. Thank you for the insights / comments. I do think there would be a benefit to allow this export, but also see the concerns here!

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

2 participants