You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
1.6 KiB

  1. ---
  2. title: "Read data"
  3. author: "Pjotr"
  4. date: "25/02/2020"
  5. output: html_document
  6. ---
  7. Set the data directory. Note you have to use one on
  8. your own system! When it is set correctly 'Run->all' in the
  9. menu will recompute everything.
  10. ```{r setup, include=FALSE}
  11. data <- "/home/wrk/iwrk/closed/kemri/Francis_Final_TregData_Jan2020/Data/"
  12. setwd(data)
  13. knitr::opts_knit$set(echo = TRUE, root.dir=data)
  14. ```
  15. ```{r}
  16. getwd()
  17. ```
  18. ## Read individuals and attributes
  19. load a table
  20. ```{r ind_attr}
  21. ind_attr=read.csv("Individual_attributes.csv")
  22. ind_attr[1:3,1:3]
  23. ```
  24. Show data structure
  25. ```{r}
  26. summary(ind_attr)
  27. ```
  28. ```{r}
  29. colnames(ind_attr)
  30. ```
  31. Three elements of phenotype column
  32. ```{r}
  33. ind_attr[["Phenotype"]][0:3]
  34. ```
  35. or
  36. ```{r}
  37. ind_attr$Phenotype[0:3]
  38. ```
  39. Let's do a simple plot. Plot ELISA values against inds:
  40. ```{r}
  41. plot(ind_attr$ELISA)
  42. ```
  43. Let's plot ELISA vs Time to diagnosis
  44. ```{r}
  45. plot(ind_attr$ELISA ~ ind_attr$Time_to_diagnosis)
  46. ```
  47. So, it looks like late diagnosis has an effect. This is just a quick example, let's continue loading sets from
  48. ```
  49. cytokines.csv
  50. final_outcome_jan2020.csv
  51. Individual_attributes.csv
  52. pcr.csv
  53. supernatant.csv
  54. transcriptomics.csv
  55. treg_phenotype_data.csv
  56. ```
  57. ```{r}
  58. cytokines = read.csv("cytokines.csv")
  59. final = read.csv("final_outcome_jan2020.csv")
  60. pcr = read.csv("pcr.csv")
  61. supernatant = read.csv("supernatant.csv")
  62. transcriptomics = read.csv("transcriptomics.csv")
  63. treg = read.csv("treg_phenotype_data.csv")
  64. ```
  65. when they load you can explore the data in the top right enviroment or
  66. ```{r}
  67. show(pcr$day[1:3])
  68. ```
  69. It will show that not all rows are labeled. That means we will need a way to cross-reference by ID.