switchAnalyzeRlist conditions reversed
1
1
Entering edit mode
2.2 years ago
Megan Noonan ▴ 10

My design matrix is below:

  sampleID condition
1      c70    ScrVeh
2      c71    ScrVeh
3      c72    ScrVeh
4      c73    ScrIns
5      c74    ScrIns
6      c75    ScrIns

However, after I make my switchAnalyzeRlist and do aSwitchList$conditions, my conditions are reversed:

  condition nrReplicates
1    ScrIns            3
2    ScrVeh            3

I need the first condition to be ScrVeh and the second condition to be ScrIns, how do I reverse this? It is the same for my plots, which show ScrIns vs ScrVeh, where I want ScrVeh vs ScrIns. I've tried adding conditions to the argument but it didn't switch them:

switchPlot(aSwitchList, 
  gene = 'TGIF1', 
  condition1 = 'ScrVeh', 
  condition2 = 'ScrIns')

Here is how I made my switchAnalyzeRlist:

aSwitchList <- importRdata(isoformCountMatrix = salmonQuant$counts, 
  isoformRepExpression = salmonQuant$abundance, 
  designMatrix = myDesign,
  isoformExonAnnoation = "gencode.v34.annotation.gtf.gz",
  isoformNtFasta = fasta,
  fixStringTieAnnotationProblem = TRUE,
  showProgress = FALSE)
IsoformSwitchAnalyzeR switchAnalyzeRlist • 1.0k views
ADD COMMENT
0
Entering edit mode

Untested, but can you change aSwitchList$conditions to factor and set the levels to what you want?

aSwitchList$conditions %<>% factor(levels = c("ScrVeh", "ScrIns"))
ADD REPLY
0
Entering edit mode

Thank you for this suggestion, I tried it and got this (below), which I don't think will work for my downstream analysis

   condition nrReplicates 
        <NA>         <NA> 
Levels: ScrVeh ScrIns
ADD REPLY
1
Entering edit mode
2.2 years ago

You can control that via the comparisonsToMake argument in importRdata().

Cheers Kristoffer

ADD COMMENT
0
Entering edit mode

And if you don't it will be alphabetical :-)

ADD REPLY
0
Entering edit mode

What an easy fix! This worked, thank you! :D

ADD REPLY

Login before adding your answer.

Traffic: 1417 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