<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">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 style="overflow-wrap: break-word;">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>