User Tools

Site Tools


users:guides:getting_structure_output

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
users:guides:getting_structure_output [2018/06/18 11:48] admins_ceabusers:guides:getting_structure_output [2018/06/18 12:19] (current) admins_ceab
Line 5: Line 5:
 After a long work searching how to save the outputs of the programs executed as R, Miguel downloades the [source code of the ParallelStructure library](https://r-forge.r-project.org/R/?group_id=1636). After a long work searching how to save the outputs of the programs executed as R, Miguel downloades the [source code of the ParallelStructure library](https://r-forge.r-project.org/R/?group_id=1636).
  
 +He unpaccked the source tar.gz:
  
- 
-Descomprimo el paquete  
 ```bash ```bash
 # tar zxvf ParallelStructure_1.0.tar.gz # tar zxvf ParallelStructure_1.0.tar.gz
 ``` ```
-el archivo que busco está en ParallelStructure/R/parallelstructure.R 
  
-Esta función en algún punto debería llamar a StructureVoilà:+The file we were searching for is in ParallelStructure/R/parallelstructure.R:
  
-```code=r+Somewhere into the function it would be some call to Structure. Vualà: 
 + 
 +```
 217 #  wait before running the job (let time to re-new seed between jobs) 217 #  wait before running the job (let time to re-new seed between jobs)
 218 Sys.sleep(job$wait) 218 Sys.sleep(job$wait)
Line 22: Line 22:
 ``` ```
  
-La primera opción que se me ocurrió fue esta:+The first solution Miguel thinked was:
  
-```R+```
 217 #  wait before running the job (let time to re-new seed between jobs) 217 #  wait before running the job (let time to re-new seed between jobs)
 218 Sys.sleep(job$wait) 218 Sys.sleep(job$wait)
Line 31: Line 31:
 ``` ```
  
-Lo vuelvo comprimir y lo paso a la máquina de pruebas (node16 en cc196, esto es un kilombo que no pondré aquí)+Then he paccked all again in tar.gz and copied all to the proves machine (node16 in cc196)
 ``` ```
 # tar zcvf ParallelStructure_1.0.tar.gz ParallelStructure # tar zcvf ParallelStructure_1.0.tar.gz ParallelStructure
 ``` ```
-Y lo instalo en Ratención al comandoque no es el de siempre+ 
 +Thenwith aun unusual command install the library:
  
 ``` ```
Line 43: Line 45:
 ``` ```
  
-Tenía serias dudas de que fuera a instalarse tan fácilmentepero se instalaPaso también todos los archivos que necesito para ejecutar Structure y descargo el programa de Structure que no está en node16 (en /home/soft/console/)+He has some doubts that it works so easilybut in fact, it did itHe copied all the files he needed it to execute Structure and he installed the Structure program that it wasn't installed at node16 (/home/soft/console).
  
-Retoco los paths de structure.R, structure.sh, genero los joblists (todo esto está explicado aquí: http://www2.ceab.csic.es/cblabdoc/doku.php?id=structure_with_r) +He retouch the paths from structure.R, structure.sh, he generated new joblists (as he explained [here](http://cc196.ceab.csic.es/cblabdoc/doku.php?id=users:guides:structure_with_r)):
  
 +```
 chmod +x structure.sh chmod +x structure.sh
 ./structure.sh ./structure.sh
 +```
 +But there is some problem: everytime that we run the program overwrite the file, and we need to save one file per generated result. After talking with Xavi, I returned to the source code. Now I modified some lines before:
  
-pero me encuentro que sobreescribe el archivo cada vez y necesito guardar uno por cada resultado generado. Después de pensarlo con Xavi vuelvo de nuevo al código fuente. Fijándome en unas líneas más arriba, modifico de nuevo la línea que me interesa: +```
- +
-```R+
 206     # generate parameted file for structure  206     # generate parameted file for structure 
 207     param_nam=paste('parameter_job_',as.character(id),sep='') 207     param_nam=paste('parameter_job_',as.character(id),sep='')
- +(...)
 219     instr=paste(structure_path,'structure -m ',param_nam,' > structure_output',as.character(id),'.txt', sep='') 219     instr=paste(structure_path,'structure -m ',param_nam,' > structure_output',as.character(id),'.txt', sep='')
 ``` ```
  
-Después tengo que repetir todo el proceso (comprimir el paquetedesinstalar el paquete en e instalar el nuevo +After repeating all the process (pack the filesuninstall the library in R, reinstall). After that we have to generate all the joblists and remove the results directory (structure_results). And then yes, we have all the files generated.
-Por si acaso vuelvo a generar los joblists, borro la carpeta de resultados (structure_results)+
  
-Y esta vez sí, ahora tenemos todos lo archivos generados.+Then we have to replicate into the cluster. He installed the library in R-3.4.3.
  
-Ahora solo queda replicarlo en el cluster. Instalaré el paquete en el R-3.4.3. 
users/guides/getting_structure_output.1529322509.txt.gz · Last modified: by admins_ceab