EdgeR does not change when swap the tissue column
1
0
Entering edit mode
@vishesh2bharat-9486
Last seen 8.7 years ago

I am running edgeR on sRNA-seq data with two tissues Control(Tissue_1) and Treated(Tissue_2) having normalized TPM (transcript per million) values for  each. I need the log FC ratio with Treated(tissue_2) value in the numerator and Control(Tissue_1) in the denominator but the results I am getting with EdgeR are there with opposite sign (-ve sign in place of + and vice a versa); e.g.:

edgeR input:

Gene_IDs Tissue_1 Tissue_2    
Gene_1 3.221 7.309    
Gene_2 2.052 2.186    
Gene_3 395.654 3190.938    
Gene_4 6.823 1.518    

edgeR output:

logFC  logCPM PValue FDR
-0.580512415 3.9735306 0.79990005 1
0.590031015 3.18245995 1 1
-2.383840251 11.7947221 0.000561377 0.002175337
2.34829059 3.91839419 0.08447205 0.218219462

 

   

 

 

 

even when I swap the groups the result remain the same. Please suggest where I am going wrong.

We are using  R 2.15.0 and BiocInstaller version 1.8.3.

Please ask for any other data you need to undersatnd this issue. We found similar kind of issue previously asked on Bioconductor ( EdgeR: Log FC does not changes when I swap the groups ), but no satisfactory solution found there.

 Command line is as following -

Case1: Column1 = Gene_IDs, Column2 = Tissue_1, Column3 = Tissue_2.

R command line as following-

$ /home/DE_analysis.pl --matrix Input_case1.txt --method edgeR --output Inputcase1

Got 3 samples, and got: 3 data fields.

Header: Gene_IDs        Tissue1 Tissue2

Next: Gene_1    7.309   3.221

-shifting sample indices over.

$VAR1 = {

          'Tissue2' => 2,

          'Tissue1' => 1

        };

$VAR1 = {

          'Tissue2' => [

                         'Tissue2'

                       ],

          'Tissue1' => [

                         'Tissue1'

                       ]

        };

Contrasts to perform are: $VAR1 = [

          [

            'Tissue1',

            'Tissue2'

          ]

        ];

CMD: R --vanilla -q < Input_case1.txt.Tissue1_vs_Tissue2.Tissue1.vs.Tissue2.EdgeR.Rscript > library(edgeR)

Loading required package: limma

> data = read.table("/home/Anoop/testing/Input_case1.txt", header=T, row.names=1, com='')

> col_ordering = c(1,2)

> rnaseqMatrix = data[,col_ordering]

> rnaseqMatrix = round(rnaseqMatrix)

> rnaseqMatrix = rnaseqMatrix[rowSums(rnaseqMatrix)>=2,]

> conditions = factor(c(rep("Tissue1", 1), rep("Tissue2", 1)))

> exp_study = DGEList(counts=rnaseqMatrix, group=conditions)

> exp_study = calcNormFactors(exp_study)

> et = exactTest(exp_study, dispersion=0.1)

> tTags = topTags(et,n=NULL)

> write.table(tTags, file='Input_case1.txt.Tissue1_vs_Tissue2.edgeR.DE_results', sep='  ', quote=F, row.names=T)

> source("/home/Analysis/DifferentialExpression/R/rnaseq_plot_funcs.R")

> pdf("Input_case1.txt.Tissue1_vs_Tissue2.edgeR.DE_results.MA_n_Volcano.pdf")

> result_table = tTags$table

> plot_MA_and_Volcano(result_table$logCPM, result_table$logFC, result_table$FDR)

> dev.off()

edger rnaseq R • 1.0k views
ADD COMMENT
1
Entering edit mode

There's a couple of problems with your post:

  • You're not using the latest version of R or Bioconductor, which will make it difficult to diagnose problems.
  • You've got a strange set-up involving a perl script and command line arguments. Please give a minimum working example only using R code.
  • The link you supply doesn't work.
  • You can't use TPM values with edgeR, you need the raw counts.
ADD REPLY
1
Entering edit mode
@gordon-smyth
Last seen 15 minutes ago
WEHI, Melbourne, Australia

To swap the order of the comparison:

exactTest(exp_study, pair=c(2,1), dispersion=0.1)

The order of comparison has nothing to do with the order that the samples occur in your dataset.

ADD COMMENT

Login before adding your answer.

Traffic: 405 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6