Skip to content

Commit

Permalink
Fixed issue for cases where there are no features retained after filt…
Browse files Browse the repository at this point in the history
…ering
  • Loading branch information
zhangycbnu committed Apr 28, 2023
1 parent ba54e9f commit c07170d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

# MTXmodel History #

## Changes in v1.2.3 (2023-04-28) ##
* Fixed issue if no features left after filtering

## Changes in v1.2.2 (2022-11-14) ##
* Fixed warning on if conditions
* Fixed issue for sample matching
Expand Down
25 changes: 25 additions & 0 deletions R/MTXmodel.R
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,31 @@ MTXmodel <-
}
}

if (ncol(filtered_data_norm) < 1) {
all_outfile <- file.path(output, "all_results.tsv")
mycolnames = c(
"feature",
"metadata",
"value",
"coef",
"stderr",
"N",
"N.not.0",
"pval",
"qval")
write.table(
t(mycolnames),
file = all_outfile,
sep = "\t",
quote = FALSE,
col.names = FALSE,
row.names = FALSE)

residuals_file = file.path(output, "residuals.rds")
file.create(residuals_file)
return(NULL)
}

# apply the method to the data with the correction
logging::loginfo(
"Running selected analysis method: %s", analysis_method)
Expand Down

0 comments on commit c07170d

Please sign in to comment.