Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Travis Lawrence
    Junior Member
    • Apr 2015
    • 2

    Blocking and using contrasts in voom (limma) (RNAseq)

    I am having trouble making the contrast matrix when I am using library preparation type (e.g. paired-end, single-end) as an addition variable in the model matrix:

    Code:
    Treatment <- factor(targets$Treatment[c(1:8,11:13)], levels=c("T1", "T2", "T3", "T4"))
    Seq <- factor(targets$Sequence[c(1:8,11:13)], level=c("single", "pair"))
    design <- model.matrix(~SeqType + Treatment)
    y <- voom(x, design, plot=TRUE)
    fit <- lmFit(y, design)
    Where SeqType is a factor with a value for each RNAseq sample of either paired or single and Treatment is a factor labeling each sample as one of four treatments.

    The resulting design matrix for the fit object is:
    Code:
    (Intercept) Seqpair Treatment2 Treatment3 Treatment4
          1       1        0          1          0  
          1       1        0          0          1
          1       0        1          0          0 
          1       1        1          0          0
          1       1        0          0          0
          1       0        0          0          1
          1       0        0          1          0
          1       0        0          0          0
          1       1        1          0          0
          1       1        0          1          0
          1       1        0          0          1
    I am unsure of how to construct the contrast matrix to test all pairwise comparisons of treatments.

    I have previously used the makeContrasts command, however, I also previously constructed the design matrix by providing it an intercept (design <- model.matrix(~0 + Treatment)) so constructing the contrasts was done by just giving the column headings of the design matrix to the makeContrasts function:

    Code:
    contrast.matrix <- makeContrasts(T1vsT2 = Treatment1-Treatment2)

Latest Articles

Collapse

  • SEQadmin2
    Nine Things a Sample Prep Scientist Thinks About Before Sequencing
    by SEQadmin2


    I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

    Here are nine questions we think about, in roughly the order they matter, before...
    06-18-2026, 07:11 AM
  • SEQadmin2
    From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
    by SEQadmin2


    Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


    The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
    ...
    06-02-2026, 10:05 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by SEQadmin2, Yesterday, 05:37 AM
0 responses
6 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 06-26-2026, 11:10 AM
0 responses
16 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 06-17-2026, 06:09 AM
0 responses
51 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 06-09-2026, 11:58 AM
0 responses
110 views
0 reactions
Last Post SEQadmin2  
Working...