---
# System prepended metadata

title: Untitled

---



```

METADATA <- read.table("METADATA.txt",sep="\t", header = T)
rownames(METADATA) <- METADATA$Sample.Names
METADATA$Strain <- factor(METADATA$Strain)
```


```
ME49_cts <- read.table("GSE217226_ME49_AP2XII-2_RNAseq_counts.tab",sep="\t", header = T)
RH_cts <- read.table("GSE217226_RH_AP2XII-2_RNAseq_counts.tab",sep="\t", header = T)

colnames(ME49_cts) <- c("X","CON1ME49","CON2ME49","CON3ME49","IAA1ME49","IAA2ME49","IAA3ME49")
colnames(RH_cts) <- c("X","CON1RH","CON2RH","CON3RH","IAA1RH","IAA2RH","IAA3RH")

```

ME49_metadata <- METADATA[1:6,]
### this line bad ME49_cts <- METADATA[1:6,]


rownames(ME49_metadata) <- ME49_metadata$Sample.Names
rownames(ME49_cts) <- ME49_cts$Sampple.Names


ME49_metadata$Strain <- factor(ME49_metadata$Strain, levels =c('ME49'))
ME49_metadata$Treatment <- factor(ME49_metadata$Treatment, levels =c('CONTROL','KD'))
rownames(ME49_cts) <- ME49_cts[,1]
ME49_cts <- ME49_cts[,-1]
RH_metadata <- METADATA[7:12,]
rownames(RH_metadata) <- RH_metadata$Sample.Names
RH_metadata$Strain <- factor(RH_metadata$Strain)
RH_metadata$Treatment <- factor(RH_metadata$Treatment, levels = c('CONTROL','KD'))
rownames(RH_cts) <- RH_cts[,1]
RH_cts <- RH_cts[,-1]
ME49_cts <- DESeqDataSetFromMatrix(countData = ME49_cts, colData = METADATA_ME49, design = ~ Treatment)

Error in h(simpleError(msg, call)) :
  error in evaluating the argument 'x' in selecting a method for function 'nrow': object 'METADATA_ME49' not found

> head(ME49_cts)
         Strain Treatment
CON1ME49   ME49   CONTROL
CON2ME49   ME49   CONTROL
CON3ME49   ME49   CONTROL
IAA1ME49   ME49        KD
IAA2ME49   ME49        KD
IAA3ME49   ME49        KD
> ME49_cts <- read.table("GSE217226_ME49_AP2XII-2_RNAseq_counts.tab",sep="\t", header = T)
> RH_cts <- read.table("GSE217226_RH_AP2XII-2_RNAseq_counts.tab",sep="\t", header = T)
> METADATA <- read.table("METADATA.txt",sep="\t", header = T)
> rownames(METADATA) <- METADATA$Sample.Names
> METADATA$Strain <- factor(METADATA$Strain)
> colnames(ME49_cts) <- c("X","CON1ME49","CON2ME49","CON3ME49","IAA1ME49","IAA2ME49","IAA3ME49")
> colnames(RH_cts) <- c("X","CON1RH","CON2RH","CON3RH","IAA1RH","IAA2RH","IAA3RH")
>  ME49_metadata <- METADATA[1:6,]
>  rownames(ME49_metadata) <- ME49_metadata$Sample.Names
> > rownames(ME49_cts) <- ME49_cts$Sampple.Names
Error: unexpected '>' in ">"
> rownames(ME49_cts) <- ME49_cts$Sampple.Names
> ME49_metadata$Strain <- factor(ME49_metadata$Strain, levels =c('ME49'))
> ME49_metadata$Treatment <- factor(ME49_metadata$Treatment, levels =c('CONTROL','KD'))
> rownames(ME49_cts) <- ME49_cts[,1]
> ME49_cts <- ME49_cts[,-1]
> RH_metadata <- METADATA[7:12,]
>
> rownames(RH_metadata) <- RH_metadata$Sample.Names
> RH_metadata$Strain <- factor(RH_metadata$Strain)
> RH_metadata$Treatment <- factor(RH_metadata$Treatment, levels = c('CONTROL','KD'))
> rownames(RH_cts) <- RH_cts[,1]
>
> RH_cts <- RH_cts[,-1]
> ME49_cts <- DESeqDataSetFromMatrix(countData = ME49_cts, colData = METADATA_ME49, design = ~ Treatment)
Error in h(simpleError(msg, call)) :
  error in evaluating the argument 'x' in selecting a method for function 'nrow': object 'METADATA_ME49' not found
