Friday, January 11, 2008

Python vs Perl

From Dr. István Albert's link Python vs Perl

EXTERIOR: DAGOBAH--DAY


With Yoda strapped to his
back, Luke climbs up one of the many thick vines that grow in the swamp
until he reaches the Dagobah statistics lab. Panting heavily, he
continues his exercises--grepping, installing new packages, logging in
as root, and writing replacements for two-year-old shell scripts in
Python.


LukeYodaYODA:
Code! Yes. A programmer's strength flows from code maintainability. But
beware of Perl. Terse syntax... more than one way to do it... default
variables. The dark side of code maintainability are they. Easily they
flow, quick to join you when code you write. If once you start down the
dark path, forever will it dominate your destiny, consume you it will.



LUKE: Is Perl better than Python?



YODA:
No... no... no. Quicker, easier, more seductive.



LUKE:
But how will I know why Python is better than Perl?



YODA:
You will know. When your code you try to read six months from now.



--- written by: funkster@midwinter.com



Powered by ScribeFire.

Connection to Mysql with Jsp

//only a note, plz ignore this article if you do not need the information.

//for connection to mysql in linux with jsp
//Caution: I noticed that the word "string" can not work in jsp, "String" should be used!
//Set Privileges in Mysql, the host should be identified as "localhost.localdomain"
//prerequisite: Tomcat with JDBC driver, my system has been configured, so I skiped this step.


<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>

<%Class.forName("org.gjt.mm.mysql.Driver").newInstance();
String url ="jdbc:mysql://localhost:3306/database";
//replace the "database"
Connection conn= DriverManager.getConnection(url,"username","passwd");
//replace the username and passwd
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); String sql="select * from KEGG_ec";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()) {%>
<%=rs.getString(1)%>
<%=rs.getString(2)%>
<%}%>
<%out.print("...........");%>
<%rs.close(); stmt.close(); conn.close(); %>

//you may need detailed knowledge from books about jsp!

Sunday, January 6, 2008

PASS



Putative Active Sites with Spheres

PASS (Putative Active Sites with Spheres) is a simple computational tool that uses geometry to characterize regions of buried volume in proteins and to identify positions likely to represent binding sites based upon the size, shape, and burial extent of these volumes. PASS'S utility as a predictive tool for binding site identification is tested by predicting known binding sites of proteins in the PDB using both complexed macromolecules and their corresponding apo-protein structures. The results indicate that PASS can serve as a front-end to fast docking. The main utility of PASS lies in the fact that it can analyze a moderate-size protein (~ 30 kD) in under twenty seconds, which makes it suitable for interactive molecular modeling, protein database analysis, and aggressive virtual screening efforts. As a modeling tool, PASS (i) rapidly identifies favorable regions of the protein surface, (ii) simplifies visualization of residues modulating binding in these regions, and (iii) provides a means of directly visualizing buried volume, which is often inferred indirectly from curvature in a surface representation.

Ref: http://www.ccl.net/cca/software/UNIX/pass/overview.shtml

Thursday, October 25, 2007

An impressing seminar, about Machine Learning

Machine learning is not a new method, but Doctor Chen Yu Zong's (http://bidd.nus.edu.sg/group/bidd.htm) lecture really impressed me. I have some thoughts, mostly about science research. Although some of them have been in my mind for a long time, they have never been considered in such a practical way.

Fisrt, Being Scrupulous. Details may be very important, not in the experiments but also in the data analysis. For instance, he said, choosing suitable training samples can be the most important thing in machine learning. Methods, such as SVM, are tumblers. You can always find a solution from a group of samples no matter how you do the sampling. Sometimes the results may seem perfect, but indeed, there are several flaws. What I want to say is: some methods seem perfect, some results seem perfect. However, we should not be satisfied by them, while they could be mistakes.

Secondly, to be an expert in the field before action. Doctor Zong did a thorough statistic about previous studies on cancer gene biomarker. In this way, his research is based on a good investigation. He knows what is the problem in this kind of study. In contrast, many researchers just read few papers before their proposal. Then what can they do with so little relevant knowledge? A couple of days ago, Prof. Shen said: ”We are in the best institute of China, then don’t you feel awful if you are doing things which can be finished by a regular researcher? ” We must do better, upon the knowledge of previous scientists, that’s how a researcher looks like!

This blog hasn’t been updated for a long time. I’ll try my best to keep this site active. Thank you for your visit.

Sunday, September 16, 2007

Wavelet Coherence and Its Application in Analyzing Auditory and Motor Task Event-Related Potentials

