La búsqueda global no está activada.
Salta al contenido principal
Foro

Foro de debate módulo 2

Dudas del Modulo 2 / Questions about the content of module 2

Dudas del Modulo 2 / Questions about the content of module 2

de Coral del Val Muñoz - Número de respuestas: 7

Hola!

En esta semana iniciamos el módulo 2, donde se pueden aprender algunos de los pasos básicos en el análisis de datos --omicos con unos ejemplos implementados en Notebooks de Google Colab. En este hilo para podéis plantear todas las dudas que surgan sobre los contenidos del mismo.

------------------

Hello!
This week we start module 2, where you can learn some of the basic steps in data analysis --omics with some examples implemented in Google Colab Notebooks. In this thread you can ask any questions you may have about the contents of the module.



En respuesta a Coral del Val Muñoz

Re: Dudas del Modulo 2 / Questions about the content of module 2

de Zaira Isabel González Sánchez -
Buenos días. Soy nueva en esto de Phyton, códigos, programación, etc. Al ejecutar el código para añadir la carpeta MyDrive/r-lib a la ruta donde se buscan las bibliotecas me dio error porque la carpeta no se llama r-lib sino r-lib_ed2024. Si cambio el código y pongo ese nombre de carpeta (r-lib_ed2024) sí me funciona y me sale la misma respuesta que en el Notebook.

El problema es que ya en el siguiente código:
"%%R
library(TCGAbiolinks)
library(SummarizedExperiment)
print(sessionInfo())"

me da el siguiente error:

" Error: package or namespace load failed for ‘TCGAbiolinks’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘munsell’
---------------------------------------------------------------------------
RRuntimeError Traceback (most recent call last)
/usr/local/lib/python3.12/dist-packages/rpy2/ipython/rmagic.py in eval(self, code)
406 r_expr = ri.parse(code)
--> 407 value, visible = ri.evalr_expr_with_visible(
408 r_expr

7 frames/usr/local/lib/python3.12/dist-packages/rpy2/rinterface.py in evalr_expr_with_visible(expr, envir)
193 if error_occured[0]:
--> 194 raise embedded.RRuntimeError(_rinterface._geterrmessage())
195 res = conversion._cdata_to_rinterface(r_res)

RRuntimeError: Error: package or namespace load failed for ‘TCGAbiolinks’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘munsell’


During handling of the above exception, another exception occurred:

RInterpreterError Traceback (most recent call last)
/tmp/ipykernel_610/4057727362.py in ()
----> 1 get_ipython().run_cell_magic('R', '', 'library(TCGAbiolinks)\nlibrary(SummarizedExperiment)\nprint(sessionInfo())\n')

/usr/local/lib/python3.12/dist-packages/google/colab/_shell.py in run_cell_magic(self, magic_name, line, cell)
221 if line and not cell:
222 cell = ' '
--> 223 return super().run_cell_magic(magic_name, line, cell)
224
225

/usr/local/lib/python3.12/dist-packages/IPython/core/interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
2471 with self.builtin_trap:
2472 args = (magic_arg_s, cell)
-> 2473 result = fn(*args, **kwargs)
2474 return result
2475
in R(self, line, cell, local_ns)

/usr/local/lib/python3.12/dist-packages/IPython/core/magic.py in (f, *a, **k)
185 # but it's overkill for just that one bit of state.
186 def magic_deco(arg):
--> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

/usr/local/lib/python3.12/dist-packages/rpy2/ipython/rmagic.py in R(self, line, cell, local_ns)
982 if not e.stdout.endswith(e.err):
983 print(e.err)
--> 984 raise e
985 finally:
986 if self.device in DEVICES_STATIC:

/usr/local/lib/python3.12/dist-packages/rpy2/ipython/rmagic.py in R(self, line, cell, local_ns)
947 return_output = False
948 else:
--> 949 text_result, result, visible = self.eval(code)
950 text_output += text_result
951 if visible:

/usr/local/lib/python3.12/dist-packages/rpy2/ipython/rmagic.py in eval(self, code)
411 # Otherwise next return seems to have copy of error.
412 warning_or_other_msg = self.flush()
--> 413 raise RInterpreterError(code, str(exception),
414 warning_or_other_msg)
415 finally:

RInterpreterError: Failed to parse and evaluate line 'library(TCGAbiolinks)\nlibrary(SummarizedExperiment)\nprint(sessionInfo())\n'.
R error message: 'Error: package or namespace load failed for ‘TCGAbiolinks’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):\n there is no package called ‘munsell’' ".

Y aquí ya me pierdo jajaja. ¿Esto ocurre porque no hay una carpeta llamada "Munsell", pero el resto de bibliotecas sí están presentes y podré continuar con el Notebook?

Agradezco por adelantado la ayuda.

Un saludo,
Zaira G.
En respuesta a Zaira Isabel González Sánchez

Re: Dudas del Modulo 2 / Questions about the content of module 2

de Pedro Carmona -
Hola Zaira,
Ese mensaje aparece porque los paquetes de R no se están cargando correctamente. En este caso, los paquetes se cargan desde Google Drive, por lo que es muy importante que ejecutes correctamente los pasos previos indicados en el apartado 3.1, donde se explica cómo enlazar la carpeta que contiene los paquetes de R con tu unidad de Google Drive.
Si se omite alguno de los pasos de este proceso o no se ejecuta correctamente, los paquetes de R no se cargarán.
Por favor, vuelve a ejecutar el procedimiento paso a paso, siguiendo todas las indicaciones que se proporcionan en ese apartado.

---
Hi Zaira,
That message appears because the R packages are not loading correctly. In this case, the packages are loaded from Google Drive, so it is very important that you correctly follow the steps outlined in section 3.1, which explains how to link the folder containing the R packages to your Google Drive.
If any of the steps in this process are skipped or not performed correctly, the R packages will not load.
Please go through the procedure step by step again, following all the instructions provided in that section.
En respuesta a Pedro Carmona

Re: Dudas del Modulo 2 / Questions about the content of module 2

de Carlos Cano Gutiérrez -
Hola Zaira,

gracias por tu interés en el curso. Tal y como Pedro te indica, y más si tienes poca experiencia en programación, es muy importante que sigas fielmente las instrucciones que te hemos dado. En tu caso, creo que tu error surge porque estás ejecutando en un cuaderno de Google Colab instrucciones que estás copiando de un PDF.

Tal y como te indicamos en este hilo de instrucciones:
https://abierta.ugr.es/mod/forum/discuss.php?d=2414
tienes dos formas de seguir los contenidos (elige una u otra, pero mejor no las mezcles):

1) un PDF con todos los códigos ejecutados. Ese PDF ha sido creado para estudiantes que no van a ejecutar los códigos, sólo para ver los programas y sus resultados. Si quieres ejecutar algo en Google Colab, mejor elige la opción 2.

