title: ggplot facet_wrap selected columns of data.frame?
body: <p>I have a data.frame <code>X</code> which contains point/sample coordinates <code>X1</code> and <code>X2</code>: </p>
  
  <pre><code>&gt; head(X)
                                 X1        X2 Cluster Timepoint Transcripts       MEF       ESC
  Drop_6_6A_0_TACCTAATCTAC 169.3437  20.18623       2     Day 0       49688 0.4366071 0.3260743
  Drop_6_6A_0_TCAGCTTGTCAC 155.8880 -16.69927       3     Day 0       47365 0.4554254 0.3350818
  Drop_6_6A_0_TCGCAATAAGAT 168.4270  36.50967       2     Day 0       44881 0.4114934 0.2595030
  Drop_6_6A_0_AATCTACCAATC 164.3964 -27.17404       3     Day 0       44640 0.4748225 0.3525822
  Drop_6_6A_0_GGATTAAGTTCA 162.2900 -24.10504       3     Day 0       36822 0.4723676 0.3391785
  Drop_6_6A_0_TGATCTAGTGTC 155.4231 -19.18974       3     Day 0       35889 0.4664174 0.3408899
  </code></pre>
  
  <p>I would like to add selected markers as columns to <code>X</code> and size the points on a scatter plot according to the associated expression value. </p>
  
  <pre><code>NANOG  = t(data['NANOG',rownames(X)])
  SAL4 = t(data['SAL4',rownames(X)])
  COL5A2 = t(data['COL5A2',rownames(X)])
  ESRRB = t(data['ESRRB',rownames(X)])
  ELN    = t(data['ELN',rownames(X)])
  POU5f1 = t(data['POU5F1',rownames(X)])
  PTN    = t(data['PTN',rownames(X)])
  CXCL5  = t(data['CXCL5',rownames(X)])
  Z = cbind(X, NANOG, SAL4, POU5f1, ESRRB, COL5A2, ELN, PTN, CXCL5)
  </code></pre>
  
  <p>After binding this data, the new data.frame <code>Z</code> looks something like this: </p>
  
  <pre><code>&gt; head(Z)
                                 X1        X2 Cluster Timepoint Transcripts       MEF       ESC     NANOG NA POU5F1 ESRRB   COL5A2 ELN      PTN     CXCL5
  Drop_6_6A_0_TACCTAATCTAC 169.3437  20.18623       2     Day 0       49688 0.4366071 0.3260743 0.0000000 NA      0     0 5.113106   0 1.004522 0.2645434
  Drop_6_6A_0_TCAGCTTGTCAC 155.8880 -16.69927       3     Day 0       47365 0.4554254 0.3350818 0.2763494 NA      0     0 3.068572   0 1.309109 1.0395819
  Drop_6_6A_0_TCGCAATAAGAT 168.4270  36.50967       2     Day 0       44881 0.4114934 0.2595030 0.0000000 NA      0     0 5.264248   0 0.000000 0.0000000
  Drop_6_6A_0_AATCTACCAATC 164.3964 -27.17404       3     Day 0       44640 0.4748225 0.3525822 0.0000000 NA      0     0 3.554919   0 1.592698 0.2916205
  Drop_6_6A_0_GGATTAAGTTCA 162.2900 -24.10504       3     Day 0       36822 0.4723676 0.3391785 0.0000000 NA      0     0 3.838676   0 1.536569 1.9954283
  Drop_6_6A_0_TGATCTAGTGTC 155.4231 -19.18974       3     Day 0       35889 0.4664174 0.3408899 0.0000000 NA      0     0 4.029014   0 6.187616 0.0000000
  </code></pre>
  
  <p><strong>Now, I am able to plot individual scatterplots with points sized to corresponding expression values (shown below), but I'm unsure how to do this within one facet_wrap plot.</strong> </p>
  
  <pre><code>library(gridExtra)
  g = arrangeGrob(
    ggplot(Z, aes(X1, X2, color=NANOG)) + ggtitle("NANOG") + 
      geom_point() + 
      xlab(paste0("TSNE1")) + 
      ylab(paste0("TSNE2")) +
      theme_bw() + theme(axis.line = element_line(colour = "black"), panel.grid.minor = element_blank(), panel.background = element_blank()) + scale_colour_gradient(low='light blue', high='red') + 
      ggsave(paste0(outdir, timepoint, ".tsne.",lab,".density.clustered.all.genes.TSNE1.TSNE2.nanog.expression.no.noise.pdf"), height=pdf_height, width=pdf_width+5),
    ggplot(Z, aes(X1, X2, color=SAL4)) + ggtitle("SAL4") + 
      geom_point() + 
      xlab(paste0("TSNE1")) + 
      ylab(paste0("TSNE2")) +
      theme_bw() + theme(axis.line = element_line(colour = "black"), panel.grid.minor = element_blank(), panel.background = element_blank()) + scale_colour_gradient(low='light blue', high='red') + 
      ggsave(paste0(outdir, timepoint, ".tsne.",lab,".density.clustered.all.genes.TSNE1.TSNE2.SAL4.expression.no.noise.pdf"), height=pdf_height, width=pdf_width+5),
    ggplot(Z, aes(X1, X2, color=POU5f1)) + ggtitle("POU5F1") + 
      geom_point() + 
      xlab(paste0("TSNE1")) + 
      ylab(paste0("TSNE2")) +
      theme_bw() + theme(axis.line = element_line(colour = "black"), panel.grid.minor = element_blank(), panel.background = element_blank()) + scale_colour_gradient(low='light blue', high='red') + 
      ggsave(paste0(outdir, timepoint, ".tsne.",lab,".density.clustered.all.genes.TSNE1.TSNE2.pou5f1.expression.pdf"), height=pdf_height, width=pdf_width+5), 
    ggplot(Z, aes(X1, X2, color=ESRRB)) + ggtitle("ESRRB") + 
      geom_point() + 
      xlab(paste0("TSNE1")) + 
      ylab(paste0("TSNE2")) +
      theme_bw() + theme(axis.line = element_line(colour = "black"), panel.grid.minor = element_blank(), panel.background = element_blank()) + scale_colour_gradient(low='light blue', high='red') + 
      ggsave(paste0(outdir, timepoint, ".tsne.",lab,".density.clustered.all.genes.TSNE1.TSNE2.ESRRB.expression.pdf"), height=pdf_height, width=pdf_width+5), 
    ggplot(Z, aes(X1, X2, color=COL5A2)) + ggtitle("COL5A2") + 
      geom_point() + 
      xlab(paste0("TSNE1")) + 
      ylab(paste0("TSNE2")) +
      theme_bw() + theme(axis.line = element_line(colour = "black"), panel.grid.minor = element_blank(), panel.background = element_blank()) + scale_colour_gradient(low='light blue', high='green') + 
      ggsave(paste0(outdir, timepoint, ".tsne.",lab,".density.clustered.all.genes.TSNE1.TSNE2.col5a2.expression.pdf"), height=pdf_height, width=pdf_width+5), 
    ggplot(Z, aes(X1, X2, color=ELN)) + ggtitle("ELN") + 
      geom_point() + 
      xlab(paste0("TSNE1")) + 
      ylab(paste0("TSNE2")) +
      theme_bw() + theme(axis.line = element_line(colour = "black"), panel.grid.minor = element_blank(), panel.background = element_blank()) + scale_colour_gradient(low='light blue', high='green') + 
      ggsave(paste0(outdir, timepoint, ".tsne.",lab,".density.clustered.all.genes.TSNE1.TSNE2.eln.expression.pdf"), height=pdf_height, width=pdf_width+5), 
    ggplot(Z, aes(X1, X2, color=PTN)) + ggtitle("PTN") + 
      geom_point() + 
      xlab(paste0("TSNE1")) + 
      ylab(paste0("TSNE2")) +
      theme_bw() + theme(axis.line = element_line(colour = "black"), panel.grid.minor = element_blank(), panel.background = element_blank()) + scale_colour_gradient(low='light blue', high='green') + 
      ggsave(paste0(outdir, timepoint, ".tsne.",lab,".density.clustered.all.genes.TSNE1.TSNE2.ptn.expression.pdf"), height=pdf_height, width=pdf_width+5), 
    ggplot(Z, aes(X1, X2, color=CXCL5)) + ggtitle("CXCL5") + 
      geom_point() + 
      xlab(paste0("TSNE1")) + 
      ylab(paste0("TSNE2")) +
      theme_bw() + theme(axis.line = element_line(colour = "black"), panel.grid.minor = element_blank(), panel.background = element_blank()) + scale_colour_gradient(low='light blue', high='green') + 
      ggsave(paste0(outdir, timepoint, ".tsne.",lab,".density.clustered.all.genes.TSNE1.TSNE2.cxcl5.expression.pdf"), height=pdf_height, width=pdf_width+5), 
    nrow=2, ncol=4
  )
  </code></pre>
  
  <p>The above code works as anticipated but is very lengthy and not sufficient for a large number, say 100, selected markers.. I am assuming that I would have to somehow melt the <code>Z</code> data.frame? Any help would be greatly appreciated. </p>