scripts/20bExpression-for-variety.Rnw
Version 1

_p_VinskaTrta/_I_EnViRoS/_S_01_Integ/_A_01_Desc-R/

SEEK ID: https://testing.sysmo-db.org/documents/544?version=1

Filename: scripts/20bExpression-for-variety.Rnw  Download

Format: Plain text document

Size: 1.35 KB

% -*- TeX:Rnw:UTF-8 -*-
% ----------------------------------------------------------------
% .R knitr file  ************************************************
% ----------------------------------------------------------------
%%
<<echo=FALSE>>=
###############################################
##                                           ##
## (c) Andrej Blejec (andrej.blejec@nib.si)  ##
##                                           ##
###############################################
@
<<echo=FALSE,results='hide'>>=
options(width=70)
@

\section{Analysis for variety}

<<>>=
var <- "C"
select <- pd$variety == var
@

<<>>=
design <- with(pd[select,], model.matrix(~ treat* day))
head(design)
@

<<>>=
fit <- lmFit(exprs[ ,select], design)
fit <- eBayes(fit)
head(fit1[1:6,])
@

<<>>=
my.interaction.plot <- function(F1,F2,y,...){
    xlab <- deparse(substitute(F1))
    y <- unlist(y)
    ylim <- range(y)
    interaction.plot(F1, F2, y,
     col = 1:length(levels(F2)),
     xlab = xlab,
     ylim = ylim,
     type = "b",
     pch = rep(16, length(levels(F2))),
     ...
     )
    points(as.numeric(F1)+(as.numeric(F2)-1.5)/15,y, col=as.numeric(F2))
    }
@

<<>>=
tt <- topTable(fit, coef=4)
@


<<>>=
varname <- rownames(tt)[1]
with(pd[select, ], my.interaction.plot(day,treat,exprs[varname,select]) )
@


<<>>=

@ 
help Creators and Submitter
Creator
Submitter
Activity

Views: 860   Downloads: 34

Created: 7th Nov 2021 at 15:25

Last updated: 7th Nov 2021 at 15:25

help Tags
help Attributions

None

Version History

Version 1 (earliest) Created 7th Nov 2021 at 15:25 by Andrej Blejec

No revision comments

Powered by
(v.1.18.0)