GetMaxLR - The the maximum likelihood ratio from a Zmapqtl output file
GetMaxLR [ -C column ] [ -i ] [ -h ] [ -j ] [ -r rep ] < input > output
GetMaxLR reads from the standard input and writes to the standard output. It can do one of two things. The first is to initialize a file of likelihood ratio maxima so that the file would have the same output as a ZipermE.out file. The second is to read the results of a run of Zmapqtl and pull out the largest value in the user-specified column. It is a Perl script meant to be run in a loop with Prune and Zmapqtl.
This Perl program was meant to be run in a shell script. Here is an example of a c shell program that allows the user to calculate the experimentwise threshold as well as comparisonwise values.
#!/bin/csh
# Permute
# Copyright (C) 2000 Christopher J. Basten
# Usage governed by the terms of the GNU General Public License, version 2 or higher
# See the file COPYING in this directory
#
# This file was meant as an example. You will need to edit it
# to work on your particular system with your data files.
#
# Start by setting the variables needed.
#
set stem=corn # filename stem
set column=4 # LR column to process
set model=3 # analysis model
set reps=1000 # number of bootstraps
set email=basten\@statgen.ncsu.edu # email address for notice
set templog=temp.log # temporary log file
set qbin=/user/local/bin # where are the QTL Cart binaries
set bin=/usr/bin # where are the system programs
#
# Should only need to change what is above.
#
$bin/rm -f $templog
echo "Permutation test started " > $templog
$bin/date >> $templog
$bin/echo "Stem: " $stem >> $templog
$bin/echo "Model: " $model >> $templog
$bin/echo "Reps: " $reps >> $templog
$bin/echo "Email: " $email >> $templog
$bin/mv $stem.log $stem.logsave
$bin/mv $stem.z $stem.zsave
$bin/rm -f $stem.z{$model}e
set i=1
$qbin/GetMaxLR -i < $stem.zsave > $stem.z{$model}.ewt
$qbin/CWTupdate -C $column < $stem.zsave > $stem.z{$model}.cwt
while ( $i <= $reps )
$qbin/Prune -A -V -i $stem.cro -b 2 >>& $templog
$bin/nice $qbin/Zmapqtl -A -V -M $model -i $stem.crb >>& $templog
$qbin/GetMaxLR -r $i -C $column < $stem.z >> $stem.z{$model}.ewt
$qbin/CWTupdate -f $stem.z{$model}.cwt -C $column < $stem.z > $stem.z{$model}.newcwt
$bin/mv $stem.z{$model}.newcwt $stem.z{$model}.cwt
$bin/rm -f $stem.z
@ i++
end
$bin/echo "Now your can run EWThreshold on $stem.z$model.ewt" >> $templog
$bin/mv $stem.zsave $stem.z
$bin/mv $stem.logsave $stem.log
$bin/date >> $templog
/usr/ucb/mail $email < $templog
Suppose you had a data set corn.cro and a map file corn.map. To use the above shell script, create a directory called cornperm and copy the two files into it. Run Qstats on the files to initialize the qtlcart.rc file, and SRmapqtl to rank a set of markers for use with composite interval mapping. Make sure that the QTL Cartographer programs and scripts are installed in the /usr/local/bin subdirectory (or change the line setting qbin above). The script above is set to do 1,000 permutations using interval mapping and restricting itself to column four of the Zmapqtl.out file. Run it as follows:
% Permute &
The script will email you a message when it is complete.
Note that the above example uses -C 4 for the GetMaxLR line in the loop. If you want to use a different column of likelihood ratios, you can change that option. You could create multiple files of the format ZipermE.out and collect the maximal likelihood ratio from different hypothesis tests by having multiple instances of GetMaxLR in the loop.
Once finished, you will have two files of interest. The first will be corn.z3.e and will contain the maxima of the likelihoods for each of the permuted data sets. Run EWThreshold on this file to get your experimentwise thresholds. The other file, corn.z3.cwt, will contain the comparisonwise thresholds.
Zmapqtl(1), Prune(1), EWThreshold(1), CWTupdate(1)
In general, it is best to contact us via email (basten@statgen.ncsu.edu)
Christopher J. Basten, B. S. Weir and Z.-B. Zeng
Department of Statistics, North Carolina State University
Raleigh, NC 27695-8203, USA
Phone: (919)515-1934