Friday, November 19, 2010

Converting ext2 filesystem to ext3

ext 2 stands for second extended file system. You may have installed your linux with an ext2 . If you wish to convert it to ext3, fire the command below

tune2fs -c 0 -i 30 -j /dev/hda1

Before doing this try checking your file system by using the command df -T. After rebooting, running the command df -T again should confirm that you've been successful.

www.linux.org

Monday, May 31, 2010

Essential gromacs commands!

Hey ,

Many of you might want to use gromacs or are using it now. Gromacs is used the most by the bio-community to perform molecular dynamic simulations on bio molecules. I have compiled a list of commands which would help you from the start to the end.

1)
pdb2gmx -f pdbid.pdb -o pdbid_processed.gro -water spce

2)
editconf -f pdbid_processed.gro -o pdbid_box.gro -c -d 1.0 -bt cubic

3)
genbox -cp pdbid_box.gro -cs spc216.gro -o pdbid_solvated.gro -p topol.top

4)
grompp -f minimization.mdp -c pdbid_solvated.gro -p topol.top -o minpdbid.tpr

5) mdrun -v -deffnm minpdbid

6)
grompp -f nvt.mdp -c minpdbid.gro -p topol.top -o nvtpdbid.tpr

7) mdrun -v -deffnm nvtpdbid

8)
grompp -f npt.mdp -c nvtpdbid.gro -t nvtpdbid.trr -p topol.top -o nptpdbid.tpr

9) mdrun -v -deffnm nptpdbid

10)
grompp -f mdrun.mdp -c nptpdbid.gro -t nptpdbid.trr -e nptpdbid.edr -p topol.top -o mdpdbid.tpr

11) mdrun -v -deffnm mdpdbid

Note that all .mdp files contain all the configurations. You can have your own file saved in the folder. I have not attached those files.

Monday, May 17, 2010

Gzip,Gunzip and Tar

A simple tip. If you need to quickly create a tar.gz archive of a folder named abc, then try the following command

tar -cvzpf desired_file_name.tar.gz /path/to/folder/abc

and if you need to get the folder back from the archive

tar -xvzpf filename.tar.gz

This is better and quick compared to the two step procedure of first using unzip and then tar.

Sunday, May 16, 2010

More on File Mainpulations

Hey,

Sometimes its tedious to get the file as u want it to be. One such case is obtaining ATOM records from a PDB file. For those of you who dont know about pdb files (http://www.wwpdb.org/documentation/format32/v3.2.html) the link is a good place to start.

But in short it contains various sections like HEADERS,ATOM,HETATM,CONECT etc. ATOM records always begin with the word 'ATOM' , HETATM records with 'HETATM' and so on.

At times you would want to extract just the atom record. Instead going through the routine procedure of opening it in a text editor and then deleting all the lines that does not being with ATOM, heres a short,easy and a single line command.
grep 'ATOM  ' pdbid.pdb>| atom.pdb
Thats it .. You have the atom records saved in atom.pdb

Thursday, May 13, 2010

Export, Set and Setenv commands

While installing many bioinformatics softwares you are required to set the environmental variable. Some of the softwares instructs you to set the variable using export and some using setenv but at times these commands do not work.

Ideally we would like to define a variable and it should be accessed in all the shells or processes invoked by the original shell. This can be achieved by the export command in ksh/sh as shown below.

export PATH="/root/satish/"

To check if the path has been set you could use the following command

echo $PATH and it should give you /root/satish/ has the output.

set and setenv are the c-shell (csh/tcsh) alternatives for setting a local variable and environment variable respectively. The set command is used for setting local variable, setenv is uesd for setting an environment variable:

To know what shell you are using type

echo $SHELL

the output will be /bin/bash or /bin/csh and so on. Depending on your shell use the above commands.

Monday, May 10, 2010

Configuring Ctrl+alt+del on your

On your Windows machine one of the most used keys are ctrl+alt+del :P . On a Linux machine there is something called as top which gives you the processes that are running and you can terminate them (same as end task). But if you would like to configure ctrl+alt+delete then you can do that too.

Go to "System > Preferences > Keyboard Shortcuts

Enter the new Ctrl-Alt-Del: At the bottom of the "Keyboard Shortcuts" window, click on "Add", to add a new "Custom Shortcut" combination. (remove the old ctrl-alt-del if it is already assigned)

Name: Ctrl-Alt-Del (name it whatever you want)

Command: gnome-system-monitor


Click "Apply" and you're done!
Test it out by pressing "Ctrl-Alt-Del"!

If you still want to stick to the linux style which is awesome just start your terminal and type "top" and hit enter.

You will be shown the name of the process and its id (PID).. just note down that id (example :- PID=5277)

Then on the terminal type kill 5277 thats it...

Thursday, May 6, 2010

The tale of the tail

If you guys have been using linux then you must have surely come across a command known as "tail" .It is used to display the last few lines of a text file. It is one the best and standard ways of watching or tracking your log files.

When you start a docking or simulation in text mode or in command mode, most of the time the screen goes blank and the cursor does not allow you to enter a new command which essentially means that your job is going on. Now the question is how do you know how much has it progressed. Most of the this program creates a output file or a log file. You could open a new terminal window and cd into that folder and then type the following command :

tail -f logfile.log or tail -f outputfile.out

-f tells the tail to follow the update and hence the latest update gets printed on the screen. By defaul tail prints out the last ten lines but with -f the entire file is monitored as and when the file gets updated.

Pretty useful command...