Last updated: 2019-10-28

Checks: 6 0

Knit directory: Porello-heart-snRNAseq/

This reproducible R Markdown analysis was created with workflowr (version 1.3.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20190603) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/

Untracked files:
    Untracked:  analysis/07b-DECardioFYA.Rmd
    Untracked:  analysis/08-ClustEpicardial.Rmd
    Untracked:  analysis/PBapproachMarker-cardio.Rmd
    Untracked:  analysis/doublet-detection.Rmd
    Untracked:  broad_props.csv
    Untracked:  code/ReadDataObjects.R
    Untracked:  code/getTransformedProps.R
    Untracked:  data/adult-clust.txt
    Untracked:  data/dcm-clust.txt
    Untracked:  data/fetal-clust.txt
    Untracked:  data/gstlist-adult.Rdata
    Untracked:  data/gstlist-dcm-res03.Rdata
    Untracked:  data/gstlist-dcm.Rdata
    Untracked:  data/gstlist-fetal.Rdata
    Untracked:  data/gstlist-young.Rdata
    Untracked:  data/heart-markers-long.txt
    Untracked:  data/immune-markers-long.txt
    Untracked:  data/pseudobulk-pool.Rds
    Untracked:  data/pseudobulk.Rds
    Untracked:  data/targets_pools.txt
    Untracked:  data/young-clust.txt
    Untracked:  output/AllAdult-clustermarkers-v2.csv
    Untracked:  output/AllAdult-clustermarkers.csv
    Untracked:  output/AllFetal-clustermarkers.csv
    Untracked:  output/AllYoung-clustermarkers.csv
    Untracked:  output/Alldcm-clustermarkers.csv
    Untracked:  output/DEAnalysis/
    Untracked:  output/Figures/
    Untracked:  output/MarkerAnalysis/
    Untracked:  output/RDataObjects/
    Untracked:  output/cardio-numcells-clusters.csv
    Untracked:  output/cardio-numcells-clusters.txt
    Untracked:  output/fetal1-clustermarkers.csv
    Untracked:  output/fetal2-clustermarkers.csv
    Untracked:  output/fetal3-clustermarkers.csv
    Untracked:  output/heatmap-top10-adultmarkergenes.pdf
    Untracked:  output/young1-clustermarkers.csv

Unstaged changes:
    Modified:   analysis/01-QualityControl.Rmd
    Modified:   analysis/01a-DEpseudobulk.Rmd
    Modified:   analysis/02-ClusterFetal.Rmd
    Modified:   analysis/02c-ClusterFetal3.Rmd
    Modified:   analysis/03-ClusterYoung.Rmd
    Modified:   analysis/04-ClusterAdult.Rmd
    Modified:   analysis/07a-ClustCardioFYA.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view them.

File Version Author Date Message
Rmd 47b04ff Belinda Phipson 2019-10-28 fix figures
html f474878 Belinda Phipson 2019-10-28 Build site.
Rmd d06c0c8 Belinda Phipson 2019-10-28 add differential expression analysis for broad cell types

Introduction

Load libraries and functions

library(edgeR)
library(RColorBrewer)
library(org.Hs.eg.db)
library(limma)
library(Seurat)
library(monocle)
library(cowplot)
library(DelayedArray)
library(scran)
library(NMF)
library(workflowr)
library(ggplot2)
library(clustree)
library(dplyr)
source("/misc/card2-single_cell_nuclei_rnaseq/Porello-heart-snRNAseq/code/normCounts.R")
source("/misc/card2-single_cell_nuclei_rnaseq/Porello-heart-snRNAseq/code/findModes.R")
source("/misc/card2-single_cell_nuclei_rnaseq/Porello-heart-snRNAseq/code/ggplotColors.R")

Load the data

targets <- read.delim("/misc/card2-single_cell_nuclei_rnaseq/Porello-heart-snRNAseq/data/targets.txt",header=TRUE, stringsAsFactors = FALSE)
targets$FileName2 <- paste(targets$FileName,"/",sep="")
targets$Group_ID2 <- gsub("LV_","",targets$Group_ID)
group <- c("Fetal_1","Fetal_2","Fetal_3",
           "Young_1","Young_2","Young_3",
           "Adult_1","Adult_2","Adult_3", 
           "Diseased_1","Diseased_2",
           "Diseased_3","Diseased_4")
m <- match(group, targets$Group_ID2)
targets <- targets[m,]
fetal.integrated <- readRDS(file="./output/RDataObjects/fetal-int.Rds")
load(file="./output/RDataObjects/fetalObjs.Rdata")

young.integrated <- readRDS(file="./output/RDataObjects/young-int.Rds")
load(file="./output/RDataObjects/youngObjs.Rdata")

adult.integrated <- readRDS(file="./output/RDataObjects/adult-int.Rds")
load(file="./output/RDataObjects/adultObjs.Rdata")
# Load unfiltered counts matrix for every sample (object all)
load("./output/RDataObjects/all-counts.Rdata")

Set default clustering resolution

# Default 0.3
Idents(fetal.integrated) <- fetal.integrated$integrated_snn_res.0.3
DimPlot(fetal.integrated, reduction = "tsne",label=TRUE,label.size = 6)+NoLegend()

Version Author Date
f474878 Belinda Phipson 2019-10-28
# Default 0.3
DimPlot(young.integrated, reduction = "tsne",label=TRUE,label.size = 6)+NoLegend()

Version Author Date
f474878 Belinda Phipson 2019-10-28
# Default 0.6
DimPlot(adult.integrated, reduction = "tsne",label=TRUE,label.size = 6)+NoLegend()

Version Author Date
f474878 Belinda Phipson 2019-10-28

Merge all data together

heart <- merge(fetal.integrated, y = c(young.integrated, adult.integrated), project = "heart")
table(heart$orig.ident)

adult fetal young 
 9416 27760 16964 
table(heart$biorep)

   a1    a2    a3    f1    f2    f3    y1    y2    y3 
 4360  3375  1681  8296 10948  8516  4422  5558  6984 
table(heart$Broad_celltype,heart$biorep)
                     
                        a1   a2   a3   f1   f2   f3   y1   y2   y3
  Cardiomyocytes      1856  564  383 5475 8580 5140 1073 2221 4456
  Endothelial cells    599  466  165  735  715 1298  511  462  550
  Epicardial cells     343  493   92  564  425  404  613  280  260
  Erythroid              0    0    0   43   49   31    0    0    0
  Fibroblast          1034 1230  495 1029  755 1201 1622 1688  805
  Immune cells         449  530  519  287  274  196  337  808  731
  Neurons               57   43   14  109  130  110  207   71  133
  Smooth muscle cells   22   49   13   54   20  136   59   28   49

Remove erythroid cells

heart <- subset(heart,subset = Broad_celltype != "Erythroid")
heart$biorep <- factor(heart$biorep,levels=c("f1","f2","f3","y1","y2","y3","a1","a2","a3"))
table(heart$Broad_celltype,heart$biorep)
                     
                        f1   f2   f3   y1   y2   y3   a1   a2   a3
  Cardiomyocytes      5475 8580 5140 1073 2221 4456 1856  564  383
  Endothelial cells    735  715 1298  511  462  550  599  466  165
  Epicardial cells     564  425  404  613  280  260  343  493   92
  Fibroblast          1029  755 1201 1622 1688  805 1034 1230  495
  Immune cells         287  274  196  337  808  731  449  530  519
  Neurons              109  130  110  207   71  133   57   43   14
  Smooth muscle cells   54   20  136   59   28   49   22   49   13

Get gene annotation

columns(org.Hs.eg.db)
 [1] "ACCNUM"       "ALIAS"        "ENSEMBL"      "ENSEMBLPROT" 
 [5] "ENSEMBLTRANS" "ENTREZID"     "ENZYME"       "EVIDENCE"    
 [9] "EVIDENCEALL"  "GENENAME"     "GO"           "GOALL"       
[13] "IPI"          "MAP"          "OMIM"         "ONTOLOGY"    
[17] "ONTOLOGYALL"  "PATH"         "PFAM"         "PMID"        
[21] "PROSITE"      "REFSEQ"       "SYMBOL"       "UCSCKG"      
[25] "UNIGENE"      "UNIPROT"     
ann <- AnnotationDbi:::select(org.Hs.eg.db,keys=rownames(all),columns=c("SYMBOL","ENTREZID","ENSEMBL","GENENAME","CHR"),keytype = "SYMBOL")
m <- match(rownames(all),ann$SYMBOL)
ann <- ann[m,]
table(ann$SYMBOL==rownames(all))

 TRUE 
33939 
mito <- grep("mitochondrial",ann$GENENAME)
length(mito)
[1] 226
ribo <- grep("ribosomal",ann$GENENAME)
length(ribo)
[1] 198
missingEZID <- which(is.na(ann$ENTREZID))
length(missingEZID)
[1] 10530

Filter out non-informative genes

m <- match(colnames(heart),colnames(all))
all.counts <- all[,m]
chuck <- unique(c(mito,ribo,missingEZID))
length(chuck)
[1] 10875
all.counts.keep <- all.counts[-chuck,]
ann.keep <- ann[-chuck,]
table(ann.keep$SYMBOL==rownames(all.counts.keep))

 TRUE 
23064 
# remove x y genes

xy <- ann.keep$CHR %in% c("X","Y")
all.counts.keep <- all.counts.keep[!xy,]
ann.keep <- ann.keep[!xy,]
numzero.genes <- rowSums(all.counts.keep==0)

#avg.exp <- rowMeans(cpm.DGEList(y.kid,log=TRUE))

#plot(avg.exp,numzero.genes,xlab="Average log-normalised-counts",ylab="Number zeroes per gene")

table(numzero.genes > (ncol(all.counts.keep)-20))

FALSE  TRUE 
18500  3557 
keep.genes <- numzero.genes < (ncol(all.counts.keep)-20)
table(keep.genes)
keep.genes
FALSE  TRUE 
 3593 18464 
all.keep <- all.counts.keep[keep.genes,]
dim(all.keep)
[1] 18464 54017
ann.keep <- ann.keep[keep.genes,]

table(colnames(heart)==colnames(all.keep))

 TRUE 
54017 
table(rownames(all.keep)==ann.keep$SYMBOL)

 TRUE 
18464 

Create pseudobulk samples

broadct <- factor(heart$Broad_celltype)
sam <- factor(heart$biorep,levels=c("f1","f2","f3","y1","y2","y3","a1","a2","a3"))
newgrp <- paste(broadct,sam,sep=".")
newgrp <- factor(newgrp,levels=paste(rep(levels(broadct),each=9),levels(sam),sep="."))
table(newgrp)
newgrp
     Cardiomyocytes.f1      Cardiomyocytes.f2      Cardiomyocytes.f3 
                  5475                   8580                   5140 
     Cardiomyocytes.y1      Cardiomyocytes.y2      Cardiomyocytes.y3 
                  1073                   2221                   4456 
     Cardiomyocytes.a1      Cardiomyocytes.a2      Cardiomyocytes.a3 
                  1856                    564                    383 
  Endothelial cells.f1   Endothelial cells.f2   Endothelial cells.f3 
                   735                    715                   1298 
  Endothelial cells.y1   Endothelial cells.y2   Endothelial cells.y3 
                   511                    462                    550 
  Endothelial cells.a1   Endothelial cells.a2   Endothelial cells.a3 
                   599                    466                    165 
   Epicardial cells.f1    Epicardial cells.f2    Epicardial cells.f3 
                   564                    425                    404 
   Epicardial cells.y1    Epicardial cells.y2    Epicardial cells.y3 
                   613                    280                    260 
   Epicardial cells.a1    Epicardial cells.a2    Epicardial cells.a3 
                   343                    493                     92 
         Fibroblast.f1          Fibroblast.f2          Fibroblast.f3 
                  1029                    755                   1201 
         Fibroblast.y1          Fibroblast.y2          Fibroblast.y3 
                  1622                   1688                    805 
         Fibroblast.a1          Fibroblast.a2          Fibroblast.a3 
                  1034                   1230                    495 
       Immune cells.f1        Immune cells.f2        Immune cells.f3 
                   287                    274                    196 
       Immune cells.y1        Immune cells.y2        Immune cells.y3 
                   337                    808                    731 
       Immune cells.a1        Immune cells.a2        Immune cells.a3 
                   449                    530                    519 
            Neurons.f1             Neurons.f2             Neurons.f3 
                   109                    130                    110 
            Neurons.y1             Neurons.y2             Neurons.y3 
                   207                     71                    133 
            Neurons.a1             Neurons.a2             Neurons.a3 
                    57                     43                     14 
Smooth muscle cells.f1 Smooth muscle cells.f2 Smooth muscle cells.f3 
                    54                     20                    136 
Smooth muscle cells.y1 Smooth muscle cells.y2 Smooth muscle cells.y3 
                    59                     28                     49 
Smooth muscle cells.a1 Smooth muscle cells.a2 Smooth muscle cells.a3 
                    22                     49                     13 
des <- model.matrix(~0+newgrp)
colnames(des) <- levels(newgrp)

dim(des)
[1] 54017    63
dim(all.counts.keep)
[1] 22057 54017
pb <- all.keep %*% des
y.pb <- DGEList(pb)
saminfo <- matrix(unlist(strsplit(colnames(y.pb$counts),split="[.]")),ncol=2,byrow=TRUE)
bct <- factor(saminfo[,1])
indiv <- factor(saminfo[,2])
group <- rep(NA,ncol(y.pb))
group[grep("f",indiv)] <- "fetal"
group[grep("y",indiv)] <- "young"
group[grep("a",indiv)] <- "adult"
group <- factor(group,levels=c("fetal","young","adult"))
targets.pb <- data.frame(bct,indiv,group)
targets.pb$Sex <- targets$Sex[1:9]
par(mfrow=c(1,1))
sexgroup <- paste(group,targets.pb$Sex,sep=".")
plotMDS.DGEList(y.pb,gene.selection="common",col=ggplotColors(7)[bct],pch=c(0,15,1,16,2,17)[factor(sexgroup)],cex=2)
legend("bottomright",legend=levels(bct),fill=ggplotColors(7),bty="n")
legend("bottomleft",legend=c("Female","Male"),pch=c(1,16),cex=1.5)
legend("topright",legend=c("Fetal","Young","Adult"),pch=c(1,2,0),cex=1.5)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plotMDS.DGEList(y.pb,gene.selection="common",col=ggplotColors(7)[bct],pch=c(0,15,1,16,2,17)[factor(sexgroup)],cex=2,dim=c(3,4))
legend("bottomright",legend=levels(bct),fill=ggplotColors(7),bty="n")
legend("top",legend=c("Female","Male"),pch=c(1,16),cex=1.5)
legend("topright",legend=c("Fetal","Young","Adult"),pch=c(1,2,0),cex=1.5)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plotMDS.DGEList(y.pb,gene.selection="common",col=ggplotColors(7)[bct],pch=c(0,15,1,16,2,17)[factor(sexgroup)],cex=2,dim=c(5,6))
legend("bottomleft",legend=levels(bct),fill=ggplotColors(7),bty="n")
legend("top",legend=c("Female","Male"),pch=c(1,16),cex=1.5)
legend("bottomright",legend=c("Fetal","Young","Adult"),pch=c(1,2,0),cex=1.5)

Version Author Date
f474878 Belinda Phipson 2019-10-28

Differential expression analysis

table(rownames(y.pb)==ann.keep$SYMBOL)

 TRUE 
18464 
y.pb$genes <- ann.keep

#logcounts <- normCounts(y.pb,log=TRUE,prior.count=0.5)
bct2 <- as.character(bct)
bct2[bct2 == "Cardiomyocytes"] <- "cardio"
bct2[bct2 == "Endothelial cells"] <- "endo"
bct2[bct2 == "Epicardial cells"] <- "epicardial"
bct2[bct2 == "Fibroblast"] <- "fibro"
bct2[bct2 == "Immune cells"] <- "immune"
bct2[bct2 == "Neurons"] <- "neurons"
bct2[bct2 == "Smooth muscle cells"] <- "smc"

newgrp <- paste(bct2,group,targets.pb$Sex,sep=".")
newgrp <- factor(newgrp)

design <- model.matrix(~0+newgrp)
colnames(design) <- levels(newgrp)

v <- voom(y.pb,design,plot=TRUE,normalize.method = "cyclicloess")

Version Author Date
f474878 Belinda Phipson 2019-10-28
fit <- lmFit(v,design)

#fit <- lmFit(logcounts,design)

Cardiomyocytes

cont.cardio <- makeContrasts(YvF = 0.5*(cardio.young.Male + cardio.young.Female) - 0.5*(cardio.fetal.Male + cardio.fetal.Female),
                         AvF = 0.5*(cardio.adult.Male + cardio.adult.Female) - 0.5*(cardio.fetal.Male + cardio.fetal.Female),
                         AvY = 0.5*(cardio.adult.Male + cardio.adult.Female) - 0.5*(cardio.young.Male + cardio.young.Female),
                         SexFetal = cardio.fetal.Male - cardio.fetal.Female,
                         SexYoung = cardio.young.Male - cardio.young.Female,
                         SexAdult = cardio.adult.Male - cardio.adult.Female,
                         InteractionAF = (cardio.adult.Male - cardio.fetal.Male) - (cardio.adult.Female - cardio.fetal.Female),
                         InteractionYF = (cardio.young.Male - cardio.fetal.Male) - (cardio.young.Female - cardio.fetal.Female),
                         InteractionAY = (cardio.adult.Male - cardio.young.Male) - (cardio.adult.Female - cardio.young.Female),
                         levels=design)
fit.cardio <- contrasts.fit(fit,contrasts = cont.cardio)
fit.cardio <- eBayes(fit.cardio,robust=TRUE)

summary(decideTests(fit.cardio))
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down    3203  3109   250      243      489      287           251
NotSig 11705 11686 17703    18159    17860    18002         17955
Up      3556  3669   511       62      115      175           258
       InteractionYF InteractionAY
Down              87           133
NotSig         18309         17995
Up                68           336
treat.cardio <- treat(fit.cardio,lfc=0.5)

dt.cardio<-decideTests(treat.cardio)

summary(dt.cardio)
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down    1387  1496    16      107       93       63            57
NotSig 15645 15481 18397    18349    18367    18384         18351
Up      1432  1487    51        8        4       17            56
       InteractionYF InteractionAY
Down              23            22
NotSig         18419         18374
Up                22            68
par(mfrow=c(3,3))
for(i in 1:9){
  plotMD(treat.cardio,coef=i,status=dt.cardio[,i],hl.col=c("blue","red"))
  abline(h=0,col="grey")
}

Version Author Date
f474878 Belinda Phipson 2019-10-28
par(mfrow=c(1,1))
par(mar=c(7,4,2,2))
barplot(summary(dt.cardio)[-2,],beside=TRUE,legend=TRUE,col=c("blue","red"),ylab="Number of significant genes",las=2,xlab="")
title("Cardiomyocytes")

Version Author Date
f474878 Belinda Phipson 2019-10-28

Young vs Fetal

options(digits=3)
topTreat(treat.cardio,coef=1,n=20,p.value=0.05)[,-c(1:3)]
                                                                  GENENAME
TMEM178B                                        transmembrane protein 178B
MBOAT2                membrane bound O-acyltransferase domain containing 2
GRAMD1B                                          GRAM domain containing 1B
TOGARAM2                    TOG array regulator of axonemal microtubules 2
DGKG                                           diacylglycerol kinase gamma
IGF2BP3                insulin like growth factor 2 mRNA binding protein 3
MIR29B2CHG                                    MIR29B2 and MIR29C host gene
PEBP4                           phosphatidylethanolamine binding protein 4
NCEH1                                neutral cholesterol ester hydrolase 1
NEAT1                            nuclear paraspeckle assembly transcript 1
CCSER1                                   coiled-coil serine rich protein 1
DAPK2                                    death associated protein kinase 2
LINC01621                      long intergenic non-protein coding RNA 1621
ADRA1A                                               adrenoceptor alpha 1A
PRICKLE1                            prickle planar cell polarity protein 1
FRMD5                                             FERM domain containing 5
THRB                                         thyroid hormone receptor beta
HECW2      HECT, C2 and WW domain containing E3 ubiquitin protein ligase 2
USP31                                      ubiquitin specific peptidase 31
CHPT1                                         choline phosphotransferase 1
           CHR logFC AveExpr     t  P.Value adj.P.Val
TMEM178B     7  7.65    4.39  21.6 3.89e-18  7.18e-14
MBOAT2       2 -3.22    6.07 -20.5 1.33e-17  1.22e-13
GRAMD1B     11  3.58    5.35  20.1 2.27e-17  1.40e-13
TOGARAM2     2  7.80    2.76  19.2 7.09e-17  3.27e-13
DGKG         3  4.76    6.21  17.9 3.64e-16  1.13e-12
IGF2BP3      7 -5.30    4.68 -17.8 3.67e-16  1.13e-12
MIR29B2CHG   1  3.92    6.61  17.7 4.46e-16  1.18e-12
PEBP4        8  4.52    4.25  17.5 5.66e-16  1.27e-12
NCEH1        3  4.08    5.33  17.5 6.19e-16  1.27e-12
NEAT1       11  3.14   10.87  17.3 7.29e-16  1.35e-12
CCSER1       4  3.32    6.59  16.8 1.42e-15  2.38e-12
DAPK2       15  3.01    5.21  16.7 1.75e-15  2.69e-12
LINC01621    6 -5.84   -1.51 -16.6 1.90e-15  2.71e-12
ADRA1A       8  4.40    3.13  15.8 6.58e-15  8.68e-12
PRICKLE1    12 -2.46    7.05 -15.6 7.93e-15  9.28e-12
FRMD5       15 -4.21    6.15 -15.6 8.04e-15  9.28e-12
THRB         3  5.02    6.58  15.3 1.25e-14  1.36e-11
HECW2        2 -4.32    6.28 -15.0 2.10e-14  2.15e-11
USP31       16  2.77    5.91  14.8 2.62e-14  2.43e-11
CHPT1       12  2.85    6.80  14.8 2.63e-14  2.43e-11

Adult vs Fetal

topTreat(treat.cardio,coef=2,n=20,p.value=0.05)[,-c(1:3)]
                                                                  GENENAME
FILIP1L                               filamin A interacting protein 1 like
TMEM178B                                        transmembrane protein 178B
MBOAT2                membrane bound O-acyltransferase domain containing 2
AAK1                                               AP2 associated kinase 1
MIR29B2CHG                                    MIR29B2 and MIR29C host gene
DGKG                                           diacylglycerol kinase gamma
CCSER1                                   coiled-coil serine rich protein 1
TOGARAM2                    TOG array regulator of axonemal microtubules 2
IGF2BP3                insulin like growth factor 2 mRNA binding protein 3
NEAT1                            nuclear paraspeckle assembly transcript 1
TMEM155                                          transmembrane protein 155
LINC01621                      long intergenic non-protein coding RNA 1621
PPP1R13L                  protein phosphatase 1 regulatory subunit 13 like
NCEH1                                neutral cholesterol ester hydrolase 1
EMILIN2                                   elastin microfibril interfacer 2
EMC10                               ER membrane protein complex subunit 10
HOOK2                                 hook microtubule tethering protein 2
AGPAT4                      1-acylglycerol-3-phosphate O-acyltransferase 4
HECW2      HECT, C2 and WW domain containing E3 ubiquitin protein ligase 2
BARD1                                       BRCA1 associated RING domain 1
           CHR logFC AveExpr     t  P.Value adj.P.Val
