Sobre tecnología.

Y es que uno se harta de ver cómo Internet, tecnología variada y cachivaches en general se están haciendo con el control de nuestras vidas, o al menos lo intentan. Pero antes de que penséis que estoy invocando a los demonios para que acaben con todo chip existente, quiero decir que soy partidario de que la tecnología avance, aunque con criterio.

Hace unos días leía que una noticia sobre cómo un hombre, especialista en temas de ciberseguridad, recibía un mensaje en su teléfono en el que se le solicitaba el permiso para instalar la aplicación de una hamburguesería en su dispositivo. La gracia consiste en que en ese mismo momento el hombre entraba a la hamburguesería en cuestión. El dispositivo decidió que la aplicación sería útil y que debía ser descargada. Revisó los permisos de geolocalización y tras indagar un poco, descubrió que en realidad, a pesar de la desactivación del GPS en determinadas aplicaciones, muchos otros servicios seguían activos, haciendo uso del mismo. Uno de ellos era el propio servicio de instalación de aplicaciones (da igual qué smartphone tengamos, todos tienen uno). No es algo nuevo, lo se. Según qué busquemos o dónde estemos, recibimos publicidad acorde a la situación. Pero el problema es que lo permitimos y sobre todo, lo estamos empezando a asumir como algo normal

El ejemplo puede ser utilizado para muchas otras situaciones: salimos a correr y activamos nuestra aplicación que monitoriza nuestro recorrido, pulsaciones, velocidad… y se sincroniza con los servidores de la aplicación; guardamos nuestros eventos y notas, compartimos vídeos, fotos, y mensajes, sin leer las condiciones de uso y qué datos cedemos al disfrutar de esos servicios. Eso mismo se está extendiendo también al pago online: podemos acercar nuestro teléfono al dispositivo adecuado y pagar aquellos que compremos, ya que nuestros datos bancarios estarán ya introducidos. No nos damos cuenta, pero cada día proporcionamos más y más información acerca de nosotros mismos sin darnos cuenta y solo por estar más cómodos. Hace poco yo mismo cambié de teléfono. Cambié de plataforma (las razones no vienen al caso) lo que supuso en cierta medida un cambio en el hábito del uso de determinadas aplicaciones o datos que tenía almacenados. Me percaté que yo mismo me he acostumbrado a determinadas acciones sin darme cuenta. Y todo porque es más fácil.

La tecnología está ahí para hacernos indudablemente la vida mucho más fácil: medicina, transportes, medio ambiente… se benefician de estos avances y repercuten en nosotros. Pero debemos plantearnos si ese beneficio merece la pena cuando a parte de ofrecer, se nos pide algo a cambio. Y más si ese algo es para controlar nuestra propia vida.

Así que como consejo os daré el siguiente (y que yo mismo me debo aplicar): cuidad de los datos que proporcionáis cuando os registráis en algún sitio. Cuanto más limitada sea la información, mejor. Pero sobre todo, tened mucha atención cuando os descarguéis algo en vuestra tablet, móvil u ordenador. Revisad en la medida de lo posible los permisos que requieren (y que se especifican antes de instalarlas) y si no os gusta lo que veis, no lo instaléis. Recordad que habéis vivido hasta ahora sin ello y que probablemente no os hará ninguna falta.

Fer

Advertisements

Where to find the missed content

Dear friend,

Recently I have move part of the content of this web site to a new one. The motives are two: here I will update all the information that is interesting to my family and friends (and therefore it will be written in Spanish and sometimes in English). Second: for a long time ago, I wanted to update this site and administrate it more in detail. Now I have a hosting domain where I will upload different files and projects. This is why I have moved all the stuff related to software and hardware to this new site:

margarmondo.com

where you will find new updates as soon as I can write them. In the mean time, you can find all the old information you’ve found here. Hope you enjoy it.

Best,
Fer

Amd hybrid graphics and Linux

Ok, ok, what I’m going to write here is not a “solution” for the problem I had (and maybe you have it you are reading this), but, ey!, it worked and now, I have again a functional laptop. So don’t blame me!

Precedents: I have a Dell Inspiron 15R SE with a hybrid graphic card Intel HD + AMD 7300M. If you have read this blog before, you may have seen I had problems with the configuration in Windows with these cards. Reading different posts and blogs, I saw it was a common problem. Concretely, Windows didn’t recognized the AMD card and always worked with the Intel. Finally, I found the proper driver and now it’s totally functional!.

The second part came when I made the partition for the Linux OS. As I’ve been working in the lab with Slackware in the last two years, seeing it is wonderful as you control all you want to install (ok, more tedious, but you know what is happening), I decided to migrate. Big problem: the OS saw the AMD card, but didn’t worked. Moreover, no OpenGL and therefore, no PyMOL or VMD.

As I read, hybrid AMD systems and Linux are not BFF, and moreover if your Linux distro is Slackware. I’ve tried several things without successes, trying with clean installations several times. But no luck. I couldn’t work with some programs or connect the laptop to a projector.

So, after reading  again some posts, I’ve decided to install Linux Mint (v.17.3). And it worked!. The default installation runs with the open-source drivers, that are good for me. But I have also tried proprietary drivers and it’s even more better, since I can configure and alternate between the Intel or the AMD, and which one should work depending on what the computer needs.

