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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #134 #136

Merged
merged 2 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Other enhancements & fixes

* [#134](https://github.com/nf-core/smrnaseq/issues/134) - Fixed colSum of zero issues for edgeR_miRBase.R script

### Parameters

| Old parameter | New parameter |
Expand Down
6 changes: 4 additions & 2 deletions bin/edgeR_miRBase.r
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ for (i in 1:2) {
# Remove genes with 0 reads in all samples
row_sub = apply(data, 1, function(row) all(row ==0 ))
# Only subset if at least one sample is remaining
nr_keep <- table(row_sub)
nr_keep <- sum(nr_keep == TRUE)
nr_keep <- sum(row_sub)
if (nr_keep > 0){
data<-data[!row_sub,]
}
#Also check for colSums > 0, otherwise DGEList will fail if samples have entirely colSum == 0 #Fixes #134
drop_colsum_zero <- (colSums(data, na.rm=T) != 0) # T if colSum is not 0, F otherwise
data <- data[, drop_colsum_zero] # all the non-zero columns

write.csv(t(data),file=paste(header,"_counts.csv",sep=""))

Expand Down