Skip to content

Commit

Permalink
fix for autoanalysis
Browse files Browse the repository at this point in the history
  • Loading branch information
cstubben committed Jan 22, 2025
1 parent b198e04 commit f236313
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/read_featureCounts.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ read_featureCounts <- function( path=".", pattern, reshape=TRUE, stats=FALSE){
fc <- read_sample_files(path, pattern, col_names=c("status", "count"), skip=1)
if(reshape){
fc <- dplyr::filter(fc, count!=0) %>% tidyr::spread(status, count)
#fix for Autoanalysis
fc$sample <- gsub("_Hg38|_GRCm39", "", fc$sample )
# add option to sort HCI samples as X1, X2, ..., X10, X11
fc <- fc[ order_samples(fc$sample), ]
}
}
else{
if(missing(pattern)) pattern <- "\\.counts$"
fc <- read_sample_files(path, pattern, col_names=c("geneid", "chr", "start", "end", "strand", "length", "count"), skip=2)
#fix for Autoanalysis
fc$sample <- gsub("_Hg38|_GRCm39", "", fc$sample )
if(reshape){
fc <- dplyr::select(fc, sample, geneid, count) %>% tidyr::spread(sample, count)
fc <- fc[, c(1, order_samples(colnames(fc)[-1])+1) ]
Expand Down

0 comments on commit f236313

Please sign in to comment.