<commit_before>## RNA-seq analysis with DESeq2
## modified from example from <NAME>, @genetics_blog

library(DESeq2)
library(RColorBrewer)
library(gplots)


## args[1] == full path to Charts directory for this analysis
## args[2] == full path to featureCounts csv for this analysis
## args[3] == comma separated string of conditions to compare and rep count:
##            "c1,c2,reps"
## args[4] == script directory
##
args = commandArgs(trailingOnly=TRUE)
setwd(args[1])
source(paste(paste(args[4],"/",sep=""),"rld_pca.r",sep=""))
source(paste(paste(args[4],"/",sep=""),"maplot.r",sep=""))
source(paste(paste(args[4],"/",sep=""),"volcanoplot.r",sep=""))


## preprocess phase --------------------------------------------------

## Read featureCounts matrix
countdata <- read.table(args[2], header=TRUE, row.names=1)

## Remove first five columns (chr, start, end, strand, length)
countdata <- countdata[ ,6:ncol(countdata)]

## Remove .bam or .sam from filenames
colnames(countdata) <- gsub("\\.[sb]am$", "", colnames(countdata))

## Convert to matrix
countdata <- as.matrix(countdata)
head(countdata)

## Assign condition
c1c2reps <- strsplit(args[3], ",", fixed = TRUE)[[1]]
c1 <- c1c2reps[[1]]
c2 <- c1c2reps[[2]]
reps <- c1c2reps[[3]]
prefix <- paste(c1,c2,sep="-")

(condition <- factor(c(rep(c1, reps), rep(c2, reps))))


## Analysis phase --------------------------------------------------

<commit_msg>correct sign of log change<commit_after>## RNA-seq analysis with DESeq2
## modified from example from <NAME>, @genetics_blog

library(DESeq2)
library(RColorBrewer)
library(gplots)


## args[1] == full path to Charts directory for this analysis
## args[2] == full path to featureCounts csv for this analysis
## args[3] == comma separated string of conditions to compare and rep count:
##            "c1,c2,reps"
## args[4] == script directory
##
args = commandArgs(trailingOnly=TRUE)
setwd(args[1])
source(paste(paste(args[4],"/",sep=""),"rld_pca.r",sep=""))
source(paste(paste(args[4],"/",sep=""),"maplot.r",sep=""))
source(paste(paste(args[4],"/",sep=""),"volcanoplot.r",sep=""))


## preprocess phase --------------------------------------------------

## Read featureCounts matrix
countdata <- read.table(args[2], header=TRUE, row.names=1)

## Remove first five columns (chr, start, end, strand, length)
countdata <- countdata[ ,6:ncol(countdata)]

## Remove .bam or .sam from filenames
colnames(countdata) <- gsub("\\.[sb]am$", "", colnames(countdata))

## Convert to matrix
countdata <- as.matrix(countdata)
head(countdata)

## Assign condition
c1c2reps <- strsplit(args[3], ",", fixed = TRUE)[[1]]
c1 <- c1c2reps[[1]]
c2 <- c1c2reps[[2]]
reps <- c1c2reps[[3]]
prefix <- paste(c1,c2,sep="-")

##(condition <- factor(c(rep(c1, reps), rep(c2, reps))))
(condition <- factor(c(rep(c2, reps), rep(c1, reps))))


## Analysis phase --------------------------------------------------


{'fraction_non_alphanumeric': 0.2539737387698687, 'fraction_numerical': 0.024187975120939877, 'mean_word_length': 3.808970099667774, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '319329', 'n_tokens_mistral': 1043, 'n_tokens_neox': 986, 'n_words': 229}