2) un cuaderno de códigos en Python y R de Google Colab. Si quieres ejecutar los códigos tú misma, puedes acceder a este cuaderno y ejecutarlo en la nube, siguiendo las instrucciones que se proporcionan. Si no consigues hacerlo ejecutar, siempre tienes la opción 1) para ver los resultados de las ejecuciones.

Como te decía, tu error surge porque has copiado código del PDF (opción 1) y lo has ejecutado en un cuaderno de Google Colab (opción 2). El código de ese PDF no está actualizado para utilizar una versión más moderna de las bibliotecas necesarias. Si quieres ejecutar código en la nube, hazlo directamente accediendo al cuaderno de Google Colab (opción 2).

Aquí nos tienes para cualquier otra duda.

---

Hello Zaira,

Thank you for your interest in the course. As Pedro mentioned, especially if you have little experience in programming, it is very important that you carefully follow the instructions we have provided. In your case, I believe the error arises because you are executing instructions in a Google Colab notebook that you copied from a PDF.

As we explain in this instruction thread:
https://abierta.ugr.es/mod/forum/discuss.php?d=2414
you have two ways to follow the course contents (please choose one or the other, but it is better not to mix them):

1) A PDF with all the code already executed. This PDF was created for students who are not going to run the code themselves, but simply want to see the programs and their results.
2)A Google Colab notebook with Python and R code. If you want to run the code yourself, you can access this notebook and execute it in the cloud by following the instructions provided. If you are unable to run it successfully, you always have option (1) to see the results of the executions.

As I mentioned, your error likely arises because you copied code from the PDF (option 1) and executed it in a Google Colab notebook (option 2). The code in that PDF is not updated to work with more recent versions of the required libraries. If you want to run the code in the cloud, please do so by directly accessing the Google Colab notebook (option 2).