So, as I said. This is not a solution for the problem you could have with your Slackware and your hybrid system. It’s a bypass so you can work. And let’s say: Cinnamon rules!

It’s your decision. In my case, next time, I will buy a laptop with just the Intel card (or with Nvidia) or a desktop with a dedicated card, and then yes, I will install Slackware again (or no).

Fer

Gromacs and g_sham

Here is a new mini-tutorial if you want to use this tool of gromacs to plot an free energy surface using  user-defined coordinates. I write this because I’ve found lot of questions about how to use it, and I think the main poroblem is the format of the inputs.

Let’s say we have done the PCA analysis of out trajectory and we have a plot with the two first eigenvectors:
The data is basically a file with two columns: one for eigvec1 and other for eigvec2. The simplest way to use g_sham would be:
g_sham -f eigen.file.xvg -notime
We add “-notime” cause we don’t have a column to indicate the time, basically. This command will plot a energy surface for a Boltzmann distribution (and the rest of files of entropy, enthalpy and probability distribution):
If we want to add our energy file (because is not a canonical ensemble), we need to extract the free energy of out md.edr file (the file created during the simulation) with the command g_energy. The file should have a single column with the energy calculated and containing the same number of lines (points) in the eigenvectors file. With this, we can call again g_sham in this way:
g_sham -f eigen.file.xvg -ene energy.file.xvg -notime
I think the main problem I find in what people writes is the format of files, agains, since the tools of gromacs returns the column of time or not depending of the data you extract, so if you mix data with/without this column, can cause you obtain no sense data.
HTH.
Fer

How to convert a trajectory from Gromacs to Amber

One of the principal problems you can find is if you want to analyze your data generated in Gromacs with Amber tools or viceversa. In the second case, is more easy, thanks to acpype. In the first one, the problem is more tricky. Afaik, there is not tools to convert the trajectory from Gromacs to Amber. Here, first, I present a mode to create a topology file of Amber using a solvated and neutralized structure using LeaP. Secondly, I show how to extract the pdb from Gromacs and format them according to the topology of Amber.

Consider a solvated and neutralized system. We will extract a pdb file from our trajectory file. You have had to recenter the box and the molecule (see Gromacs manual):
trjconv -s mol.tpr -f mol.xtc -o mol.pdb -b 0 -e 0
In order to make this pdb useful for tleap and the force field (ff99SB-ILDN in my case), we need to substitute several things:
  • Change the SOL residue name with WAT
  • Change atom types of WAT: HW1 -> H1, HW2 -> H2 and OW -> O. These two steps can be done with sed, awk or your editor.
  • Need to add a TER after every WAT molecule and ion.
  • Be carefull with the ions. Check the manual of Amber to write them properly.
For all this stuff, please, see the bottom script written in bash. Once you have modified your pdb file, load it tleap:
source leaprc.ff99SBildn
x = loadPdb mol.pdb
setbox x vdw
saveAmberParm x mol.tpp mol.xyz
The setbox command will read the information of your box.
Respect to the coordinate file, the problem starts when you have ions, cause Gromacs and Amber put them in different order. At this point, the only solution I’ve found at this moment is to generate different pdb files and reorder the coordinates. This method can be useful only for the analysis of frames, where no information of velocity is necessary.
Create several pdb with trjconv (option -sep) and modify them in the same way we have done before. Here there is the script I used:
#!/bin/bash
first=`grep -n -2  WAT traj0.pdb | head -3 | tail -1 | awk -F: '{print $1}'`
last=` grep -n -2  WAT traj0.pdb | tail -2 | head -1 | awk -F: '{print $1}'`

for file in `ls traj*`; do
sed 's/HW1 WAT/H1  WAT/g' $file | sed 's/HW2 WAT/H2  WAT/g' | sed 's/OW  WAT/O   WAT/g' | sed 's/NA   NA/Na+ Na+/g' > tmp
sed ${first}','${last}'{H;d};${p;x;s/^//}' tmp | grep -v "ENDMDL|TER" > tmp2
awk '/H2  WAT/{print;print "TER";next}1' tmp2 | awk '/Na/{print;print "TER";next}1' | awk '/3HH3 NME/{print;print "TER";next}1' | awk '/H3T DT3/{print;print "TER";next}1' |  sed -e '/^n*$/d' > new_${file}
done
rm tmp tmp2
Now you can combine all these pdb in a single trajectory file with cpptraj or use them directly, i.e., for their analysis with MMPBSA.
Hope this help. If you find some error, please, indicate it.
Fer

How to save images on gnuplot

If you want to save your images in gnuplot as png or postscript, introduce the following series of commands:

To save as png:

set term pngcairo size 640,640 
set output "image.png"
replot
set term X11

To save as postscript

set terminal postscript eps size 3.5,2.62 enhanced color
   font 'Helvetica,20' linewidth 2
set output "image.eps"
replot
set term X1

Of course, there are a lot of options, but this is just for a quick image for a presentation (like in my case)

Source: http://www.gnuplotting.org/output-terminals/

Fer

Perl – Spliting files

Just another problem solved thanks to google and perl. If you want to split a big file into several ones, using a pattern inside, you can execute a simple command line using perl:

perl -n -e '/^PATTERN/ and open FH, ">output_".$n++"; print FH;' file

In my case, I wanted to split a mol2 database in individual mol2 files. Easy and fast. You can find the whole information HERE.

Fer