Tuesday, April 30, 2013

Probability and Likelihood: two similarly different terms

Let us start the discussion with 2 very simple examples:-

Example 1:- 


Let us assume that each of the above 10mer DNA sequences are the experimentally derived binding sites of a Transcription Factor(TF), say X. So, which of the following questions will be correct?
a) what is the probability that G will come at position 4 of the binding site of X?
b) what is the likelihood of G at position 4?

Example 2:-

  |  1  2  3  4  5  6  7  8  9
A |  3  6  1  0  0  6  7  2  1
C |  2  2  1  0  0  2  1  1  2
G |  1  1  7 10  0  1  1  5  1
T |  4  1  1  0 10  1  1  2  6

The above matrix is the position specific frequency matrix derived from the sequences of example 1. Now, which of the following questions is correct?
a) what is the probability that the sequence CAGGTTGGA is a binding site of the TF X?
b) what is the likelihood that the sequence CAGGTTGGA is a binding site of X?

See, in both the cases it seems like both answers are correct since both the terms sounds very similar unless we carefully review the definition of the terms.
The term likelihood is used when we describe a function of a parameter given a fixed outcome.
In both of the examples, the outcome, that is the experimentally derived sequences are given. So the out come is fixed and based on this observations we are asking a question. So, in both of the cases the therm Likelihood will be used.

What? Not convinced??????  ok, let me give you an example of the situation where the term  "probability" will be used.

a) What is the probability that the 10mer sequence CAGGTTGGA will come in our genome?
b) what is the likelihood that the 10mer sequence CAGGTTGGA will come in our genome?

See, this time no prior data, that is, no observation is given (our genome size is fixed). So, likelihood is not the word meant for used in this case. So, the 10mer has a probability, not likelihood to be there in our genome.
Clear??? A bit?? I hope so. If not, feel free to post your query using the comment box below. Time to go, will return soon with more such topics. Till then, bbyeee!!!!   :)

Some of our recent acquisitions...

We can't do anything without these
Servers are the mother of it all... 
We have started from scratch and we get excited when new things reach us. Today is one such day when we received many cute looking pipettes and tip boxes and some loading buffer samples... Sharing some pictures of our not-so-fancy equipments....
Electrophoresis unit
pipettes with stand
And  pH meter

Our cute centrifuge
The Laminar Flow is the Center of our Universe

Wednesday, April 24, 2013

Setting auto increment correctly in mysql tables

If you are uploading data in batch mode and don't want to physically type in the values for the primary key that auto increments, you probably have to reset your table definitions:

