For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > November 2006 > Any Module for peak detection









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Any Module for peak detection
Yuanxin

2006-11-20, 6:58 pm

I have a txt file containing a large number of X, Y values used to build a figure. I just wonder whether some perl module can use these values to calculate the onset of the peak and the area under the peak. Excel is not working on this very well. Thanks a
lot!

Terence






Jay Savage

2006-11-20, 6:58 pm

T24gMTEvMjAvMDYsIFl1YW54aW4gPFkuRGluZ0Bz
b3Rvbi5hYy51az4gd3JvdGU6Cj4gSSBoYXZl
IGEgdHh0IGZpbGUgY29udGFpbmluZyBhIGxhcmdl
IG51bWJlciBvZiBYLCBZIHZhbHVlcyB1c2Vk
IHRvIGJ1aWxkIGEgZmlndXJlLiBJIGp1c3Qgd29u
ZGVyIHdoZXRoZXIgc29tZSBwZXJsIG1vZHVs
ZSBjYW4gdXNlIHRoZXNlIHZhbHVlcyB0byBjYWxj
dWxhdGUgdGhlIG9uc2V0IG9mIHRoZSBwZWFr
IGFuZCB0aGUgYXJlYSB1bmRlciB0aGUgcGVhay4g
RXhjZWwgaXMgbm90IHdvcmtpbmcgb24gdGhp
cyB2ZXJ5IHdlbGwuIFRoYW5rcyBhIGxvdCEKPgoK
Tm90aGluZyBpbiBDUEFOIHdvcmtlZCBmb3Ig
eW91PyBXaGF0IHRlcm1zIGRpZCB5b3UgdHJ5IHNl
YXJjaGluZwpzZWFyY2guY3Bhbi5vcmcgZm9y
PwoKQmVzdCwKCi0tIGpheQotLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLQpUaGlzIGVtYWlsIGFuZCBhdHRh
Y2htZW50KHMpOiBbICBdIGJsb2dhYmxlOyBb
IHggXSBhc2sgZmlyc3Q7IFsgIF0KcHJpdmF0ZSBh
bmQgY29uZmlkZW50aWFsCgpkYWdnZXJxdWls
bCBbYXRdIGdtYWlsIFtkb3RdIGNvbQpodHRwOi8v
d3d3LnR1YXcuY29tICBodHRwOi8vd3d3LmRv
d25sb2Fkc3F1YWQuY29tICBodHRwOi8vd3d3LmVu
Z2F0aWtpLm9yZwoKdmFsdWVzIG9mIOIgd2ls
bCBnaXZlIHJpc2UgdG8gZG9tIQo=
Ovid

2006-11-20, 6:58 pm

--- Yuanxin <Y.Ding@soton.ac.uk> wrote:

> I have a txt file containing a large number of X, Y values used to
> build a figure. I just wonder whether some perl module can use these
> values to calculate the onset of the peak and the area under the
> peak. Excel is not working on this very well. Thanks a lot!


You'll have to define:

1. "a figure"
2. Peak.
3. Onset of the peak.
4. How you want to approach calculating the area.

If by 'peak' you mean 'highest value', that's trivial (but false
ceilings can be a problem, are multiple peaks OK, what do you do if you
have more than one "highest" peak with the same value, and so on). Of
course, this could also mean the maximum of a curve, which implies
calculus. Heck, curve-fitting might be involved.

Onset of the peak might be a simple statistics function determining
standard deviation
(http://search.cpan.org/dist/Statist...ptive-Discrete/ can
help), where you choose how many standard deviations are meaningful to
your problem. Or it might just mean choosing an arbitrary limit.

By calculating area, it could be as simple as summing up the areas of
rectangles under the points, but it could mean using integration to
find the area under a curve if you can figure out an equation which
fits the points. There are a number of calculus related modules on the
CPAN which can help with this.

In short, you'll have to provide a lot more information about the type
of data you are using. Perhaps if you can provide an example (and
particularly, define "figure"), we might be better prepared to help
you.

Cheers,
Ovid

--

Buy the book -- http://www.oreilly.com/catalog/perlhks/
Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/
Mumia W.

2006-11-20, 6:58 pm

On 11/20/2006 09:11 AM, Yuanxin wrote:
> I have a txt file containing a large number of X, Y values used to
> build a figure. I just wonder whether some perl module can use these
> values to calculate the onset of the peak and the area under the
> peak. Excel is not working on this very well. Thanks a lot!
>
> Terence
>