> rownames(ME49_cts) <- ME49_cts$Sample.Names
> ME49_metadata$Strain <- factor(ME49_metadata$Strain, levels =c('ME49'))
> ME49_metadata$Treatment <- factor(ME49_metadata$Treatment, levels =c('CONTROL','KD'))
> rownames(ME49_cts) <- ME49_cts[,1]
Error in `.rowNamesDF<-`(x, value = value) :
  duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘10’, ‘11’, ‘12’, ‘13’, ‘14’, ‘15’, ‘16’, ‘17’, ‘18’, ‘19’, ‘20’, ‘21’, ‘22’, ‘23’, ‘24’, ‘25’, ‘26’, ‘27’, ‘28’, ‘29’, ‘30’, ‘31’, ‘32’, ‘33’, ‘34’, ‘35’, ‘36’, ‘37’, ‘38’, ‘39’, ‘40’, ‘41’, ‘42’, ‘43’, ‘44’, ‘45’, ‘46’, ‘47’, ‘48’, ‘49’, ‘50’, ‘51’, ‘52’, ‘53’, ‘54’, ‘55’, ‘56’, ‘57’, ‘58’, ‘59’, ‘60’, ‘61’, ‘62’, ‘63’, ‘64’, ‘65’, ‘66’, ‘68’, ‘69’, ‘70’, ‘71’, ‘72’, ‘73’, ‘74’, ‘75’, ‘77’, ‘78’, ‘79’, ‘80’, ‘81’, ‘82’, ‘83’, ‘85’, ‘86’, ‘87’, ‘88’, ‘89’, ‘91’, ‘92’, ‘93’, ‘94’, ‘96’, ‘98’, ‘99’, ‘100’, ‘101’, ‘1 [... truncated]
> ME49_cts <- DESeqDataSetFromMatrix(countData = ME49_cts, colData = METADATA_ME49, design = ~ Treatment)
Error in h(simpleError(msg, call)) :
  error in evaluating the argument 'x' in selecting a method for function 'nrow': object 'METADATA_ME49' not found
> ME49_cts <- DESeqDataSetFromMatrix(countData = ME49_cts, colData = ME49_metadata, design = ~ Treatment)
> head(ME49_cts)
class: DESeqDataSet
dim: 6 6
metadata(1): version
assays(1): counts
rownames: NULL
rowData names(0):
colnames(6): CON1ME49 CON2ME49 ... IAA2ME49 IAA3ME49
colData names(3): Sample.Names Strain Treatment
> rownames(ME49_metadata) <- ME49_metadata$Sample.Names
> rownames(ME49_cts) <- ME49_cts$Sample.Names
> head(ME49_cts)
class: DESeqDataSet
dim: 6 6
metadata(1): version
assays(1): counts
rownames(6): CON1ME49 CON2ME49 ... IAA2ME49 IAA3ME49
rowData names(0):
colnames(6): CON1ME49 CON2ME49 ... IAA2ME49 IAA3ME49
colData names(3): Sample.Names Strain Treatment
> ME49_data <- DESeq(ME49_cts)
Error in h(simpleError(msg, call)) :
  error in evaluating the argument 'x' in selecting a method for function 'mcols': missing values not allowed in rownames
> rownames(ME49_cts) <- ME49_cts$Sample.Names
> head(ME49_cts)
class: DESeqDataSet
dim: 6 6
metadata(1): version
assays(1): counts
rownames(6): CON1ME49 CON2ME49 ... IAA2ME49 IAA3ME49
rowData names(0):
colnames(6): CON1ME49 CON2ME49 ... IAA2ME49 IAA3ME49
colData names(3): Sample.Names Strain Treatment
>