Log normalization

Log normalization

Postby cwyoo » Mon Jul 14, 2014 11:14 am

NAME
log_norm.pl - Log normalization perl script

SYNOPSIS
log_norm.pl

AVAILABILITY
Git repository (public)

DESCRIPTION
This scripts calculates log scores provided in a text file log_scores.txt in the same directory.

EXAMPLES

If you run the script with the text file log_scores.txt in the same directory with the following content:

2.972013412
1.557986984
4.648754528
3.506570268
-0.434294482
-2.694955206
-3.643825586
-0.508617802

You will get the following results:

Total score 5.09627312309116
Log score 2.972013412 is 11.952141590284 % of total score
Total score 5.09627312309116
Log score 1.557986984 is 2.90630945243736 % of total score
Total score 5.09627312309116
Log score 4.648754528 is 63.9212329928271 % of total score
Total score 5.09627312309116
Log score 3.506570268 is 20.398621619523 % of total score
Total score 5.09627312309116
Log score -0.434294482 is 0.396373861224409 % of total score
Total score 5.09627312309116
Log score -2.694955206 is 0.0413344848523151 % of total score
Total score 5.09627312309116
Log score -3.643825586 is 0.0160038089915447 % of total score
Total score 5.09627312309116
Log score -0.508617802 is 0.367982189860324 % of total score

The results show that log score of 3.506570268 is about 20.3986% of the sum of all log scores provided in log_scores.txt

FILES
log_scores.txt: a text file that has log score per line. The file should be in the same directory.

SEE ALSO
Log likelihood score, BDe score, Log score
Attachments
log_norm.zip
Perl script for log normalization and text file to specify log socres
(759 Bytes) Downloaded 259 times
cwyoo
Site Admin
 
Posts: 377
Joined: Sun Jun 22, 2014 2:38 pm

Re: Log normalization

Postby meninonas » Thu Jul 17, 2014 4:24 pm

Professor,

What command do you need in order to execute this script?

In addition, for the PAH dataset, would you like to place all of the values from all of the runs in the log_scores.txt files or separate the log scores per run?
meninonas
 
Posts: 137
Joined: Tue Jun 24, 2014 3:25 pm

Re: Log normalization

Postby cwyoo » Thu Jul 17, 2014 10:34 pm

meninonas wrote:Professor,

What command do you need in order to execute this script?

In addition, for the PAH dataset, would you like to place all of the values from all of the runs in the log_scores.txt files or separate the log scores per run?


This is a perl script. Just type log_norm.pl and press enter in the command prompt in the terminal of the server or any machine that has perl installed. I believe Mac comes with perl installed, correct? Also you may search for information about how to run a perl script.
cwyoo
Site Admin
 
Posts: 377
Joined: Sun Jun 22, 2014 2:38 pm

Re: Log normalization

Postby jramo033 » Mon Nov 30, 2015 6:30 pm

I was trying to follow the instructions but "log_norm.pl" looks more like a file and not a command in perl. I got the message "it is not recognized as a command". It looks like the file with the information (numbers) needs to be read first but we need to write the complete script (reading plus log normalization commands). If anybody knows how to do it, I would appreciate it.
jramo033
 
Posts: 38
Joined: Thu Sep 03, 2015 11:21 pm

Re: Log normalization

Postby cwyoo » Tue Dec 01, 2015 1:44 pm

jramo033 wrote:I was trying to follow the instructions but "log_norm.pl" looks more like a file and not a command in perl. I got the message "it is not recognized as a command". It looks like the file with the information (numbers) needs to be read first but we need to write the complete script (reading plus log normalization commands). If anybody knows how to do it, I would appreciate it.


Try to type in "perl log_norm.pl" and press enter. Of course, you need to update log_scores.txt file with appropriate log scores.
cwyoo
Site Admin
 
Posts: 377
Joined: Sun Jun 22, 2014 2:38 pm

Re: Log normalization

Postby mprec001 » Fri Dec 04, 2015 12:03 pm

It appears windows has several versions of Perl available. Do you have a recommendation on which one to use?
mprec001
 
Posts: 23
Joined: Tue Sep 01, 2015 2:44 pm

Re: Log normalization

Postby cwyoo » Fri Dec 04, 2015 8:45 pm

mprec001 wrote:It appears windows has several versions of Perl available. Do you have a recommendation on which one to use?


Any perl will work. BTW, all severs have perl installed.
cwyoo
Site Admin
 
Posts: 377
Joined: Sun Jun 22, 2014 2:38 pm

Re: Log normalization

Postby mprec001 » Wed Dec 09, 2015 2:23 am

I have been trying to run log normalization script without success on the server.

I have created the .txt file within a working directory, but when I try to run the perl script by typing "perl log_norm.pl", it gives the error "Can't open perl script "log_norm.pl": No such file or directory.

I suspect the script needs to be created first, using what is explained on this website on how to run perl scripts:

http://perl.about.com/od/gettingstarted ... tm#showall

Is there a file on the server where the script is located? I tried accessing the Git Repository, but was denied access.

Any ideas?
mprec001
 
Posts: 23
Joined: Tue Sep 01, 2015 2:44 pm

Re: Log normalization

Postby cwyoo » Wed Dec 09, 2015 6:30 pm

mprec001 wrote:I have been trying to run log normalization script without success on the server.

I have created the .txt file within a working directory, but when I try to run the perl script by typing "perl log_norm.pl", it gives the error "Can't open perl script "log_norm.pl": No such file or directory.

I suspect the script needs to be created first, using what is explained on this website on how to run perl scripts:

http://perl.about.com/od/gettingstarted ... tm#showall

Is there a file on the server where the script is located? I tried accessing the Git Repository, but was denied access.

Any ideas?


I have attached the perl script and its related file on the original post.
cwyoo
Site Admin
 
Posts: 377
Joined: Sun Jun 22, 2014 2:38 pm

Re: Log normalization

Postby mprec001 » Thu Dec 10, 2015 1:59 am

Thank you Dr. Yoo. I was able to run the log normalization with the script provided.
mprec001
 
Posts: 23
Joined: Tue Sep 01, 2015 2:44 pm


Return to How to run scripts/programs

Who is online

Users browsing this forum: No registered users and 2 guests

cron