Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Code Block
titleLook at results
head results/deseq2_kallisto_C1_vs_C2.csv

Find the top 10 upregulated genes

Code Block
titleFind the top 10 upregulated genes
#DESeq2 results
sed 's/,/\t/g' results/deseq2_kallisto_C1_vs_C2.csv|sort -n -r -k3,3|cut -f 1,3|head

 
#Notice the idiosyncracy with sort
sed 's/,/\t/g' results/deseq2_kallisto_C1_vs_C2.csv|sort -n -r -k3,3|grep -v 'e-0'|cut -f 1,3|head

Find the top 10 downregulated genes

Code Block
titleFind the top 10 upregulated genes
#DESeq2 results

sed 's/,/\t/g' results/deseq2_kallisto_C1_vs_C2.csv|sort -n -k3,3|cut -f 1,3|head
 
#Notice the idiosyncracy with sort
sed 's/,/\t/g' results/deseq2_kallisto_C1_vs_C2.csv|sort -n -k3,3|grep -v 'e-0'|cut -f 1,3|head

2.  Select DEGs with following cut offs-  Fold Change >=2 (or <= -2) (this means log 2 fold change >= 1 or <=-1) and adj p value < 0.05 and count how many DEGs we have

Code Block
titleCount the number of DEG
#DESeq2 results
sed 's/,/\t/g' results/deseq2_kallisto_C1_vs_C2.csv|awk '{if ((($3>=1)||($3<=-1))&&($7<=0.05)) print $1,$3,$7}'|wc -l


If you wanted to use DESeq2 for more complicated designs (with multiple factors, multiple levels), you can by adjusting two things: design and contrast.

Advanced options

Code Block
#One factor

...


ddsHTSeq<-DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, directory=directory, design=~condition)

...


#Two factors (one factor has multiple levels): condition (control, treated), and sequencing type (single, paired, matepair)

...


ddsHTSeq<-DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, directory=directory, design=~type + condition)

...

#Fold changes

...

 will by default be provided for condition (treated vs control)

...


res <- results(dds)

...


#To view

...

 fold changes for sequencing type, use contrast

...


res <- results(dds, contrast = c("type""paired""single"))

...


res <- results(dds, contrast = c("type""matepair""single"))




DEXSeq

This package is meant for finding differential exon usage between samples from different conditions.

Relative usage of an exon  =   transcripts from the gene that contain this exon / all transcripts from the gene 

For each exon (or part of an exon) and each sample :

  1. count how many reads map to this exon
  2. count how many reads map to other exons of the same gene.
  3. calculate ratio of 1 to 2. 
  4. Look for changes in this ratio across conditions
  5. Look for statistically significantchanges in this ratio across conditions, by using replicates.

This lets you identify changes in alternative splicing, changes in usage of alternative transcript start sites.

Ballgown

Ballgown (a part of the new tuxedo suite) is a popular tool for testing for differential expression.  We will cover this along with the rest of the tuxedo suite. 

BACK TO COURSE OUTLINE