CRI-MAP Users Forum Posted mail
From jillmrubens.its.unimelb.edu.au  Mon Nov  7 17:52:32 2011
From: Jill Maddox <jillmrubens.its.unimelb.edu.au>
To: Multiple Recipients of <crimap-usersanimalgenome.org>
Subject: Re: Question
Date: Mon, 07 Nov 2011 17:52:32 -0600

Hi Yan-fa

There are several factors that influence speed - hardware - processor speed
and amount of memory (more is better - use top to see how much it is using
and whether it is using real (faster) or virtual (slower)), and also some
of defs.h settings data - complexity (structure of families) and size of
pedigree, number of ungenotyped shared ancestors in pedigree (for snps but
not microsatellites - if subfamilies are only linked by ungenotyped animals
then should split pedigree into separate families and only keep within a
family sub-families that linked via genotyped animals), whether
grandparents are genotyped (fixes some phases), any errors in genotypes
(can slow things down enormously), par file values e.g. PK_LIKE_TOL,
PUK_LIKE_TOL, PK_NUM_ORDS_TOL, PUK_NUM_ORDS_TOL

CRI-MAP is not that fast so you need to run it on a computer that stays
turned on using nohup and with output diverted to a file e.g. nohup crimap
n build > chrn.build &

I am not sure what you mean by "Some families lost the F1 or F0 parent" -
do you mean youhave an F2 population with some ungenotyped parents and
grandparents?

The par file needs to be ascii - any editor that saves in that format will
do. The results won't be in the par file - you will have to extract them
from the build file (if a partial run then look at current orders for a
given number of markers for which only 1 current_order is given - don't
look at those where there are multiple current orders of the same length -
can do fixed or build if update current order line. I have attached a shell
script (Linux, Unix) that helps with updating the par file from a list of
mapped loci - assumes they are in a file named chrn.mapped. You can copy
and paste them from the build file into the .mapped file. Usage
update_par.sh n Note: The update_par.sh file needs to be executable (use
chmod). I keep these scripts in a subdirectory of my home directory called
bin and this subdirectory is in my path. If you don't set them up this way
you will need to adjust the update_par.sh script to handle how you have
things set up. Look at the Linux/Unix tutorials on the web for more
information on how to do this if you don't know how to do it.

Regards

 
Jill 
At 06:22 PM 7/11/2011, =?GBK?B?y+/R3rei?= wrote: 

>
>Hi, Jill and everyone! Thank you. A lot valuable suggestion for me. when I 
>used the crimap chrompic and build commcands, I can not get the results, 
>the shell show XXX bytes allocated in morecore, or current orders. So long 
>time wait for it over (about one night ), so that I must shut it. I was 
>very puzzle for this. what the good method for me build the genetic map? My 
>data have 20 full-sib families and 6840 SNPs.  And, the .par file,  
>how can I editor it to get the results 
>easily? 
> 
> 
>Sun Yan-fa 
> 
> 

 
*************************************************************** 

Jill Maddox 16 Park Square Port Melbourne, 3207 Australia phone: 03 9646
0428 E-mail: jillmrubens.its.unimelb.edu.au

*************************************************************** 
# update_par.awk 
# update lists or ordered and inserted loci in par file 
# inputs 
# file containing locus numbers for ordered mapped loci 
# par file 
# replace list of ordered loci in original par file with those in file 
# containing mapped loci; remove any mapped loci from inserted_loci list 
# 

BEGIN \ {
    input_file = var; 
#    FS=OFS="\t"; 
    temp_file = "chr" var ".par.tmp"; 
    new_num_inserted = 0; 
} 

# parse par file. each line in par file starts with a lower or uppercase
letter # the lines to be adjusted are those starting with ordered_loci and
# inserted_loci # mapped loci file consists of a single line of numbers
separated by whitespace # gets list of ordered loci from chr{var}.mapped #
gets list of loci to be inserted from chr{var}.par - list separated by #
whitespace - might be on multiple lines. List is terminated with *. $1 ~
/^[dginouwPST]/{
    line_num += 1; 
    if (($1 ~ /^[dgnuwPST]/) || ($1 ~ /ord_file/)) 
    { 
        printf "%s\n", $0 > temp_file; 
    } 
    else if ($1 ~ /^i/) 
    { 
        old_inserted_line = $0; 
        old_num_inserted = split(old_inserted_line, old_inserted_loci); 
printf "old num inserted = %d, first = %s, last = %s\n",  
   old_num_inserted-2, old_inserted_loci[2], old_inserted_loci[old_num_inserted-1]; 
    } 
} 

$1 ~ /^[1-9]/{
    ordered_line = $0; 
    num_ordered_loci = split(ordered_line, ordered_loci); 
# printf "num ordered = %d, first ordered = %d, last ordered = %d\n",  
#    num_ordered_loci, ordered_loci[1], ordered_loci[num_ordered_loci]; 
} 

 
END { 
    for (i = 1; i <= num_ordered_loci; i += 1) 
    { 
        temp = ordered_loci[i]; 
        ordered_list[temp] = i; 
    } 
# remove ordered loci from inserted loci line and build new inserted loci  
# array. note 1st position occupied by inserted_line, last occupied by * 
    for (i = 2; i < old_num_inserted; i += 1) 
    { 
        temp = old_inserted_loci[i]; 
        if ((temp in ordered_list) || (temp ~ /\*/)) 
        { 
        } 
        else 
        { 
            new_num_inserted += 1; 
            new_inserted_loci[new_num_inserted] = temp; 
        } 

    } 
# print ordered loci line 
    printf "ordered_loci " > temp_file; 
    for (i = 1; i <= num_ordered_loci; i += 1) 
    { 
        printf "%d ", ordered_loci[i] > temp_file; 
    } 
    printf " *\n" > temp_file; 
# print inserted loci line 
    printf "inserted_loci " > temp_file; 
    for (i = 1; i <= new_num_inserted; i += 1) 
    { 
        printf "%d ", new_inserted_loci[i] > temp_file; 
    } 
    printf " *\nEND\n" > temp_file; 
    close(temp_file); 
} 
#!/bin/bash 
# update_par.sh 
# script to update lists or ordered and inserted loci in par file 
# inputs 
# file containing locus numbers for ordered mapped loci 
# par file 
# replace list of ordered loci in original par file with those in file  
# containing mapped loci; remove any mapped loci from inserted_loci list 
if [ $# -ne 1 ]; then 
    echo 1>&2 Usage: $0 chr_num 
    exit 127 
fi 

if ! [ -a ./chr${1}.mapped ]; then
   echo "file chr${1}.mapped not found" 
   exit 127 
fi 
if ! [ -a ./chr${1}.par ]; then 
   echo "file chr${1 }.par not found" 
   exit 127 
fi 

cat chr${1}.mapped chr${1}.par \
 | gawk -v var=${1} -f ${HOME}/bin/update_par.awk 

mv chr${1}.par chr${1}.par.orig mv chr${1}.par.tmp chr${1}.par exit


 

 

© 2003-2024: USA · USDA · NRPSP8 · Program to Accelerate Animal Genomics Applications. Contact: Bioinformatics Team