Please feel free to contact us if you have any other questions.
En respuesta a Carlos Cano Gutiérrez

Re: Dudas del Modulo 2 / Questions about the content of module 2

de Zaira Isabel González Sánchez -

Buenos días,


Muchas gracias a ambos por contestar. Efectivamente, ese era mi error. Había leído las instrucciones, pero a la hora de hacerlo se me pasó y, además, pensaba que en el pdf estaban los códigos actualizados. Lo pruebo como me indicas. 


Aunque no tenga mucha experiencia previa, mi intención es ir aprendiendo a usar estas herramientas, por eso había decidido ejecutar los códigos yo misma e ir adquiriendo algo de soltura. 


Gracias de nuevo a ambos.


Un saludo,

Zaira G.


En respuesta a Coral del Val Muñoz

Re: Dudas del Modulo 2 / Questions about the content of module 2

de Ana Armendariz -
Hola buenos días, yo hice perfectamente todos los pasos hasta el 4. Después de ese punto me aparece este error y no se como seguir. No tengo conocimientos previos asi que no se como solucionarlo. Quise ayudarme con la IA disponible de gemini en Googlecolab pero no se soluciono, en los pasos anteriores no me dio nunca error. Aguardo respuesta.
Muchas gracias

%%R
# Hemos descargado previamente los datos de expresion de TCGA-SKCM con normalización RSEM y los ponemos a tu disposición en un fichero
normRSEMtranscr.counts <- readRDS("/content/mydrive/r-lib-130525/normRSEMtranscr.counts.RDS")
Error in gzfile(file, "rb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "rb") :
cannot open compressed file '/content/mydrive/r-lib-130525/normRSEMtranscr.counts.RDS', probable reason 'No such file or directory'
Error in gzfile(file, "rb") : cannot open the connection
---------------------------------------------------------------------------
RRuntimeError Traceback (most recent call last)
/usr/local/lib/python3.12/dist-packages/rpy2/ipython/rmagic.py in eval(self, code)
406 r_expr = ri.parse(code)
--> 407 value, visible = ri.evalr_expr_with_visible(
408 r_expr

7 frames
RRuntimeError: Error in gzfile(file, "rb") : cannot open the connection


During handling of the above exception, another exception occurred:

RInterpreterError Traceback (most recent call last) in R(self, line, cell, local_ns)

/usr/local/lib/python3.12/dist-packages/rpy2/ipython/rmagic.py in eval(self, code)
411 # Otherwise next return seems to have copy of error.
412 warning_or_other_msg = self.flush()
--> 413 raise RInterpreterError(code, str(exception),
414 warning_or_other_msg)
415 finally:

RInterpreterError: Failed to parse and evaluate line '# Hemos descargado previamente los datos de expresion de TCGA-SKCM con normalización RSEM y los ponemos a tu disposición en un fichero\n\nnormRSEMtranscr.counts <- readRDS("/content/mydrive/r-lib-130525/normRSEMtranscr.counts.RDS")\n'.
R error message: 'Error in gzfile(file, "rb") : cannot open the connection'
R stdout:
Error in gzfile(file, "rb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "rb") :
cannot open compressed file '/content/mydrive/r-lib-130525/normRSEMtranscr.counts.RDS', probable reason 'No such file or directory'

The file normRSEMtranscr.counts.RDS was not found. I've corrected the file path in the cell below by removing a redundant 'MyDrive' segment. Please make sure the r-lib-130525 folder and the normRSEMtranscr.counts.RDS file are directly inside your Google Drive's 'My Drive'. If you placed the shortcut or folder elsewhere, you'll need to adjust the path accordingly. Please run the corrected cell.
En respuesta a Ana Armendariz

Re: Dudas del Modulo 2 / Questions about the content of module 2

de Carlos Cano Gutiérrez -
Hola Ana,

gracias por tu mensaje. Efectivamente, había una ruta que tenía que ser actualizada para encontrar el fichero normRSEMtrasncr.counts.RDS con la matriz de conteos normalizada. Tenías la ruta cambiada ya en tu código, probablemente por Gemini. En cualquier caso, la he cambiado en el notebook original y si vuelves a cargarlo te debe funcionar sin problema. 

Un saludo

---
Hello Ana,

Thanks for your message. You are right, there was an outdated path variable in this cell which prevented you from running it successfully. If you reload the notebook now it should be working fine. 

Best,