<div dir="ltr"><div><br></div><div>library(tidyverse)<br>library(metan)<br>db <- structure(list(gene = c("ACTB", "ACTG1", "AJUBA"), <br> BE.exp = c(4.006,3.85, 1.185), <br> BE. = c(99.8, 5.9, 5.9),<br> CE_exp = c(3.69, 3.592, 0.972),<br> CE. = c(99.6, 7.1, 7.1), <br> E_exp = c(2.691, 2.469, 1.042), <br> E. = c(95.2, 1.5, 1.5), <br> F_exp = c(2.377, 2.252, 0.912), <br> F. = c(80.1, 1.1, 1.1), <br> HE_exp = c(2.901, 3.129, 1.043), <br> HE. = c(97.7, 6.4,6.4), <br> L.exp = c(3.182, 2.451, 0.865), <br> L. = c(94.1, 0.6, 0.6), <br> LE.exp = c(2.864, 2.979, 1.024), <br> LE. = c(94, 1.1, 1.1), <br> N.exp = c(3.243, 3.104, 0), <br> N. = c(96L, 0L, 0L), <br> SM.exp = c(3.214, 2.5, 1.149), <br> SM. = c(93.5, 2.4, 2.4)), <br> class = "data.frame", row.names = c(NA, -3L))<br><br><br>db1 <- db %>% select(gene,ends_with("exp"))<br>db1 <- db1 %>% pivot_longer(cols=-1, names_to = "exp", values_to = "valor1")<br>db2 <- db %>% select(gene,!ends_with("exp"))<br>db2 <- db2 %>% pivot_longer(cols=-1, names_to = "per", values_to = "valor2")<br><br>df <- cbind(db1,db2[-1])<br><br>df %>% ggplot(aes(gene,valor2, color=exp))+geom_point(aes(size=valor1), position = position_dodge(0.5))<br></div><div><br></div><div><br></div><div>seria isso?</div><div><br></div><img src="cid:ii_l3lxvaui0" alt="image.png" width="472" height="399"><br><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="text-align:left"><br></div><div style="text-align:center"><div style="text-align:left"><font color="#073763"><b><i>Cid Edson Mendonça Póvoas</i></b></font></div><div style="text-align:left"><font color="#073763"><b><i><br></i></b></font></div><div style="text-align:left"><b style="font-size:12.8px;color:rgb(7,55,99)"><i><a href="http://www.anovagro.com/" target="_blank">AnovAgro</a></i></b><br></div><div style="text-align:left"><b><i><font color="#073763">Engenheiro Agrônomo - </font></i></b><i style="color:rgb(7,55,99)"><b>Data Scientist</b></i><b><i><font color="#073763"> </font></i></b></div><div><div style="text-align:left"><i style="color:rgb(7,55,99)"><b>CREA-BA:</b> 051984991-4</i><b><font color="#073763"><i><br></i></font></b></div><div style="text-align:left"><b><font color="#073763"><i>Técnico em Segurança do Trabalho </i></font></b><br></div><div style="text-align:left"><i style="color:rgb(7,55,99)"><b>Nº: </b></i><span style="text-align:center"><font color="#073763"><i>0012669/BA</i></font></span></div><div style="text-align:left"><i style="color:rgb(7,55,99)"><b>Tel: </b>+55 73 99151-9565</i></div><div style="text-align:left"><font color="#073763"><span style="font-size:12.8px"><b>Lattes : </b></span><span style="font-size:12.8px"><a href="http://lattes.cnpq.br/2303498368142537" target="_blank">http://lattes.cnpq.br/2303498368142537</a></span><br></font></div></div><div><div><div style="text-align:left"><span style="font-size:12.8px"><font color="#073763"><b>LinkedIn :</b> <a href="http://br.linkedin.com/in/cidedson/" target="_blank">http://br.linkedin.com/in/cidedson/</a></font></span></div><div style="text-align:left"><font color="#073763"><b>Whatsapp :</b> <a href="https://wa.me/5573991519565" target="_blank">https://wa.me/5573991519565</a></font></div></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em qua., 25 de mai. de 2022 às 15:14, Cesar Rabak por (R-br) <<a href="mailto:r-br@listas.c3sl.ufpr.br">r-br@listas.c3sl.ufpr.br</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Acho que <font face="monospace">reshape</font>, <i>per se</i>, não é suficiente. . .<div><br></div><div>É necessário efetuar aglutinações nos dados para que se tenha as nove "linhas" da tabela que gerarão as posições no eixo x do <i>bubble plot</i>, etc.<br><br>Uma busca na documentação por "dplyr aggregate by group" mostrará o caminho a seguir.</div><div><br></div><div>Se eu entendo corretamente, no final do processamento necessita-se um <font face="monospace">tibble</font> (ou <font face="monospace">dataframe</font> se forem usadas funções do ggplot2) com três variáveis para alimentar a função de interesse.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 25, 2022 at 10:25 AM Daniel Guimarães Tiezzi por (R-br) <<a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Vc precisa transformar a tabela do formate wide para long.<div><br></div><div>Existem varias formas. Aqui tem um exemplo</div><div><br></div><div><a href="https://www.datasciencemadesimple.com/reshape-in-r-from-wide-to-long-from-long-to-wide/" target="_blank">https://www.datasciencemadesimple.com/reshape-in-r-from-wide-to-long-from-long-to-wide/</a></div><div><br></div><div><br></div><div><br></div><div>daniel<br><div><br><blockquote type="cite"><div>On May 25, 2022, at 8:01 AM, Michele Claire Breton por (R-br) <<a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a>> wrote:</div><br><div><div dir="ltr">Caríssimos(as) colegas(as), muito bom dia!<div><br></div><div>Espero que todos se encontrem bem.</div><div><br></div><div>Estou com uma dificuldade. Quero fazer um bubble plot usando as funções ggplot2 e dplyr, onde pretendo plotar no eixo x o gene_ID (são 84 linhas), no y a % de ocorrência da expressão na célula e no color, o valor da expressão. O meu primeiro problema é que no y são 9 tipos celulares diferentes e cada um tem, na tabela de entrada de dados, uma coluna com os dados de expressão e outra com os dados de % de ocorrência (amostra abaixo). Como eu escrevo a função geom_point para plotar o gráfico?</div><div><br></div><div>Amostra da tabela de entrada</div><div>
<table cellspacing="0" border="0" style="font-family:"Liberation Sans";font-size:x-small">
<colgroup width="82"></colgroup>
<colgroup width="55"></colgroup>
<colgroup width="46"></colgroup>
<colgroup width="55"></colgroup>
<colgroup width="46"></colgroup>
<colgroup width="55"></colgroup>
<colgroup width="46"></colgroup>
<colgroup span="3" width="55"></colgroup>
<colgroup width="46"></colgroup>
<colgroup width="55"></colgroup>
<colgroup width="46"></colgroup>
<colgroup width="55"></colgroup>
<colgroup width="46"></colgroup>
<colgroup width="55"></colgroup>
<colgroup width="46"></colgroup>
<colgroup span="2" width="55"></colgroup>
<tbody><tr>
<td height="21" align="left" style="font-family:"Liberation Sans"">gene</td>
<td align="left" style="font-family:"Liberation Sans"">BE-exp</td>
<td align="left" style="font-family:"Liberation Sans"">BE%</td>
<td align="left" style="font-family:"Liberation Sans"">CE_exp</td>
<td align="left" style="font-family:"Liberation Sans"">CE%</td>
<td align="left" style="font-family:"Liberation Sans"">E_exp</td>
<td align="left" style="font-family:"Liberation Sans"">E%</td>
<td align="left" style="font-family:"Liberation Sans"">F_exp</td>
<td align="left" style="font-family:"Liberation Sans"">F%</td>
<td align="left" style="font-family:"Liberation Sans"">HE_exp</td>
<td align="left" style="font-family:"Liberation Sans"">HE%</td>
<td align="left" style="font-family:"Liberation Sans"">L-exp</td>
<td align="left" style="font-family:"Liberation Sans"">L%</td>
<td align="left" style="font-family:"Liberation Sans"">LE-exp</td>
<td align="left" style="font-family:"Liberation Sans"">LE%</td>
<td align="left" style="font-family:"Liberation Sans"">N-exp</td>
<td align="left" style="font-family:"Liberation Sans"">N%</td>
<td align="left" style="font-family:"Liberation Sans"">SM-exp</td>
<td align="left" style="font-family:"Liberation Sans"">SM%</td>
</tr>
<tr>
<td height="21" align="left" style="font-family:"Liberation Sans"">ACTB</td>
<td align="left" style="font-family:"Liberation Sans"">4.006</td>
<td align="left" style="font-family:"Liberation Sans"">99.8</td>
<td align="left" style="font-family:"Liberation Sans"">3.690</td>
<td align="left" style="font-family:"Liberation Sans"">99.6</td>
<td align="left" style="font-family:"Liberation Sans"">2.691</td>
<td align="left" style="font-family:"Liberation Sans"">95.2</td>
<td align="left" style="font-family:"Liberation Sans"">2.377</td>
<td align="left" style="font-family:"Liberation Sans"">80.1</td>
<td align="left" style="font-family:"Liberation Sans"">2.901</td>
<td align="left" style="font-family:"Liberation Sans"">97.7</td>
<td align="left" style="font-family:"Liberation Sans"">3.182</td>
<td align="left" style="font-family:"Liberation Sans"">94.1</td>
<td align="left" style="font-family:"Liberation Sans"">2.864</td>
<td align="left" style="font-family:"Liberation Sans"">94.0</td>
<td align="left" style="font-family:"Liberation Sans"">3.243</td>
<td align="left" style="font-family:"Liberation Sans"">96.0</td>
<td align="left" style="font-family:"Liberation Sans"">3.214</td>
<td align="left" style="font-family:"Liberation Sans"">93.5</td>
</tr>
<tr>
<td height="21" align="left" style="font-family:"Liberation Sans"">ACTG1</td>
<td align="left" style="font-family:"Liberation Sans"">3.850</td>
<td align="left" style="font-family:"Liberation Sans"">5.9</td>
<td align="left" style="font-family:"Liberation Sans"">3.592</td>
<td align="left" style="font-family:"Liberation Sans"">7.1</td>
<td align="left" style="font-family:"Liberation Sans"">2.469</td>
<td align="left" style="font-family:"Liberation Sans"">1.5</td>
<td align="left" style="font-family:"Liberation Sans"">2.252</td>
<td align="left" style="font-family:"Liberation Sans"">1.1</td>
<td align="left" style="font-family:"Liberation Sans"">3.129</td>
<td align="left" style="font-family:"Liberation Sans"">6.4</td>
<td align="left" style="font-family:"Liberation Sans"">2.451</td>
<td align="left" style="font-family:"Liberation Sans"">0.6</td>
<td align="left" style="font-family:"Liberation Sans"">2.979</td>
<td align="left" style="font-family:"Liberation Sans"">1.1</td>
<td align="left" style="font-family:"Liberation Sans"">3.104</td>
<td align="right" style="font-family:"Liberation Sans"">0</td>
<td align="left" style="font-family:"Liberation Sans"">2.500</td>
<td align="left" style="font-family:"Liberation Sans"">2.4</td>
</tr>
<tr>
<td height="21" align="left" style="font-family:"Liberation Sans"">AJUBA</td>
<td align="left" style="font-family:"Liberation Sans"">1.185</td>
<td align="left" style="font-family:"Liberation Sans"">5.9</td>
<td align="left" style="font-family:"Liberation Sans"">0.972</td>
<td align="left" style="font-family:"Liberation Sans"">7.1</td>
<td align="left" style="font-family:"Liberation Sans"">1.042</td>
<td align="left" style="font-family:"Liberation Sans"">1.5</td>
<td align="left" style="font-family:"Liberation Sans"">0.912</td>
<td align="left" style="font-family:"Liberation Sans"">1.1</td>
<td align="left" style="font-family:"Liberation Sans"">1.043</td>
<td align="left" style="font-family:"Liberation Sans"">6.4</td>
<td align="left" style="font-family:"Liberation Sans"">0.865</td>
<td align="left" style="font-family:"Liberation Sans"">0.6</td>
<td align="left" style="font-family:"Liberation Sans"">1.024</td>
<td align="left" style="font-family:"Liberation Sans"">1.1</td>
<td align="right" style="font-family:"Liberation Sans"">0</td>
<td align="right" style="font-family:"Liberation Sans"">0</td>
<td align="left" style="font-family:"Liberation Sans"">1.149</td>
<td align="left" style="font-family:"Liberation Sans"">2.4</td>
</tr>
</tbody></table></div><div><br></div><div>Muitíssimo obrigada pela ajuda!</div><div><br></div><div>Michele</div><div><br></div><div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr">------------------------------------------------------------------------<br><div><i><b>Dra. Michele Claire Breton</b></i></div><div>Técnica Superior em Bioinformática</div><div>CICS - Centro de Investigação em Ciências da Saúde</div><div>Faculdade de Ciências da Saúde</div><div>Universidade da Beira Interior</div><div>Covilhã - Castelo Branco - Portugal</div></div></div></div></div>
_______________________________________________<br>R-br mailing list<br><a href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a><br><a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br></div></blockquote></div><br></div></div>_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="noreferrer" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" rel="noreferrer" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br>
</blockquote></div>
_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="noreferrer" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" rel="noreferrer" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br>
</blockquote></div>