-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* cleanup pileup logs * cleanup bigwig threads * correct orlando scaling factors * Add deseq2_params rule and update deseq2.qmd.jinja * Update file calculate_spikein_norm_factors.r to write normalization factors to snakemake output --------- Co-authored-by: CChahrour <[email protected]>
- Loading branch information
1 parent
f797427
commit a48548b
Showing
7 changed files
with
250 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
library(tidyverse) | ||
|
||
# Load the data | ||
counts <- read_table(snakemake@input[[1]]) | ||
metadata <- read_table(snakemake@input[[2]]) | ||
|
||
spikein_rows <- which(rownames(counts) %in% c("AmpR_seq", "Cas9_5p_seq", "Cas9_3p_seq")) | ||
|
||
spikein_counts <- counts[spikein_rows, ] | ||
size_factors <- colSums(spikein_counts) / median(colSums(spikein_counts)) | ||
normalized_counts <- sweep(counts, 2, size_factors, FUN="/") | ||
|
||
size_factors <- colData(dds)[, "sizeFactor"] | ||
names(size_factors) <- colData(dds)[, "sample"] | ||
sf <- toJSON(size_factors) | ||
writeLines(sf, snakemake@output[[1]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.