m_qtlmap_format_carthagene

[ Top ] [ OUTPUT ] [ Modules ]

NAME

    m_qtlmap_format_carthagene

SYNOPSIS

    Manage allele information and print the information on a ASCII carthagne format

DESCRIPTION

    Print information phases for each animal in a encoded carthagene format according the following array :

   Notation Synonym      Possible Genotypes

   1        A                 F0 |M0
   2                          F0 |M1
   3                       F0 |M0 , F0 |M1
   4                           F1 |M0
   5                       F0 |M0 , F1 |M0
   6        H              F0 |M1 , F1 |M0
   7        D          F0 |M0 , F0 |M1 , F1 |M0
   8        B                   F1 |M1
   9                       F0 |M0 , F1 |M1
   a                       F0 |M1 , F1 |M1
   b                  F0 |M0 , F0 |M1 , F1 |M1
   c                       F1 |M0 , F1 |M1
   d                  F0 |M0 , F1 |M0 , F1 |M1
   e                 F0 |M1 , F1 |M0 , F1 |M1
   f              F0 |M0 , F0 |M1 , F1 |M0 , F1 |M1

NOTES

SEE ALSO


print_transmission_allele

[ Top ] [ m_qtlmap_format_carthagene ] [ Subroutines ]

NAME

    print_transmission_allele

DESCRIPTION

    use the prot array (probabilities to receive a haplotype from parents) and encode in the carthagene format.

NOTES

     prot ( *,*,*,1) --> F0/M0 => 1
     prot ( *,*,*,2) --> F0/M1 => 2
     prot ( *,*,*,3) --> F1/M0 => 4
     prot ( *,*,*,4) --> F1/M1 => 8

SOURCE

 61      subroutine print_transmission_allele(prot,outfile,type_out)
 62        character(len=LENGTH_MAX_FILE) ,intent(in) :: outfile
 63        real (kind=dp)   ,dimension(:,:,:,:), intent(in) :: prot
 64        integer                        ,intent(in) :: type_out
 65        integer :: val_recl = 2**14
 66        integer :: ios,unitf,valhexa(nd),ll,kd,i,chr,stat
 67        character(len=1) ,dimension(0:15) :: hexa,synonym
 68 
 69        !si on tombe sur 0, cas impossible, on considere que toutes les transmissions sont possibles
 70        data(hexa(i),i=0,15) /'f','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'/
 71     data(synonym(i),i=0,15) /' ','A',' ',' ',' ',' ','H','D','B',' ',' ',' ',' ',' ',' ','-'/
 72 
 73        if (trim(outfile) == '' ) then
 74          call stop_application("Dev error : print_transmission_allele need a input file")
 75        end if
 76 
 77        do chr=1,nchr
 78            open(UNIT=unitf,file=trim(outfile)//trim(str(chr)), form="formatted",recl=val_recl,iostat=ios)
 79            if (ios/=0) then
 80             call stop_application("Can not open the file :"//trim(outfile)//trim(str(chr)))
 81            end if
 82            if ( type_out == 1 ) then
 83             write (unitf,fmt='(a)') "data type f2 intercross"
 84            else
 85             write (unitf,fmt='(a)') "data type f2 backcross"
 86            end if
 87 
 88            write (unitf,fmt='(i5,i5," 0 0 ")') nd,nmk(chr)
 89 
 90            do ll=1,nmk(chr)
 91               valhexa = 0
 92               do kd=1,nd
 93 
 94                  if ( prot (chr,ll,kd,1) /= 0 ) valhexa(kd) = valhexa(kd) + 1
 95                  if ( prot (chr,ll,kd,2) /= 0 ) valhexa(kd) = valhexa(kd) + 2
 96                  if ( prot (chr,ll,kd,3) /= 0 ) valhexa(kd) = valhexa(kd) + 4
 97                  if ( prot (chr,ll,kd,4) /= 0 ) valhexa(kd) = valhexa(kd) + 8
 98               end do
 99               select case (type_out)
100               case (1)
101                 write (unitf,fmt='(a," ",'//trim(str(nd))//'(a1))') '*'//trim(mark(chr,ll)),( hexa(valhexa(kd)),kd=1,nd )
102               case (2)
103                 write (unitf,fmt='(a," ",'//trim(str(nd))//'(a1))') '*'//trim(mark(chr,ll)),( synonym(valhexa(kd)),kd=1,nd )
104               case default
105 
106               end select
107            end do
108            close(unitf)
109            call log_mess(" ** Generate ["//trim(outfile)//trim(str(chr))//"] ** ",INFO_DEF)
110        end do
111 
112      end subroutine