As Jay Savage said, try CPAN. Search for things like "area" and
"integral." If memory servers, the integral of a curve over a range is
the area under that curve over that range.


Andy Greenwood

2006-11-20, 6:58 pm

On 11/20/06, Mumia W. <mumia.w.18.spam+nospam@earthlink.net> wrote:
> On 11/20/2006 09:11 AM, Yuanxin wrote:
>
> As Jay Savage said, try CPAN. Search for things like "area" and
> "integral." If memory servers, the integral of a curve over a range is
> the area under that curve over that range.


That is indeed correct. Also, the points at which the derivitave is 0
are your maxima and minima.

>
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>



--
I'm nerdy in the extreme and whiter than sour cream
Connie A. Logg

2006-11-20, 6:58 pm

Try gnuplot.

Connie Logg, Network Analyst
Stanford Linear Accelerator Center
ph: 650-926-2879=20
"Happiness is found along the way, not at the end of the road, and 'IF' =
is the middle word in life."
=20

-----Original Message-----
From: Andy Greenwood [mailto:greenwood.andy@gmail.com]=20
Sent: Monday, November 20, 2006 1:57 PM
To: Mumia W.
Cc: Beginners List
Subject: Re: Any Module for peak detection

On 11/20/06, Mumia W. <mumia.w.18.spam+nospam@earthlink.net> wrote:
> On 11/20/2006 09:11 AM, Yuanxin wrote:
[color=darkred]
>
> As Jay Savage said, try CPAN. Search for things like "area" and=20
> "integral." If memory servers, the integral of a curve over a range is =


> the area under that curve over that range.


That is indeed correct. Also, the points at which the derivitave is 0 =
are your maxima and minima.

>
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org For additional=20
> commands, e-mail: beginners-help@perl.org <http://learn.perl.org/>=20
> <http://learn.perl.org/first-response>
>
>
>



--
I'm nerdy in the extreme and whiter than sour cream

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org For additional =
commands, e-mail: beginners-help@perl.org <http://learn.perl.org/> =
<http://learn.perl.org/first-response>


Yuanxin

2006-11-21, 7:57 am

Thanks everyone, I think I may solve the problem. if comes wrong in the future, i will send another email with more details for help.

Terence


>Try gnuplot.
>
>Connie Logg, Network Analyst
>Stanford Linear Accelerator Center
>ph: 650-926-2879
>"Happiness is found along the way, not at the end of the road, and 'IF' is the middle word in life."
>
>
>-----Original Message-----
>From: Andy Greenwood [mailto:greenwood.andy@gmail.com]
>Sent: Monday, November 20, 2006 1:57 PM
>To: Mumia W.
>Cc: Beginners List
>Subject: Re: Any Module for peak detection
>
>On 11/20/06, Mumia W. <mumia.w.18.spam+nospam@earthlink.net> wrote:
>
>That is indeed correct. Also, the points at which the derivitave is 0 are your maxima and minima.
>
>
>
>--
>I'm nerdy in the extreme and whiter than sour cream
>
>--
>To unsubscribe, e-mail: beginners-unsubscribe@perl.org For additional commands, e-mail: beginners-help@perl.org <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>
>--
>To unsubscribe, e-mail: beginners-unsubscribe@perl.org
>For additional commands, e-mail: beginners-help@perl.org
><http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>
>
>
>




Kviel

2006-11-21, 6:57 pm

----- Original Message -----
From: Yuanxin <Y.Ding@soton.ac.uk>
Date: Monday, November 20, 2006 9:11 am
Subject: Any Module for peak detection

> I have a txt file containing a large number of X, Y values used to
> build a figure. I just wonder whether some perl module can use
> these values to calculate the onset of the peak and the area under
> the peak. Excel is not working on this very well. Thanks a lot!


What is the origins or nature of your data? For instance, in sequencing (genetics) we can use external programs, like phred.

Good luck,

Kevin

Dr.Ruud

2006-11-22, 3:57 am

"Yuanxin" schreef:
> I have a txt file containing a large number of X, Y values used to
> build a figure. I just wonder whether some perl module can use these
> values to calculate the onset of the peak and the area under the
> peak. Excel is not working on this very well. Thanks a lot!


How about Math::PARI? (with Term::Gnuplot)

--
Affijn, Ruud

"Gewoon is een tijger."
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com