Re: [AMBER] Any manual for python or perl to transform a matrix for data analysis?

From: M. Shahid <mohammad.shahid.gmail.com>
Date: Fri, 25 Mar 2011 21:57:33 +0100

Hi,

preferably, one liners (with awk/sed/cut etc) can also do many things very
quickly and saving time....
e.g the above format can be changed in the desired format with just single
line using awk:

awk '{sub("---","\t",$1);sub("Angle.---","",$2);sub("Angle.---","",$3);
print $1"\t"$2"\t"$3};' < table_file.txt

which is just substitution of some characters from the 3 columns...
The preference of shell's one-liners over other scripting languages is that
they are very fast in doing these
simple kind of tasks, while the scripting languages should be used for
rather more complex tasks.....

i hope it helps..

Best regards,


-- 
O      o O         o  O    O M.Shahid (MS)
|  o O | | | O o O | | | O  |  Phone: +49-2241-142777
O      O o         O  o    O www.b-it-center.de
On Fri, Mar 25, 2011 at 4:23 PM, Jason Swails <jason.swails.gmail.com>wrote:
> On Fri, Mar 25, 2011 at 1:31 AM, <steinbrt.rci.rutgers.edu> wrote:
>
> > Hi Catherine,
> >
> > I would suggest using Perl for this. There are plenty of web resources on
> > how to manipulate text files. Also, O'Reilly's 'Learning Perl' by
> > Schwartz&Phoenix is a must have for anyone writing scripts. It's actually
> > the only manual I ever saw that is good and fun to read.
> >
> > Why not use Python? Because I'm trying to start a flamewar here!
> >
>
> haha -- then you should cross-post this on the python mailing list.  I'd
> cast my vote for Python since I know it much better.  I won't draw any
> comparisons with Perl because I don't use it or know it very well.  I found
> Python incredibly easy to learn, and it's a very natural language.
>
> There are also many 3rd party packages that are ideally suited for common
> applications.  There are also intuitive Python bindings to basically every
> toolkit/API out there (MPI, NetCDF, CUDA, GTK, OpenGL, etc.).  Of course
> you
> have to learn about these bindings/APIs in order to use them, but that's
> always true.
>
> If you decide to go the Python route, check out scipy and numpy (as already
> suggested).  These have linear algebra routines among many others.
>
> Hope this helps,
> Jason
>
>
> >
> > Ok, admittedly Perl and Python will both do a good job...
> >
> > Thomas
> >
> > Dr. Thomas Steinbrecher
> > formerly at the
> > BioMaps Institute
> > Rutgers University
> > 610 Taylor Rd.
> > Piscataway, NJ 08854
> >
> > _______________________________________________
> > AMBER mailing list
> > AMBER.ambermd.org
> > http://lists.ambermd.org/mailman/listinfo/amber
> >
>
>
>
> --
> Jason M. Swails
> Quantum Theory Project,
> University of Florida
> Ph.D. Candidate
> 352-392-4032
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Fri Mar 25 2011 - 14:00:04 PDT
Custom Search