Skip to content

Commit

Permalink
update path to featurecounts for deseq2
Browse files Browse the repository at this point in the history
  • Loading branch information
CChahrour committed Mar 28, 2024
1 parent df5c1c0 commit 6c521ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions seqnado/workflow/config/deseq2.qmd.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ print(kable(sample_info, align = "l", format = "simple", row.names = FALSE))
## Counts

```{r counts}
counts <- read.delim("seqnado_output/feature_counts/read_counts.tsv", comment.char = "#") %>%
counts <- read.delim("seqnado_output/readcounts/feature_counts/read_counts.tsv", comment.char = "#") %>%
rename_with(~ gsub("(seqnado_output.aligned.)(.+)(.bam)", "\\2", .), everything()) %>%
column_to_rownames(var = "Geneid") %>%
dplyr::select(one_of(make.names(sample_info$sample))) %>%
Expand Down Expand Up @@ -103,6 +103,12 @@ if (has_spikein) {
kable(colData(dds), row.names = F)
counts(dds) <- counts(dds)[!rownames(counts(dds)) %in% spikein_genes, ]
dds <- DESeq(dds, quiet = T)
# Output size factors

size_factors <- colData(dds)[, "sizeFactor"]
names(size_factors) <- colData(dds)[, "sample"]
sf <- toJSON(size_factors)
writeLines(sf, "seqnado_output/resources/all_normalisation_factors.json")

} else {

Expand All @@ -123,12 +129,7 @@ if (nrow(counts) > 1000){
res_names <- resultsNames(dds)[-1]
res <- results(dds, name = res_names)

# Output size factors

size_factors <- colData(dds)[, "sizeFactor"]
names(size_factors) <- colData(dds)[, "sample"]
sf <- toJSON(size_factors)
writeLines(sf, "seqnado_output/resources/all_normalisation_factors.json")

normCounts <- counts(dds, normalized = TRUE) %>%
as_tibble(rownames = "gene")
Expand Down
2 changes: 1 addition & 1 deletion seqnado/workflow/rules/deseq2_rna.smk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rule deseq2_report_rnaseq:
input:
counts="seqnado_output/feature_counts/read_counts.tsv",
counts="seqnado_output/readcounts/feature_counts/read_counts.tsv",
qmd=f"deseq2_{PROJECT_NAME}.qmd".replace(" ", ""),
output:
deseq2=f"deseq2_{PROJECT_NAME}.html".replace(" ", ""),
Expand Down

0 comments on commit 6c521ce

Please sign in to comment.