create table XXX
(  Name varchar(30) not null ,
   Type varchar(20) not null,
   ID int not null AUTO_INCREMENT,
   Primary KEY (ID)
But if you are working with Phpmyadmin, you can certainly supply these commands in the sql box. But there is also another easy way. Log into phpmyadmin as the owner of the table and click on structure. You will see every column has column definition available for you to edit. Click on change link for the column you wish to change, in this case ID column, and check on a box that has constraint A_I. Then save it. Now you are ready to roll. 
Now every time data uploaded it remembers the last auto-increment value and increments from there. In order to reset to 0 or any other number, say the following at the mysql prompt: Alter table XXX auto_increment=n; Now it will update auto increment value from that number.

Friday, April 19, 2013

preparation of modified BG 11 medium

preparation of modified BG11 medium without any precipitation:

when i prepare the BG11 medium i used to get precipitates and my culture doesn't grow with the medium what i have prepared. now i got the right composition for the medium and the modified one and am posting it here.
Chemical Name
Quantity (mg/Litre)
Boric acid
Calcium chloride Anhydrous

Calcium Chloride Dihydrate

Citric Acid Anhydrous

Citric Acid.H2o

Cupric Sulphate
Ferric Ammonium Citrate
Magnesium sulphate.7H20


Magnesium Sulphate

Manganese Chloride.4H2o


Manganese Chloride

Potassium phosphate dibasic
Sodium Carbonate Anhydrous
Sodium Molybdate.2H20
Sodium Molybdate

Zinc sulphate.7H20
Zinc Sulphate



Properties of medium:
Form: liquid
Appearance: light yellow to yellow
Solubility: Miscible with water
Storage: 2-6C
PH: 8.0 (by adding the NaOH or KOH)
* please avoid autoclaving the medium  for long time because it leads to precipitate, pressure of about 15 to 20 pounds for 45 minutes

Thursday, April 18, 2013

Creating Network File System on your servers

Network File system is a great way to use your resources efficiently especially when they are connected to each other by network. There is a great article here [] that guides you about how to achieve this. For the impatient, I am putting a shorter step by step version here, so that you can quickly achieve it.

As a pre-requisite you need to have root access in all your servers you are trying to connect.

1. edit /etc/exports file to have the following entries:
/usr/data nnn.n.n.n(rw,sync)
/usr/data mmm.m.m.m(rw,sync)

where /usr/data in the local machine is the directory you want to share with machines with ip nnn.n.n.n and mmm.m.m.m. Here rw means read write, sync is to synchronise.
You can change this file in all the servers you want to share items with.

2. make entries in your /etc/hosts file which should read something like: xxx.localdomain localhost
nnn.n.n.n yyy.localdomain -> where your machine has the name 'xxx' and the ip address of the machine you are trying to have in network is nnn.n.n.n and the name of that machine is: 'yyy'. This way you can keep adding the number of machines in the network that you wish to add.

3. In newer machines you can make the following entries into your /etc/hosts.deny file:
All these commands are harmless, and nothing happens if your system does not have a particular protocol. But it is a great way to protect your machine.
4. In /etc/hosts.allow file add the following lines:
                                                              service:nnn.n.n.n , mmm.m.m.m
                                                              lockd:nnn.n.n.n , mmm.m.m.m
                                                              rquotad:nnn.n.n.n , mmm.m.m.m
                                                              mountd:nnn.n.n.n , mmm.m.m.m
                                                              statd:nnn.n.n.n , mmm.m.m.m
5. Run rpcinfo -p to check if portmapper, rquotad, mountd, nfs, amd, status, nlockmgr is running.

(where nnn.n.n.n and mmm.m.m.m are the other two machines in your network you wish to give nfs access to)

6. Run exportfs -ra to make nfsd to read /etc/exports

7. Check /proc/filesystems and see if there is an entry on nfs. If it is there then you are good to go

8. Check if rpc.statd and rpc.lockd is running by doing ps aux | grep statd or ps aux | grep lockd

9. Also check if nfs is running on your machine. For that do a

service nfs restart, then you should get the following:
[root@MYX]# service nfs stop
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
[root@MYX]# service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]

9. Finally mount the file system. Make sure you have mount package is installed in your computer.
be a root in machine xxx.x.x.x and you want to have /usr/data drive of machine nnn.n.n.n to be mounted in /share/data in your local file system -> do the following:
mount -t nfs nnn.n.n.n:/usr/data /share/data
and keep adding mount drives for other machines as well. In other words, nnn.n.n.n:/filesystem is the remote i and the absolute location of the remote ip and /share/data is the drive it needs to be mounted.

Do the same for other machines if you want to have drives from your machine xxx.x.x.x to be mounted else where. Now finally you are done!!

For all redhat linux machines, the following can be done:
make entries in /etc/fstab file of your local machine with the following syntax:
mount-t nfs AAA.localdomain:/usr/apaladata /share/apaladata
mount-t nfs BBB.localdomain:/usr/amritdata /share/amritdata

Where as your machine is CCC .

Another redhat article is here:

Happy creating network file system....

Tuesday, April 2, 2013

What you do when your server gets attacked

Recently, we had a bad episode of server attack, where the attacker used our system for spamming email system. When I got to know about it, I was kind of working on fixing it, then the next thing I noticed was our system's root password was stolen. That was shocking beyond belief!!!!!!!! I took care of the root password recovery and closing down the network port. Now these are the things that has happened.
1. Our host name was changed.
2. Many new programs appeared in /etc area.
3. /etc/hosts; /etc/hosts.allow; /etc/hosts.deny;  and many other files execution permission have been changed. Made executable.

The first thing needs to be done is to recover the root password. In order to do that, follow our earlier blog post here:

Once root password is recovered, check the files under /etc directory and check the executable file paths and find newly installed executables. Change the /etc/hosts file. Change the /etc/sysconfig/network file. Then run /etc/rc.d/init.d/network restart to restart network. Change permissions of most of the /etc files that are made executable to simple read-write mode.

Check your mysql server. If the root password is stolen then try to recover it by doing the following:

a. Stop mysqld server using /etc/init.d/mysql stop
b. mysqld_safe --skip-grant-tables & #This will start mysqld in safe mode and it will NOT ask for root password.
c. Login into mysql in passwordless mode: mysql -u root # You will be logged in passwordless
d. Then change the root password for mysql using:
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
e. Then stop mysqld and restart. This will take care of all your changes.