<p>The <code>mroast</code> function has an argument to specify which contrast do you want to test, quoting from the help page:</p>

<blockquote>
  <p>contrast<br>
  contrast for which the test is required. Can be an integer specifying a column of design, or the name of a column of design, or a numeric contrast vector of length equal to the number of columns of design.</p>
</blockquote>

<p>So if you have the contrast of 1-min timepoint positive vs 1-min timepoint negative you can use this.<br>
Read the help pages in detail, specially the help pages in limma are quite extensive and detailed to answer most questions if not all about how to use the software.</p>

CC BY-SA 4.0
2019-03-29T16:47:20.370Z
thanks for your response! I have read the help pages and they were of no help in understanding this process. I even tried looking at the source code for the function but it was not available.
h3ab74
CC BY-SA 4.0
2019-03-29T16:49:27.707Z
what exactly do you mean by "if you have the contrast of 1-min timepoint positive vs 1-min timepoint negative you can use this."? I understand that I can call the column 2-plus however, how does just calling on this column within the function specify that the contrast must be done relative to the 1-min timepoint?
h3ab74
CC BY-SA 4.0
2019-03-29T23:10:27.010Z
A contrast is a comparison if you use a colum of the design you can compare 1-min timepoint vs the others but I assume that this is not what you want. It would be helpful if you posted your design matrix and your question (and your differential analysis )
llrs
CC BY-SA 4.0
2019-03-30T18:19:19.927Z
So are you saying that should I call on any of the other columns in the design, it would default the contrast to {thatTimepoint - 1-min} ? This is in fact what I want, I just want to understand the mechanism behind it. And, hypothetically speaking, how I could run other contrasts should I wish to in the future. Also, good point, I will upload part of the design matrix in a few hours to give a better idea. Thanks again.
h3ab74
CC BY-SA 4.0
2019-03-31T15:00:25.497Z
If you want to understand the mechanism look the code. I didn't mention the default of the contrast, and in fact it is the last column of the design matrix
llrs
CC BY-SA 4.0
2019-04-01T13:40:11.343Z
Could you upload a link the source code if you know where it is? I have looked all over and could not find it.
h3ab74
CC BY-SA 4.0
2019-04-01T13:45:31.880Z
It is in your computer but you can also access it from the tar.gz file from [bioconductor page](http://bioconductor.org/packages/release/bioc/src/contrib/limma_3.38.3.tar.gz).
llrs
CC BY-SA 4.0
2019-04-01T14:20:20.803Z
Yes I am familiar with these files.. Unfortunately though it does not contain the mroast() function in them.. Thanks anyway though for your help!
h3ab74
CC BY-SA 4.0
2019-04-01T14:44:33.110Z
The mroast function is in the R/geneset-roast.R file (I found via `grep -n "mroast" *.R`. If this answer has helped you, please consider accepting this answer. If not please improve the question as I explained some comments above.
llrs
CC BY-SA 4.0
2019-03-29T09:26:52.257Z
2019-03-29T09:26:52.257Z
llrs
<p>While I have used my title, it is more of a general statistics question regarding how these significance tests are carried out, these include <code>decideTests</code> and <code>mroast</code> / <code>roast</code> among others.</p>

<p>To give a brief overview of my experimental design, I am analysing bulk RNASeq datasets and there are two main factors in the design matrix: <code>patientID</code> and <code>casetimeViremia</code>; where the latter identifies whether a patient is viremia positive or negative at a particular time point (1-4). This leaves us with 5 different possibilities for <code>casetimeViremia</code>: 1-min, 2-plus, 3-min, 3-plus, 4-min.</p>

<p>The design matrix was created in R by running: </p>

<p><code>model.matrix(~patientID + casetimeViremia, data = dgeObject$samples)</code> </p>

<p>Where <code>dgeObject</code> is an object of the function <code>DGEList</code>.</p>

<p>For the purpose of answering this biological question, we wish to conduct the differential expression testing by seeing whether all the previously mentioned <code>casetimeViremia</code> timepoints are separately and significantly expressed relative to each person's <em>first</em> timepoint, which is labelled as: 1-min.</p>

<p>Now, I understood that should I wish to conduct this test, I do not need to specify a contrast matrix in the <code>mroast</code> function and can just do this by calling the column number of interest.. But in that case, how does <code>mroast</code> <em>know</em> that I wish to do the contrast relative to the 1-min timepoint? And, just wondering, should I wish to define a contrast matrix, how would I do this given that there are two <code>colnames</code> missing from the design, in this case one patientID and the 1-min timepoint?  </p>

<p>Thank you all for your time.</p>

<rna-seq><r><limma>
Significant gene set testing - limma
# Significant gene set testing - limma

(Asked by: username_0 on 2019-03-28)

While I have used my title, it is more of a general statistics question regarding how these significance tests are carried out, these include `decideTests` and `mroast` / `roast` among others.

To give a brief overview of my experimental design, I am analysing bulk RNASeq datasets and there are two main factors in the design matrix: `patientID` and `casetimeViremia`; where the latter identifies whether a patient is viremia positive or negative at a particular time point (1-4). This leaves us with 5 different possibilities for `casetimeViremia`: 1-min, 2-plus, 3-min, 3-plus, 4-min.

The design matrix was created in R by running:

`model.matrix(~patientID + casetimeViremia, data = dgeObject$samples)`

Where `dgeObject` is an object of the function `DGEList`.

For the purpose of answering this biological question, we wish to conduct the differential expression testing by seeing whether all the previously mentioned `casetimeViremia` timepoints are separately and significantly expressed relative to each person's *first* timepoint, which is labelled as: 1-min.

Now, I understood that should I wish to conduct this test, I do not need to specify a contrast matrix in the `mroast` function and can just do this by calling the column number of interest.. But in that case, how does `mroast` *know* that I wish to do the contrast relative to the 1-min timepoint? And, just wondering, should I wish to define a contrast matrix, how would I do this given that there are two `colnames` missing from the design, in this case one patientID and the 1-min timepoint?

Thank you all for your time.

**Tags:** rna-seq, r, limma

---

## 1 answers

### Answer by username_1 on 2019-03-29. Score: 2 | Accepted answer

The `mroast` function has an argument to specify which contrast do you want to test, quoting from the help page:

> contrast  
> contrast for which the test is required. Can be an integer specifying a column of design, or the name of a column of design, or a numeric contrast vector of length equal to the number of columns of design.

So if you have the contrast of 1-min timepoint positive vs 1-min timepoint negative you can use this.  
Read the help pages in detail, specially the help pages in limma are quite extensive and detailed to answer most questions if not all about how to use the software.

> **Comments:**
> **username_0**: thanks for your response! I have read the help pages and they were of no help in understanding this process. I even tried looking at the source code for the function but it was not available.  
> **username_0**: what exactly do you mean by "if you have the contrast of 1-min timepoint positive vs 1-min timepoint negative you can use this."? I understand that I can call the column 2-plus however, how does just calling on this column within the function specify that the contrast must be done relative to the 1-min timepoint?  
> **username_1**: A contrast is a comparison if you use a colum of the design you can compare 1-min timepoint vs the others but I assume that this is not what you want. It would be helpful if you posted your design matrix and your question (and your differential analysis )  
> **username_0**: So are you saying that should I call on any of the other columns in the design, it would default the contrast to {thatTimepoint - 1-min} ? This is in fact what I want, I just want to understand the mechanism behind it. And, hypothetically speaking, how I could run other contrasts should I wish to in the future. Also, good point, I will upload part of the design matrix in a few hours to give a better idea. Thanks again.  
> **username_1**: If you want to understand the mechanism look the code. I didn't mention the default of the contrast, and in fact it is the last column of the design matrix  
> **username_0**: Could you upload a link the source code if you know where it is? I have looked all over and could not find it.  
> **username_1**: It is in your computer but you can also access it from the tar.gz file from [bioconductor page](http://bioconductor.org/packages/release/bioc/src/contrib/limma_3.38.3.tar.gz).  
> **username_0**: Yes I am familiar with these files.. Unfortunately though it does not contain the mroast() function in them.. Thanks anyway though for your help!  
> **username_1**: The mroast function is in the R/geneset-roast.R file (I found via `grep -n "mroast" *.R`. If this answer has helped you, please consider accepting this answer. If not please improve the question as I explained some comments above.  

---

