title: Perform a PCA to check if there's separation between biological replicates of different sexes. How can i do it in this case with the data I have?
body: <p>I have to identify genes showing sex specific expression in 2 tissues: &quot;pancreas&quot; and &quot;lung&quot;.
  To do it first of all i need to do a PCA to ascertain whether there is separation between tissues of different sexes (in particular there are 3 individuals of sex 1 and 3 of sex2 for each tissue)
  I suppose that i should classify the genes in counts for sex by using the sex column in the Design list and after I should perform a PCA where different colors are assigned to sex 1 and sex 2 genes.
  The problem is that even if I know what I should do to perform the PCA (if what i tought is right) I don't know how to write the codes required to do it: how can i create a new dataframe made by only the genes in count that correspond to lung and pancreas rows in Design?
  I thought to do in this way in order to color the genes with different colors depending by sex (information shown in Design), if there's a simplier way is well accepted any suggestion.</p>
  <p><code> dput(Design[1:10,]):</code></p>
  <pre><code>Design = structure(list(Individual = c(&quot;GTEX-Y5V6&quot;, &quot;GTEX-1KXAM&quot;, &quot;GTEX-18A67&quot;, 
  &quot;GTEX-14BMU&quot;, &quot;GTEX-13PVR&quot;, &quot;GTEX-1211K&quot;, &quot;GTEX-1KXAM&quot;, &quot;GTEX-18A67&quot;, 
  &quot;GTEX-14BMU&quot;, &quot;GTEX-1211K&quot;), sex = c(1L, 1L, 1L, 2L, 2L, 2L, 
  1L, 1L, 2L, 2L), age = c(&quot;60-69&quot;, &quot;60-69&quot;, &quot;50-59&quot;, &quot;20-29&quot;, 
  &quot;60-69&quot;, &quot;60-69&quot;, &quot;60-69&quot;, &quot;50-59&quot;, &quot;20-29&quot;, &quot;60-69&quot;), RNA.quality..max10. = c(7.1, 
  8.1, 7.2, 7.2, 7.3, 7, 7.2, 7.3, 7.4, 8.2), organ = c(&quot;Thyroid&quot;, 
  &quot;Thyroid&quot;, &quot;Thyroid&quot;, &quot;Thyroid&quot;, &quot;Thyroid&quot;, &quot;Thyroid&quot;, &quot;Stomach&quot;, 
  &quot;Stomach&quot;, &quot;Stomach&quot;, &quot;Stomach&quot;), tissue = c(&quot;Thyroid&quot;, &quot;Thyroid&quot;, 
  &quot;Thyroid&quot;, &quot;Thyroid&quot;, &quot;Thyroid&quot;, &quot;Thyroid&quot;, &quot;Stomach&quot;, &quot;Stomach&quot;, 
  &quot;Stomach&quot;, &quot;Stomach&quot;)), row.names = c(&quot;GTEX-Y5V6-0526-SM-4VBRV&quot;, 
  &quot;GTEX-1KXAM-1726-SM-D3LAE&quot;, &quot;GTEX-18A67-0826-SM-7KFTI&quot;, &quot;GTEX-14BMU-0226-SM-5S2QA&quot;, 
  &quot;GTEX-13PVR-0626-SM-5S2RC&quot;, &quot;GTEX-1211K-0726-SM-5FQUW&quot;, &quot;GTEX-1KXAM-0926-SM-CXZKA&quot;, 
  &quot;GTEX-18A67-2626-SM-718AD&quot;, &quot;GTEX-14BMU-1126-SM-5RQJ8&quot;, &quot;GTEX-1211K-1426-SM-5FQTF&quot;
  ), class = &quot;data.frame&quot;)
  </code></pre>
  <p><code>dput(counts[1:10,]):</code></p>
  <pre><code>structure(list(`GTEX-Y5V6-0526-SM-4VBRV` = c(0L, 1L, 2L, 1L, 
  0L, 0L, 0L, 0L, 0L, 214L), `GTEX-1KXAM-1726-SM-D3LAE` = c(0L, 
  0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 205L), `GTEX-18A67-0826-SM-7KFTI` = c(0L, 
  0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 164L), `GTEX-14BMU-0226-SM-5S2QA` = c(0L, 
  0L, 0L, 12L, 0L, 0L, 0L, 0L, 0L, 108L), `GTEX-13PVR-0626-SM-5S2RC` = c(0L, 
  0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 100L), `GTEX-1211K-0726-SM-5FQUW` = c(0L, 
  0L, 0L, 2L, 0L, 0L, 1L, 0L, 0L, 174L), `GTEX-1KXAM-0926-SM-CXZKA` = c(2L, 
  1L, 2L, 2L, 0L, 0L, 0L, 0L, 0L, 99L), `GTEX-18A67-2626-SM-718AD` = c(7L, 
  3L, 7L, 2L, 0L, 1L, 5L, 0L, 0L, 116L), `GTEX-14BMU-1126-SM-5RQJ8` = c(0L, 
  0L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 44L), `GTEX-1211K-1426-SM-5FQTF` = c(4L, 
  0L, 5L, 2L, 0L, 0L, 0L, 0L, 0L, 143L), `GTEX-11TT1-0726-SM-5GU5A` = c(0L, 
  0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 57L), `GTEX-1HCUA-1626-SM-A9SMG` = c(0L, 
  0L, 0L, 22L, 0L, 0L, 0L, 0L, 0L, 53L), `GTEX-1KXAM-0226-SM-EV7AP` = c(0L, 
  0L, 1L, 1L, 0L, 0L, 1L, 0L, 1L, 75L), `GTEX-18A67-1726-SM-7KFT9` = c(0L, 
  0L, 2L, 1L, 0L, 0L, 0L, 0L, 0L, 73L), `GTEX-14BMU-0726-SM-73KXS` = c(0L, 
  0L, 0L, 40L, 0L, 0L, 0L, 0L, 0L, 74L), `GTEX-13PVR-0726-SM-5S2PX` = c(0L, 
  0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 54L), `GTEX-1211K-1126-SM-5EGGB` = c(0L, 
  1L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 25L), `GTEX-11TT1-0326-SM-5LUAY` = c(0L, 
  0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 54L), `GTEX-1KXAM-2426-SM-DIPFC` = c(1L, 
  0L, 2L, 1L, 0L, 0L, 2L, 0L, 0L, 29L), `GTEX-18A67-0326-SM-7LG5X` = c(0L, 
  0L, 5L, 4L, 0L, 0L, 2L, 0L, 1L, 91L), `GTEX-14BMU-2026-SM-5S2W6` = c(0L, 
  0L, 2L, 5L, 0L, 0L, 0L, 0L, 0L, 30L), `GTEX-13PVR-2526-SM-5RQIT` = c(0L, 
  0L, 2L, 1L, 0L, 0L, 0L, 0L, 0L, 14L), `GTEX-1211K-2126-SM-59HJZ` = c(1L, 
  0L, 2L, 0L, 0L, 0L, 1L, 0L, 0L, 51L), `GTEX-Y3I4-2326-SM-4TT81` = c(0L, 
  0L, 3L, 0L, 0L, 0L, 1L, 0L, 0L, 38L), `GTEX-1KXAM-0426-SM-DHXKG` = c(0L, 
  0L, 1L, 1L, 0L, 0L, 1L, 0L, 0L, 105L), `GTEX-18A67-1126-SM-7KFSB` = c(1L, 
  0L, 0L, 4L, 0L, 0L, 1L, 0L, 0L, 76L), `GTEX-14BMU-0526-SM-73KW4` = c(0L, 
  0L, 0L, 11L, 0L, 0L, 0L, 0L, 0L, 53L), `GTEX-1211K-0826-SM-5FQUP` = c(1L, 
  0L, 0L, 2L, 0L, 0L, 1L, 0L, 0L, 104L), `GTEX-11TT1-1626-SM-5EQL7` = c(0L, 
  0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 113L), `GTEX-ZYFG-0226-SM-5GIDT` = c(1L, 
  0L, 2L, 2L, 0L, 0L, 2L, 0L, 0L, 54L), `GTEX-1KXAM-0826-SM-CXZK9` = c(0L, 
  0L, 0L, 5L, 0L, 0L, 2L, 0L, 0L, 97L), `GTEX-18A67-2426-SM-7LT95` = c(1L, 
  0L, 2L, 0L, 0L, 1L, 3L, 0L, 0L, 69L), `GTEX-14BMU-0926-SM-5S2QB` = c(0L, 
  0L, 0L, 3L, 0L, 0L, 0L, 0L, 0L, 29L), `GTEX-13PVR-1826-SM-5Q5CC` = c(1L, 
  0L, 0L, 3L, 0L, 1L, 2L, 0L, 0L, 32L), `GTEX-1211K-0926-SM-5FQTL` = c(0L, 
  0L, 0L, 3L, 0L, 0L, 1L, 0L, 0L, 99L), `GTEX-11TT1-0526-SM-5P9JO` = c(0L, 
  1L, 2L, 4L, 0L, 0L, 2L, 0L, 0L, 52L), `GTEX-1KXAM-0726-SM-E9U5I` = c(0L, 
  0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 45L), `GTEX-18A67-2526-SM-7LG5Z` = c(1L, 
  0L, 2L, 0L, 0L, 0L, 1L, 0L, 0L, 91L), `GTEX-14BMU-1026-SM-5RQJ5` = c(1L, 
  0L, 1L, 8L, 0L, 0L, 0L, 0L, 0L, 47L), `GTEX-13PVR-2026-SM-73KXT` = c(0L, 
  0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 27L), `GTEX-1211K-1326-SM-5FQV2` = c(0L, 
  0L, 3L, 0L, 0L, 0L, 1L, 1L, 0L, 57L), `GTEX-11TT1-0626-SM-5GU4X` = c(1L, 
  0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 90L), `GTEX-ZYFG-1826-SM-5GZWX` = c(0L, 
  0L, 3L, 2L, 0L, 0L, 2L, 0L, 0L, 91L), `GTEX-1KXAM-1926-SM-D3LAG` = c(0L, 
  0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 103L), `GTEX-18A67-2226-SM-7LT9Z` = c(0L, 
  0L, 2L, 2L, 0L, 0L, 1L, 0L, 1L, 157L), `GTEX-13PVR-1726-SM-5Q5EC` = c(1L, 
  0L, 2L, 0L, 0L, 0L, 1L, 0L, 0L, 34L), `GTEX-1211K-1826-SM-5EGJ2` = c(0L, 
  0L, 1L, 3L, 0L, 0L, 0L, 0L, 0L, 49L), `GTEX-11TT1-0926-SM-5GU5M` = c(0L, 
  2L, 0L, 3L, 1L, 0L, 0L, 0L, 1L, 49L), `GTEX-1KXAM-1026-SM-CY8IA` = c(0L, 
  0L, 1L, 3L, 0L, 0L, 0L, 0L, 0L, 93L), `GTEX-14BMU-1626-SM-5TDE7` = c(0L, 
  1L, 3L, 13L, 0L, 0L, 1L, 0L, 0L, 84L), `GTEX-13PVR-2226-SM-7DHKP` = c(0L, 
  0L, 2L, 2L, 0L, 0L, 0L, 0L, 0L, 75L), `GTEX-1211K-1926-SM-5EQLB` = c(0L, 
  1L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 114L), `GTEX-11TT1-2126-SM-5GU5Y` = c(2L, 
  0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 49L), `GTEX-ZT9W-2026-SM-51MRA` = c(0L, 
  0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 70L), `GTEX-1KXAM-2326-SM-CYPTD` = c(0L, 
  0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 20L), `GTEX-18A67-0226-SM-7LG67` = c(0L, 
  0L, 5L, 2L, 0L, 0L, 1L, 0L, 0L, 94L), `GTEX-14BMU-2126-SM-5S2TS` = c(0L, 
  0L, 0L, 3L, 0L, 0L, 0L, 0L, 0L, 50L), `GTEX-13PVR-2426-SM-5RQHN` = c(0L, 
  0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 59L), `GTEX-1211K-2226-SM-5FQU6` = c(0L, 
  0L, 0L, 3L, 0L, 0L, 0L, 0L, 0L, 81L), `GTEX-11TT1-2426-SM-5EQMK` = c(0L, 
  1L, 0L, 2L, 0L, 0L, 0L, 0L, 0L, 60L)), row.names = c(&quot;ENSG00000243485&quot;, 
  &quot;ENSG00000237613&quot;, &quot;ENSG00000186092&quot;, &quot;ENSG00000238009&quot;, &quot;ENSG00000222623&quot;, 
  &quot;ENSG00000241599&quot;, &quot;ENSG00000236601&quot;, &quot;ENSG00000235146&quot;, &quot;ENSG00000223181&quot;, 
  &quot;ENSG00000237491&quot;), class = &quot;data.frame&quot;)
  </code></pre>