FILIP1L      3  3.92   7.639  21.7 3.62e-18  4.36e-14
TMEM178B     7  7.63   4.393  21.5 4.72e-18  4.36e-14
MBOAT2       2 -3.21   6.065 -19.8 3.01e-17  1.47e-13
AAK1         2  1.90   8.115  19.8 3.19e-17  1.47e-13
MIR29B2CHG   1  4.25   6.614  19.5 4.43e-17  1.64e-13
DGKG         3  5.06   6.211  19.1 7.05e-17  2.17e-13
CCSER1       4  3.67   6.590  19.0 8.43e-17  2.22e-13
TOGARAM2     2  7.65   2.758  18.5 1.68e-16  3.89e-13
IGF2BP3      7 -5.52   4.676 -17.1 9.95e-16  2.04e-12
NEAT1       11  3.09  10.866  17.0 1.16e-15  2.14e-12
TMEM155      4 -8.30  -0.498 -16.8 1.49e-15  2.34e-12
LINC01621    6 -5.83  -1.513 -16.8 1.55e-15  2.34e-12
PPP1R13L    19  3.69   4.399  16.7 1.65e-15  2.34e-12
NCEH1        3  3.95   5.332  16.4 2.51e-15  3.24e-12
EMILIN2     18 -4.04   4.507 -16.4 2.64e-15  3.24e-12
EMC10       19 -3.45   6.132 -16.1 3.84e-15  4.43e-12
HOOK2       19  2.30   5.762  15.8 6.45e-15  7.01e-12
AGPAT4       6 -3.90   5.821 -15.7 7.39e-15  7.58e-12
HECW2        2 -5.38   6.279 -15.4 1.10e-14  1.06e-11
BARD1        2 -2.94   5.740 -15.2 1.63e-14  1.50e-11

Adult vs Young

topTreat(treat.cardio,coef=3,n=20,p.value=0.05)[,-c(1:3)]
                                                  GENENAME CHR logFC
ZFP57                            ZFP57 zinc finger protein   6  5.52
FAM153A       family with sequence similarity 153 member A   5  3.96
DNAAF3                   dynein axonemal assembly factor 3  19  3.14
SVOP                                   SV2 related protein  12  2.88
CACNA1E     calcium voltage-gated channel subunit alpha1 E   1  3.08
AGBL4                       ATP/GTP binding protein like 4   1  2.94
FILIP1L               filamin A interacting protein 1 like   3  1.49
TNNT1                      troponin T1, slow skeletal type  19  2.88
GLIS3                            GLIS family zinc finger 3   9 -2.96
TBC1D3D                       TBC1 domain family member 3D  17  3.28
ARG2                                            arginase 2  14 -2.15
LINC02506      long intergenic non-protein coding RNA 2506   4  3.27
CYP2J2       cytochrome P450 family 2 subfamily J member 2   1  2.05
LINC02232      long intergenic non-protein coding RNA 2232   4  4.90
EXOG                                    exo/endonuclease G   3  1.27
DNAH14                      dynein axonemal heavy chain 14   1  2.35
OR4C3     olfactory receptor family 4 subfamily C member 3  11  2.70
POU6F2                              POU class 6 homeobox 2   7  1.65
LINC01699      long intergenic non-protein coding RNA 1699   1  3.53
ASB2              ankyrin repeat and SOCS box containing 2  14  2.09
          AveExpr     t  P.Value adj.P.Val
ZFP57       0.270 10.72 3.36e-11  4.42e-07
FAM153A     1.699 10.53 4.79e-11  4.42e-07
DNAAF3      1.626  8.85 1.58e-09  9.72e-06
SVOP        1.498  8.44 3.90e-09  1.80e-05
CACNA1E     2.080  7.63 2.54e-08  9.36e-05
AGBL4       4.816  7.14 8.05e-08  2.48e-04
FILIP1L     7.639  7.02 1.07e-07  2.83e-04
TNNT1       1.732  6.83 1.71e-07  3.85e-04
GLIS3       7.093 -6.80 1.88e-07  3.85e-04
TBC1D3D    -1.750  6.65 2.67e-07  4.93e-04
ARG2        3.449 -6.43 4.63e-07  7.77e-04
LINC02506   1.150  6.24 7.48e-07  1.15e-03
CYP2J2      2.796  5.92 1.65e-06  2.20e-03
LINC02232   0.675  5.94 1.67e-06  2.20e-03
EXOG        5.847  5.78 2.41e-06  2.82e-03
DNAH14      4.038  5.77 2.45e-06  2.82e-03
OR4C3      -1.822  5.52 4.66e-06  5.06e-03
POU6F2      3.111  5.44 5.67e-06  5.82e-03
LINC01699  -1.609  5.39 6.61e-06  6.43e-03
ASB2        3.129  5.35 7.19e-06  6.64e-03

Male vs Female in fetal samples

topTreat(treat.cardio,coef=4,n=20,p.value=0.05)[,-c(1:3)]
                                              GENENAME CHR logFC AveExpr
BMP10                    bone morphogenetic protein 10   2 -8.33  -1.542
ZNF385B                       zinc finger protein 385B   2 -3.90   3.787
EPHA4                                  EPH receptor A4   2 -3.38   5.247
APOA2                                apolipoprotein A2   1 -4.67  -1.812
FAM155A   family with sequence similarity 155 member A  13 -4.60   5.622
ZFP57                        ZFP57 zinc finger protein   6  6.13   0.270
SHOX2                         short stature homeobox 2   3 -6.93   0.702
GSG1L                                        GSG1 like  16 -4.02   2.272
SYNPR                                     synaptoporin   3 -3.64   2.716
FABP2                     fatty acid binding protein 2   4 -6.43  -1.390
FLG-AS1                            FLG antisense RNA 1   1  3.63   5.496
IRF4                    interferon regulatory factor 4   6 -3.67   0.408
VWDE           von Willebrand factor D and EGF domains   7 -3.87   0.899
SLC45A2              solute carrier family 45 member 2   5 -2.37   1.009
TDGF1          teratocarcinoma-derived growth factor 1   3  7.25  -0.681
PPFIA2               PTPRF interacting protein alpha 2  12 -2.99   5.432
PLCB1                           phospholipase C beta 1  20 -3.10   8.683
SLC5A12              solute carrier family 5 member 12  11 -4.96   0.421
DAB1                             DAB adaptor protein 1   1  2.16   7.416
FAM189A1 family with sequence similarity 189 member A1  15 -2.87   3.589
              t  P.Value adj.P.Val
BMP10    -16.14 4.05e-15  7.48e-11
ZNF385B  -14.04 9.27e-14  6.35e-10
EPHA4    -13.97 1.03e-13  6.35e-10
APOA2    -10.19 9.61e-11  4.11e-07
FAM155A  -10.10 1.14e-10  4.11e-07
ZFP57     10.04 1.33e-10  4.11e-07
SHOX2     -9.77 2.35e-10  6.19e-07
GSG1L     -9.59 3.27e-10  7.55e-07
SYNPR     -9.43 4.60e-10  9.43e-07
FABP2     -9.36 5.52e-10  1.02e-06
FLG-AS1    9.00 1.15e-09  1.91e-06
IRF4      -8.96 1.24e-09  1.91e-06
VWDE      -8.79 1.81e-09  2.57e-06
SLC45A2   -8.36 4.75e-09  6.26e-06
TDGF1      8.07 9.70e-09  1.19e-05
PPFIA2    -7.81 1.67e-08  1.85e-05
PLCB1     -7.80 1.71e-08  1.85e-05
SLC5A12   -7.51 3.43e-08  3.52e-05
DAB1       7.42 4.13e-08  4.01e-05
FAM189A1  -7.34 4.97e-08  4.56e-05

Male vs Female in young samples

topTreat(treat.cardio,coef=5,n=20,p.value=0.05)[,-c(1:3)]
                                                      GENENAME CHR logFC
SLC38A8                      solute carrier family 38 member 8  16 -5.65
C4orf54                     chromosome 4 open reading frame 54   4 -4.60
GBE1                       1,4-alpha-glucan branching enzyme 1   3 -1.78
TOGARAM2        TOG array regulator of axonemal microtubules 2   2 -2.23
TSPEAR    thrombospondin type laminin G domain and EAR repeats  21 -3.45
ABCC3                ATP binding cassette subfamily C member 3  17 -3.54
ELOVL6                             ELOVL fatty acid elongase 6   4 -2.40
LINC00964           long intergenic non-protein coding RNA 964   8 -2.79
MCTP2        multiple C2 and transmembrane domain containing 2  15 -3.97
LUCAT1                     lung cancer associated transcript 1   5 -4.20
XIRP2                    xin actin binding repeat containing 2   2 -2.74
HMGCS2               3-hydroxy-3-methylglutaryl-CoA synthase 2   1 -4.79
LINC01147          long intergenic non-protein coding RNA 1147  14 -4.50
PDE11A                                   phosphodiesterase 11A   2 -3.42
LINC02137          long intergenic non-protein coding RNA 2137  16 -2.48
IL24                                            interleukin 24   1 -3.58
TAS2R8                               taste 2 receptor member 8  12 -2.81
MIR646HG                                      MIR646 host gene  20 -2.64
LINC02506          long intergenic non-protein coding RNA 2506   4 -5.03
RALYL                            RALY RNA binding protein like   8 -3.02
          AveExpr      t  P.Value adj.P.Val
SLC38A8     0.289 -11.85 4.02e-12  7.42e-08
C4orf54    -1.271 -10.15 1.03e-10  9.52e-07
GBE1        7.950  -7.85 1.49e-08  9.09e-05
TOGARAM2    2.758  -7.73 2.00e-08  9.09e-05
TSPEAR      2.186  -7.64 2.46e-08  9.09e-05
ABCC3       2.658  -7.23 6.51e-08  2.00e-04
ELOVL6      4.667  -7.14 8.08e-08  2.13e-04
LINC00964   1.979  -6.80 1.84e-07  3.65e-04
MCTP2       3.161  -6.80 1.86e-07  3.65e-04
LUCAT1      2.984  -6.78 1.98e-07  3.65e-04
XIRP2       4.265  -6.32 6.10e-07  1.02e-03
HMGCS2     -0.220  -6.23 7.90e-07  1.22e-03
LINC01147  -0.882  -6.14 9.72e-07  1.38e-03
PDE11A     -1.168  -6.03 1.29e-06  1.70e-03
LINC02137   2.129  -5.96 1.50e-06  1.85e-03
IL24       -1.612  -5.89 1.80e-06  2.08e-03
TAS2R8     -1.644  -5.80 2.28e-06  2.47e-03
MIR646HG    5.670  -5.71 2.86e-06  2.59e-03
LINC02506   1.150  -5.72 2.91e-06  2.59e-03
RALYL       4.234  -5.70 2.94e-06  2.59e-03

Male vs Female in adult samples

topTreat(treat.cardio,coef=6,n=20,p.value=0.05)[,-c(1:3)]
                                                      GENENAME CHR logFC
XIRP2-AS1                                XIRP2 antisense RNA 1   2  7.38
ABHD18                        abhydrolase domain containing 18   4 -2.30
TOGARAM2        TOG array regulator of axonemal microtubules 2   2  2.89
CACNA1E         calcium voltage-gated channel subunit alpha1 E   1  3.44
HLA-DMA   major histocompatibility complex, class II, DM alpha   6 -3.81
EXOG                                        exo/endonuclease G   3 -1.69
RHOBTB1                    Rho related BTB domain containing 1  10 -1.82
TBC1D3D                           TBC1 domain family member 3D  17 -3.83
PIK3R1          phosphoinositide-3-kinase regulatory subunit 1   5 -2.50
LINC02552          long intergenic non-protein coding RNA 2552  11 -7.62
WNT9A                                     Wnt family member 9A   1 -5.40
KRTAP10-4                      keratin associated protein 10-4  21 -3.55
LINC02425          long intergenic non-protein coding RNA 2425  12 -5.24
PLEKHA7               pleckstrin homology domain containing A7  11 -2.46
TKT                                              transketolase   3  1.92
PDK4                           pyruvate dehydrogenase kinase 4   7 -3.74
CPLX3                                              complexin 3  15  3.52
LMAN1L                          lectin, mannose binding 1 like  15  3.00
MTRNR2L1                                        MT-RNR2 like 1  17 -4.81
NTN1                                                  netrin 1  17  2.19
          AveExpr      t  P.Value adj.P.Val
XIRP2-AS1  -1.220  11.05 1.85e-11  3.41e-07
ABHD18      7.150 -10.65 3.80e-11  3.50e-07
TOGARAM2    2.758   9.13 8.60e-10  5.29e-06
CACNA1E     2.080   7.77 1.84e-08  8.47e-05
HLA-DMA     2.495  -7.12 8.60e-08  2.65e-04
EXOG        5.847  -7.07 9.48e-08  2.65e-04
RHOBTB1     6.032  -7.03 1.06e-07  2.65e-04
TBC1D3D    -1.750  -7.00 1.15e-07  2.65e-04
PIK3R1      8.062  -6.83 1.74e-07  3.56e-04
LINC02552   2.302  -6.69 2.67e-07  4.93e-04
WNT9A       2.522  -6.56 3.49e-07  5.85e-04
KRTAP10-4  -0.179  -6.40 4.99e-07  7.68e-04
LINC02425  -1.107  -6.33 6.14e-07  8.72e-04
PLEKHA7     7.099  -6.19 8.45e-07  1.05e-03
TKT         4.745   6.17 8.78e-07  1.05e-03
PDK4        6.558  -6.16 9.11e-07  1.05e-03
CPLX3      -1.152   6.01 1.33e-06  1.44e-03
LMAN1L     -0.370   5.95 1.58e-06  1.62e-03
MTRNR2L1    0.596  -5.92 1.75e-06  1.70e-03
NTN1        5.133   5.86 1.93e-06  1.78e-03

Interaction of sex differences between adult and fetal

topTreat(treat.cardio,coef=7,n=20,p.value=0.05)[,-c(1:3)]
                                                            GENENAME CHR
XIRP2-AS1                                      XIRP2 antisense RNA 1   2
ABHD18                              abhydrolase domain containing 18   4
PPM1K-DT                                  PPM1K divergent transcript   4
BMP10                                  bone morphogenetic protein 10   2
APOA2                                              apolipoprotein A2   1
ZFP57                                      ZFP57 zinc finger protein   6
WNT9A                                           Wnt family member 9A   1
EPHA4                                                EPH receptor A4   2
FABP2                                   fatty acid binding protein 2   4
C17orf97                         chromosome 17 open reading frame 97  17
LINC02552                long intergenic non-protein coding RNA 2552  11
KCNJ3           potassium voltage-gated channel subfamily J member 3   2
FLG-AS1                                          FLG antisense RNA 1   1
GNAO1                                     G protein subunit alpha o1  16
FAM201A                 family with sequence similarity 201 member A   9
EXOG                                              exo/endonuclease G   3
IRF4                                  interferon regulatory factor 4   6
PRKAG2    protein kinase AMP-activated non-catalytic subunit gamma 2   7
NTN1                                                        netrin 1  17
LINC02425                long intergenic non-protein coding RNA 2425  12
          logFC AveExpr     t  P.Value adj.P.Val
XIRP2-AS1  8.10  -1.220 11.16 1.51e-11  2.79e-07
ABHD18    -2.47   7.150 -9.85 1.89e-10  1.75e-06
PPM1K-DT   6.42   2.479  9.33 5.85e-10  3.60e-06
BMP10      9.43  -1.542  9.09 1.04e-09  4.81e-06
APOA2      5.76  -1.812  7.71 2.15e-08  7.92e-05
ZFP57     -5.47   0.270 -7.38 4.76e-08  1.46e-04
WNT9A     -6.37   2.522 -7.10 9.34e-08  2.46e-04
EPHA4      2.89   5.247  6.99 1.16e-07  2.69e-04
FABP2      9.29  -1.390  6.92 1.61e-07  3.30e-04
C17orf97   3.99   2.388  6.64 2.80e-07  5.17e-04
LINC02552 -7.77   2.302 -6.49 4.42e-07  7.43e-04
KCNJ3      8.39   2.072  6.42 5.38e-07  8.24e-04
FLG-AS1   -3.41   5.496 -6.34 5.80e-07  8.24e-04
GNAO1      6.29   3.776  6.31 6.71e-07  8.85e-04
FAM201A   -5.78  -0.994 -6.28 7.19e-07  8.85e-04
EXOG      -1.93   5.847 -6.15 9.39e-07  1.00e-03
IRF4       6.42   0.408  6.18 9.43e-07  1.00e-03
PRKAG2     2.22   7.307  6.13 9.78e-07  1.00e-03
NTN1       3.06   5.133  6.09 1.09e-06  1.06e-03
LINC02425 -6.04  -1.107 -6.07 1.22e-06  1.13e-03

Interaction of sex differences between young and fetal

topTreat(treat.cardio,coef=8,n=20,p.value=0.05)[,-c(1:3)]
                                              GENENAME CHR logFC AveExpr
ZFP57                        ZFP57 zinc finger protein   6 -9.53   0.270
SLC38A8              solute carrier family 38 member 8  16 -5.55   0.289
APOA2                                apolipoprotein A2   1  5.00  -1.812
DAB1                             DAB adaptor protein 1   1 -2.89   7.416
SYNPR                                     synaptoporin   3  4.76   2.716
BMP10                    bone morphogenetic protein 10   2  6.01  -1.542
FAM155A   family with sequence similarity 155 member A  13  5.89   5.622
SHOX2                         short stature homeobox 2   3  8.02   0.702
FLG-AS1                            FLG antisense RNA 1   1 -3.16   5.496
NAV1                                neuron navigator 1   1 -2.00   8.027
C4orf54             chromosome 4 open reading frame 54   4 -5.77  -1.271
LINC02531  long intergenic non-protein coding RNA 2531   6 -5.62  -1.497
PLCB1                           phospholipase C beta 1  20  4.69   8.683
IL24                                    interleukin 24   1 -5.12  -1.612
MT1H                                metallothionein 1H  16  6.35  -1.630
ZNF98                           zinc finger protein 98  19 -2.71   4.130
NR2F2-AS1                        NR2F2 antisense RNA 1  15  5.29   8.198
TDGF1          teratocarcinoma-derived growth factor 1   3 -7.02  -0.681
LINC01147  long intergenic non-protein coding RNA 1147  14 -5.33  -0.882
LINC00964   long intergenic non-protein coding RNA 964   8 -2.71   1.979
              t  P.Value adj.P.Val
ZFP57     -8.80 2.01e-09  0.000037
SLC38A8   -7.48 3.76e-08  0.000347
APOA2      6.55 3.51e-07  0.001751
DAB1      -6.51 3.79e-07  0.001751
SYNPR      6.35 5.83e-07  0.001859
BMP10      6.35 6.04e-07  0.001859
FAM155A    6.24 7.82e-07  0.002063
SHOX2      6.03 1.44e-06  0.003323
FLG-AS1   -5.84 2.06e-06  0.004233
NAV1      -5.78 2.37e-06  0.004372
C4orf54   -5.66 3.46e-06  0.005813
LINC02531 -5.58 4.25e-06  0.006544
PLCB1      5.51 4.92e-06  0.006983
IL24      -5.48 5.42e-06  0.007143
MT1H       5.37 7.64e-06  0.009403
ZNF98     -5.27 8.98e-06  0.009802
NR2F2-AS1  5.29 9.02e-06  0.009802
TDGF1     -5.28 9.75e-06  0.009999
LINC01147 -5.13 1.37e-05  0.012799
LINC00964 -5.10 1.39e-05  0.012799

Interaction of sex differences between adult and young

topTreat(treat.cardio,coef=9,n=20,p.value=0.05)[,-c(1:3)]
                                                GENENAME CHR logFC AveExpr
TOGARAM2  TOG array regulator of axonemal microtubules 2   2  5.12   2.758
C4orf54               chromosome 4 open reading frame 54   4  5.66  -1.271
TKT                                        transketolase   3  3.63   4.745
LUCAT1               lung cancer associated transcript 1   5  8.13   2.984
XIRP2-AS1                          XIRP2 antisense RNA 1   2  7.32  -1.220
NTN1                                            netrin 1  17  3.70   5.133
GBE1                 1,4-alpha-glucan branching enzyme 1   3  2.41   7.950
RHOBTB1              Rho related BTB domain containing 1  10 -2.56   6.032
INPP5J            inositol polyphosphate-5-phosphatase J  22  4.12   0.913
LINC00964     long intergenic non-protein coding RNA 964   8  4.01   1.979
GRAMD1B                        GRAM domain containing 1B  11  2.35   5.349
PDK4                     pyruvate dehydrogenase kinase 4   7 -4.67   6.558
STC2                                     stanniocalcin 2   5  4.89   1.232
SLC38A8                solute carrier family 38 member 8  16  5.05   0.289
ABCC3          ATP binding cassette subfamily C member 3  17  4.57   2.658
PPM1K-DT                      PPM1K divergent transcript   4  4.18   2.479
MYL12A                            myosin light chain 12A  18 -3.10   5.979
PIK3R1    phosphoinositide-3-kinase regulatory subunit 1   5 -2.78   8.062
LINC02506    long intergenic non-protein coding RNA 2506   4  5.43   1.150
MET         MET proto-oncogene, receptor tyrosine kinase   7  3.22   2.549
              t  P.Value adj.P.Val
