ORDERCHR(1)           User Contributed Perl Documentation          ORDERCHR(1)



NAME
       orderchr - determine a chromosome order to minimize cross-over of links

SYNOPSIS
         orderchr -links linkfile.txt { -anchorfile anchors.txt | -anchorrx REGEX } -karyotype karyotype.txt

DESCRIPTION
       By examining the frequencies of chromosome-chromosome relationships
       defined in the link file, this script suggests a new order for chromo-
       somes that results in fewer cross-overs between links. The order of
       anchor chromosomes is adjusted - links to/from other chromosomes are
       not considered and those chromosomes are not re-ordered.. You can
       define anchors using a file or regular expression.

       Simulated annealing is used to optimize the chromosome order (read
       below about parameters). Run the simulation a couple of times to check
       convergence (finding a global minimum is not guaranteed).

       There are four modes in which the script is run and each mode differs
       in the way anchor chromosomes are defined. In order of increasing con-
       venience, these modes are

       MODE 1 - anchors defined in a file (karyotype file is not used)

         > orderchr -links linkfile.txt -anchorfile anchors.txt

       Order of chromosomes provided in the -anchorfile is optimized.

       MODE 2 - anchors defined by regular expression (karyotype file is used)

         > orderchr -links linkfile.txt -anchorrx chr1 -karyotype karyotype.txt

       All chromosomes are read from the karyotype file and the list is fil-
       tered by the -anchorrx regular expression. Those chromosomes that match
       the regular expression are re-ordered.

       In this example, chromosomes matching "chr1" will be re-ordered (e.g.
       chr1, chr10, chr11, etc).

       MODE 3 - no explicit anchors are defined (karyotype file is not used)

         > orderchr -links linkfile.txt

       In the absence of an anchor filter, or a karyotype file, all chromo-
       somes referenced in the link file will be re-ordered.

       This mode is helpful if you don't have a formatted karyotype file yet.

       MODE 4 - no explicit anchors are defined (karyotype file is used)

         > orderchr -links linkfile.txt -karyotype karyotype.txt

       In the absence of an anchor filter, all chromosomes in the karyotype
       file are re-ordered.

SIMULATED ANNEALING
       This method is an optimization method that encourages the discovery of
       a global minimum by traversing the space of solutions with a small (and
       decreasing as simulation runs) chance of visiting less desirable solu-
       tions.

       There are three parameters that control the optimization.

       iterations

       The number of iterations to perform. At each iteration, the current
       solution is randomly modified and either accepted or rejected.

       max_flips

       The optimization run is split into max_flips equal-sized intervals.
       During each iterval (i=1..max_flips), the number of random chromosome
       pair swaps in the solution is given by

         max_flips - i + 1

       For example, if max_flips is 3 and iterations=1000. Then the number of
       random pair swaps is

         iteration 1-333    3
         iteration 334-666  2
         iteration 667-1000 1

       temp0

       This parameter determines the probability of a transition to a less
       desirable solution. The transition probability is

         p(dE) = temp0*exp( - dE/t )

       where t=1..0 over the length of the simulation and dE is the relative
       change in the desirability of two solutions.

       If temp0=1, then the probability of accepting a solution that is 10%
       worse (e.g. dE=0.1) is

         p(0.1) = exp (-0.1/1)   = 90%    at start of simulation
                = exp (-0.1/0.5) = 82%    half way through simulation
                = exp (-0.1/0.1) = 37%    90% of the way through simulation

       By lowering temp0, you lower the probability of transition to a less
       desirable solution.

       Do not adjust temp0 unless you feel that the simulation is (a) not
       traversing the solution space sufficiently - in which case make temp0
       larger or (b) too many low-quality solutions are accepted - in which
       case make temp0 smaller.

       optimize = minimize|maximize

       Most of the time you'll want to adjust the chromosome order in a way to
       minimize the number of crossing links. However, you can set to maximize
       the number of crossing links by setting

         optimize = maximize

HISTORY
       * 8 July 2008
           Started and versioned.

BUGS
AUTHOR
       Martin Krzywinski

CONTACT
         Martin Krzywinski
         Genome Sciences Centre
         Vancouver BC Canada
         www.bcgsc.ca
         martink@bcgsc.ca



perl v5.8.7                       2008-07-08                       ORDERCHR(1)