WU Jie,ZHANG Ning,YANG Zhuo,ZHANG Tao, Wavelet coherence and its application in analyzing auditory and motor task event-related potentials.

This paper has been accepted by ACTA BIOPYSICA SINICA,here is its abstract.

Related links:Tips about Wavelet , Wavelet Coherence Method,A Vivid Example to Show How Wavelet Coherence Works, Some Concepts about ERP signals ,Wavelet and EEG Signals. These links can help to gain further information about this paper.

Abstract:
Wavelet coherence method is applied in analyzing single trial of ERP (event-related potential). There are three groups of experiments: auditory single task, motor single task 1 and motor single task 2. Data from 12 participants is analyzed around 40 Hz by wavelet coherence method and the coherence values between prefrontal area and other areas in the brain are calculated. It is found that the coherence values in motor tasks are larger than those in auditory task and there are significantly differences. Furthermore, in different tasks, the distributions of the coherence values are obviously different, and the values are changing in particularly ways according the varying of the time. This analysis indicates that wavelet coherence method has its advantages in investigating short time EEG signals.

Brief descriptions:


The coherence values, around 40Hz between prefrontal area and other areas in the cerebral cortex, were measured. It was found that the coherence values in the MST (Motor Single Task) are larger than that in the AST (Auditory Single Task) with significant differences.Brain dealing with complicated tasks can have more information to process, and there should be more information communication between different areas of the brain. This can be denoted by coherence values.


Wavelet Coherence Values along the time axis. The colors in the images indicate the coherence values between prefrontal area and other areas in the cerebral cortex around 40Hz(the relationship between the color and the value is shown in the color-bar).large coherence values exactly locate in Auditory Cortex at temporal lobe in AST conditions, whilst in MST conditions, the big values are in motor cortex which is in parietal area.

The data show that the wavelet methods calculations of non-stationary signals, compared to the Fourier methods, can characterize the time-frequency features of neural mechanisms underlying cognitive control. Furthermore, wavelet approach can provide higher resolution in both temporal and spatial scales and can be applied in analyzing other physiological signals.

Main reference:
Lachaux, J.-P., et al., Estimating the time-course of coherence between single-trial brain signals: an introduction to wavelet coherence. Neurophysiol Clin., 2002. 32: p. 157-174.

A Vivid Example to Show How Wavelet Coherence Works

Some formulas have been given in previous article, but they are not friendly to understand. Now there is a vivid example to show what Wavelet Coherence analysis looks like.

Please pay attention to the differences of the two pictures below. The description following the pictures will tell you the details.

a


b
Two signals in experiments were randomly chosen and a synchronization in 2~3 s and 10~40Hz was created between them. Then the Wavelet Coherence values were calculated. (a) result of the signals without artificial synchronization, (b) result of the signals with artificial synchronization. The color-bar in the right shows the relationship between coherence values and the colors. High coherence values can be seen in area with designed synchronization (2~3 s and 10~40Hz).

References of this article:
Lachaux J-P, Lutz A, Rudrauf D, Cosmelli D, Quyen MLV, Martinerie J,Varela F. Estimating the time-course of coherence between single-trial brain signals: an introduction to wavelet coherence. Neurophysiol Clin., 2002, 32: 157-174.

Wavelet Analysis of ERP Recordings for Dual Tasks in Man

WU J, YANG Z, ZHANG T, Wavelet analysis of ERP recordings for dual tasks in man.

This paper has been accepted by ICCN'07 & SICPB'07 which will be held in Shanghai, China during November 17-21, 2007. The abstract is shown as below.

Click Wavelet Packet Transform, Relative Wavelet Energy, ERP for more relevant information.

Abstract:
The study was to examine the application of wavelet packet method to electrophysiological responses recorded during single and dual task performance. Relative energies of both EEG alpha and beta frequency bands were significantly higher in the single task conditions compared with that of the dual task condition (P is less than 0.05). The data demonstrated that relative energy measurements based on wavelet transform could be a useful alternative approach to analyzing short duration EEG signals on a time scale of seconds.

It is impossible and unnecessary to show the details of this paper in a single short article, so only the abstract is shown here.

The most important point is that, compared to the Fourier methods, wavelet method can be an alternative and much better method to deal with short time EEG signals. Accordingly, wavelet method can be used in analyzing other data in our lab, those data include EEG, ERP and RSNA signals. They are all complicated signals and represent nonlinear dynamic systems with high dimensionality.

There will be other artcles in this blog to illustrate the advantages of Wavelet method compared to regular frequency analysis methods.