TOGARAM2  13.42 2.60e-13  4.80e-09
C4orf54    9.61 3.22e-10  2.00e-06
TKT        9.59 3.25e-10  2.00e-06
LUCAT1     8.94 1.42e-09  6.54e-06
XIRP2-AS1  8.75 2.10e-09  7.09e-06
NTN1       8.68 2.31e-09  7.09e-06
GBE1       7.86 1.46e-08  3.86e-05
RHOBTB1   -7.61 2.62e-08  6.04e-05
INPP5J     7.53 3.24e-08  6.65e-05
LINC00964  7.26 6.06e-08  1.12e-04
GRAMD1B    6.74 2.15e-07  3.61e-04
PDK4      -6.65 2.75e-07  4.02e-04
STC2       6.64 2.83e-07  4.02e-04
SLC38A8    6.60 3.11e-07  4.10e-04
ABCC3      5.96 1.53e-06  1.89e-03
PPM1K-DT   5.67 3.21e-06  3.53e-03
MYL12A    -5.66 3.25e-06  3.53e-03
PIK3R1    -5.58 4.03e-06  4.13e-03
LINC02506  5.56 4.42e-06  4.30e-03
MET        5.50 4.89e-06  4.47e-03
par(mar=c(5,5,3,2))
plot(treat.cardio$coefficients[,1],treat.cardio$coefficients[,2],xlab="logFC: Young vs Fetal", ylab="logFC: Adult vs Fetal",main="Cardiomyocytes: Development",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0,col=colours()[c(175)])
sig.genes <-  dt.cardio[,1] !=0 | dt.cardio[,2] != 0
text(treat.cardio$coefficients[sig.genes,1],treat.cardio$coefficients[sig.genes,2],labels=rownames(dt.cardio)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.cardio$coefficients[,4],treat.cardio$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="Cardiomyocytes: Sex differences - fetal and young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.cardio[,4] !=0 | dt.cardio[,5] != 0
text(treat.cardio$coefficients[sig.genes,4],treat.cardio$coefficients[sig.genes,5],labels=rownames(dt.cardio)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.cardio$coefficients[,4],treat.cardio$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="Cardiomyocytes: Sex differences - fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.cardio[,4] !=0 | dt.cardio[,6] != 0
text(treat.cardio$coefficients[sig.genes,4],treat.cardio$coefficients[sig.genes,6],labels=rownames(dt.cardio)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.cardio$coefficients[,5],treat.cardio$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="Cardiomyocytes: Sex differences - young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
sig.genes <- dt.cardio[,5] !=0 | dt.cardio[,6] != 0
text(treat.cardio$coefficients[sig.genes,5],treat.cardio$coefficients[sig.genes,6],labels=rownames(dt.cardio)[sig.genes],col=2,cex=0.6)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.cardio$coefficients[,4],treat.cardio$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="Cardiomyocytes: Interaction term: Fetal vs Young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.cardio[,8] !=0 
text(treat.cardio$coefficients[sig.genes,4],treat.cardio$coefficients[sig.genes,5],labels=rownames(dt.cardio)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.cardio$coefficients[,4],treat.cardio$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="Cardiomyocytes: Interaction term: fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.cardio[,7] !=0 
text(treat.cardio$coefficients[sig.genes,4],treat.cardio$coefficients[sig.genes,6],labels=rownames(dt.cardio)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.cardio$coefficients[,5],treat.cardio$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="Cardiomyocytes: Interaction term: young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.cardio[,9] !=0 
text(treat.cardio$coefficients[sig.genes,5],treat.cardio$coefficients[sig.genes,6],labels=rownames(dt.cardio)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28

Epicardial cells

cont.epi <- makeContrasts(YvF = 0.5*(epicardial.young.Male + epicardial.young.Female) - 0.5*(epicardial.fetal.Male + epicardial.fetal.Female),
                         AvF = 0.5*(epicardial.adult.Male + epicardial.adult.Female) - 0.5*(epicardial.fetal.Male + epicardial.fetal.Female),
                         AvY = 0.5*(epicardial.adult.Male + epicardial.adult.Female) - 0.5*(epicardial.young.Male + epicardial.young.Female),
                         SexFetal = epicardial.fetal.Male - epicardial.fetal.Female,
                         SexYoung = epicardial.young.Male - epicardial.young.Female,
                         SexAdult = epicardial.adult.Male - epicardial.adult.Female,
                         InteractionAF = (epicardial.adult.Male - epicardial.fetal.Male) - (epicardial.adult.Female - epicardial.fetal.Female),
                         InteractionYF = (epicardial.young.Male - epicardial.fetal.Male) - (epicardial.young.Female - epicardial.fetal.Female),
                         InteractionAY = (epicardial.adult.Male - epicardial.young.Male) - (epicardial.adult.Female - epicardial.young.Female),
                         levels=design)
fit.epicardial <- contrasts.fit(fit,contrasts = cont.epi)
fit.epicardial <- eBayes(fit.epicardial,robust=TRUE)

summary(decideTests(fit.epicardial))
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down    1583  1553     0        2        0        0             0
NotSig 15745 15623 18464    18461    18464    18463         18464
Up      1136  1288     0        1        0        1             0
       InteractionYF InteractionAY
Down               0             0
NotSig         18464         18464
Up                 0             0
treat.epicardial <- treat(fit.epicardial,lfc=0.5)

dt.epicardial<-decideTests(treat.epicardial)

summary(dt.epicardial)
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down     906   924     0        2        0        0             0
NotSig 17175 17044 18464    18461    18464    18463         18464
Up       383   496     0        1        0        1             0
       InteractionYF InteractionAY
Down               0             0
NotSig         18464         18464
Up                 0             0
par(mfrow=c(3,3))
for(i in 1:9){
  plotMD(treat.epicardial,coef=i,status=dt.epicardial[,i],hl.col=c("blue","red"))
  abline(h=0,col="grey")
}

Version Author Date
f474878 Belinda Phipson 2019-10-28
par(mfrow=c(1,1))
par(mar=c(7,4,2,2))
barplot(summary(dt.epicardial)[-2,],beside=TRUE,legend=TRUE,col=c("blue","red"),ylab="Number of significant genes",las=2)
title("Epicardial cells")

Version Author Date
f474878 Belinda Phipson 2019-10-28

Young vs Fetal

options(digits=3)
topTreat(treat.epicardial,coef=1,n=20,p.value=0.05)[,-c(1:3)]
                                                          GENENAME CHR
PIEZO2         piezo type mechanosensitive ion channel component 2  18
MOCS1                              molybdenum cofactor synthesis 1   6
STEAP4                                     STEAP4 metalloreductase   7
ABCA5                    ATP binding cassette subfamily A member 5  17
DENND3                                    DENN domain containing 3   8
CNTNAP2                        contactin associated protein like 2   7
EFHD1                              EF-hand domain family member D1   2
COL6A6                              collagen type VI alpha 6 chain   3
IGF2BP1        insulin like growth factor 2 mRNA binding protein 1  17
SULT1E1                        sulfotransferase family 1E member 1   4
GLRB                                         glycine receptor beta   4
FRMD3                                     FERM domain containing 3   9
GLP1R                             glucagon like peptide 1 receptor   6
MARCH11                 membrane associated ring-CH-type finger 11   5
EGFLAM        EGF like, fibronectin type III and laminin G domains   5
SLC17A4                          solute carrier family 17 member 4   6
PRICKLE1                    prickle planar cell polarity protein 1  12
IGF2BP3        insulin like growth factor 2 mRNA binding protein 3   7
PACSIN2  protein kinase C and casein kinase substrate in neurons 2  22
PRSS35                                          serine protease 35   6
         logFC AveExpr      t  P.Value adj.P.Val
PIEZO2   -5.55   4.448 -11.74 4.92e-12  9.08e-08
MOCS1     3.08   3.916  10.65 3.76e-11  3.21e-07
STEAP4    5.88   4.161  10.50 5.21e-11  3.21e-07
ABCA5     3.34   6.005  10.11 1.12e-10  3.69e-07
DENND3    4.98   5.553  10.10 1.15e-10  3.69e-07
CNTNAP2  -5.51   6.678 -10.08 1.20e-10  3.69e-07
EFHD1     4.18   4.405   9.55 3.54e-10  9.34e-07
COL6A6   -5.52   4.996  -9.47 4.27e-10  9.85e-07
IGF2BP1  -6.52   1.905  -9.40 5.05e-10  1.04e-06
SULT1E1  -7.24   0.545  -9.14 9.04e-10  1.67e-06
GLRB     -6.53   2.601  -8.73 2.18e-09  3.24e-06
FRMD3     2.73   7.605   8.67 2.35e-09  3.24e-06
GLP1R    -6.18   1.486  -8.66 2.50e-09  3.24e-06
MARCH11  -8.30   3.233  -8.68 2.50e-09  3.24e-06
EGFLAM    3.96   5.588   8.62 2.63e-09  3.24e-06
SLC17A4   4.53  -1.342   8.36 4.75e-09  5.48e-06
PRICKLE1 -4.34   7.047  -8.32 5.22e-09  5.67e-06
IGF2BP3  -5.27   4.676  -8.26 6.00e-09  6.16e-06
PACSIN2   2.21   7.829   8.21 6.53e-09  6.35e-06
PRSS35   -4.86   1.689  -8.13 8.00e-09  7.38e-06

Adult vs Fetal

topTreat(treat.epicardial,coef=2,n=20,p.value=0.05)[,-c(1:3)]
                                                      GENENAME CHR logFC
PIEZO2     piezo type mechanosensitive ion channel component 2  18 -7.06
SULT1E1                    sulfotransferase family 1E member 1   4 -9.26
SNX31                                         sorting nexin 31   8  6.00
PRSS35                                      serine protease 35   6 -6.35
CNTNAP2                    contactin associated protein like 2   7 -4.56
LYPD6                            LY6/PLAUR domain containing 6   2 -6.90
EFHD1                          EF-hand domain family member D1   2  4.36
EGFLAM    EGF like, fibronectin type III and laminin G domains   5  4.24
STEAP4                                 STEAP4 metalloreductase   7  5.45
IGF2BP1    insulin like growth factor 2 mRNA binding protein 1  17 -6.45
COL6A6                          collagen type VI alpha 6 chain   3 -4.83
MOCS1                          molybdenum cofactor synthesis 1   6  2.76
SNCG                                           synuclein gamma  10  6.31
ABCA5                ATP binding cassette subfamily A member 5  17  3.01
GDF6                           growth differentiation factor 6   8 -6.41
IGF2BP3    insulin like growth factor 2 mRNA binding protein 3   7 -5.73
XKR5                                              XK related 5   8 -4.88
SGO1                                               shugoshin 1   3 -5.29
LINC02237          long intergenic non-protein coding RNA 2237   8  3.04
KLHL23                             kelch like family member 23   2  2.46
          AveExpr      t  P.Value adj.P.Val
PIEZO2      4.448 -12.52 1.24e-12  2.29e-08
SULT1E1     0.545 -11.93 3.73e-12  3.44e-08
SNX31       2.672  11.27 1.19e-11  7.30e-08
PRSS35      1.689 -10.64 4.04e-11  1.87e-07
CNTNAP2     6.678 -10.27 8.15e-11  2.93e-07
LYPD6       2.890 -10.21 9.53e-11  2.93e-07
EFHD1       4.405  10.05 1.28e-10  3.36e-07
EGFLAM      5.588   9.46 4.27e-10  9.04e-07
STEAP4      4.161   9.46 4.41e-10  9.04e-07
IGF2BP1     1.905  -9.33 5.82e-10  1.07e-06
COL6A6      4.996  -9.19 7.71e-10  1.24e-06
MOCS1       3.916   9.16 8.03e-10  1.24e-06
SNCG        1.517   9.00 1.20e-09  1.70e-06
ABCA5       6.005   8.77 1.88e-09  2.45e-06
GDF6        0.832  -8.76 1.99e-09  2.45e-06
IGF2BP3     4.676  -8.71 2.21e-09  2.55e-06
XKR5        0.124  -8.30 5.45e-09  5.92e-06
SGO1        1.725  -8.13 8.17e-09  8.29e-06
LINC02237   3.300   8.10 8.53e-09  8.29e-06
KLHL23      6.288   8.00 1.05e-08  9.56e-06

Adult vs Young

topTreat(treat.epicardial,coef=3)[,-c(1:3)]
                                               GENENAME CHR logFC AveExpr
SNX31                                  sorting nexin 31   8  2.20  2.6724
PQLC2L                 PQ loop repeat containing 2 like   3  3.72  1.6416
CCL8                       C-C motif chemokine ligand 8  17 -3.15 -0.5607
TNFSF15                       TNF superfamily member 15   9  3.27 -0.2964
SCGN      secretagogin, EF-hand calcium binding protein   6 -2.46  1.6456
NOS1AP          nitric oxide synthase 1 adaptor protein   1 -2.69  4.4866
SPTSSB      serine palmitoyltransferase small subunit B   3  3.85 -0.0464
GALNT8  polypeptide N-acetylgalactosaminyltransferase 8  12 -3.01  2.2605
FOSL1     FOS like 1, AP-1 transcription factor subunit  11 -3.27  1.1629
NXPH3                                   neurexophilin 3  17  2.28  0.6529
            t  P.Value adj.P.Val
SNX31    4.30 0.000112         1
PQLC2L   4.06 0.000218         1
CCL8    -3.96 0.000276         1
TNFSF15  3.87 0.000345         1
SCGN    -3.75 0.000464         1
NOS1AP  -3.52 0.000837         1
SPTSSB   3.44 0.001086         1
GALNT8  -3.38 0.001199         1
FOSL1   -3.25 0.001698         1
NXPH3    3.23 0.001719         1

Male vs Female in fetal samples

topTreat(treat.epicardial,coef=4)[,-c(1:3)]
                                              GENENAME CHR logFC AveExpr
ZFP57                        ZFP57 zinc finger protein   6  6.35   0.270
NMUR2                          neuromedin U receptor 2   5 -4.32  -0.989
EPHA4                                  EPH receptor A4   2 -3.73   5.247
HIST1H2AG        histone cluster 1 H2A family member g   6  4.16  -0.464
ZNF385B                       zinc finger protein 385B   2 -3.40   3.787
GRM7                 glutamate metabotropic receptor 7   3 -2.52   3.350
TDGF1          teratocarcinoma-derived growth factor 1   3  4.51  -0.681
PATE2                  prostate and testis expressed 2  11 -3.80  -1.342
FAM155A   family with sequence similarity 155 member A  13 -2.53   5.622
LMX1A        LIM homeobox transcription factor 1 alpha   1 -3.08  -0.189
              t  P.Value adj.P.Val
ZFP57      6.11 1.10e-06    0.0203
NMUR2     -5.48 5.26e-06    0.0417
EPHA4     -5.38 6.78e-06    0.0417
HIST1H2AG  4.47 7.54e-05    0.3151
ZNF385B   -4.41 8.53e-05    0.3151
GRM7      -4.20 1.44e-04    0.4425
TDGF1      4.16 1.69e-04    0.4470
PATE2     -3.96 2.83e-04    0.5943
FAM155A   -3.93 2.90e-04    0.5943
LMX1A     -3.71 5.29e-04    0.9270

Male vs Female in young samples

topTreat(treat.epicardial,coef=5)[,-c(1:3)]
                                           GENENAME CHR logFC AveExpr
NXPH3                               neurexophilin 3  17  4.51   0.653
ALLC                                   allantoicase   2 -3.41   0.904
ZNF304                      zinc finger protein 304  19  4.29   2.425
CCL8                   C-C motif chemokine ligand 8  17 -4.38  -0.561
SLC17A4           solute carrier family 17 member 4   6 -3.18  -1.342
TESC-AS1        TESC antisense RNA 1 (head to head)  12  3.48   1.742
THSD7B   thrombospondin type 1 domain containing 7B   2 -2.88   3.773
TMEM54                     transmembrane protein 54   1  3.85   1.041
CTXND2                 cortexin domain containing 2   1  3.05   0.558
KLF5                          Kruppel like factor 5  13  3.92   2.466
             t  P.Value adj.P.Val
NXPH3     4.97 2.00e-05     0.369
ALLC     -4.43 8.12e-05     0.489
ZNF304    4.32 1.13e-04     0.489
CCL8     -4.26 1.29e-04     0.489
SLC17A4  -4.18 1.54e-04     0.489
TESC-AS1  4.17 1.59e-04     0.489
THSD7B   -4.08 2.00e-04     0.527
TMEM54    4.04 2.29e-04     0.529
CTXND2    3.77 4.44e-04     0.882
KLF5      3.76 4.78e-04     0.882

Male vs Female in adult samples

topTreat(treat.epicardial,coef=6)[,-c(1:3)]
                                             GENENAME CHR logFC AveExpr
HESX1                                 HESX homeobox 1   3  5.45   2.750
THNSL2                      threonine synthase like 2   2  5.55   3.382
RIMS1       regulating synaptic membrane exocytosis 1   6  7.80   3.166
LINC01768 long intergenic non-protein coding RNA 1768   1  4.30   1.303
LINC01703 long intergenic non-protein coding RNA 1703   1  3.32   1.078
TMEM17                       transmembrane protein 17   2  3.86   1.245
CPB2                              carboxypeptidase B2  13  3.36   0.912
SCG5                                  secretogranin V  15  3.62   2.342
LINC02507 long intergenic non-protein coding RNA 2507   4  4.69   0.616
MT1A                               metallothionein 1A  16 -4.85   0.061
              t  P.Value adj.P.Val
HESX1      6.36 5.79e-07    0.0107
THNSL2     4.45 8.42e-05    0.7770
RIMS1      4.31 1.31e-04    0.8089
LINC01768  3.96 2.84e-04    0.8834
LINC01703  3.92 3.06e-04    0.8834
TMEM17     3.87 3.54e-04    0.8834
CPB2       3.85 3.72e-04    0.8834
SCG5       3.84 3.83e-04    0.8834
LINC02507  3.76 4.91e-04    0.9475
MT1A      -3.73 5.44e-04    0.9475

Interaction of sex differences between adult and fetal

topTreat(treat.epicardial,coef=7)[,-c(1:3)]
                                                  GENENAME CHR logFC
HESX1                                      HESX homeobox 1   3  5.76
CLDN7                                            claudin 7  17 -7.59
LINC01768      long intergenic non-protein coding RNA 1768   1  5.85
C1orf141               chromosome 1 open reading frame 141   1  5.29
UFSP1                 UFM1 specific peptidase 1 (inactive)   7 -5.36
LINC02604      long intergenic non-protein coding RNA 2604   7  5.16
GLRA3                             glycine receptor alpha 3   4  5.08
THNSL2                           threonine synthase like 2   2  5.68
OR7D2     olfactory receptor family 7 subfamily D member 2  19 -5.53
MT1A                                    metallothionein 1A  16 -7.84
          AveExpr     t  P.Value adj.P.Val
HESX1      2.7500  5.08 1.58e-05     0.291
CLDN7     -0.3517 -4.35 1.17e-04     0.881
LINC01768  1.3032  4.25 1.43e-04     0.881
C1orf141   1.2605  3.90 3.48e-04     1.000
UFSP1     -0.0981 -3.84 4.08e-04     1.000
LINC02604  0.7727  3.81 4.41e-04     1.000
GLRA3     -0.1054  3.79 4.69e-04     1.000
THNSL2     3.3820  3.76 5.20e-04     1.000
OR7D2     -0.3870 -3.69 6.18e-04     1.000
MT1A       0.0610 -3.71 6.45e-04     1.000

Interaction of sex differences between young and fetal

topTreat(treat.epicardial,coef=8)[,-c(1:3)]
                                             GENENAME CHR logFC AveExpr
ZFP57                       ZFP57 zinc finger protein   6 -6.78  0.2703
DCLK3                      doublecortin like kinase 3   3 -4.28 -0.1446
NMUR2                         neuromedin U receptor 2   5  4.76 -0.9891
PI4K2B      phosphatidylinositol 4-kinase type 2 beta   4  5.10  1.3328
LRP1-AS                            LRP1 antisense RNA  12 -4.26 -1.5297
LINC02242 long intergenic non-protein coding RNA 2242   5  4.31 -0.4070
CCL8                     C-C motif chemokine ligand 8  17 -5.24 -0.5607
ANGPT4                                 angiopoietin 4  20 -5.76 -0.1577
LINC00589  long intergenic non-protein coding RNA 589   8  4.94  0.0723
OASL             2'-5'-oligoadenylate synthetase like  12 -4.40  0.5243
              t  P.Value adj.P.Val
ZFP57     -4.41 9.85e-05         1
DCLK3     -4.10 1.99e-04         1
NMUR2      3.97 2.85e-04         1
PI4K2B     3.57 8.21e-04         1
LRP1-AS   -3.55 8.33e-04         1
LINC02242  3.50 9.45e-04         1
CCL8      -3.47 1.08e-03         1
ANGPT4    -3.43 1.22e-03         1
LINC00589  3.41 1.24e-03         1
OASL      -3.29 1.63e-03         1

Interaction of sex differences between adult and young

topTreat(treat.epicardial,coef=9)[,-c(1:3)]
                                                   GENENAME CHR logFC
HESX1                                       HESX homeobox 1   3  5.98
LINC00587        long intergenic non-protein coding RNA 587   9  4.87
GALNT3      polypeptide N-acetylgalactosaminyltransferase 3   2  7.91
PLA2G4C-AS1                         PLA2G4C antisense RNA 1  19 -5.21
NR1D2         nuclear receptor subfamily 1 group D member 2   3 -2.88
TOX2            TOX high mobility group box family member 2  20  6.32
C4orf51                  chromosome 4 open reading frame 51   4 -4.60
FBXL13             F-box and leucine rich repeat protein 13   7 -2.96
NXPH3                                       neurexophilin 3  17 -4.41
E2F1                             E2F transcription factor 1  20  6.84
            AveExpr     t  P.Value adj.P.Val
HESX1         2.750  4.82 3.13e-05     0.578
LINC00587    -0.337  4.10 2.04e-04     1.000
GALNT3        1.793  4.14 2.08e-04     1.000
PLA2G4C-AS1  -0.240 -3.78 4.85e-04     1.000
NR1D2         6.278 -3.73 4.90e-04     1.000
TOX2          3.868  3.74 5.70e-04     1.000
C4orf51       1.512 -3.69 5.84e-04     1.000
FBXL13        5.165 -3.57 7.44e-04     1.000
NXPH3         0.653 -3.55 8.50e-04     1.000
E2F1          1.392  3.58 8.74e-04     1.000
par(mar=c(5,5,3,2))
plot(treat.epicardial$coefficients[,1],treat.epicardial$coefficients[,2],xlab="logFC: Young vs Fetal", ylab="logFC: Adult vs Fetal",main="Epicardial: Development",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0,col=colours()[c(175)])
sig.genes <-  dt.epicardial[,1] !=0 | dt.epicardial[,2] != 0
text(treat.epicardial$coefficients[sig.genes,1],treat.epicardial$coefficients[sig.genes,2],labels=rownames(dt.epicardial)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.epicardial$coefficients[,4],treat.epicardial$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="epicardial: Sex differences - fetal and young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.epicardial[,4] !=0 | dt.epicardial[,5] != 0
text(treat.epicardial$coefficients[sig.genes,4],treat.epicardial$coefficients[sig.genes,5],labels=rownames(dt.epicardial)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.epicardial$coefficients[,4],treat.epicardial$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="epicardial: Sex differences - fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.epicardial[,4] !=0 | dt.epicardial[,6] != 0
text(treat.epicardial$coefficients[sig.genes,4],treat.epicardial$coefficients[sig.genes,6],labels=rownames(dt.epicardial)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.epicardial$coefficients[,5],treat.epicardial$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="epicardial: Sex differences - young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
sig.genes <- dt.epicardial[,5] !=0 | dt.epicardial[,6] != 0
text(treat.epicardial$coefficients[sig.genes,5],treat.epicardial$coefficients[sig.genes,6],labels=rownames(dt.epicardial)[sig.genes],col=2,cex=0.6)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.epicardial$coefficients[,4],treat.epicardial$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="epicardial: Interaction term: Fetal vs Young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
sig.genes <- dt.epicardial[,8] !=0 
if(sum(sig.genes)!=0){
  text(treat.epicardial$coefficients[sig.genes,4],treat.epicardial$coefficients[sig.genes,5],
       labels=rownames(dt.epicardial)[sig.genes],col=2,cex=0.6)
}
plot(treat.epicardial$coefficients[,4],treat.epicardial$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="epicardial: Interaction term: fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
sig.genes <- dt.epicardial[,7] !=0 
if(sum(sig.genes)!=0){
  text(treat.epicardial$coefficients[sig.genes,4],treat.epicardial$coefficients[sig.genes,6],
       labels=rownames(dt.epicardial)[sig.genes],col=2,cex=0.6)
}
plot(treat.epicardial$coefficients[,5],treat.epicardial$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="epicardial: Interaction term: young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
sig.genes <- dt.epicardial[,9] !=0 
if(sum(sig.genes)!=0){
  text(treat.epicardial$coefficients[sig.genes,5],treat.epicardial$coefficients[sig.genes,6],
       labels=rownames(dt.epicardial)[sig.genes],col=2,cex=0.6)
}

Fibroblasts

cont.fibro <- makeContrasts(YvF = 0.5*(fibro.young.Male + fibro.young.Female) - 0.5*(fibro.fetal.Male + fibro.fetal.Female),
                         AvF = 0.5*(fibro.adult.Male + fibro.adult.Female) - 0.5*(fibro.fetal.Male + fibro.fetal.Female),
                         AvY = 0.5*(fibro.adult.Male + fibro.adult.Female) - 0.5*(fibro.young.Male + fibro.young.Female),
                         SexFetal = fibro.fetal.Male - fibro.fetal.Female,
                         SexYoung = fibro.young.Male - fibro.young.Female,
                         SexAdult = fibro.adult.Male - fibro.adult.Female,
                         InteractionAF = (fibro.adult.Male - fibro.fetal.Male) - (fibro.adult.Female - fibro.fetal.Female),
                         InteractionYF = (fibro.young.Male - fibro.fetal.Male) - (fibro.young.Female - fibro.fetal.Female),
                         InteractionAY = (fibro.adult.Male - fibro.young.Male) - (fibro.adult.Female - fibro.young.Female),
                         levels=design)
fit.fibro <- contrasts.fit(fit,contrasts = cont.fibro)
fit.fibro <- eBayes(fit.fibro,robust=TRUE)

summary(decideTests(fit.fibro))
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down    1983  1546    63       10       25       15             4
NotSig 14894 15710 18356    18452    18433    18445         18459
Up      1587  1208    45        2        6        4             1
       InteractionYF InteractionAY
Down               0            12
NotSig         18464         18444
Up                 0             8
treat.fibro <- treat(fit.fibro,lfc=0.5)

dt.fibro<-decideTests(treat.fibro)

summary(dt.fibro)
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down     830   668     5        4        4        5             2
NotSig 17012 17299 18451    18460    18459    18459         18461
Up       622   497     8        0        1        0             1
       InteractionYF InteractionAY
Down               0             7
NotSig         18464         18453
Up                 0             4
par(mfrow=c(3,3))
for(i in 1:9){
  plotMD(treat.fibro,coef=i,status=dt.fibro[,i],hl.col=c("blue","red"))
  abline(h=0,col="grey")
}

Version Author Date
f474878 Belinda Phipson 2019-10-28
par(mfrow=c(1,1))
par(mar=c(7,4,2,2))
barplot(summary(dt.fibro)[-2,],beside=TRUE,legend=TRUE,col=c("blue","red"),ylab="Number of significant genes",las=2)
title("fibroblast cells")

Version Author Date
f474878 Belinda Phipson 2019-10-28

Young vs Fetal

options(digits=3)
topTreat(treat.fibro,coef=1,n=20,p.value=0.05)[,-c(1:3)]
                                                                              GENENAME
CNTNAP2                                            contactin associated protein like 2
PIEZO2                             piezo type mechanosensitive ion channel component 2
LAMA2                                                          laminin subunit alpha 2
COL6A6                                                  collagen type VI alpha 6 chain
MTUS1                                        microtubule associated scaffold protein 1
MEST                                                      mesoderm specific transcript
IGF2BP3                            insulin like growth factor 2 mRNA binding protein 3
MANCR                                       mitotically associated long non coding RNA
SULT1E1                                            sulfotransferase family 1E member 1
ABCA5                                        ATP binding cassette subfamily A member 5
JADE1                                                         jade family PHD finger 1
CACNB4                          calcium voltage-gated channel auxiliary subunit beta 4
ELFN2   extracellular leucine rich repeat and fibronectin type III domain containing 2
KHDRBS2             KH RNA binding domain containing, signal transduction associated 2
HHIP                                                      hedgehog interacting protein
DPP10                                                     dipeptidyl peptidase like 10
GRID2                               glutamate ionotropic receptor delta type subunit 2
HUNK                                     hormonally up-regulated Neu-associated kinase
HTATIP2                                                HIV-1 Tat interactive protein 2
PTCH2                                                                        patched 2
        CHR logFC AveExpr     t  P.Value adj.P.Val
CNTNAP2   7 -3.49   6.678 -18.0 2.87e-16  5.29e-12
PIEZO2   18 -4.71   4.448 -14.7 3.14e-14  2.90e-10
LAMA2     6  3.91  10.484  14.4 4.89e-14  3.01e-10
COL6A6    3 -2.83   4.996 -13.7 1.70e-13  7.87e-10
MTUS1     8  3.38   7.791  13.2 3.75e-13  1.38e-09
MEST      7 -5.99   3.378 -13.1 4.79e-13  1.48e-09
IGF2BP3   7 -5.84   4.676 -12.8 8.06e-13  2.12e-09
MANCR    10  8.96   0.425  12.4 1.49e-12  3.43e-09
SULT1E1   4 -9.64   0.545 -12.1 2.82e-12  5.79e-09
ABCA5    17  3.39   6.005  11.9 3.59e-12  6.63e-09
JADE1     4  3.50   6.188  11.7 5.67e-12  9.41e-09
CACNB4    2 -3.79   4.275 -11.6 6.20e-12  9.41e-09
ELFN2    22 -6.29   0.103 -11.6 6.62e-12  9.41e-09
KHDRBS2   6 -4.56   3.746 -11.5 8.02e-12  1.06e-08
HHIP      4 -4.75   3.428 -11.1 1.56e-11  1.91e-08
DPP10     2 -4.41   4.348 -10.9 2.28e-11  2.63e-08
GRID2     4 -5.35   5.329 -10.8 2.95e-11  3.21e-08
HUNK     21 -4.14   3.464 -10.6 4.04e-11  3.97e-08
HTATIP2  11  5.56   2.925  10.6 4.09e-11  3.97e-08
PTCH2     1 -3.97   3.542 -10.5 5.15e-11  4.68e-08

Adult vs Fetal

topTreat(treat.fibro,coef=2,n=20,p.value=0.05)[,-c(1:3)]
                                                                    GENENAME
CNTNAP2                                  contactin associated protein like 2
LAMA2                                                laminin subunit alpha 2
PIEZO2                   piezo type mechanosensitive ion channel component 2
MTUS1                              microtubule associated scaffold protein 1
COL6A6                                        collagen type VI alpha 6 chain
C11orf87                                 chromosome 11 open reading frame 87
LINC02511                        long intergenic non-protein coding RNA 2511
IGF2BP3                  insulin like growth factor 2 mRNA binding protein 3
MEST                                            mesoderm specific transcript
COL28A1                                   collagen type XXVIII alpha 1 chain
PRSS35                                                    serine protease 35
PEG10                                                paternally expressed 10
TMEM26                                              transmembrane protein 26
HHIP                                            hedgehog interacting protein
MANCR                             mitotically associated long non coding RNA
STRA6                                          stimulated by retinoic acid 6
VIT                                                                   vitrin
KHDRBS2   KH RNA binding domain containing, signal transduction associated 2
SAMD5                                sterile alpha motif domain containing 5
GRID2                     glutamate ionotropic receptor delta type subunit 2
          CHR logFC AveExpr     t  P.Value adj.P.Val
CNTNAP2     7 -3.13   6.678 -15.5 1.00e-14  1.85e-10
LAMA2       6  3.88  10.484  14.0 9.34e-14  8.62e-10
PIEZO2     18 -5.84   4.448 -13.8 1.43e-13  8.79e-10
MTUS1       8  3.41   7.791  13.0 5.07e-13  2.34e-09
COL6A6      3 -2.61   4.996 -11.8 4.19e-12  1.41e-08
C11orf87   11 -6.61  -0.653 -11.8 4.80e-12  1.41e-08
LINC02511   4  4.81   2.366  11.6 6.50e-12  1.41e-08
IGF2BP3     7 -5.78   4.676 -11.6 6.58e-12  1.41e-08
MEST        7 -6.12   3.378 -11.6 6.86e-12  1.41e-08
COL28A1     7  4.52   3.797  11.3 1.03e-11  1.72e-08
PRSS35      6 -6.82   1.689 -11.3 1.10e-11  1.72e-08
PEG10       7 -6.71   1.558 -11.3 1.12e-11  1.72e-08
TMEM26     10 -8.65   1.029 -11.2 1.49e-11  2.11e-08
HHIP        4 -5.80   3.428 -11.1 1.67e-11  2.21e-08
MANCR      10  8.25   0.425  11.0 2.03e-11  2.50e-08
STRA6      15 -6.17  -0.210 -10.8 3.09e-11  3.56e-08
VIT         2  5.66   2.889  10.5 5.17e-11  5.61e-08
KHDRBS2     6 -5.24   3.746 -10.4 6.52e-11  6.69e-08
SAMD5       6 -4.70   5.148 -10.3 7.13e-11  6.84e-08
GRID2       4 -5.14   5.329 -10.3 7.41e-11  6.84e-08

Adult vs Young

topTreat(treat.fibro,coef=3,n=20,p.value=0.05)[,-c(1:3)]
                                                             GENENAME CHR
LINC02511                 long intergenic non-protein coding RNA 2511   4
TLL2                                                   tolloid like 2  10
CCL11                                   C-C motif chemokine ligand 11  17
LGR5      leucine rich repeat containing G protein-coupled receptor 5  12
KCNN3        potassium calcium-activated channel subfamily N member 3   1
HIST1H1D                         histone cluster 1 H1 family member d   6
LINC01807                 long intergenic non-protein coding RNA 1807   2
OR2A5                olfactory receptor family 2 subfamily A member 5   7
TBC1D3D                                  TBC1 domain family member 3D  17
LMX1A                       LIM homeobox transcription factor 1 alpha   1
CLSTN2                                                  calsyntenin 2   3
JADRR                                   JADE1 adjacent regulatory RNA   4
LMO3                                                LIM domain only 3  12
          logFC AveExpr     t  P.Value adj.P.Val
LINC02511  3.27   2.366  9.69 2.62e-10  4.84e-06
TLL2       3.38   3.375  7.55 3.06e-08  2.83e-04
CCL11      3.63   0.421  6.91 1.42e-07  8.74e-04
LGR5      -3.73   1.544 -6.48 4.11e-07  1.90e-03
KCNN3      3.96   3.689  6.30 6.45e-07  2.22e-03
HIST1H1D  -5.45   1.959 -6.24 7.80e-07  2.22e-03
LINC01807 -3.00   1.589 -6.19 8.42e-07  2.22e-03
OR2A5      3.48  -1.639  5.84 2.05e-06  4.74e-03
TBC1D3D    2.99  -1.750  5.71 2.89e-06  5.93e-03
LMX1A      2.74  -0.189  5.30 8.18e-06  1.51e-02
CLSTN2    -2.10   5.208 -5.20 1.08e-05  1.70e-02
JADRR     -4.09  -1.077 -5.20 1.10e-05  1.70e-02
LMO3       2.94   1.571  4.89 2.40e-05  3.41e-02

Male vs Female in fetal samples

topTreat(treat.fibro,coef=4)[,-c(1:3)]
                                                     GENENAME CHR logFC
NMUR2                                 neuromedin U receptor 2   5 -4.81
PDZRN4                    PDZ domain containing ring finger 4  12 -3.78
COMP                      cartilage oligomeric matrix protein  19 -4.94
APOA2                                       apolipoprotein A2   1 -3.15
CILP2                  cartilage intermediate layer protein 2  19 -3.12
PIEZO2    piezo type mechanosensitive ion channel component 2  18 -1.59
GREM1                    gremlin 1, DAN family BMP antagonist  15 -4.85
LINC02117         long intergenic non-protein coding RNA 2117   5  3.12
GRM7                        glutamate metabotropic receptor 7   3 -2.01
BTBD17                               BTB domain containing 17  17 -4.05
          AveExpr     t  P.Value adj.P.Val
NMUR2      -0.989 -7.05 1.03e-07   0.00191
PDZRN4      3.678 -6.62 2.91e-07   0.00269
COMP       -0.265 -5.70 3.08e-06   0.01707
APOA2      -1.812 -5.61 3.70e-06   0.01707
CILP2      -0.780 -4.77 3.33e-05   0.09358
PIEZO2      4.448 -4.75 3.42e-05   0.09358
GREM1       0.200 -4.74 3.74e-05   0.09358
LINC02117  -1.503  4.69 4.05e-05   0.09358
GRM7        3.350 -4.45 7.65e-05   0.14471
BTBD17     -0.983 -4.42 8.41e-05   0.14471

Male vs Female in young samples

topTreat(treat.fibro,coef=5)[,-c(1:3)]
                                                   GENENAME CHR logFC
NR1D2         nuclear receptor subfamily 1 group D member 2   3  2.42
NTRK1               neurotrophic receptor tyrosine kinase 1   1 -2.52
LIPG                             lipase G, endothelial type  18 -4.25
VEPH1     ventricular zone expressed PH domain containing 1   3 -2.58
STC2                                        stanniocalcin 2   5 -4.15
PVT1                                          Pvt1 oncogene   8 -2.31
LINC01442       long intergenic non-protein coding RNA 1442  13 -3.94
CNBD1         cyclic nucleotide binding domain containing 1   8  2.48
UHRF1     ubiquitin like with PHD and ring finger domains 1  19 -2.97
NR1D1         nuclear receptor subfamily 1 group D member 1  17  4.27
          AveExpr     t  P.Value adj.P.Val
NR1D2       6.278  5.78 2.39e-06    0.0351
NTRK1       1.790 -5.60 3.80e-06    0.0351
LIPG        0.838 -5.39 6.74e-06    0.0384
VEPH1       2.539 -5.30 8.33e-06    0.0384
STC2        1.232 -5.18 1.15e-05    0.0426
PVT1        5.407 -4.93 2.14e-05    0.0659
LINC01442  -1.202 -4.68 4.28e-05    0.1130
CNBD1       3.440  4.26 1.24e-04    0.2860
UHRF1       2.694 -4.21 1.42e-04    0.2874
NR1D1       2.081  4.19 1.56e-04    0.2874

Male vs Female in adult samples

topTreat(treat.fibro,coef=6)[,-c(1:3)]
                                                  GENENAME CHR logFC
CCL19                        C-C motif chemokine ligand 19   9 -7.44
OR2A5     olfactory receptor family 2 subfamily A member 5   7 -4.58
LINC02511      long intergenic non-protein coding RNA 2511   4 -2.46
DPP10-AS1                            DPP10 antisense RNA 1   2 -4.33
TBC1D3D                       TBC1 domain family member 3D  17 -3.75
DLD                         dihydrolipoamide dehydrogenase   7 -1.82
FAM90A26     family with sequence similarity 90 member A26   4 -3.73
LINC02026      long intergenic non-protein coding RNA 2026   3  4.64
BBOX1                    gamma-butyrobetaine hydroxylase 1  11 -2.70
MME-AS1                                MME antisense RNA 1   3 -3.11
          AveExpr     t  P.Value adj.P.Val
CCL19      -0.977 -9.99 1.51e-10  2.79e-06
OR2A5      -1.639 -6.73 2.24e-07  1.51e-03
LINC02511   2.366 -6.69 2.45e-07  1.51e-03
DPP10-AS1  -1.138 -5.92 1.71e-06  7.83e-03
TBC1D3D    -1.750 -5.83 2.12e-06  7.83e-03
DLD         5.526 -4.90 2.35e-05  5.28e-02
FAM90A26   -1.365 -4.90 2.40e-05  5.28e-02
LINC02026   0.804  4.90 2.43e-05  5.28e-02
BBOX1       0.750 -4.82 2.86e-05  5.28e-02
MME-AS1    -1.139 -4.83 2.86e-05  5.28e-02

Interaction of sex differences between adult and fetal

topTreat(treat.fibro,coef=7)[,-c(1:3)]
                                                               GENENAME
ADAMTS1        ADAM metallopeptidase with thrombospondin type 1 motif 1
PDZRN4                              PDZ domain containing ring finger 4
DPP10-AS1                                         DPP10 antisense RNA 1
LINC01686                   long intergenic non-protein coding RNA 1686
COMP                                cartilage oligomeric matrix protein
KCNG4     potassium voltage-gated channel modifier subfamily G member 4
OR2A5                  olfactory receptor family 2 subfamily A member 5
LINC02026                   long intergenic non-protein coding RNA 2026
TBC1D3D                                    TBC1 domain family member 3D
NMUR2                                           neuromedin U receptor 2
          CHR logFC AveExpr     t  P.Value adj.P.Val
ADAMTS1    21 -4.91   5.302 -6.00 1.43e-06    0.0187
PDZRN4     12  6.38   3.678  5.88 2.02e-06    0.0187
DPP10-AS1   2 -4.67  -1.138 -5.39 6.75e-06    0.0415
LINC01686   1 -7.01  -1.180 -5.03 1.88e-05    0.0866
COMP       19  6.83  -0.265  4.83 3.19e-05    0.1179
KCNG4      16 -5.16  -1.553 -4.68 4.51e-05    0.1387
OR2A5       7 -5.14  -1.639 -4.60 5.54e-05    0.1436
LINC02026   3  5.47   0.804  4.46 8.09e-05    0.1436
TBC1D3D    17 -4.30  -1.750 -4.37 9.65e-05    0.1436
NMUR2       5  5.02  -0.989  4.36 1.02e-04    0.1436

Interaction of sex differences between young and fetal

topTreat(treat.fibro,coef=8)[,-c(1:3)]
                                                          GENENAME CHR
CNBD1                cyclic nucleotide binding domain containing 1   8
NR1D2                nuclear receptor subfamily 1 group D member 2   3
BTBD17                                    BTB domain containing 17  17
PVT1                                                 Pvt1 oncogene   8
LINC01799              long intergenic non-protein coding RNA 1799   2
ADAMTS1   ADAM metallopeptidase with thrombospondin type 1 motif 1  21
LINC01781              long intergenic non-protein coding RNA 1781   1
LINC02583              long intergenic non-protein coding RNA 2583   2
LINC01139              long intergenic non-protein coding RNA 1139   1
LRRTM4                leucine rich repeat transmembrane neuronal 4   2
          logFC AveExpr     t  P.Value adj.P.Val
CNBD1      3.47   3.440  4.81 2.99e-05     0.415
NR1D2      2.56   6.278  4.45 7.61e-05     0.415
BTBD17     6.11  -0.983  4.45 8.58e-05     0.415
PVT1      -2.87   5.407 -4.39 9.00e-05     0.415
LINC01799  5.83  -0.899  4.24 1.45e-04     0.451
ADAMTS1   -3.06   5.302 -4.15 1.69e-04     0.451
LINC01781  5.39  -0.987  4.18 1.71e-04     0.451
LINC02583 -4.82  -1.576 -4.07 2.20e-04     0.465
LINC01139  5.21  -0.939  4.03 2.52e-04     0.465
LRRTM4     3.13   5.063  3.94 2.87e-04     0.465

Interaction of sex differences between adult and young

topTreat(treat.fibro,coef=9)[,-c(1:3)]
                                                      GENENAME CHR logFC
NTRK1                  neurotrophic receptor tyrosine kinase 1   1  4.73
CCL19                            C-C motif chemokine ligand 19   9 -6.99
NR1D2            nuclear receptor subfamily 1 group D member 2   3 -3.18
CYP4Z1           cytochrome P450 family 4 subfamily Z member 1   1  4.80
PER3                              period circadian regulator 3   1 -4.06
SH3RF3-AS1                              SH3RF3 antisense RNA 1   2 -6.15
LINC02511          long intergenic non-protein coding RNA 2511   4 -3.53
AKR1C1                  aldo-keto reductase family 1 member C1  10  3.10
ARNTL      aryl hydrocarbon receptor nuclear translocator like  11  4.32
BBOX1                        gamma-butyrobetaine hydroxylase 1  11 -4.13
           AveExpr     t  P.Value adj.P.Val
NTRK1        1.790  6.86 1.64e-07   0.00274
CCL19       -0.977 -6.64 2.97e-07   0.00274
NR1D2        6.278 -6.12 1.01e-06   0.00620
CYP4Z1       2.090  5.99 1.45e-06   0.00672
PER3         6.458 -5.39 6.63e-06   0.02133
SH3RF3-AS1  -1.236 -5.40 6.93e-06   0.02133
LINC02511    2.366 -5.30 8.35e-06   0.02201
AKR1C1       3.666  5.19 1.10e-05   0.02544
ARNTL        5.082  5.05 1.65e-05   0.03383
BBOX1        0.750 -4.93 2.24e-05   0.04134
par(mar=c(5,5,3,2))
plot(treat.fibro$coefficients[,1],treat.fibro$coefficients[,2],xlab="logFC: Young vs Fetal", ylab="logFC: Adult vs Fetal",main="Fibroblasts: Development",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0,col=colours()[c(175)])
sig.genes <-  dt.fibro[,1] !=0 | dt.fibro[,2] != 0
text(treat.fibro$coefficients[sig.genes,1],treat.fibro$coefficients[sig.genes,2],labels=rownames(dt.fibro)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.fibro$coefficients[,4],treat.fibro$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="Fibroblasts: Sex differences - fetal and young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.fibro[,4] !=0 | dt.fibro[,5] != 0
text(treat.fibro$coefficients[sig.genes,4],treat.fibro$coefficients[sig.genes,5],labels=rownames(dt.fibro)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.fibro$coefficients[,4],treat.fibro$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="Fibroblasts: Sex differences - fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.fibro[,4] !=0 | dt.fibro[,6] != 0
text(treat.fibro$coefficients[sig.genes,4],treat.fibro$coefficients[sig.genes,6],labels=rownames(dt.fibro)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.fibro$coefficients[,5],treat.fibro$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="Fibroblasts: Sex differences - young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
sig.genes <- dt.fibro[,5] !=0 | dt.fibro[,6] != 0
text(treat.fibro$coefficients[sig.genes,5],treat.fibro$coefficients[sig.genes,6],labels=rownames(dt.fibro)[sig.genes],col=2,cex=0.6)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.fibro$coefficients[,4],treat.fibro$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="Fibroblasts: Interaction term: Fetal vs Young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
sig.genes <- dt.fibro[,8] !=0 
if(sum(sig.genes)!=0){
  text(treat.fibro$coefficients[sig.genes,4],treat.fibro$coefficients[sig.genes,5],
       labels=rownames(dt.fibro)[sig.genes],col=2,cex=0.6)
}
plot(treat.fibro$coefficients[,4],treat.fibro$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="Fibroblast: Interaction term: fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.fibro[,7] !=0 
text(treat.fibro$coefficients[sig.genes,4],treat.fibro$coefficients[sig.genes,6],labels=rownames(dt.fibro)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.fibro$coefficients[,5],treat.fibro$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="Fibroblasts: Interaction term: young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.fibro[,9] !=0 
text(treat.fibro$coefficients[sig.genes,5],treat.fibro$coefficients[sig.genes,6],labels=rownames(dt.fibro)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28

Smooth muscle cells

cont.smc <- makeContrasts(YvF = 0.5*(smc.young.Male + smc.young.Female) - 0.5*(smc.fetal.Male + smc.fetal.Female),
                         AvF = 0.5*(smc.adult.Male + smc.adult.Female) - 0.5*(smc.fetal.Male + smc.fetal.Female),
                         AvY = 0.5*(smc.adult.Male + smc.adult.Female) - 0.5*(smc.young.Male + smc.young.Female),
                         SexFetal = smc.fetal.Male - smc.fetal.Female,
                         SexYoung = smc.young.Male - smc.young.Female,
                         SexAdult = smc.adult.Male - smc.adult.Female,
                         InteractionAF = (smc.adult.Male - smc.fetal.Male) - (smc.adult.Female - smc.fetal.Female),
                         InteractionYF = (smc.young.Male - smc.fetal.Male) - (smc.young.Female - smc.fetal.Female),
                         InteractionAY = (smc.adult.Male - smc.young.Male) - (smc.adult.Female - smc.young.Female),
                         levels=design)
fit.smc <- contrasts.fit(fit,contrasts = cont.smc)
fit.smc <- eBayes(fit.smc,robust=TRUE)

summary(decideTests(fit.smc))
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down     110   158     3       54        0        0             1
NotSig 18295 18250 18460    18381    18455    18433         18446
Up        59    56     1       29        9       31            17
       InteractionYF InteractionAY
Down               3             0
NotSig         18456         18464
Up                 5             0
treat.smc <- treat(fit.smc,lfc=0.5)

dt.smc<-decideTests(treat.smc)

summary(dt.smc)
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down      32    53     0       30        0        0             0
NotSig 18418 18398 18464    18424    18461    18457         18460
Up        14    13     0       10        3        7             4
       InteractionYF InteractionAY
Down               1             0
NotSig         18461         18464
Up                 2             0
par(mfrow=c(3,3))
for(i in 1:9){
  plotMD(treat.smc,coef=i,status=dt.smc[,i],hl.col=c("blue","red"))
  abline(h=0,col="grey")
}

Version Author Date
f474878 Belinda Phipson 2019-10-28
par(mfrow=c(1,1))
par(mar=c(7,4,2,2))
barplot(summary(dt.smc)[-2,],beside=TRUE,legend=TRUE,col=c("blue","red"),ylab="Number of significant genes",las=2)
title("smooth muscle cells")

Version Author Date
f474878 Belinda Phipson 2019-10-28

Young vs Fetal

options(digits=3)
topTreat(treat.smc,coef=1,n=20,p.value=0.05)[,-c(1:3)]
                                                     GENENAME CHR logFC
SCN3A            sodium voltage-gated channel alpha subunit 3   2  8.12
PIEZO2    piezo type mechanosensitive ion channel component 2  18 -4.77
PRSS35                                     serine protease 35   6 -4.81
GREM2                    gremlin 2, DAN family BMP antagonist   1 -4.66
SULT1E1                   sulfotransferase family 1E member 1   4 -6.12
EFNA5                                               ephrin A5   5 -7.63
ABCA5               ATP binding cassette subfamily A member 5  17  3.54
MEG3                                   maternally expressed 3  14 -6.54
CBFA2T3                   CBFA2/RUNX1 translocation partner 3  16  5.53
SEMA6A                                          semaphorin 6A   5 -3.69
IGF2BP3   insulin like growth factor 2 mRNA binding protein 3   7 -4.18
PRDM6                                         PR/SET domain 6   5 -4.83
SMO                       smoothened, frizzled class receptor   7 -3.44
TMEM140                             transmembrane protein 140   7  4.75
LINC02507         long intergenic non-protein coding RNA 2507   4 -4.45
DIPK2A                     divergent protein kinase domain 2A   3 -2.56
CACNA1A        calcium voltage-gated channel subunit alpha1 A  19  2.53
BCL7C          BAF chromatin remodeling complex subunit BCL7C  16 -2.78
GPR137C                       G protein-coupled receptor 137C  14 -3.91
RAB7B                       RAB7B, member RAS oncogene family   1 -4.45
          AveExpr     t  P.Value adj.P.Val
SCN3A       2.955  8.71 2.33e-09  0.000043
PIEZO2      4.448 -7.37 4.70e-08  0.000326
PRSS35      1.689 -7.33 5.29e-08  0.000326
GREM2       1.334 -7.18 7.42e-08  0.000343
SULT1E1     0.545 -6.72 2.41e-07  0.000889
EFNA5       6.711 -6.62 3.18e-07  0.000979
ABCA5       6.005  5.98 1.44e-06  0.003737
MEG3        4.906 -5.97 1.62e-06  0.003737
CBFA2T3     3.714  5.91 1.83e-06  0.003753
SEMA6A      5.381 -5.68 3.12e-06  0.005757
IGF2BP3     4.676 -5.62 3.65e-06  0.006123
PRDM6       3.380 -5.46 5.67e-06  0.008163
SMO         4.381 -5.43 5.89e-06  0.008163
TMEM140     4.006  5.43 6.19e-06  0.008163
LINC02507   0.616 -5.29 8.86e-06  0.010904
DIPK2A      5.372 -5.20 1.07e-05  0.012352
CACNA1A     4.507  5.11 1.34e-05  0.013870
BCL7C       6.149 -5.11 1.35e-05  0.013870
GPR137C     4.948 -5.04 1.64e-05  0.015402
RAB7B       2.594 -5.04 1.67e-05  0.015402

Adult vs Fetal

topTreat(treat.smc,coef=2,n=20,p.value=0.05)[,-c(1:3)]
                                                            GENENAME CHR
PIEZO2           piezo type mechanosensitive ion channel component 2  18
SCN3A                   sodium voltage-gated channel alpha subunit 3   2
GREM2                           gremlin 2, DAN family BMP antagonist   1
MBOAT2          membrane bound O-acyltransferase domain containing 2   2
PRSS35                                            serine protease 35   6
ST6GALNAC5 ST6 N-acetylgalactosaminide alpha-2,6-sialyltransferase 5   1
SULT1E1                          sulfotransferase family 1E member 1   4
PRDM6                                                PR/SET domain 6   5
PRCD                                    photoreceptor disc component  17
FSTL4                                             follistatin like 4   5
CNTN6                                                    contactin 6   3
DIPK2A                            divergent protein kinase domain 2A   3
GRID2             glutamate ionotropic receptor delta type subunit 2   4
STRBP                      spermatid perinuclear RNA binding protein   9
ABCA5                      ATP binding cassette subfamily A member 5  17
CBFA2T3                          CBFA2/RUNX1 translocation partner 3  16
DIAPH3                                   diaphanous related formin 3  13
PRTFDC1               phosphoribosyl transferase domain containing 1  10
SEMA6A                                                 semaphorin 6A   5
MEGF6                                    multiple EGF like domains 6   1
           logFC AveExpr     t  P.Value adj.P.Val
PIEZO2     -5.64   4.448 -9.25 6.91e-10  1.28e-05
SCN3A       8.27   2.955  8.61 2.97e-09  2.74e-05
GREM2      -4.87   1.334 -7.56 3.01e-08  1.86e-04
MBOAT2     -3.55   6.065 -7.24 6.37e-08  2.94e-04
PRSS35     -4.59   1.689 -6.94 1.35e-07  4.98e-04
ST6GALNAC5 -6.48   3.879 -6.79 2.01e-07  6.18e-04
SULT1E1    -6.00   0.545 -6.58 3.40e-07  8.94e-04
PRDM6      -5.54   3.380 -6.52 3.87e-07  8.94e-04
PRCD        4.58   2.370  6.44 4.56e-07  9.23e-04
FSTL4       4.71   1.475  6.41 5.00e-07  9.23e-04
CNTN6      -4.45   3.613 -6.15 9.52e-07  1.60e-03
DIPK2A     -2.87   5.372 -5.83 2.10e-06  2.87e-03
GRID2      -5.63   5.329 -5.85 2.12e-06  2.87e-03
STRBP      -3.28   5.934 -5.82 2.18e-06  2.87e-03
ABCA5       3.45   6.005  5.60 3.88e-06  4.61e-03
CBFA2T3     5.46   3.714  5.60 4.00e-06  4.61e-03
DIAPH3     -5.85   4.974 -5.56 4.48e-06  4.76e-03
PRTFDC1    -3.77   4.176 -5.52 4.79e-06  4.76e-03
SEMA6A     -3.61   5.381 -5.48 5.26e-06  4.76e-03
MEGF6      -4.54   3.712 -5.47 5.51e-06  4.76e-03

Adult vs Young

topTreat(treat.smc,coef=3)[,-c(1:3)]
                                          GENENAME CHR logFC AveExpr     t
GBA                        glucosylceramidase beta   1  2.96    3.42  5.51
TUBGCP6 tubulin gamma complex associated protein 6  22 -2.86    3.60 -4.88
LIN52     lin-52 DREAM MuvB core complex component  14 -2.60    6.61 -4.68
ATXN7                                     ataxin 7   3 -2.92    4.72 -4.68
FSTL4                           follistatin like 4   5  3.40    1.47  4.52
ALDH1A2  aldehyde dehydrogenase 1 family member A2  15 -4.16    5.63 -4.04
POLR2H                 RNA polymerase II subunit H   3  2.42    4.12  4.01
ZNF12                       zinc finger protein 12   7 -2.43    4.69 -3.90
SUPV3L1                     Suv3 like RNA helicase  10 -2.29    4.82 -3.73
PHF2                          PHD finger protein 2   9  2.13    5.45  3.70
         P.Value adj.P.Val
GBA     4.78e-06    0.0883
TUBGCP6 2.45e-05    0.1927
LIN52   4.13e-05    0.1927
ATXN7   4.17e-05    0.1927
FSTL4   6.36e-05    0.2349
ALDH1A2 2.28e-04    0.6205
POLR2H  2.35e-04    0.6205
ZNF12   3.18e-04    0.7336
SUPV3L1 4.92e-04    0.8469
PHF2    5.30e-04    0.8469

Male vs Female in fetal samples

topTreat(treat.smc,coef=4,n=20,p.value=0.05)[,-c(1:3)]
                                                           GENENAME CHR
GREM2                          gremlin 2, DAN family BMP antagonist   1
OSR1                     odd-skipped related transcription factor 1   2
GPHA2                                  glycoprotein hormone alpha 2  11
ADORA2B                                      adenosine A2b receptor  17
SFRP2                           secreted frizzled related protein 2   4
MOV10L1                      Mov10 like RISC complex RNA helicase 1  22
LINC01886               long intergenic non-protein coding RNA 1886   2
RSPO2                                                   R-spondin 2   8
CHRD                                                        chordin   3
IQCA1                         IQ motif containing with AAA domain 1   2
ENPP1            ectonucleotide pyrophosphatase/phosphodiesterase 1   6
MIR3681HG                                         MIR3681 host gene   2
RAB3C                             RAB3C, member RAS oncogene family   5
SLITRK5                          SLIT and NTRK like family member 5  13
ADAM22                              ADAM metallopeptidase domain 22   7
ADAMTS17  ADAM metallopeptidase with thrombospondin type 1 motif 17  15
LRRC3B                            leucine rich repeat containing 3B   3
SLC22A3                           solute carrier family 22 member 3   6
THSD7B                   thrombospondin type 1 domain containing 7B   2
LRRTM4                 leucine rich repeat transmembrane neuronal 4   2
          logFC AveExpr      t  P.Value adj.P.Val
GREM2     -8.55   1.334 -13.07 4.95e-13  9.14e-09
OSR1      -7.05   0.756  -7.96 1.25e-08  1.15e-04
GPHA2     -4.84  -1.777  -6.77 2.03e-07  1.25e-03
ADORA2B    6.41   2.743   6.62 3.11e-07  1.44e-03
SFRP2     -8.53  -0.817  -6.52 4.24e-07  1.50e-03
MOV10L1   -6.23   1.635  -6.43 4.87e-07  1.50e-03
LINC01886 -5.54   0.260  -6.19 8.92e-07  2.35e-03
RSPO2     -5.43   2.084  -5.98 1.49e-06  3.15e-03
CHRD       6.17   2.010   5.98 1.54e-06  3.15e-03
IQCA1     -5.65   2.517  -5.87 2.04e-06  3.51e-03
ENPP1     -5.02   4.216  -5.85 2.09e-06  3.51e-03
MIR3681HG -4.82   3.305  -5.72 2.90e-06  4.47e-03
RAB3C     -6.03   2.110  -5.51 5.13e-06  6.92e-03
SLITRK5   -5.82   0.513  -5.50 5.25e-06  6.92e-03
ADAM22    -4.87   4.266  -5.45 5.88e-06  7.24e-03
ADAMTS17  -5.12   4.708  -5.34 7.87e-06  8.78e-03
LRRC3B    -5.74   1.042  -5.34 8.09e-06  8.78e-03
SLC22A3   -4.86   3.158  -5.26 9.64e-06  9.89e-03
THSD7B    -5.21   3.773  -5.12 1.38e-05  1.28e-02
LRRTM4    -5.66   5.063  -5.12 1.42e-05  1.28e-02

Male vs Female in young samples

topTreat(treat.smc,coef=5)[,-c(1:3)]
                                                             GENENAME CHR
PHF2                                             PHD finger protein 2   9
ACTR6                                         actin related protein 6  12
MPHOSPH10                                   M-phase phosphoprotein 10   2
MALT1                                               MALT1 paracaspase  18
MAGOH                     mago homolog, exon junction complex subunit   1
ZNF121                                        zinc finger protein 121  19
EIF2B5    eukaryotic translation initiation factor 2B subunit epsilon   3
MED21                                     mediator complex subunit 21  12
GABPA           GA binding protein transcription factor subunit alpha  21
BCL9                                   BCL9 transcription coactivator   1
          logFC AveExpr    t  P.Value adj.P.Val
PHF2       4.04    5.45 5.89 1.84e-06    0.0340
ACTR6      3.50    4.49 5.58 4.04e-06    0.0373
MPHOSPH10  3.89    5.08 5.38 6.90e-06    0.0425
MALT1      4.06    5.91 4.97 2.02e-05    0.0855
MAGOH      3.08    4.42 4.91 2.32e-05    0.0855
ZNF121     3.12    4.68 4.79 3.15e-05    0.0894
EIF2B5     2.92    3.72 4.76 3.39e-05    0.0894
MED21      3.48    4.49 4.71 3.92e-05    0.0905
GABPA      3.09    5.15 4.43 8.06e-05    0.1653
BCL9       4.06    5.50 4.32 1.11e-04    0.1859

Male vs Female in adult samples

topTreat(treat.smc,coef=6)[,-c(1:3)]
                                                   GENENAME CHR logFC
LIN52              lin-52 DREAM MuvB core complex component  14  4.82
TOX4            TOX high mobility group box family member 4  14  4.16
PPM1G           protein phosphatase, Mg2+/Mn2+ dependent 1G   2  3.94
EPM2AIP1                        EPM2A interacting protein 1   3  3.62
DNAJC16   DnaJ heat shock protein family (Hsp40) member C16   1  4.03
ZDHHC5                   zinc finger DHHC-type containing 5  11  3.40
TESK2          testis associated actin remodelling kinase 2   1  4.65
NDST1                N-deacetylase and N-sulfotransferase 1   5  4.01
CCDC174                   coiled-coil domain containing 174   3  3.27
FAHD2A   fumarylacetoacetate hydrolase domain containing 2A   2  3.68
         AveExpr    t  P.Value adj.P.Val
LIN52       6.61 6.53 3.68e-07   0.00461
TOX4        5.53 6.41 4.99e-07   0.00461
PPM1G       5.40 5.92 1.69e-06   0.01037
EPM2AIP1    5.75 5.42 6.15e-06   0.02840
DNAJC16     5.38 5.28 8.81e-06   0.03253
ZDHHC5      5.22 5.17 1.16e-05   0.03583
TESK2       5.30 5.03 1.74e-05   0.04595
NDST1       5.68 4.90 2.39e-05   0.05300
CCDC174     4.70 4.83 2.84e-05   0.05300
FAHD2A      4.25 4.80 3.12e-05   0.05300

Interaction of sex differences between adult and fetal

topTreat(treat.smc,coef=7)[,-c(1:3)]
                                            GENENAME CHR logFC AveExpr
GREM2           gremlin 2, DAN family BMP antagonist   1  8.35   1.334
LRRC42             leucine rich repeat containing 42   1  6.34   3.562
LIN52       lin-52 DREAM MuvB core complex component  14  4.92   6.606
GTF3C3   general transcription factor IIIC subunit 3   2  4.47   5.039
PPM1G    protein phosphatase, Mg2+/Mn2+ dependent 1G   2  4.05   5.401
OSR1      odd-skipped related transcription factor 1   2  7.67   0.756
TRAM2    translocation associated membrane protein 2   6  4.66   5.691
EPM2AIP1                 EPM2A interacting protein 1   3  3.90   5.753
BTBD11                      BTB domain containing 11  12  7.37   3.016
GPHA2                   glycoprotein hormone alpha 2  11  4.89  -1.777
            t  P.Value adj.P.Val
GREM2    6.80 2.09e-07   0.00386
LRRC42   6.05 1.31e-06   0.01208
LIN52    5.56 4.34e-06   0.02673
GTF3C3   5.42 6.17e-06   0.02850
PPM1G    4.88 2.56e-05   0.05703
OSR1     4.91 2.68e-05   0.05703
TRAM2    4.85 2.82e-05   0.05703
EPM2AIP1 4.83 2.85e-05   0.05703
BTBD11   4.83 3.26e-05   0.05703
GPHA2    4.76 3.52e-05   0.05703

Interaction of sex differences between young and fetal

topTreat(treat.smc,coef=8)[,-c(1:3)]
                                                           GENENAME CHR
GREM2                          gremlin 2, DAN family BMP antagonist   1
PHF2                                           PHD finger protein 2   9
CACNA1A              calcium voltage-gated channel subunit alpha1 A  19
ACTR6                                       actin related protein 6  12
SNN                                                         stannin  16
GPHA2                                  glycoprotein hormone alpha 2  11
EIF2B5  eukaryotic translation initiation factor 2B subunit epsilon   3
HARBI1                              harbinger transposase derived 1  11
ADORA2B                                      adenosine A2b receptor  17
OSR1                     odd-skipped related transcription factor 1   2
        logFC AveExpr     t  P.Value adj.P.Val
GREM2    8.66   1.334  7.05 1.14e-07   0.00211
PHF2     5.39   5.453  6.38 5.45e-07   0.00503
CACNA1A -4.93   4.507 -5.57 4.28e-06   0.02635
ACTR6    4.22   4.492  5.16 1.21e-05   0.05578
SNN     -5.35   2.078 -4.99 1.98e-05   0.07111
GPHA2    5.04  -1.777  4.93 2.31e-05   0.07111
EIF2B5   3.86   3.719  4.84 2.80e-05   0.07391
HARBI1  -7.04   2.035 -4.83 3.21e-05   0.07412
ADORA2B -6.68   2.743 -4.72 4.24e-05   0.08306
OSR1     7.33   0.756  4.69 4.77e-05   0.08306

Interaction of sex differences between adult and young

topTreat(treat.smc,coef=9)[,-c(1:3)]
                                                   GENENAME CHR logFC
TOX4            TOX high mobility group box family member 4  14  4.68
NRBF2                     nuclear receptor binding factor 2  10 -6.27
MPHOSPH10                         M-phase phosphoprotein 10   2 -4.80
PPM1G           protein phosphatase, Mg2+/Mn2+ dependent 1G   2  4.26
DNAJC16   DnaJ heat shock protein family (Hsp40) member C16   1  4.99
ASB3               ankyrin repeat and SOCS box containing 3   2  4.89
LINC01572       long intergenic non-protein coding RNA 1572  16  5.00
CCDC174                   coiled-coil domain containing 174   3  4.18
ACTR6                               actin related protein 6  12 -3.90
LIN52              lin-52 DREAM MuvB core complex component  14  4.32
          AveExpr     t  P.Value adj.P.Val
TOX4         5.53  5.11 1.42e-05     0.219
NRBF2        3.88 -4.67 4.76e-05     0.219
MPHOSPH10    5.08 -4.57 5.88e-05     0.219
PPM1G        5.40  4.56 5.92e-05     0.219
DNAJC16      5.38  4.54 6.43e-05     0.219
ASB3         3.28  4.50 7.13e-05     0.219
LINC01572    5.65  4.44 8.32e-05     0.220
CCDC174      4.70  4.36 1.01e-04     0.222
ACTR6        4.49 -4.26 1.28e-04     0.222
LIN52        6.61  4.26 1.30e-04     0.222
par(mar=c(5,5,3,2))
plot(treat.smc$coefficients[,1],treat.smc$coefficients[,2],xlab="logFC: Young vs Fetal", ylab="logFC: Adult vs Fetal",main="smooth muscle cells: Development",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0,col=colours()[c(175)])
sig.genes <-  dt.smc[,1] !=0 | dt.smc[,2] != 0
text(treat.smc$coefficients[sig.genes,1],treat.smc$coefficients[sig.genes,2],labels=rownames(dt.smc)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.smc$coefficients[,4],treat.smc$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="smooth muscle cells: Sex differences - fetal and young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.smc[,4] !=0 | dt.smc[,5] != 0
text(treat.smc$coefficients[sig.genes,4],treat.smc$coefficients[sig.genes,5],labels=rownames(dt.smc)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.smc$coefficients[,4],treat.smc$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="smooth muscle cells: Sex differences - fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.smc[,4] !=0 | dt.smc[,6] != 0
text(treat.smc$coefficients[sig.genes,4],treat.smc$coefficients[sig.genes,6],labels=rownames(dt.smc)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.smc$coefficients[,5],treat.smc$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="smooth muscle cells: Sex differences - young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
sig.genes <- dt.smc[,5] !=0 | dt.smc[,6] != 0
text(treat.smc$coefficients[sig.genes,5],treat.smc$coefficients[sig.genes,6],labels=rownames(dt.smc)[sig.genes],col=2,cex=0.6)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.smc$coefficients[,4],treat.smc$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="smooth muscle cells: Interaction term: Fetal vs Young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.smc[,8] !=0 
text(treat.smc$coefficients[sig.genes,4],treat.smc$coefficients[sig.genes,5],labels=rownames(dt.smc)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.smc$coefficients[,4],treat.smc$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="smooth muscle cells: Interaction term: fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.smc[,7] !=0 
text(treat.smc$coefficients[sig.genes,4],treat.smc$coefficients[sig.genes,6],labels=rownames(dt.smc)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.smc$coefficients[,5],treat.smc$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="smooth muscle cells: Interaction term: young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
sig.genes <- dt.smc[,9] !=0 
if(sum(sig.genes)!=0){
  text(treat.smc$coefficients[sig.genes,5],treat.smc$coefficients[sig.genes,6],
       labels=rownames(dt.smc)[sig.genes],col=2,cex=0.6)
}

Endothelial cells

cont.endo <- makeContrasts(YvF = 0.5*(endo.young.Male + endo.young.Female) - 0.5*(endo.fetal.Male + endo.fetal.Female),
                         AvF = 0.5*(endo.adult.Male + endo.adult.Female) - 0.5*(endo.fetal.Male + endo.fetal.Female),
                         AvY = 0.5*(endo.adult.Male + endo.adult.Female) - 0.5*(endo.young.Male + endo.young.Female),
                         SexFetal = endo.fetal.Male - endo.fetal.Female,
                         SexYoung = endo.young.Male - endo.young.Female,
                         SexAdult = endo.adult.Male - endo.adult.Female,
                         InteractionAF = (endo.adult.Male - endo.fetal.Male) - (endo.adult.Female - endo.fetal.Female),
                         InteractionYF = (endo.young.Male - endo.fetal.Male) - (endo.young.Female - endo.fetal.Female),
                         InteractionAY = (endo.adult.Male - endo.young.Male) - (endo.adult.Female - endo.young.Female),
                         levels=design)
fit.endo <- contrasts.fit(fit,contrasts = cont.endo)
fit.endo <- eBayes(fit.endo,robust=TRUE)

summary(decideTests(fit.endo))
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down     772   892     0        6        0        1             2
NotSig 16982 16753 18464    18457    18463    18463         18461
Up       710   819     0        1        1        0             1
       InteractionYF InteractionAY
Down               0             2
NotSig         18462         18462
Up                 2             0
treat.endo <- treat(fit.endo,lfc=0.5)

dt.endo<-decideTests(treat.endo)

summary(dt.endo)
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down     316   422     0        4        0        0             1
NotSig 17922 17781 18464    18460    18463    18464         18463
Up       226   261     0        0        1        0             0
       InteractionYF InteractionAY
Down               0             2
NotSig         18462         18462
Up                 2             0
par(mfrow=c(3,3))
for(i in 1:9){
  plotMD(treat.endo,coef=i,status=dt.endo[,i],hl.col=c("blue","red"))
  abline(h=0,col="grey")
}

Version Author Date
f474878 Belinda Phipson 2019-10-28
par(mfrow=c(1,1))
par(mar=c(7,4,2,2))
barplot(summary(dt.endo)[-2,],beside=TRUE,legend=TRUE,col=c("blue","red"),ylab="Number of significant genes",las=2)
title("Endothelial cells")

Version Author Date
f474878 Belinda Phipson 2019-10-28

Young vs Fetal

options(digits=3)
topTreat(treat.endo,coef=1,n=20,p.value=0.05)[,-c(1:3)]
                                                           GENENAME CHR
PRND                                      prion like protein doppel  20
NTS                                                     neurotensin  12
TMTC1       transmembrane and tetratricopeptide repeat containing 1  12
PEG10                                       paternally expressed 10   7
HOXD9                                                   homeobox D9   2
PIEZO2          piezo type mechanosensitive ion channel component 2  18
OR51E1            olfactory receptor family 51 subfamily E member 1  11
TIMP4                             TIMP metallopeptidase inhibitor 4   3
RASGRF2  Ras protein specific guanine nucleotide releasing factor 2   5
IGF2BP3         insulin like growth factor 2 mRNA binding protein 3   7
PRSS35                                           serine protease 35   6
GPR182                               G protein-coupled receptor 182  12
HOXD-AS2                               HOXD cluster antisense RNA 2   2
HBA1                                     hemoglobin subunit alpha 1  16
CCL21                                 C-C motif chemokine ligand 21   9
SOX11                                                    SRY-box 11   2
JADE2                                      jade family PHD finger 2   5
CLVS1                                                    clavesin 1   8
L1TD1                    LINE1 type transposase domain containing 1   1
IGF2BP1         insulin like growth factor 2 mRNA binding protein 1  17
         logFC AveExpr      t  P.Value adj.P.Val
PRND     -7.67  -1.201 -23.13 7.67e-19  1.42e-14
NTS      -6.82  -0.384 -13.46 2.49e-13  2.30e-09
TMTC1     3.75   7.751  10.87 2.47e-11  1.52e-07
PEG10    -6.23   1.558 -10.49 5.41e-11  2.50e-07
HOXD9    -4.76  -1.728 -10.27 8.15e-11  3.01e-07
PIEZO2   -5.61   4.448 -10.07 1.23e-10  3.77e-07
OR51E1    6.40   0.658   9.45 4.58e-10  1.10e-06
TIMP4     7.57   1.237   9.44 4.78e-10  1.10e-06
RASGRF2   3.63   4.285   9.31 5.84e-10  1.20e-06
IGF2BP3  -5.69   4.676  -8.85 1.65e-09  2.78e-06
PRSS35   -5.55   1.689  -8.84 1.66e-09  2.78e-06
GPR182   -4.28  -1.607  -8.56 3.02e-09  4.65e-06
HOXD-AS2 -4.93  -1.028  -8.09 8.81e-09  1.25e-05
HBA1     -8.20   1.612  -7.98 1.24e-08  1.63e-05
CCL21    -4.71   1.302  -7.82 1.64e-08  2.02e-05
SOX11    -6.30   1.386  -7.80 1.80e-08  2.07e-05
JADE2     2.85   4.433   7.68 2.23e-08  2.42e-05
CLVS1    -4.04   3.973  -7.64 2.50e-08  2.42e-05
L1TD1    -4.95   0.565  -7.63 2.57e-08  2.42e-05
IGF2BP1  -5.70   1.905  -7.60 2.84e-08  2.42e-05

Adult vs Fetal

topTreat(treat.endo,coef=2,n=20,p.value=0.05)[,-c(1:3)]
                                                            GENENAME CHR
PRND                                       prion like protein doppel  20
NTS                                                      neurotensin  12
PEG10                                        paternally expressed 10   7
HOXD9                                                    homeobox D9   2
RASGRF2   Ras protein specific guanine nucleotide releasing factor 2   5
CLRN1-AS1                                      CLRN1 antisense RNA 1   3
TMTC1        transmembrane and tetratricopeptide repeat containing 1  12
LINC02100                long intergenic non-protein coding RNA 2100   5
IGF2BP3          insulin like growth factor 2 mRNA binding protein 3   7
PIEZO2           piezo type mechanosensitive ion channel component 2  18
CABP1                                      calcium binding protein 1  12
SYNE1          spectrin repeat containing nuclear envelope protein 1   6
TIMP4                              TIMP metallopeptidase inhibitor 4   3
HBA2                                      hemoglobin subunit alpha 2  16
PRSS35                                            serine protease 35   6
SOX11                                                     SRY-box 11   2
JADE2                                       jade family PHD finger 2   5
RGS20                            regulator of G protein signaling 20   8
CALCOCO2                    calcium binding and coiled-coil domain 2  17
HAGLR           HOXD antisense growth-associated long non-coding RNA   2
          logFC AveExpr      t  P.Value adj.P.Val
PRND      -7.64  -1.201 -22.99 8.88e-19  1.64e-14
NTS       -7.13  -0.384 -14.27 6.65e-14  6.14e-10
PEG10     -6.46   1.558 -10.96 2.14e-11  1.32e-07
HOXD9     -4.75  -1.728 -10.24 8.69e-11  4.01e-07
RASGRF2    3.87   4.285  10.12 1.09e-10  4.03e-07
CLRN1-AS1 -5.76   0.978  -9.99 1.45e-10  4.47e-07
TMTC1      3.45   7.751   9.77 2.22e-10  5.87e-07
LINC02100  4.08   1.383   9.57 3.39e-10  7.82e-07
IGF2BP3   -5.64   4.676  -9.10 9.47e-10  1.83e-06
PIEZO2    -4.02   4.448  -9.03 1.07e-09  1.83e-06
CABP1      6.43   1.974   9.04 1.09e-09  1.83e-06
SYNE1      2.25   8.640   8.43 4.02e-09  6.18e-06
TIMP4      7.07   1.237   8.34 5.19e-09  7.38e-06
HBA2      -7.73   2.179  -8.14 8.29e-09  1.03e-05
PRSS35    -5.16   1.689  -8.12 8.33e-09  1.03e-05
SOX11     -6.35   1.386  -7.97 1.19e-08  1.35e-05
JADE2      2.93   4.433   7.94 1.24e-08  1.35e-05
RGS20     -3.99   2.554  -7.69 2.21e-08  2.26e-05
CALCOCO2   2.45   6.451   7.57 2.91e-08  2.83e-05
HAGLR     -5.44  -1.172  -7.52 3.36e-08  3.10e-05

Adult vs Young

topTreat(treat.endo,coef=3)[,-c(1:3)]
                                             GENENAME CHR logFC AveExpr
SCN4B     sodium voltage-gated channel beta subunit 4  11  4.01   1.534
ITGBL1                   integrin subunit beta like 1  13  6.22   2.168
PTCHD4                    patched domain containing 4   6  3.87   2.284
G6PC2       glucose-6-phosphatase catalytic subunit 2   2  3.98  -1.190
NOTCH3                               notch receptor 3  19  4.47   4.992
ADGRF2         adhesion G protein-coupled receptor F2   6  3.07  -1.173
TUBB8                       tubulin beta 8 class VIII  10 -3.25   1.019
LSAMP       limbic system associated membrane protein   3 -3.03   7.186
MTRNR2L1                               MT-RNR2 like 1  17  3.34   0.596
UNC5B-AS1                       UNC5B antisense RNA 1  10  2.72  -0.226
              t  P.Value adj.P.Val
SCN4B      5.00 1.87e-05     0.294
ITGBL1     4.82 3.18e-05     0.294
PTCHD4     4.61 5.10e-05     0.314
G6PC2      4.50 6.80e-05     0.314
NOTCH3     4.18 1.63e-04     0.602
ADGRF2     3.77 4.49e-04     1.000
TUBB8     -3.73 5.03e-04     1.000
LSAMP     -3.49 9.11e-04     1.000
MTRNR2L1   3.45 1.03e-03     1.000
UNC5B-AS1  3.44 1.03e-03     1.000

Male vs Female in fetal samples

topTreat(treat.endo,coef=4)[,-c(1:3)]
                                           GENENAME CHR logFC AveExpr
APOA2                             apolipoprotein A2   1 -3.74  -1.812
BMP10                 bone morphogenetic protein 10   2 -4.40  -1.542
COMP            cartilage oligomeric matrix protein  19 -5.22  -0.265
GPHA2                  glycoprotein hormone alpha 2  11 -3.74  -1.777
ADGRA1       adhesion G protein-coupled receptor A1  10 -4.16  -1.388
ADGRF2       adhesion G protein-coupled receptor F2   6 -4.58  -1.173
PRG4                                 proteoglycan 4   1 -3.37   0.409
C2CD4B    C2 calcium dependent domain containing 4B  15  2.85  -0.113
SMAD1-AS1                     SMAD1 antisense RNA 1   4  4.12  -0.852
SLC6A11           solute carrier family 6 member 11   3 -4.07  -0.521
              t  P.Value adj.P.Val
APOA2     -6.95 1.30e-07   0.00239
BMP10     -5.61 3.78e-06   0.03486
COMP      -5.35 7.64e-06   0.04208
GPHA2     -5.27 9.12e-06   0.04208
ADGRA1    -4.73 3.77e-05   0.13923
ADGRF2    -4.60 5.39e-05   0.16597
PRG4      -4.47 7.26e-05   0.18954
C2CD4B     4.42 8.21e-05   0.18954
SMAD1-AS1  4.25 1.32e-04   0.27115
SLC6A11   -4.19 1.55e-04   0.28606

Male vs Female in young samples

topTreat(treat.endo,coef=5)[,-c(1:3)]
                                             GENENAME CHR logFC AveExpr
UMODL1                              uromodulin like 1  21  6.55  -0.404
ITLN1                                    intelectin 1   1 -3.86  -0.125
CHRNA2 cholinergic receptor nicotinic alpha 2 subunit   8 -3.33  -1.583
MAFA                  MAF bZIP transcription factor A   8 -4.41  -1.370
SLC9C1              solute carrier family 9 member C1   3  2.69   4.306
OPN5                                          opsin 5   6  5.29  -0.194
ZNF750                        zinc finger protein 750  17  4.67   0.683
GSDMC                                     gasdermin C   8 -4.24  -0.886
CLDN6                                       claudin 6  16 -4.00  -0.509
GBX1                    gastrulation brain homeobox 1   7 -4.65   1.261
           t  P.Value adj.P.Val
UMODL1  7.12 8.94e-08   0.00165
ITLN1  -4.81 3.03e-05   0.28010
CHRNA2 -4.41 8.57e-05   0.45091
MAFA   -4.37 9.77e-05   0.45091
SLC9C1  4.11 1.84e-04   0.53329
OPN5    4.11 2.04e-04   0.53329
ZNF750  4.08 2.11e-04   0.53329
GSDMC  -4.03 2.41e-04   0.53329
CLDN6  -3.99 2.60e-04   0.53329
GBX1   -3.96 2.93e-04   0.54022

Male vs Female in adult samples

topTreat(treat.endo,coef=6)[,-c(1:3)]
                                                    GENENAME CHR logFC
SLCO4A1-AS1                          SLCO4A1 antisense RNA 1  20 -4.06
CYP8B1         cytochrome P450 family 8 subfamily B member 1   3 -4.46
UNC5B-AS1                              UNC5B antisense RNA 1  10 -4.45
LINC01060        long intergenic non-protein coding RNA 1060   4 -5.28
L1TD1             LINE1 type transposase domain containing 1   1 -4.27
OR2A5       olfactory receptor family 2 subfamily A member 5   7 -3.74
GPR12                          G protein-coupled receptor 12  13 -3.51
SUCNR1                                  succinate receptor 1   3 -4.72
GHRHR              growth hormone releasing hormone receptor   7 -4.83
SH3RF3-AS1                            SH3RF3 antisense RNA 1   2 -3.59
            AveExpr     t  P.Value adj.P.Val
SLCO4A1-AS1 -1.6254 -5.47 5.39e-06    0.0996
CYP8B1      -0.0337 -4.99 1.90e-05    0.1469
UNC5B-AS1   -0.2265 -4.67 4.51e-05    0.1469
LINC01060    3.3689 -4.56 6.14e-05    0.1469
L1TD1        0.5651 -4.50 6.91e-05    0.1469
OR2A5       -1.6389 -4.49 7.03e-05    0.1469
GPR12       -1.5994 -4.47 7.33e-05    0.1469
SUCNR1      -0.7171 -4.48 7.44e-05    0.1469
GHRHR       -0.5781 -4.48 7.46e-05    0.1469
SH3RF3-AS1  -1.2361 -4.44 7.95e-05    0.1469

Interaction of sex differences between adult and fetal

topTreat(treat.endo,coef=7)[,-c(1:3)]
                                                 GENENAME CHR logFC
SH3RF3-AS1                         SH3RF3 antisense RNA 1   2 -6.52
L1TD1          LINE1 type transposase domain containing 1   1 -5.93
GHRHR           growth hormone releasing hormone receptor   7 -8.39
APOA2                                   apolipoprotein A2   1  4.03
FOXN3-AS2                           FOXN3 antisense RNA 2  14 -7.58
SLCO4A1-AS1                       SLCO4A1 antisense RNA 1  20 -5.20
SMAD1-AS1                           SMAD1 antisense RNA 1   4 -5.81
ONECUT3                                one cut homeobox 3  19 -5.13
BMP10                       bone morphogenetic protein 10   2  4.79
CYP8B1      cytochrome P450 family 8 subfamily B member 1   3 -4.82
            AveExpr     t  P.Value adj.P.Val
SH3RF3-AS1  -1.2361 -5.81 2.40e-06    0.0443
L1TD1        0.5651 -5.12 1.41e-05    0.0734
GHRHR       -0.5781 -5.14 1.48e-05    0.0734
APOA2       -1.8119  5.06 1.59e-05    0.0734
FOXN3-AS2   -0.5031 -4.57 6.62e-05    0.2446
SLCO4A1-AS1 -1.6254 -4.46 7.99e-05    0.2459
SMAD1-AS1   -0.8519 -4.35 1.08e-04    0.2852
ONECUT3     -0.8844 -4.04 2.45e-04    0.5416
BMP10       -1.5421  4.00 2.64e-04    0.5416
CYP8B1      -0.0337 -3.87 3.74e-04    0.6330

Interaction of sex differences between young and fetal

topTreat(treat.endo,coef=8)[,-c(1:3)]
                                        GENENAME CHR logFC AveExpr     t
UMODL1                         uromodulin like 1  21  9.33 -0.4040  6.82
PRG4                              proteoglycan 4   1  6.57  0.4090  6.04
ADGRF2    adhesion G protein-coupled receptor F2   6  7.08 -1.1731  4.72
APOA2                          apolipoprotein A2   1  3.58 -1.8119  4.42
OPN5                                     opsin 5   6  5.43 -0.1936  3.95
SLC9C1         solute carrier family 9 member C1   3  2.88  4.3058  3.85
NCBP2-AS1                  NCBP2 antisense RNA 1   3 -6.15  0.4250 -3.84
INMT         indolethylamine N-methyltransferase   7  5.14  0.7208  3.77
OOEP-AS1                    OOEP antisense RNA 1   6 -5.94  0.0219 -3.78
SMAD1-AS1                  SMAD1 antisense RNA 1   4 -5.21 -0.8519 -3.77
           P.Value adj.P.Val
UMODL1    2.04e-07   0.00377
PRG4      1.34e-06   0.01238
ADGRF2    4.35e-05   0.26754
APOA2     8.27e-05   0.38187
OPN5      3.10e-04   0.92168
SLC9C1    3.61e-04   0.92168
NCBP2-AS1 4.30e-04   0.92168
INMT      4.94e-04   0.92168
OOEP-AS1  4.94e-04   0.92168
SMAD1-AS1 4.99e-04   0.92168

Interaction of sex differences between adult and young

topTreat(treat.endo,coef=9)[,-c(1:3)]
                                                      GENENAME CHR logFC
SH3RF3-AS1                              SH3RF3 antisense RNA 1   2 -6.68
UMODL1                                       uromodulin like 1  21 -7.83
C16orf78                   chromosome 16 open reading frame 78  16 -6.84
TNFRSF10A-AS1                        TNFRSF10A antisense RNA 1   8 -5.63
TNFRSF8                      TNF receptor superfamily member 8   1  3.80
SLCO4A1-AS1                            SLCO4A1 antisense RNA 1  20 -5.12
OR2A5         olfactory receptor family 2 subfamily A member 5   7 -5.16
ABCC3                ATP binding cassette subfamily C member 3  17  5.98
HEMGN                                                  hemogen   9 -5.11
ZNF750                                 zinc finger protein 750  17 -6.05
              AveExpr     t  P.Value adj.P.Val
SH3RF3-AS1     -1.236 -6.04 1.35e-06    0.0249
UMODL1         -0.404 -5.56 4.80e-06    0.0443
C16orf78       -0.263 -5.12 1.48e-05    0.0909
TNFRSF10A-AS1  -1.506 -4.63 5.24e-05    0.2419
TNFRSF8         1.650  4.36 9.91e-05    0.2995
SLCO4A1-AS1    -1.625 -4.34 1.09e-04    0.2995
OR2A5          -1.639 -4.33 1.14e-04    0.2995
ABCC3           2.658  4.29 1.30e-04    0.3011
HEMGN          -0.134 -4.10 2.08e-04    0.3244
ZNF750          0.683 -4.09 2.19e-04    0.3244
par(mar=c(5,5,3,2))
plot(treat.endo$coefficients[,1],treat.endo$coefficients[,2],xlab="logFC: Young vs Fetal", ylab="logFC: Adult vs Fetal",main="endothelial cells: Development",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0,col=colours()[c(175)])
sig.genes <-  dt.endo[,1] !=0 | dt.endo[,2] != 0
text(treat.endo$coefficients[sig.genes,1],treat.endo$coefficients[sig.genes,2],labels=rownames(dt.endo)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.endo$coefficients[,4],treat.endo$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="endothelial cells: Sex differences - fetal and young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.endo[,4] !=0 | dt.endo[,5] != 0
text(treat.endo$coefficients[sig.genes,4],treat.endo$coefficients[sig.genes,5],labels=rownames(dt.endo)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.endo$coefficients[,4],treat.endo$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="endothelial cells: Sex differences - fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.endo[,4] !=0 | dt.endo[,6] != 0
text(treat.endo$coefficients[sig.genes,4],treat.endo$coefficients[sig.genes,6],labels=rownames(dt.endo)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.endo$coefficients[,5],treat.endo$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="endothelial cells: Sex differences - young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
sig.genes <- dt.endo[,5] !=0 | dt.endo[,6] != 0
text(treat.endo$coefficients[sig.genes,5],treat.endo$coefficients[sig.genes,6],labels=rownames(dt.endo)[sig.genes],col=2,cex=0.6)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.endo$coefficients[,4],treat.endo$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="endothelial cells: Interaction term: Fetal vs Young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.endo[,8] !=0 
text(treat.endo$coefficients[sig.genes,4],treat.endo$coefficients[sig.genes,5],labels=rownames(dt.endo)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.endo$coefficients[,4],treat.endo$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="endothelial cells: Interaction term: fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.endo[,7] !=0 
text(treat.endo$coefficients[sig.genes,4],treat.endo$coefficients[sig.genes,6],labels=rownames(dt.endo)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.endo$coefficients[,5],treat.endo$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="endothelial cells: Interaction term: young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.endo[,9] !=0 
text(treat.endo$coefficients[sig.genes,5],treat.endo$coefficients[sig.genes,6],labels=rownames(dt.endo)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28

Immune cells

cont.immune <- makeContrasts(YvF = 0.5*(immune.young.Male + immune.young.Female) - 0.5*(immune.fetal.Male + immune.fetal.Female),
                         AvF = 0.5*(immune.adult.Male + immune.adult.Female) - 0.5*(immune.fetal.Male + immune.fetal.Female),
                         AvY = 0.5*(immune.adult.Male + immune.adult.Female) - 0.5*(immune.young.Male + immune.young.Female),
                         SexFetal = immune.fetal.Male - immune.fetal.Female,
                         SexYoung = immune.young.Male - immune.young.Female,
                         SexAdult = immune.adult.Male - immune.adult.Female,
                         InteractionAF = (immune.adult.Male - immune.fetal.Male) - (immune.adult.Female - immune.fetal.Female),
                         InteractionYF = (immune.young.Male - immune.fetal.Male) - (immune.young.Female - immune.fetal.Female),
                         InteractionAY = (immune.adult.Male - immune.young.Male) - (immune.adult.Female - immune.young.Female),
                         levels=design)
fit.immune <- contrasts.fit(fit,contrasts = cont.immune)
fit.immune <- eBayes(fit.immune,robust=TRUE)

summary(decideTests(fit.immune))
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down     305   403     5        0       12        7             1
NotSig 17852 17738 18457    18464    18451    18449         18463
Up       307   323     2        0        1        8             0
       InteractionYF InteractionAY
Down               0            12
NotSig         18464         18381
Up                 0            71
treat.immune <- treat(fit.immune,lfc=0.5)

dt.immune<-decideTests(treat.immune)

summary(dt.immune)
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down     115   198     0        0        7        5             1
NotSig 18251 18167 18463    18464    18457    18457         18463
Up        98    99     1        0        0        2             0
       InteractionYF InteractionAY
Down               0             5
NotSig         18464         18426
Up                 0            33
par(mfrow=c(3,3))
for(i in 1:9){
  plotMD(treat.immune,coef=i,status=dt.immune[,i],hl.col=c("blue","red"))
  abline(h=0,col="grey")
}

Version Author Date
f474878 Belinda Phipson 2019-10-28
par(mfrow=c(1,1))
par(mar=c(7,4,2,2))
barplot(summary(dt.immune)[-2,],beside=TRUE,legend=TRUE,col=c("blue","red"),ylab="Number of significant genes",las=2)
title("Immune cells")

Version Author Date
f474878 Belinda Phipson 2019-10-28

Young vs Fetal

options(digits=3)
topTreat(treat.immune,coef=1,n=20,p.value=0.05)[,-c(1:3)]
                                                     GENENAME CHR logFC
IGF2BP3   insulin like growth factor 2 mRNA binding protein 3   7 -4.85
MSLN                                               mesothelin  16 -4.99
IGHM                         immunoglobulin heavy constant mu  14 -4.86
IGF2BP1   insulin like growth factor 2 mRNA binding protein 1  17 -6.05
HBA1                               hemoglobin subunit alpha 1  16 -8.00
ME1                                            malic enzyme 1   6  3.73
LINC01127         long intergenic non-protein coding RNA 1127   2  3.56
LINC02513         long intergenic non-protein coding RNA 2513   4 -5.40
SMIM34B                   small integral membrane protein 34B  21  4.23
SGMS2                                sphingomyelin synthase 2   4  4.19
PRICKLE1               prickle planar cell polarity protein 1  12 -3.40
HBA2                               hemoglobin subunit alpha 2  16 -7.11
CX3CR1                      C-X3-C motif chemokine receptor 1   3 -4.11
SAP30                             Sin3A associated protein 30   4  3.38
AGFG1                                ArfGAP with FG repeats 1   2  1.99
LINC02621         long intergenic non-protein coding RNA 2621  10  3.85
VPREB3               V-set pre-B cell surrogate light chain 3  22 -4.26
WWP1       WW domain containing E3 ubiquitin protein ligase 1   8 -1.54
IGF2R                   insulin like growth factor 2 receptor   6  1.93
LINC00996          long intergenic non-protein coding RNA 996   7 -4.59
          AveExpr     t  P.Value adj.P.Val
IGF2BP3     4.676 -9.44 4.49e-10  8.29e-06
MSLN       -1.367 -8.72 2.13e-09  1.97e-05
IGHM       -0.960 -8.06 9.55e-09  5.88e-05
IGF2BP1     1.905 -7.67 2.43e-08  1.12e-04
HBA1        1.612 -7.35 5.44e-08  1.62e-04
ME1         5.175  7.30 5.58e-08  1.62e-04
LINC01127  -1.398  7.26 6.15e-08  1.62e-04
LINC02513  -1.429 -7.08 9.61e-08  2.17e-04
SMIM34B    -0.168  7.03 1.06e-07  2.17e-04
SGMS2       4.569  6.65 2.70e-07  4.75e-04
PRICKLE1    7.047 -6.63 2.83e-07  4.75e-04
HBA2        2.179 -6.47 4.57e-07  7.03e-04
CX3CR1      0.380 -6.40 5.09e-07  7.23e-04
SAP30       3.772  6.36 5.55e-07  7.32e-04
AGFG1       7.242  6.16 9.14e-07  1.06e-03
LINC02621  -0.992  6.15 9.40e-07  1.06e-03
VPREB3     -1.284 -6.14 9.78e-07  1.06e-03
WWP1        7.724 -6.03 1.26e-06  1.29e-03
IGF2R       6.997  5.94 1.60e-06  1.49e-03
LINC00996  -0.702 -5.94 1.62e-06  1.49e-03

Adult vs Fetal

topTreat(treat.immune,coef=2,n=20,p.value=0.05)[,-c(1:3)]
                                                                 GENENAME
ME1                                                        malic enzyme 1
IGF2BP3               insulin like growth factor 2 mRNA binding protein 3
MSLN                                                           mesothelin
LINC02513                     long intergenic non-protein coding RNA 2513
GSDMA                                                         gasdermin A
TLR10                                               toll like receptor 10
CCL3L1                                C-C motif chemokine ligand 3 like 1
AGR2      anterior gradient 2, protein disulphide isomerase family member
TIFAB                                                      TIFA inhibitor
IGF2BP1               insulin like growth factor 2 mRNA binding protein 1
IGHM                                     immunoglobulin heavy constant mu
HBA2                                           hemoglobin subunit alpha 2
LINC01684                     long intergenic non-protein coding RNA 1684
MARCH11                        membrane associated ring-CH-type finger 11
PRICKLE1                           prickle planar cell polarity protein 1
LINC01839                     long intergenic non-protein coding RNA 1839
IGHG3                  immunoglobulin heavy constant gamma 3 (G3m marker)
DAAM2                 dishevelled associated activator of morphogenesis 2
MS4A1                                      membrane spanning 4-domains A1
FBXL7                             F-box and leucine rich repeat protein 7
          CHR logFC AveExpr     t  P.Value adj.P.Val
ME1         6  4.59   5.175  9.25 6.74e-10  1.17e-05
IGF2BP3     7 -4.54   4.676 -8.82 1.72e-09  1.17e-05
MSLN       16 -4.98  -1.367 -8.77 1.91e-09  1.17e-05
LINC02513   4 -6.18  -1.429 -8.53 3.36e-09  1.55e-05
GSDMA      17  4.54   0.783  8.31 5.34e-09  1.97e-05
TLR10       4 -5.40  -0.798 -7.37 4.79e-08  1.47e-04
CCL3L1     17 -5.84  -1.374 -7.21 7.18e-08  1.89e-04
AGR2        7 -5.36  -0.339 -6.97 1.27e-07  2.74e-04
TIFAB       5 -4.34  -1.206 -6.91 1.44e-07  2.74e-04
IGF2BP1    17 -5.55   1.905 -6.91 1.48e-07  2.74e-04
IGHM       14 -4.10  -0.960 -6.81 1.83e-07  3.07e-04
HBA2       16 -7.05   2.179 -6.75 2.26e-07  3.48e-04
LINC01684  21  5.52   1.529  6.65 2.78e-07  3.94e-04
MARCH11     5 -7.04   3.233 -6.57 3.58e-07  4.45e-04
PRICKLE1   12 -3.84   7.047 -6.53 3.61e-07  4.45e-04
LINC01839   3  3.86  -1.579  6.38 5.33e-07  6.13e-04
IGHG3      14  5.02  -1.009  6.36 5.74e-07  6.13e-04
DAAM2       6  6.80   6.334  6.36 5.97e-07  6.13e-04
MS4A1      11 -3.73  -0.994 -6.25 7.40e-07  7.20e-04
FBXL7       5 -3.39   9.909 -6.15 9.41e-07  8.32e-04

Adult vs Young

topTreat(treat.immune,coef=3)[,-c(1:3)]
                                                  GENENAME CHR logFC
LINC01839      long intergenic non-protein coding RNA 1839   3  3.13
LINC01127      long intergenic non-protein coding RNA 1127   2 -2.70
CCL3L1                 C-C motif chemokine ligand 3 like 1  17 -4.18
CLNK          cytokine dependent hematopoietic cell linker   4 -2.55
HIST1H4E              histone cluster 1 H4 family member e   6 -3.41
DNM1                                             dynamin 1   9  1.78
ZFP57                            ZFP57 zinc finger protein   6  3.88
SIGLEC10             sialic acid binding Ig like lectin 10  19 -2.75
HS3ST2    heparan sulfate-glucosamine 3-sulfotransferase 2  16  3.88
SLC39A8                  solute carrier family 39 member 8   4 -1.75
          AveExpr     t  P.Value adj.P.Val
LINC01839 -1.5788  6.11 1.04e-06    0.0192
LINC01127 -1.3980 -4.99 1.84e-05    0.1335
CCL3L1    -1.3741 -4.94 2.17e-05    0.1335
CLNK       2.7053 -4.72 3.72e-05    0.1716
HIST1H4E   0.3600 -4.53 6.28e-05    0.1786
DNM1       4.9970  4.49 6.76e-05    0.1786
ZFP57      0.2703  4.50 6.77e-05    0.1786
SIGLEC10  -0.0423 -4.13 1.74e-04    0.4025
HS3ST2     2.7275  4.02 2.40e-04    0.4918
SLC39A8    3.0931 -3.90 3.12e-04    0.5762

Male vs Female in fetal samples

topTreat(treat.immune,coef=4)[,-c(1:3)]
                                          GENENAME CHR logFC AveExpr     t
MT1H                            metallothionein 1H  16 -4.14  -1.630 -4.49
ACTG2                 actin gamma 2, smooth muscle   2 -5.51   0.555 -4.42
MOCOS                molybdenum cofactor sulfurase  18 -4.04   2.316 -3.93
FBXW9      F-box and WD repeat domain containing 9  19  3.60   1.500  3.80
HOXA9                                  homeobox A9   7  3.27  -1.673  3.78
PRDM6                              PR/SET domain 6   5 -4.69   3.380 -3.77
PI15                        peptidase inhibitor 15   8 -5.84   1.285 -3.74
CLNK  cytokine dependent hematopoietic cell linker   4 -2.16   2.705 -3.60
TLR3                          toll like receptor 3   4 -4.53   1.145 -3.61
PLET1              placenta expressed transcript 1  11  4.19   2.155  3.60
       P.Value adj.P.Val
MT1H  7.03e-05     0.833
ACTG2 9.02e-05     0.833
MOCOS 3.07e-04     1.000
FBXW9 4.28e-04     1.000
HOXA9 4.38e-04     1.000
PRDM6 4.78e-04     1.000
PI15  5.49e-04     1.000
CLNK  6.72e-04     1.000
TLR3  7.28e-04     1.000
PLET1 7.29e-04     1.000

Male vs Female in young samples

topTreat(treat.immune,coef=5)[,-c(1:3)]
                                                     GENENAME CHR logFC
IGHG3      immunoglobulin heavy constant gamma 3 (G3m marker)  14 -7.55
LINC01839         long intergenic non-protein coding RNA 1839   3 -5.65
IGHG4      immunoglobulin heavy constant gamma 4 (G4m marker)  14 -4.70
SLC39A8                     solute carrier family 39 member 8   4 -2.46
IGHG1      immunoglobulin heavy constant gamma 1 (G1m marker)  14 -5.49
SPATA8-AS1              SPATA8 antisense RNA 1 (head to head)  15 -3.38
SPINK1               serine peptidase inhibitor, Kazal type 1   5 -4.70
FCRL5                                      Fc receptor like 5   1 -5.11
FAM30A            family with sequence similarity 30 member A  14 -4.37
LINC01416         long intergenic non-protein coding RNA 1416  18  5.29
           AveExpr     t  P.Value adj.P.Val
IGHG3       -1.009 -8.87 1.62e-09  2.98e-05
LINC01839   -1.579 -7.88 1.45e-08  1.34e-04
IGHG4       -1.571 -6.45 4.52e-07  2.78e-03
SLC39A8      3.093 -5.39 6.50e-06  2.41e-02
IGHG1       -1.240 -5.41 6.53e-06  2.41e-02
SPATA8-AS1  -1.650 -5.25 9.46e-06  2.91e-02
SPINK1      -1.116 -5.14 1.32e-05  3.48e-02
FCRL5       -0.469 -4.89 2.57e-05  5.42e-02
FAM30A      -1.688 -4.87 2.64e-05  5.42e-02
LINC01416    1.626  4.63 5.14e-05  9.50e-02

Male vs Female in adult samples

topTreat(treat.immune,coef=6)[,-c(1:3)]
                                                    GENENAME CHR  logFC
IGKC                           immunoglobulin kappa constant   2 -12.19
IGHA1                  immunoglobulin heavy constant alpha 1  14  -7.61
JCHAIN               joining chain of multimeric IgA and IgM   4  -5.80
IGHG3     immunoglobulin heavy constant gamma 3 (G3m marker)  14  -5.31
LINC02236        long intergenic non-protein coding RNA 2236   5   4.99
IGHG4     immunoglobulin heavy constant gamma 4 (G4m marker)  14  -4.77
FBXO43                                      F-box protein 43   8   5.48
HJURP                  Holliday junction recognition protein   2   6.40
CDKN3                    cyclin dependent kinase inhibitor 3  14   4.16
TUBB8                              tubulin beta 8 class VIII  10   5.14
          AveExpr      t  P.Value adj.P.Val
IGKC       0.1232 -10.33 8.49e-11  1.57e-06
IGHA1     -1.0981  -6.39 5.65e-07  5.21e-03
JCHAIN    -0.0733  -6.18 9.05e-07  5.57e-03
IGHG3     -1.0092  -5.69 3.18e-06  1.13e-02
LINC02236 -0.1323   5.67 3.27e-06  1.13e-02
IGHG4     -1.5710  -5.63 3.67e-06  1.13e-02
FBXO43     0.9102   5.02 1.83e-05  4.83e-02
HJURP      0.8771   4.84 3.08e-05  7.12e-02
CDKN3      1.8178   4.58 5.54e-05  1.14e-01
TUBB8      1.0194   4.53 6.60e-05  1.22e-01

Interaction of sex differences between adult and fetal

topTreat(treat.immune,coef=7)[,-c(1:3)]
                                                          GENENAME CHR
IGKC                                 immunoglobulin kappa constant   2
ARHGEF33                 Rho guanine nucleotide exchange factor 33   2
FBXO43                                            F-box protein 43   8
GRM4                             glutamate metabotropic receptor 4   6
POMC                                           proopiomelanocortin   2
ZG16B                                  zymogen granule protein 16B  16
IGHG4           immunoglobulin heavy constant gamma 4 (G4m marker)  14
TREML2       triggering receptor expressed on myeloid cells like 2   6
APOBEC3B-AS1                              APOBEC3B antisense RNA 1  22
SHISA4                                       shisa family member 4   1
              logFC AveExpr     t  P.Value adj.P.Val
IGKC         -12.75   0.123 -6.85 2.08e-07   0.00384
ARHGEF33       5.18   1.996  4.32 1.15e-04   0.85539
FBXO43         6.90   0.910  4.28 1.39e-04   0.85539
GRM4           4.99  -0.479  3.93 3.18e-04   0.97632
POMC          -6.72   0.517 -3.94 3.36e-04   0.97632
ZG16B         -5.59  -1.423 -3.87 3.82e-04   0.97632
IGHG4         -4.72  -1.571 -3.77 4.80e-04   0.97632
TREML2        -4.67  -1.534 -3.75 5.03e-04   0.97632
APOBEC3B-AS1   5.19  -0.512  3.67 6.36e-04   0.97632
SHISA4         4.76   1.884  3.65 6.56e-04   0.97632

Interaction of sex differences between young and fetal

topTreat(treat.immune,coef=8)[,-c(1:3)]
                                                    GENENAME CHR logFC
IGHG3     immunoglobulin heavy constant gamma 3 (G3m marker)  14 -7.45
LINC01416        long intergenic non-protein coding RNA 1416  18  7.92
CSTA                                              cystatin A   3 -5.78
C17orf53                 chromosome 17 open reading frame 53  17 -5.25
SIGLEC11               sialic acid binding Ig like lectin 11  19 -5.36
SIX5                                          SIX homeobox 5  19  5.76
FAM30A           family with sequence similarity 30 member A  14 -5.49
IGHG4     immunoglobulin heavy constant gamma 4 (G4m marker)  14 -4.65
LILRA4             leukocyte immunoglobulin like receptor A4  19 -4.30
SLC35G5                   solute carrier family 35 member G5   8 -5.17
          AveExpr     t  P.Value adj.P.Val
IGHG3      -1.009 -4.99 2.15e-05     0.262
LINC01416   1.626  4.83 3.35e-05     0.262
CSTA        0.499 -4.71 4.26e-05     0.262
C17orf53    1.717 -4.34 1.11e-04     0.512
SIGLEC11   -1.716 -4.21 1.57e-04     0.532
SIX5        2.519  4.18 1.73e-04     0.532
FAM30A     -1.688 -4.03 2.54e-04     0.670
IGHG4      -1.571 -3.96 2.95e-04     0.681
LILRA4     -1.580 -3.88 3.56e-04     0.723
SLC35G5    -0.105 -3.86 3.92e-04     0.723

Interaction of sex differences between adult and young

topTreat(treat.immune,coef=9)[,-c(1:3)]
                                              GENENAME CHR logFC AveExpr
FBXO43                                F-box protein 43   8  8.09   0.910
LINC01839  long intergenic non-protein coding RNA 1839   3  5.49  -1.579
ME1                                     malic enzyme 1   6  3.20   5.175
LINC00676   long intergenic non-protein coding RNA 676  13 -6.81  -1.783
CDKN3              cyclin dependent kinase inhibitor 3  14  6.16   1.818
ESPL1       extra spindle pole bodies like 1, separase  12  7.62   2.213
HJURP            Holliday junction recognition protein   2  9.01   0.877
SPC24     SPC24 component of NDC80 kinetochore complex  19  5.34   2.509
DEPDC1B                       DEP domain containing 1B   5  7.76   2.330
LINC02236  long intergenic non-protein coding RNA 2236   5  6.40  -0.132
              t  P.Value adj.P.Val
FBXO43     5.96 1.73e-06    0.0122
LINC01839  5.80 2.43e-06    0.0122
ME1        5.76 2.54e-06    0.0122
LINC00676 -5.70 3.23e-06    0.0122
CDKN3      5.68 3.31e-06    0.0122
ESPL1      5.59 4.42e-06    0.0136
HJURP      5.51 5.74e-06    0.0151
SPC24      5.30 8.70e-06    0.0169
DEPDC1B    5.32 9.14e-06    0.0169
LINC02236  5.30 9.14e-06    0.0169
par(mar=c(5,5,3,2))
plot(treat.immune$coefficients[,1],treat.immune$coefficients[,2],xlab="logFC: Young vs Fetal", ylab="logFC: Adult vs Fetal",main="immune cells: Development",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0,col=colours()[c(175)])
sig.genes <-  dt.immune[,1] !=0 | dt.immune[,2] != 0
text(treat.immune$coefficients[sig.genes,1],treat.immune$coefficients[sig.genes,2],labels=rownames(dt.immune)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.immune$coefficients[,4],treat.immune$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="immune cells: Sex differences - fetal and young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.immune[,4] !=0 | dt.immune[,5] != 0
text(treat.immune$coefficients[sig.genes,4],treat.immune$coefficients[sig.genes,5],labels=rownames(dt.immune)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.immune$coefficients[,4],treat.immune$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="immune cells: Sex differences - fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.immune[,4] !=0 | dt.immune[,6] != 0
text(treat.immune$coefficients[sig.genes,4],treat.immune$coefficients[sig.genes,6],labels=rownames(dt.immune)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.immune$coefficients[,5],treat.immune$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="immune cells: Sex differences - young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
sig.genes <- dt.immune[,5] !=0 | dt.immune[,6] != 0
text(treat.immune$coefficients[sig.genes,5],treat.immune$coefficients[sig.genes,6],labels=rownames(dt.immune)[sig.genes],col=2,cex=0.6)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.immune$coefficients[,4],treat.immune$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="immune cells: Interaction term: Fetal vs Young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
sig.genes <- dt.immune[,8] !=0 
if(sum(sig.genes)!=0){
  text(treat.immune$coefficients[sig.genes,4],treat.immune$coefficients[sig.genes,5],
       labels=rownames(dt.immune)[sig.genes],col=2,cex=0.6)
}
plot(treat.immune$coefficients[,4],treat.immune$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="immune cells: Interaction term: fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.immune[,7] !=0 
text(treat.immune$coefficients[sig.genes,4],treat.immune$coefficients[sig.genes,6],labels=rownames(dt.immune)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.immune$coefficients[,5],treat.immune$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="immune cells: Interaction term: young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.immune[,9] !=0 
text(treat.immune$coefficients[sig.genes,5],treat.immune$coefficients[sig.genes,6],labels=rownames(dt.immune)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28

Neurons

cont.neurons <- makeContrasts(YvF = 0.5*(neurons.young.Male + neurons.young.Female) - 0.5*(neurons.fetal.Male + neurons.fetal.Female),
                         AvF = 0.5*(neurons.adult.Male + neurons.adult.Female) - 0.5*(neurons.fetal.Male + neurons.fetal.Female),
                         AvY = 0.5*(neurons.adult.Male + neurons.adult.Female) - 0.5*(neurons.young.Male + neurons.young.Female),
                         SexFetal = neurons.fetal.Male - neurons.fetal.Female,
                         SexYoung = neurons.young.Male - neurons.young.Female,
                         SexAdult = neurons.adult.Male - neurons.adult.Female,
                         InteractionAF = (neurons.adult.Male - neurons.fetal.Male) - (neurons.adult.Female - neurons.fetal.Female),
                         InteractionYF = (neurons.young.Male - neurons.fetal.Male) - (neurons.young.Female - neurons.fetal.Female),
                         InteractionAY = (neurons.adult.Male - neurons.young.Male) - (neurons.adult.Female - neurons.young.Female),
                         levels=design)
fit.neurons <- contrasts.fit(fit,contrasts = cont.neurons)
fit.neurons <- eBayes(fit.neurons,robust=TRUE)

summary(decideTests(fit.neurons))
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down     396   382     5        0        0        0             0
NotSig 17742 17869 18456    18464    18460    18462         18464
Up       326   213     3        0        4        2             0
       InteractionYF InteractionAY
Down               0             2
NotSig         18464         18461
Up                 0             1
treat.neurons <- treat(fit.neurons,lfc=0.5)

dt.neurons<-decideTests(treat.neurons)

summary(dt.neurons)
         YvF   AvF   AvY SexFetal SexYoung SexAdult InteractionAF
Down     190   167     0        0        0        0             0
NotSig 18142 18216 18464    18464    18462    18464         18464
Up       132    81     0        0        2        0             0
       InteractionYF InteractionAY
Down               0             2
NotSig         18464         18461
Up                 0             1
par(mfrow=c(3,3))
for(i in 1:9){
  plotMD(treat.neurons,coef=i,status=dt.neurons[,i],hl.col=c("blue","red"))
  abline(h=0,col="grey")
}

Version Author Date
f474878 Belinda Phipson 2019-10-28
par(mfrow=c(1,1))
par(mar=c(7,4,2,2))
barplot(summary(dt.neurons)[-2,],beside=TRUE,legend=TRUE,col=c("blue","red"),ylab="Number of significant genes",las=2)
title("Neurons")

Version Author Date
f474878 Belinda Phipson 2019-10-28

Young vs Fetal

options(digits=3)
topTreat(treat.neurons,coef=1,n=20,p.value=0.05)[,-c(1:3)]
                                                      GENENAME CHR logFC
SLC5A8                        solute carrier family 5 member 8  12 -5.72
LINC00598           long intergenic non-protein coding RNA 598  13  4.12
PHOX2B                                 paired like homeobox 2B   4 -6.13
GBP2                               guanylate binding protein 2   1  8.46
CADM2                                 cell adhesion molecule 2   3  3.20
MMD2       monocyte to macrophage differentiation associated 2   7 -5.56
LINC02026          long intergenic non-protein coding RNA 2026   3  5.17
NRN1                                                neuritin 1   6  7.12
KCNH5     potassium voltage-gated channel subfamily H member 5  14 -5.02
COL2A1                          collagen type II alpha 1 chain  12 -6.49
FAM135B           family with sequence similarity 135 member B   8  4.60
SHISA9                                   shisa family member 9  16  3.02
COL20A1                         collagen type XX alpha 1 chain  20 -4.73
ADRA1B                                   adrenoceptor alpha 1B   5  7.30
GIMAP8                            GTPase, IMAP family member 8   7  6.72
BIRC3                      baculoviral IAP repeat containing 3  11  5.47
GRAMD2A                              GRAM domain containing 2A  15 -3.97
LINC00682           long intergenic non-protein coding RNA 682   4 -4.39
C2orf72                     chromosome 2 open reading frame 72   2 -4.85
KIAA1217                                              KIAA1217  10  3.81
          AveExpr     t  P.Value adj.P.Val
SLC5A8    -0.3421 -9.86 1.92e-10  2.60e-06
LINC00598  4.6402  9.66 2.82e-10  2.60e-06
PHOX2B    -1.4883 -9.39 5.17e-10  3.18e-06
GBP2       3.6829  8.83 1.80e-09  8.30e-06
CADM2      5.5407  8.67 2.34e-09  8.66e-06
MMD2       1.1011 -8.53 3.29e-09  1.01e-05
LINC02026  0.8045  7.94 1.26e-08  2.93e-05
NRN1       1.2287  7.93 1.35e-08  2.93e-05
KCNH5      1.8926 -7.88 1.43e-08  2.93e-05
COL2A1    -0.8189 -7.75 1.99e-08  3.67e-05
FAM135B    2.7144  7.69 2.22e-08  3.73e-05
SHISA9     3.0904  7.46 3.77e-08  5.80e-05
COL20A1   -0.8501 -7.38 4.60e-08  6.24e-05
ADRA1B     2.8972  7.40 4.73e-08  6.24e-05
GIMAP8     3.2806  7.22 7.05e-08  8.67e-05
BIRC3      2.6840  7.12 8.73e-08  1.01e-04
GRAMD2A    1.2349 -6.98 1.22e-07  1.32e-04
LINC00682 -1.6322 -6.89 1.50e-07  1.54e-04
C2orf72   -0.0717 -6.74 2.23e-07  2.16e-04
KIAA1217   8.3628  6.67 2.58e-07  2.38e-04

Adult vs Fetal

topTreat(treat.neurons,coef=2,n=20,p.value=0.05)[,-c(1:3)]
                                                             GENENAME CHR
MDGA2     MAM domain containing glycosylphosphatidylinositol anchor 2  14
SLC5A8                               solute carrier family 5 member 8  12
COL20A1                                collagen type XX alpha 1 chain  20
CADM2                                        cell adhesion molecule 2   3
PHOX2B                                        paired like homeobox 2B   4
MMD2              monocyte to macrophage differentiation associated 2   7
NRN1                                                       neuritin 1   6
GPR137C                               G protein-coupled receptor 137C  14
GRAMD2A                                     GRAM domain containing 2A  15
COL2A1                                 collagen type II alpha 1 chain  12
TFAP2B                                 transcription factor AP-2 beta   6
IGF2BP3           insulin like growth factor 2 mRNA binding protein 3   7
GBP2                                      guanylate binding protein 2   1
IFIH1                     interferon induced with helicase C domain 1   2
NTRK3                         neurotrophic receptor tyrosine kinase 3  15
CCN5                          cellular communication network factor 5  20
PRTFDC1                phosphoribosyl transferase domain containing 1  10
LGI1                                leucine rich glioma inactivated 1  10
LINC01608                 long intergenic non-protein coding RNA 1608   8
SOX11                                                      SRY-box 11   2
          logFC AveExpr      t  P.Value adj.P.Val
MDGA2     -7.43   3.442 -11.53 7.42e-12  1.37e-07
SLC5A8    -5.92  -0.342 -10.26 8.48e-11  7.83e-07
COL20A1   -5.91  -0.850  -9.57 3.52e-10  1.69e-06
CADM2      3.51   5.541   9.51 3.82e-10  1.69e-06
PHOX2B    -6.13  -1.488  -9.39 5.15e-10  1.69e-06
MMD2      -5.92   1.101  -9.36 5.49e-10  1.69e-06
NRN1       7.36   1.229   8.37 4.89e-09  1.29e-05
GPR137C   -5.53   4.948  -7.83 1.64e-08  3.79e-05
GRAMD2A   -4.31   1.235  -7.75 1.95e-08  3.99e-05
COL2A1    -6.38  -0.819  -7.61 2.78e-08  5.13e-05
TFAP2B    -5.74  -1.242  -7.52 3.43e-08  5.76e-05
IGF2BP3   -5.20   4.676  -7.16 7.96e-08  1.22e-04
GBP2       7.47   3.683   6.87 1.71e-07  2.43e-04
IFIH1      4.91   3.564   6.72 2.34e-07  3.08e-04
NTRK3     -6.08   4.438  -6.55 3.65e-07  4.36e-04
CCN5       6.71   2.044   6.54 3.78e-07  4.36e-04
PRTFDC1   -4.35   4.176  -6.42 4.86e-07  5.27e-04
LGI1      -6.52   2.120  -6.41 5.25e-07  5.38e-04
LINC01608 -4.91   0.607  -6.36 5.62e-07  5.47e-04
SOX11     -5.36   1.386  -6.32 6.37e-07  5.79e-04

Adult vs Young

topTreat(treat.neurons,coef=3)[,-c(1:3)]
                                                                  GENENAME
RSPH3                                                  radial spoke head 3
SLC29A2                                  solute carrier family 29 member 2
ZRANB3                                zinc finger RANBP2-type containing 3
GPR137C                                    G protein-coupled receptor 137C
TFAP2B                                      transcription factor AP-2 beta
LSM4    LSM4 homolog, U6 small nuclear RNA and mRNA degradation associated
TRIM11                                      tripartite motif containing 11
KARS                                                 lysyl-tRNA synthetase
IL20RB                                interleukin 20 receptor subunit beta
EXOSC2                                                 exosome component 2
        CHR logFC AveExpr     t  P.Value adj.P.Val
RSPH3     6 -3.57    4.44 -5.39 6.57e-06     0.105
SLC29A2  11 -3.36    2.65 -5.12 1.32e-05     0.105
ZRANB3    2  2.54    6.79  4.95 2.08e-05     0.105
GPR137C  14 -4.23    4.95 -4.92 2.28e-05     0.105
TFAP2B    6 -4.16   -1.24 -4.61 5.16e-05     0.191
LSM4     19  2.64    3.89  4.31 1.08e-04     0.299
TRIM11    1 -2.36    3.28 -4.30 1.13e-04     0.299
KARS     16  2.26    4.52  4.23 1.35e-04     0.312
IL20RB    3 -2.97    2.90 -4.00 2.49e-04     0.494
EXOSC2    9 -2.93    3.35 -3.97 2.68e-04     0.494

Male vs Female in fetal samples

topTreat(treat.neurons,coef=4)[,-c(1:3)]
                                                                  GENENAME
FRS3                         fibroblast growth factor receptor substrate 3
NCMAP                                non-compact myelin associated protein
C1orf194                               chromosome 1 open reading frame 194
PRR22                                                      proline rich 22
SLC48A1                                  solute carrier family 48 member 1
STAC3                                       SH3 and cysteine rich domain 3
LINC02347                      long intergenic non-protein coding RNA 2347
CCDC106                                  coiled-coil domain containing 106
KCNE4     potassium voltage-gated channel subfamily E regulatory subunit 4
IQCD                                                 IQ motif containing D
          CHR logFC AveExpr     t  P.Value adj.P.Val
FRS3        6  3.65   2.693  4.29 0.000117         1
NCMAP       1 -3.77   1.244 -3.97 0.000277         1
C1orf194    1  3.40  -0.466  3.94 0.000292         1
PRR22      19 -3.52   0.785 -3.84 0.000381         1
SLC48A1    12  3.67   3.644  3.75 0.000487         1
STAC3      12  4.10   2.422  3.74 0.000505         1
LINC02347  12 -4.41  -1.066 -3.66 0.000626         1
CCDC106    19  3.19   1.897  3.62 0.000671         1
KCNE4       2 -3.60   3.617 -3.44 0.001066         1
IQCD       12  3.46   2.083  3.41 0.001151         1

Male vs Female in young samples

topTreat(treat.neurons,coef=5)[,-c(1:3)]
                                                           GENENAME CHR
DNTTIP1  deoxynucleotidyltransferase terminal interacting protein 1  20
CREBL2               cAMP responsive element binding protein like 2  12
DEDD                               death effector domain containing   1
KARS                                          lysyl-tRNA synthetase  16
LPIN2                                                       lipin 2  18
MITD1   microtubule interacting and trafficking domain containing 1   2
ZRANB3                         zinc finger RANBP2-type containing 3   2
CCDC18                             coiled-coil domain containing 18   1
FTSJ3                             FtsJ RNA 2'-O-methyltransferase 3  17
CDIP1                              cell death inducing p53 target 1  16
        logFC AveExpr     t  P.Value adj.P.Val
DNTTIP1  3.73    4.32  6.21 8.10e-07   0.00921
CREBL2   4.51    5.01  6.13 9.97e-07   0.00921
DEDD     3.73    4.49  5.21 1.06e-05   0.06502
KARS     3.18    4.52  4.67 4.31e-05   0.19281
LPIN2    4.16    5.70  4.61 5.22e-05   0.19281
MITD1    3.91    4.90  4.53 6.32e-05   0.19453
ZRANB3   3.46    6.79  4.46 7.44e-05   0.19618
CCDC18   4.61    5.58  4.35 1.05e-04   0.21844
FTSJ3   -3.62    3.24 -4.33 1.06e-04   0.21844
CDIP1    2.79    4.22  3.92 3.06e-04   0.56453

Male vs Female in adult samples

topTreat(treat.neurons,coef=6)[,-c(1:3)]
                                                GENENAME CHR logFC AveExpr
C6orf136             chromosome 6 open reading frame 136   6  4.40    3.59
PFAS          phosphoribosylformylglycinamidine synthase  17  4.16    3.03
IKZF4                        IKAROS family zinc finger 4  12  3.71    4.08
PALB2                     partner and localizer of BRCA2  16  4.80    4.09
SRRD                              SRR1 domain containing  22  4.04    2.63
CCDC150                coiled-coil domain containing 150   2  4.82    3.75
UXS1                     UDP-glucuronate decarboxylase 1   2  4.01    4.85
ATP10B   ATPase phospholipid transporting 10B (putative)   5 -5.83    2.44
C3orf62               chromosome 3 open reading frame 62   3  4.33    4.11
RANBP17                           RAN binding protein 17   5 -4.54    6.94
             t  P.Value adj.P.Val
C6orf136  5.40 6.62e-06     0.122
PFAS      5.08 1.52e-05     0.140
IKZF4     4.78 3.26e-05     0.154
PALB2     4.73 3.88e-05     0.154
SRRD      4.69 4.18e-05     0.154
CCDC150   4.62 5.13e-05     0.156
UXS1      4.56 5.90e-05     0.156
ATP10B   -4.50 7.40e-05     0.171
C3orf62   4.32 1.13e-04     0.215
RANBP17  -4.31 1.16e-04     0.215

Interaction of sex differences between adult and fetal

topTreat(treat.neurons,coef=7)[,-c(1:3)]
                                              GENENAME CHR logFC AveExpr
FRS3     fibroblast growth factor receptor substrate 3   6 -5.14    2.69
MED8                        mediator complex subunit 8   1 -4.85    3.24
PALB2                   partner and localizer of BRCA2  16  5.70    4.09
C6orf136           chromosome 6 open reading frame 136   6  4.78    3.59
RANBP17                         RAN binding protein 17   5 -5.19    6.94
ABCA2        ATP binding cassette subfamily A member 2   9  4.40    3.11
CCDC150              coiled-coil domain containing 150   2  5.28    3.75
UXS1                   UDP-glucuronate decarboxylase 1   2  4.23    4.85
RPP25L             ribonuclease P/MRP subunit p25 like   9 -4.93    1.99
PFAS        phosphoribosylformylglycinamidine synthase  17  4.29    3.03
             t  P.Value adj.P.Val
FRS3     -4.40 9.39e-05     0.490
MED8     -4.33 1.10e-04     0.490
PALB2     4.30 1.23e-04     0.490
C6orf136  4.29 1.24e-04     0.490
RANBP17  -4.27 1.33e-04     0.490
ABCA2     4.06 2.24e-04     0.623
CCDC150   4.03 2.51e-04     0.623
UXS1      3.94 3.02e-04     0.623
RPP25L   -3.95 3.03e-04     0.623
PFAS      3.80 4.35e-04     0.803

Interaction of sex differences between young and fetal

topTreat(treat.neurons,coef=8)[,-c(1:3)]
                                              GENENAME CHR logFC AveExpr
CREBL2  cAMP responsive element binding protein like 2  12  4.65    5.01
DPP3                            dipeptidyl peptidase 3  11 -5.08    1.94
KARS                             lysyl-tRNA synthetase  16  3.63    4.52
LPIN2                                          lipin 2  18  4.48    5.70
DEDD                  death effector domain containing   1  3.75    4.49
FAM209A   family with sequence similarity 209 member A  20 -4.31    1.33
PMEL                             premelanosome protein  12 -5.36    1.72
CDIP1                 cell death inducing p53 target 1  16  3.47    4.22
NCMAP            non-compact myelin associated protein   1  5.04    1.24
ZRANB3            zinc finger RANBP2-type containing 3   2  3.35    6.79
            t  P.Value adj.P.Val
CREBL2   4.79 3.25e-05     0.599
DPP3    -4.33 1.13e-04     0.868
KARS     4.05 2.20e-04     0.868
LPIN2    4.03 2.41e-04     0.868
DEDD     3.95 2.91e-04     0.868
FAM209A -3.95 2.92e-04     0.868
PMEL    -3.90 3.56e-04     0.868
CDIP1    3.83 3.88e-04     0.868
NCMAP    3.82 4.26e-04     0.868
ZRANB3   3.76 4.70e-04     0.868

Interaction of sex differences between adult and young

topTreat(treat.neurons,coef=9)[,-c(1:3)]
                                                            GENENAME CHR
DNTTIP1   deoxynucleotidyltransferase terminal interacting protein 1  20
TRIM11                                tripartite motif containing 11   1
RANBP17                                       RAN binding protein 17   5
SRRD                                          SRR1 domain containing  22
LINC01436                long intergenic non-protein coding RNA 1436  21
SLC2A8                              solute carrier family 2 member 8   9
C3orf62                           chromosome 3 open reading frame 62   3
ZRANB3                          zinc finger RANBP2-type containing 3   2
C6orf136                         chromosome 6 open reading frame 136   6
HOXD-AS2                                HOXD cluster antisense RNA 2   2
          logFC AveExpr     t  P.Value adj.P.Val
DNTTIP1   -6.14    4.32 -7.27 6.26e-08   0.00116
TRIM11     5.62    3.28  5.91 1.83e-06   0.01175
RANBP17   -9.13    6.94 -5.93 1.91e-06   0.01175
SRRD       5.75    2.63  4.77 3.56e-05   0.16426
LINC01436 -6.29   -1.71 -4.54 6.75e-05   0.19159
SLC2A8     6.71    3.29  4.50 7.64e-05   0.19159
C3orf62    6.23    4.11  4.45 8.54e-05   0.19159
ZRANB3    -4.13    6.79 -4.40 9.06e-05   0.19159
C6orf136   5.09    3.59  4.36 1.03e-04   0.19159
HOXD-AS2  -6.00   -1.03 -4.29 1.29e-04   0.19159
par(mar=c(5,5,3,2))
plot(treat.neurons$coefficients[,1],treat.neurons$coefficients[,2],xlab="logFC: Young vs Fetal", ylab="logFC: Adult vs Fetal",main="neurons: Development",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0,col=colours()[c(175)])
sig.genes <-  dt.neurons[,1] !=0 | dt.neurons[,2] != 0
text(treat.neurons$coefficients[sig.genes,1],treat.neurons$coefficients[sig.genes,2],labels=rownames(dt.neurons)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.neurons$coefficients[,4],treat.neurons$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="neurons: Sex differences - fetal and young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.neurons[,4] !=0 | dt.neurons[,5] != 0
text(treat.neurons$coefficients[sig.genes,4],treat.neurons$coefficients[sig.genes,5],labels=rownames(dt.neurons)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.neurons$coefficients[,4],treat.neurons$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="neurons: Sex differences - fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
sig.genes <- dt.neurons[,4] !=0 | dt.neurons[,6] != 0
if(sum(sig.genes)!=0){
  text(treat.neurons$coefficients[sig.genes,4],treat.neurons$coefficients[sig.genes,6],
       labels=rownames(dt.neurons)[sig.genes],col=2,cex=0.6)
}
plot(treat.neurons$coefficients[,5],treat.neurons$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="neurons: Sex differences - young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
sig.genes <- dt.neurons[,5] !=0 | dt.neurons[,6] != 0
text(treat.neurons$coefficients[sig.genes,5],treat.neurons$coefficients[sig.genes,6],labels=rownames(dt.neurons)[sig.genes],col=2,cex=0.6)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
plot(treat.neurons$coefficients[,4],treat.neurons$coefficients[,5],xlab="logFC: Fetal Male vs Female", ylab="logFC: Young Male vs Female",main="neurons: Interaction term: Fetal vs Young",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
sig.genes <- dt.neurons[,8] !=0 
if(sum(sig.genes)!=0){
  text(treat.neurons$coefficients[sig.genes,4],treat.neurons$coefficients[sig.genes,5],
       labels=rownames(dt.neurons)[sig.genes],col=2,cex=0.6)
}
plot(treat.neurons$coefficients[,4],treat.neurons$coefficients[,6],xlab="logFC: Fetal Male vs Female", ylab="logFC: Adult Male vs Female",main="neurons: Interaction term: fetal and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)

Version Author Date
f474878 Belinda Phipson 2019-10-28
sig.genes <- dt.neurons[,7] !=0 
if(sum(sig.genes)!=0){
  text(treat.neurons$coefficients[sig.genes,4],treat.neurons$coefficients[sig.genes,6],
       labels=rownames(dt.neurons)[sig.genes],col=2,cex=0.6)
}
plot(treat.neurons$coefficients[,5],treat.neurons$coefficients[,6],xlab="logFC: Young Male vs Female", ylab="logFC: Adult Male vs Female",main="neurons: Interaction term: young and adult",col=rgb(0,0,1,alpha=0.25),pch=16,cex=0.8)
abline(h=0,v=0)
sig.genes <- dt.neurons[,9] !=0 
text(treat.neurons$coefficients[sig.genes,5],treat.neurons$coefficients[sig.genes,6],labels=rownames(dt.neurons)[sig.genes],col=2,cex=0.6)

Version Author Date
f474878 Belinda Phipson 2019-10-28

Write out results

fdr.cardio <- apply(treat.cardio$p.value, 2, function(x) p.adjust(x, method="BH"))
output.cardio <- data.frame(treat.cardio$genes,LogFC=treat.cardio$coefficients,AveExp=treat.cardio$Amean,tstat=treat.cardio$t, pvalue=treat.cardio$p.value, fdr=fdr.cardio)
write.csv(output.cardio,file="./output/DEAnalysis/BroadCellTypes/de-cardio-all.csv")

fdr.endo <- apply(treat.endo$p.value, 2, function(x) p.adjust(x, method="BH"))
output.endo <- data.frame(treat.endo$genes,LogFC=treat.endo$coefficients,AveExp=treat.endo$Amean,tstat=treat.endo$t, pvalue=treat.endo$p.value, fdr=fdr.endo)
write.csv(output.endo,file="./output/DEAnalysis/BroadCellTypes/de-endo-all.csv")

fdr.epicardial <- apply(treat.epicardial$p.value, 2, function(x) p.adjust(x, method="BH"))
output.epicardial <- data.frame(treat.epicardial$genes,LogFC=treat.epicardial$coefficients,AveExp=treat.epicardial$Amean,tstat=treat.epicardial$t, pvalue=treat.epicardial$p.value, fdr=fdr.epicardial)
write.csv(output.epicardial,file="./output/DEAnalysis/BroadCellTypes/de-epicardial-all.csv")

fdr.fibro <- apply(treat.fibro$p.value, 2, function(x) p.adjust(x, method="BH"))
output.fibro <- data.frame(treat.fibro$genes,LogFC=treat.fibro$coefficients,AveExp=treat.fibro$Amean,tstat=treat.fibro$t, pvalue=treat.fibro$p.value, fdr=fdr.fibro)
write.csv(output.fibro,file="./output/DEAnalysis/BroadCellTypes/de-fibro-all.csv")

fdr.immune <- apply(treat.immune$p.value, 2, function(x) p.adjust(x, method="BH"))
output.immune <- data.frame(treat.immune$genes,LogFC=treat.immune$coefficients,AveExp=treat.immune$Amean,tstat=treat.immune$t, pvalue=treat.immune$p.value, fdr=fdr.immune)
write.csv(output.immune,file="./output/DEAnalysis/BroadCellTypes/de-immune-all.csv")

fdr.neurons <- apply(treat.neurons$p.value, 2, function(x) p.adjust(x, method="BH"))
output.neurons <- data.frame(treat.neurons$genes,LogFC=treat.neurons$coefficients,AveExp=treat.neurons$Amean,tstat=treat.neurons$t, pvalue=treat.neurons$p.value, fdr=fdr.neurons)
write.csv(output.neurons,file="./output/DEAnalysis/BroadCellTypes/de-neurons-all.csv")

fdr.smc <- apply(treat.smc$p.value, 2, function(x) p.adjust(x, method="BH"))
output.smc <- data.frame(treat.smc$genes,LogFC=treat.smc$coefficients,AveExp=treat.smc$Amean,tstat=treat.smc$t, pvalue=treat.smc$p.value, fdr=fdr.smc)
write.csv(output.smc,file="./output/DEAnalysis/BroadCellTypes/de-smc-all.csv")
# Standard limma analysis with no fold change cut-off
# Cardiomyocytes
for(i in 1:ncol(fit.cardio)){
  write.csv(topTable(fit.cardio,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/STD-ind/de-cardio-",colnames(fit.cardio)[i],".csv",sep=""),
            row.names = FALSE)
}

# Endothelium
for(i in 1:ncol(fit.endo)){
  write.csv(topTable(fit.endo,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/STD-ind/de-endo-",colnames(fit.endo)[i],".csv",sep=""),
            row.names = FALSE)
}

# Epicardial
for(i in 1:ncol(fit.epicardial)){
  write.csv(topTable(fit.epicardial,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/STD-ind/de-epicardial-",colnames(fit.epicardial)[i],".csv",sep=""),
            row.names = FALSE)
}

# Fibroblasts
for(i in 1:ncol(fit.fibro)){
  write.csv(topTable(fit.fibro,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/STD-ind/de-fibro-",colnames(fit.fibro)[i],".csv",sep=""),
            row.names = FALSE)
}

# Immune
for(i in 1:ncol(fit.immune)){
  write.csv(topTable(fit.immune,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/STD-ind/de-immune-",colnames(fit.immune)[i],".csv",sep=""),
            row.names = FALSE)
}

# Neurons
for(i in 1:ncol(fit.neurons)){
  write.csv(topTable(fit.neurons,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/STD-ind/de-neurons-",colnames(fit.neurons)[i],".csv",sep=""),
            row.names = FALSE)
}

# smooth muscle cells
for(i in 1:ncol(fit.smc)){
  write.csv(topTable(fit.smc,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/STD-ind/de-smc-",colnames(fit.smc)[i],".csv",sep=""),
            row.names = FALSE)
}


# TREAT analysis with log-fold change cut-off of 0.5
# Cardiomyocytes
for(i in 1:ncol(treat.cardio)){
  write.csv(topTreat(treat.cardio,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/TREAT-indiv/de-cardio-",colnames(treat.cardio)[i],".csv",sep=""),
            row.names = FALSE)
}

# Endothelium
for(i in 1:ncol(treat.endo)){
  write.csv(topTreat(treat.endo,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/TREAT-indiv/de-endo-",colnames(treat.endo)[i],".csv",sep=""),
            row.names = FALSE)
}

# Epicardial
for(i in 1:ncol(treat.epicardial)){
  write.csv(topTreat(treat.epicardial,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/TREAT-indiv/de-epicardial-",colnames(treat.epicardial)[i],".csv",sep=""),
            row.names = FALSE)
}

# Fibroblasts
for(i in 1:ncol(treat.fibro)){
  write.csv(topTreat(treat.fibro,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/TREAT-indiv/de-fibro-",colnames(treat.fibro)[i],".csv",sep=""),
            row.names = FALSE)
}

# Immune
for(i in 1:ncol(treat.immune)){
  write.csv(topTreat(treat.immune,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/TREAT-indiv/de-immune-",colnames(treat.immune)[i],".csv",sep=""),
            row.names = FALSE)
}

# Neurons
for(i in 1:ncol(treat.neurons)){
  write.csv(topTreat(treat.neurons,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/TREAT-indiv/de-neurons-",colnames(treat.neurons)[i],".csv",sep=""),
            row.names = FALSE)
}

# smooth muscle cells
for(i in 1:ncol(treat.smc)){
  write.csv(topTreat(treat.smc,coef=i,n="Inf"),
            file=paste("./output/DEAnalysis/BroadCellTypes/TREAT-indiv/de-smc-",colnames(treat.smc)[i],".csv",sep=""),
            row.names = FALSE)
}

sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.7 (Final)

Matrix products: default
BLAS:   /usr/local/installed/R/3.6.0/lib64/R/lib/libRblas.so
LAPACK: /usr/local/installed/R/3.6.0/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
 [1] splines   parallel  stats4    stats     graphics  grDevices utils    
 [8] datasets  methods   base     

other attached packages:
 [1] dplyr_0.8.3                 clustree_0.4.0             
 [3] ggraph_1.0.2                workflowr_1.3.0            
 [5] NMF_0.21.0                  bigmemory_4.5.33           
 [7] cluster_2.1.0               rngtools_1.4               
 [9] pkgmaker_0.27               registry_0.5-1             
[11] scran_1.12.0                SingleCellExperiment_1.6.0 
[13] SummarizedExperiment_1.14.1 GenomicRanges_1.36.0       
[15] GenomeInfoDb_1.20.0         DelayedArray_0.10.0        
[17] BiocParallel_1.18.1         matrixStats_0.55.0         
[19] cowplot_1.0.0               monocle_2.12.0             
[21] DDRTree_0.1.5               irlba_2.3.3                
[23] VGAM_1.1-1                  ggplot2_3.2.1              
[25] Matrix_1.2-17               Seurat_3.0.3.9019          
[27] org.Hs.eg.db_3.8.2          AnnotationDbi_1.46.1       
[29] IRanges_2.18.1              S4Vectors_0.22.0           
[31] Biobase_2.44.0              BiocGenerics_0.30.0        
[33] RColorBrewer_1.1-2          edgeR_3.26.3               
[35] limma_3.40.2               

loaded via a namespace (and not attached):
  [1] reticulate_1.13          R.utils_2.9.0           
  [3] tidyselect_0.2.5         RSQLite_2.1.2           
  [5] htmlwidgets_1.5          grid_3.6.0              
  [7] combinat_0.0-8           docopt_0.6.1            
  [9] Rtsne_0.15               munsell_0.5.0           
 [11] codetools_0.2-16         ica_1.0-2               
 [13] statmod_1.4.30           future_1.14.0           
 [15] withr_2.1.2              colorspace_1.4-1        
 [17] fastICA_1.2-2            knitr_1.25              
 [19] ROCR_1.0-7               gbRd_0.4-11             
 [21] listenv_0.7.0            labeling_0.3            
 [23] Rdpack_0.11-0            git2r_0.26.1            
 [25] slam_0.1-45              GenomeInfoDbData_1.2.1  
 [27] polyclip_1.10-0          farver_1.1.0            
 [29] bit64_0.9-7              pheatmap_1.0.12         
 [31] rprojroot_1.3-2          vctrs_0.2.0             
 [33] xfun_0.10                R6_2.4.0                
 [35] doParallel_1.0.15        ggbeeswarm_0.6.0        
 [37] rsvd_1.0.2               locfit_1.5-9.1          
 [39] bitops_1.0-6             assertthat_0.2.1        
 [41] SDMTools_1.1-221.1       scales_1.0.0            
 [43] beeswarm_0.2.3           gtable_0.3.0            
 [45] npsurv_0.4-0             globals_0.12.4          
 [47] rlang_0.4.0              zeallot_0.1.0           
 [49] lazyeval_0.2.2           yaml_2.2.0              
 [51] reshape2_1.4.3           backports_1.1.5         
 [53] tools_3.6.0              gridBase_0.4-7          
 [55] gplots_3.0.1.1           dynamicTreeCut_1.63-1   
 [57] ggridges_0.5.1           Rcpp_1.0.2              
 [59] plyr_1.8.4               zlibbioc_1.30.0         
 [61] purrr_0.3.2              RCurl_1.95-4.12         
 [63] densityClust_0.3         pbapply_1.4-1           
 [65] viridis_0.5.1            zoo_1.8-6               
 [67] ggrepel_0.8.1            fs_1.3.1                
 [69] magrittr_1.5             data.table_1.12.4       
 [71] lmtest_0.9-37            RANN_2.6.1              
 [73] whisker_0.3-2            fitdistrplus_1.0-14     
 [75] lsei_1.2-0               evaluate_0.14           
 [77] xtable_1.8-4             sparsesvd_0.1-4         
 [79] gridExtra_2.3            HSMMSingleCell_1.4.0    
 [81] compiler_3.6.0           scater_1.12.2           
 [83] tibble_2.1.3             KernSmooth_2.23-15      
 [85] crayon_1.3.4             R.oo_1.22.0             
 [87] htmltools_0.4.0          tidyr_0.8.3             
 [89] DBI_1.0.0                tweenr_1.0.1            
 [91] MASS_7.3-51.4            R.methodsS3_1.7.1       
 [93] gdata_2.18.0             metap_1.1               
 [95] igraph_1.2.4.1           pkgconfig_2.0.3         
 [97] bigmemory.sri_0.1.3      plotly_4.9.0            
 [99] foreach_1.4.7            vipor_0.4.5             
[101] dqrng_0.2.1              XVector_0.24.0          
[103] bibtex_0.4.2             stringr_1.4.0           
[105] digest_0.6.21            sctransform_0.2.0       
[107] RcppAnnoy_0.0.12         tsne_0.1-3              
[109] rmarkdown_1.14           DelayedMatrixStats_1.6.0
[111] gtools_3.8.1             nlme_3.1-141            
[113] jsonlite_1.6             BiocNeighbors_1.2.0     
[115] viridisLite_0.3.0        pillar_1.4.2            
[117] lattice_0.20-38          httr_1.4.1              
[119] survival_2.44-1.1        glue_1.3.1              
[121] qlcMatrix_0.9.7          FNN_1.1.3               
[123] png_0.1-7                iterators_1.0.12        
[125] bit_1.1-14               ggforce_0.3.0           
[127] stringi_1.4.3            blob_1.2.0              
[129] BiocSingular_1.0.0       caTools_1.17.1.2        
[131] memoise_1.1.0            future.apply_1.3.0      
[133] ape_5.3