Skip to content

Commit

Permalink
fixed contrast pairs, updated changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
WackerO committed Aug 2, 2024
1 parent ffbf84a commit 46f8902
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## dev

### Added

- [#250](https://github.com/qbic-pipelines/rnadeseq/pull/250) Added clearer error for incorrect contrast_pairs

### Fixed

- [#250](https://github.com/qbic-pipelines/rnadeseq/pull/250) Fixed incorrect reading and indexing of contrast_pairs

## 2.4 - A Pair of Shoes

### Added
Expand Down
14 changes: 8 additions & 6 deletions assets/RNAseq_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -1526,19 +1526,21 @@ if (isProvided(params$path_contrast_list)) {
contrast_names <- append(contrast_names, contname)
}
}
if (isProvided(params$path_contrast_pairs)) {
contrasts <- read.table(path_contrast_pairs, sep="\t", header = T, colClasses = "character")
contrasts <- read.table(params$path_contrast_pairs, sep="\t", header = T, colClasses = "character")
write.table(contrasts, file="differential_gene_expression/metadata/contrast_pairs.tsv", sep="\t", quote=F, col.names = T, row.names = F)
# Contrast calculation for contrast pairs
for (i in c(1:nrow(contrasts))) {
cont <- as.character(contrasts[i,])
contname <- cont[0]
if (!(cont[2] %in% coefficients & cont[3] %in% coefficients)){
stop(paste("Provided contrast name is invalid, it needs to be contained in", coefficients))
contname <- cont[1]
if (!(cont[2] %in% coefficients)){
stop(paste0("Provided contrast name ", cont[2], " is invalid, it needs to be contained in ", paste(coefficients, collapse=", ")))
}
if (!(cont[3] %in% coefficients)){
stop(paste0("Provided contrast name ", cont[3], " is invalid, it needs to be contained in ", paste(coefficients, collapse=", ")))
}
results_DEseq_contrast <- results(cds, contrast=list(cont[1],cont[2]))
results_DEseq_contrast <- results(cds, contrast=list(cont[2],cont[3]))
results_DEseq_contrast <- as.data.frame(results_DEseq_contrast)
print("Analyzing contrast:")
print(contname)
Expand Down

0 comments on commit 46f8902

Please sign in to comment.