These exercises cover the factors and data frames sections of Introduction to R.
Exercise 1 - Factors
Exercise 2 - Data frames
Create a data frame called Annotation with a column of gene names (“Gene_1”, “Gene_2”, “Gene_3”,“Gene_4”,“Gene_5”), ensembl gene names (“Ens001”, “Ens003”, “Ens006”, “Ens007”, “Ens010”), pathway information (“Glycolysis”, “TGFb”, “Glycolysis”, “TGFb”, “Glycolysis”) and gene lengths (100, 3000, 200, 1000,1200).
Create data frame called Sample1 with ensembl gene names (“Ens001”, “Ens003”, “Ens006”, “Ens010”) and expression (1000, 3000, 10000,5000)
Create data frame called Sample2 with ensembl gene names (“Ens001”, “Ens003”, “Ens006”, “Ens007”,“Ens010”) and expression (1500, 1500, 17000,500,10000)
Create a data frame containing only those gene names common to all data frames with all information from Annotation and the expression from Sample 1 and Sample 2.
Add an extra two columns containing the length normalised expressions for Sample 1 and Sample 2
Identify the mean length normalised expression across Sample1 and Sample2 for Ens006 genes
For all genes, identify the log2 fold change in length normalised expression from Sample 1 to Sample 2.
Identify the total length of genes in Glycolysis pathway.