SIB-PAIR: List of subroutines and functions

Sib-pair is largely written in standard Fortran 95 (as usual, there are a few system specific routines for file handling, time and date etc).

The Sib-pair source code is distributed as a single file, with C-preprocesser macros to deal with platform specific code. The "source lines" in the tables below are the lines within that single file.

The listings below are automatically generated (by an awk script), so check the source for additional informative comments that may have been skipped.

Listing is first by position in the source code file, then alphabetically. The organization of the source is modules, main, I/O, statistical library routines, association and linkage.

handler {interrupt}

Name of routine: handler
Source lines: 336 - 342
Type subroutine
Call handler()
Moduleinterrupt
Notes
 keyboard interrupt handler (exits after 6 interrupts, usually ctrl-C)

loccode {locus_types}

Name of routine: loccode
Source lines: 378 - 395
Type function
Call loccode(ch)
Modulelocus_types
Notes
 Locus types
 loctyp 1=marker 2=X-marker 3=quant 4=affection 5=mito/Y-marker 11-15=deleted

setup_loci {locus_data}

Name of routine: setup_loci
Source lines: 421 - 428
Type subroutine
Call setup_loci(n)
Modulelocus_data
Notes
 Allocate storage for locus descriptions

cleanup_loci {locus_data}

Name of routine: cleanup_loci
Source lines: 432 - 436
Type subroutine
Call cleanup_loci()
Modulelocus_data
Notes
 Deallocate storage for locus descriptions

expand_loci {locus_data}

Name of routine: expand_loci
Source lines: 440 - 471
Type subroutine
Call expand_loci(nextra, plevel)
Modulelocus_data
Notes
 Expand arrays for locus descriptions

insloc {locus_data}

Name of routine: insloc
Source lines: 476 - 485
Type subroutine
Call insloc(pos)
Modulelocus_data
Notes
  
 insert a locus into the locus list
 other details of the slot are left blank
  

setupmer {locus_data}

Name of routine: setupmer
Source lines: 489 - 519
Type subroutine
Call setupmer(strm)
Modulelocus_data
Notes
 Allocate arrays for locus descriptions from MERLIN locus file

setup_stat {locus_data}

Name of routine: setup_stat
Source lines: 523 - 526
Type subroutine
Call setup_stat()
Modulelocus_data
Notes
 initialize locstat (stores test statistic for each locus)

setup_peds {ped_class}

Name of routine: setup_peds
Source lines: 568 - 600
Type subroutine
Call setup_peds(nped, nobs, numloc, numcol, dataset, astat)
Moduleped_class
Notes
 allocate pedigree data

copy_peds {ped_class}

Name of routine: copy_peds
Source lines: 604 - 631
Type subroutine
Call copy_peds(set1, set2)
Moduleped_class
Notes
 copy pedigree data

cleanup_peds {ped_class}

Name of routine: cleanup_peds
Source lines: 635 - 659
Type subroutine
Call cleanup_peds(dataset)
Moduleped_class
Notes
 deallocate pedigree structure arrays

show_ped_allocation {ped_class}

Name of routine: show_ped_allocation
Source lines: 663 - 686
Type subroutine
Call show_ped_allocation(dataset)
Moduleped_class
Notes
 Diagnostics for structure

copyfreq {alleles_class}

Name of routine: copyfreq
Source lines: 713 - 733
Type subroutine
Call copyfreq(allele_buffer, allele_buffer2)
Modulealleles_class
Notes
 Copy allele frequency data from one structure to another

expand_alleles {alleles_class}

Name of routine: expand_alleles
Source lines: 737 - 760
Type subroutine
Call expand_alleles(allele_buffer, nextra)
Modulealleles_class
Notes
 expand size of an allele frequency structure

cleanup_alleles {alleles_class}

Name of routine: cleanup_alleles
Source lines: 764 - 781
Type subroutine
Call cleanup_alleles(allele_buffer)
Modulealleles_class
Notes
 release memory held by an allele frequency structure

genot {alleles_class}

Name of routine: genot
Source lines: 785 - 799
Type subroutine
Call genot(allele_buffer, gfrq)
Modulealleles_class
Notes
  
 produce genotype frequencies for Metropolis algorithm
  

calc_gtp_freqs {alleles_class}

Name of routine: calc_gtp_freqs
Source lines: 802 - 820
Type subroutine
Call calc_gtp_freqs(allele_buffer)
Modulealleles_class
Notes
 or for sequential imputation

setup_hash {idhash_class}

Name of routine: setup_hash
Source lines: 838 - 874
Type subroutine
Call setup_hash(nrec, hashtab, load)
Moduleidhash_class
Notes
 Allocate an open addressed hash table
   number of buckets is prime
   probe using exponential hash following Muehlbacher 2004 JUCS 10: 1239-1249

cleanup_hash {idhash_class}

Name of routine: cleanup_hash
Source lines: 878 - 886
Type subroutine
Call cleanup_hash(hashtab)
Moduleidhash_class
Notes
 release memory held by a hash table

setup_mem {scheme_lang}

Name of routine: setup_mem
Source lines: 1146 - 1212
Type subroutine
Call setup_mem(siz)
Modulescheme_lang
Notes
 Memory management

cleanup_bank {scheme_lang}

Name of routine: cleanup_bank
Source lines: 1218 - 1233
Type subroutine
Call cleanup_bank(sta, fin)
Modulescheme_lang
Notes
 Clean up memory arrays

 Zero a block of cells, including deallocating strings 

cleanup_mem {scheme_lang}

Name of routine: cleanup_mem
Source lines: 1237 - 1240
Type subroutine
Call cleanup_mem()
Modulescheme_lang
Notes
 Free all memory

gc_mark {scheme_lang}

Name of routine: gc_mark
Source lines: 1246 - 1285
Type subroutine
Call gc_mark(a)
Modulescheme_lang
Notes
 Mark-sweep garbage collector

 Mark cells to be saved

gc {scheme_lang}

Name of routine: gc
Source lines: 1290 - 1323
Type subroutine
Call gc(a, b, plevel)
Modulescheme_lang
Notes
 Copy all registers to free memory
 Reset pointers from old addresses to new addresses

getcell {scheme_lang}

Name of routine: getcell
Source lines: 1327 - 1345
Type function
Call getcell(a, b)
Modulescheme_lang
Notes
 Get next free cell

set_type {scheme_lang}

Name of routine: set_type
Source lines: 1350 - 1354
Type subroutine
Call set_type(p, iflag)
Modulescheme_lang
Notes
 Cell type operations

 Setting values

set_ivalue {scheme_lang}

Name of routine: set_ivalue
Source lines: 1355 - 1359
Type subroutine
Call set_ivalue(p, ivalue)
Modulescheme_lang
Notes
 Cell type operations

 Setting values

set_string {scheme_lang}

Name of routine: set_string
Source lines: 1360 - 1373
Type subroutine
Call set_string(p, str)
Modulescheme_lang
Notes
 Cell type operations

 Setting values

set_substring {scheme_lang}

Name of routine: set_substring
Source lines: 1374 - 1384
Type subroutine
Call set_substring(p, sta, fin, str)
Modulescheme_lang
Notes
 Cell type operations

 Setting values

set_car {scheme_lang}

Name of routine: set_car
Source lines: 1386 - 1389
Type subroutine
Call set_car(p, icar)
Modulescheme_lang
Notes
 Miniscm

set_cdr {scheme_lang}

Name of routine: set_cdr
Source lines: 1390 - 1393
Type subroutine
Call set_cdr(p, icdr)
Modulescheme_lang
Notes
 Miniscm

set_caar {scheme_lang}

Name of routine: set_caar
Source lines: 1394 - 1397
Type subroutine
Call set_caar(p, icaar)
Modulescheme_lang
Notes
 Miniscm

set_cdar {scheme_lang}

Name of routine: set_cdar
Source lines: 1398 - 1401
Type subroutine
Call set_cdar(p, icdar)
Modulescheme_lang
Notes
 Miniscm

set_syntaxnum {scheme_lang}

Name of routine: set_syntaxnum
Source lines: 1402 - 1405
Type subroutine
Call set_syntaxnum(p, op)
Modulescheme_lang
Notes
 Miniscm

get_ivalue {scheme_lang}

Name of routine: get_ivalue
Source lines: 1409 - 1413
Type function
Call get_ivalue(p)
Modulescheme_lang
Notes
 Getting values

get_string {scheme_lang}

Name of routine: get_string
Source lines: 1417 - 1427
Type function
Call get_string(p)
Modulescheme_lang
Notes
 Strings
 

get_substr {scheme_lang}

Name of routine: get_substr
Source lines: 1429 - 1441
Type function
Call get_substr(p, sta, fin)
Modulescheme_lang
Notes
 Substring

get_strlen {scheme_lang}

Name of routine: get_strlen
Source lines: 1443 - 1447
Type function
Call get_strlen(p)
Modulescheme_lang
Notes
 String length

get_listlen {scheme_lang}

Name of routine: get_listlen
Source lines: 1449 - 1461
Type function
Call get_listlen(p)
Modulescheme_lang
Notes
 Miniscm

get_var {scheme_lang}

Name of routine: get_var
Source lines: 1467 - 1540
Type subroutine
Call get_var(string, pos, fin, istat)
Modulescheme_lang
Notes
 allowing access to Scheme environment from Sib-pair
 accessible variables are atomic
 result inserted into passed string

list_var {scheme_lang}

Name of routine: list_var
Source lines: 1544 - 1587
Type subroutine
Call list_var(typ)
Modulescheme_lang
Notes
 List Sib-pair accessible (atomic or pair) variables

isafun {scheme_lang}

Name of routine: isafun
Source lines: 1591 - 1620
Type function
Call isafun(nam)
Modulescheme_lang
Notes
 Test if a macro function exists

procnum {scheme_lang}

Name of routine: procnum
Source lines: 1622 - 1626
Type function
Call procnum(p)
Modulescheme_lang
Notes
 Miniscm

syntaxnum {scheme_lang}

Name of routine: syntaxnum
Source lines: 1627 - 1631
Type function
Call syntaxnum(p)
Modulescheme_lang
Notes
 Miniscm

typeof {scheme_lang}

Name of routine: typeof
Source lines: 1635 - 1639
Type function
Call typeof(p)
Modulescheme_lang
Notes
 Underlying primitives for Scheme

isstring {scheme_lang}

Name of routine: isstring
Source lines: 1640 - 1644
Type function
Call isstring(p)
Modulescheme_lang
Notes
 Underlying primitives for Scheme

isnumber {scheme_lang}

Name of routine: isnumber
Source lines: 1645 - 1649
Type function
Call isnumber(p)
Modulescheme_lang
Notes
 Underlying primitives for Scheme

ispair {scheme_lang}

Name of routine: ispair
Source lines: 1650 - 1654
Type function
Call ispair(p)
Modulescheme_lang
Notes
 Underlying primitives for Scheme

car {scheme_lang}

Name of routine: car
Source lines: 1658 - 1662
Type function
Call car(p)
Modulescheme_lang
Notes
 car, cdr etc

cdr {scheme_lang}

Name of routine: cdr
Source lines: 1663 - 1667
Type function
Call cdr(p)
Modulescheme_lang
Notes
 car, cdr etc

caar {scheme_lang}

Name of routine: caar
Source lines: 1669 - 1674
Type function
Call caar(p)
Modulescheme_lang
Notes
 Miniscm

cadr {scheme_lang}

Name of routine: cadr
Source lines: 1675 - 1680
Type function
Call cadr(p)
Modulescheme_lang
Notes
 Miniscm

cdar {scheme_lang}

Name of routine: cdar
Source lines: 1681 - 1686
Type function
Call cdar(p)
Modulescheme_lang
Notes
 Miniscm

cddr {scheme_lang}

Name of routine: cddr
Source lines: 1687 - 1692
Type function
Call cddr(p)
Modulescheme_lang
Notes
 Miniscm

cadar {scheme_lang}

Name of routine: cadar
Source lines: 1693 - 1699
Type function
Call cadar(p)
Modulescheme_lang
Notes
 Miniscm

caddr {scheme_lang}

Name of routine: caddr
Source lines: 1700 - 1706
Type function
Call caddr(p)
Modulescheme_lang
Notes
 Miniscm

cadaar {scheme_lang}

Name of routine: cadaar
Source lines: 1707 - 1714
Type function
Call cadaar(p)
Modulescheme_lang
Notes
 Miniscm

cadddr {scheme_lang}

Name of routine: cadddr
Source lines: 1715 - 1722
Type function
Call cadddr(p)
Modulescheme_lang
Notes
 Miniscm

cddddr {scheme_lang}

Name of routine: cddddr
Source lines: 1723 - 1730
Type function
Call cddddr(p)
Modulescheme_lang
Notes
 Miniscm

issymbol {scheme_lang}

Name of routine: issymbol
Source lines: 1732 - 1736
Type function
Call issymbol(p)
Modulescheme_lang
Notes
 Miniscm

issyntax {scheme_lang}

Name of routine: issyntax
Source lines: 1737 - 1741
Type function
Call issyntax(p)
Modulescheme_lang
Notes
 Miniscm

isproc {scheme_lang}

Name of routine: isproc
Source lines: 1742 - 1746
Type function
Call isproc(p)
Modulescheme_lang
Notes
 Miniscm

isclosure {scheme_lang}

Name of routine: isclosure
Source lines: 1747 - 1751
Type function
Call isclosure(p)
Modulescheme_lang
Notes
 Miniscm

iscontinuation {scheme_lang}

Name of routine: iscontinuation
Source lines: 1752 - 1756
Type function
Call iscontinuation(p)
Modulescheme_lang
Notes
 Miniscm

ispromise {scheme_lang}

Name of routine: ispromise
Source lines: 1757 - 1761
Type function
Call ispromise(p)
Modulescheme_lang
Notes
 Miniscm

isport {scheme_lang}

Name of routine: isport
Source lines: 1762 - 1766
Type function
Call isport(p)
Modulescheme_lang
Notes
 Miniscm

istrue {scheme_lang}

Name of routine: istrue
Source lines: 1768 - 1772
Type function
Call istrue(p)
Modulescheme_lang
Notes
 true or false value functions

isfalse {scheme_lang}

Name of routine: isfalse
Source lines: 1773 - 1777
Type function
Call isfalse(p)
Modulescheme_lang
Notes
 true or false value functions

isatom {scheme_lang}

Name of routine: isatom
Source lines: 1781 - 1785
Type function
Call isatom(p)
Modulescheme_lang
Notes
 Garbage collection
 

setatom {scheme_lang}

Name of routine: setatom
Source lines: 1786 - 1789
Type subroutine
Call setatom(p)
Modulescheme_lang
Notes
 Garbage collection
 

clratom {scheme_lang}

Name of routine: clratom
Source lines: 1790 - 1793
Type subroutine
Call clratom(p)
Modulescheme_lang
Notes
 Garbage collection
 

ismark {scheme_lang}

Name of routine: ismark
Source lines: 1794 - 1798
Type function
Call ismark(p)
Modulescheme_lang
Notes
 Garbage collection
 

setmark {scheme_lang}

Name of routine: setmark
Source lines: 1799 - 1802
Type subroutine
Call setmark(p)
Modulescheme_lang
Notes
 Garbage collection
 

clrmark {scheme_lang}

Name of routine: clrmark
Source lines: 1803 - 1806
Type subroutine
Call clrmark(p)
Modulescheme_lang
Notes
 Garbage collection
 

cons {scheme_lang}

Name of routine: cons
Source lines: 1810 - 1817
Type function
Call cons(reg1, reg2)
Modulescheme_lang
Notes
 Cons

ceqstr {scheme_lang}

Name of routine: ceqstr
Source lines: 1821 - 1838
Type function
Call ceqstr(cstr, reg)
Modulescheme_lang
Notes
 Contents of a Lisp string cell equal to a Fortran string

streq {scheme_lang}

Name of routine: streq
Source lines: 1842 - 1858
Type function
Call streq(a, b)
Modulescheme_lang
Notes
 Contents of a Lisp string equal to a Lisp string 

mk_number {scheme_lang}

Name of routine: mk_number
Source lines: 1862 - 1870
Type function
Call mk_number(num)
Modulescheme_lang
Notes
 Declare a number

mk_string {scheme_lang}

Name of routine: mk_string
Source lines: 1874 - 1882
Type function
Call mk_string(nam)
Modulescheme_lang
Notes
 Declare a string

mk_symbol {scheme_lang}

Name of routine: mk_symbol
Source lines: 1886 - 1902
Type function
Call mk_symbol(nam)
Modulescheme_lang
Notes
 Declare a symbol

mk_atom {scheme_lang}

Name of routine: mk_atom
Source lines: 1906 - 1935
Type function
Call mk_atom(str)
Modulescheme_lang
Notes
 make symbol or number atom from string

mk_const {scheme_lang}

Name of routine: mk_const
Source lines: 1939 - 1951
Type function
Call mk_const(nam)
Modulescheme_lang
Notes
 
 Make a constant

mk_closure {scheme_lang}

Name of routine: mk_closure
Source lines: 1955 - 1964
Type function
Call mk_closure(c, e)
Modulescheme_lang
Notes
 make closure, c is code, e is environment

mk_continuation {scheme_lang}

Name of routine: mk_continuation
Source lines: 1968 - 1976
Type function
Call mk_continuation(d)
Modulescheme_lang
Notes
 make continuation

mk_port {scheme_lang}

Name of routine: mk_port
Source lines: 1980 - 1990
Type function
Call mk_port(iport, nam)
Modulescheme_lang
Notes
 make a port

test_port {scheme_lang}

Name of routine: test_port
Source lines: 1993 - 2004
Type function
Call test_port(iport)
Modulescheme_lang
Notes
 Test a port - return location in portaddress

reverse {scheme_lang}

Name of routine: reverse
Source lines: 2008 - 2023
Type function
Call reverse(a)
Modulescheme_lang
Notes
 Reverse list

non_alloc_rev {scheme_lang}

Name of routine: non_alloc_rev
Source lines: 2027 - 2043
Type function
Call non_alloc_rev(term, list)
Modulescheme_lang
Notes
 Reverse list -- no new cell generated

append {scheme_lang}

Name of routine: append
Source lines: 2047 - 2063
Type function
Call append(a, b)
Modulescheme_lang
Notes
 append list -- make new cells

eqv {scheme_lang}

Name of routine: eqv
Source lines: 2067 - 2082
Type function
Call eqv(a, b)
Modulescheme_lang
Notes
 equivalence of atoms

inchar {scheme_lang}

Name of routine: inchar
Source lines: 2086 - 2104
Type subroutine
Call inchar(ch)
Modulescheme_lang
Notes
 get a new character from input file or stdin

clearinput {scheme_lang}

Name of routine: clearinput
Source lines: 2108 - 2110
Type subroutine
Call clearinput()
Modulescheme_lang
Notes
 clear input buffer

flushinput {scheme_lang}

Name of routine: flushinput
Source lines: 2114 - 2116
Type subroutine
Call flushinput()
Modulescheme_lang
Notes
 back to standard input

backchar {scheme_lang}

Name of routine: backchar
Source lines: 2120 - 2122
Type subroutine
Call backchar()
Modulescheme_lang
Notes
 backstep one character in input buffer

skipspace {scheme_lang}

Name of routine: skipspace
Source lines: 2126 - 2136
Type subroutine
Call skipspace()
Modulescheme_lang
Notes
 skip whitespace

token {scheme_lang}

Name of routine: token
Source lines: 2140 - 2178
Type function
Call token()
Modulescheme_lang
Notes
 get next token

scheme_delim {scheme_lang}

Name of routine: scheme_delim
Source lines: 2182 - 2191
Type function
Call scheme_delim(ch)
Modulescheme_lang
Notes
 read characters to delimiter  -- hard coded to work on Windows as well

readstr {scheme_lang}

Name of routine: readstr
Source lines: 2193 - 2208
Type subroutine
Call readstr(res)
Modulescheme_lang
Notes
 Miniscm

readstrexp {scheme_lang}

Name of routine: readstrexp
Source lines: 2212 - 2235
Type subroutine
Call readstrexp(res, reslen)
Modulescheme_lang
Notes
 read rest of a quoted string

printatom {scheme_lang}

Name of routine: printatom
Source lines: 2239 - 2269
Type subroutine
Call printatom(l)
Modulescheme_lang
Notes
 print an atom

ok_abbrev {scheme_lang}

Name of routine: ok_abbrev
Source lines: 2271 - 2275
Type function
Call ok_abbrev(x)
Modulescheme_lang
Notes
 Miniscm

s_save {scheme_lang}

Name of routine: s_save
Source lines: 2277 - 2282
Type subroutine
Call s_save(a, b, c)
Modulescheme_lang
Notes
 Miniscm

s_return {scheme_lang}

Name of routine: s_return
Source lines: 2283 - 2291
Type subroutine
Call s_return(a)
Modulescheme_lang
Notes
 Miniscm

s_retbool {scheme_lang}

Name of routine: s_retbool
Source lines: 2292 - 2299
Type subroutine
Call s_retbool(tf)
Modulescheme_lang
Notes
 Miniscm

opexe0 {scheme_lang}

Name of routine: opexe0
Source lines: 2303 - 2590
Type subroutine
Call opexe0(op, inline)
Modulescheme_lang
Notes
 Apply Scheme commands - split into opexe0 to opexe10

opexe1 {scheme_lang}

Name of routine: opexe1
Source lines: 2592 - 2770
Type subroutine
Call opexe1(op)
Modulescheme_lang
Notes
 Miniscm

opexe2 {scheme_lang}

Name of routine: opexe2
Source lines: 2772 - 2937
Type subroutine
Call opexe2(op)
Modulescheme_lang
Notes
 Miniscm

opexe3 {scheme_lang}

Name of routine: opexe3
Source lines: 2939 - 3019
Type subroutine
Call opexe3(op)
Modulescheme_lang
Notes
 Miniscm

opexe4 {scheme_lang}

Name of routine: opexe4
Source lines: 3021 - 3090
Type subroutine
Call opexe4(op, plevel)
Modulescheme_lang
Notes
 Miniscm

opexe5 {scheme_lang}

Name of routine: opexe5
Source lines: 3092 - 3228
Type subroutine
Call opexe5(op, plevel)
Modulescheme_lang
Notes
 Miniscm

opexe6 {scheme_lang}

Name of routine: opexe6
Source lines: 3230 - 3277
Type subroutine
Call opexe6(op)
Modulescheme_lang
Notes
 Miniscm

opexe7 {scheme_lang}

Name of routine: opexe7
Source lines: 3281 - 3304
Type subroutine
Call opexe7(op)
Modulescheme_lang
Notes
 Mathematical functions

opexe8 {scheme_lang}

Name of routine: opexe8
Source lines: 3308 - 3348
Type subroutine
Call opexe8(op)
Modulescheme_lang
Notes
 A few other library functions eg min, max

opexe9 {scheme_lang}

Name of routine: opexe9
Source lines: 3352 - 3509
Type subroutine
Call opexe9(op)
Modulescheme_lang
Notes
 string functions

opexe10 {scheme_lang}

Name of routine: opexe10
Source lines: 3513 - 3746
Type subroutine
Call opexe10(op)
Modulescheme_lang
Notes
 Nonstandard library additions for system interface such as system, readline

mk_syntax {scheme_lang}

Name of routine: mk_syntax
Source lines: 3750 - 3758
Type subroutine
Call mk_syntax(op, nam)
Modulescheme_lang
Notes
 Initialization of internal keywords

mk_proc {scheme_lang}

Name of routine: mk_proc
Source lines: 3760 - 3769
Type subroutine
Call mk_proc(op, nam)
Modulescheme_lang
Notes
 Miniscm

init_vars_global {scheme_lang}

Name of routine: init_vars_global
Source lines: 3773 - 3778
Type subroutine
Call init_vars_global()
Modulescheme_lang
Notes
 Initiate global environment

init_syntax {scheme_lang}

Name of routine: init_syntax
Source lines: 3782 - 3799
Type subroutine
Call init_syntax()
Modulescheme_lang
Notes
 Initiate syntax

init_procs {scheme_lang}

Name of routine: init_procs
Source lines: 3803 - 3890
Type subroutine
Call init_procs()
Modulescheme_lang
Notes
 Initiate procedures

init_scm {scheme_lang}

Name of routine: init_scm
Source lines: 3894 - 3988
Type subroutine
Call init_scm()
Modulescheme_lang
Notes
 Inlined init.scm

init_globals {scheme_lang}

Name of routine: init_globals
Source lines: 3992 - 4003
Type subroutine
Call init_globals()
Modulescheme_lang
Notes
 Initiate procedures

error0 {scheme_lang}

Name of routine: error0
Source lines: 4007 - 4014
Type subroutine
Call error0(s)
Modulescheme_lang
Notes
 Error handling

error1 {scheme_lang}

Name of routine: error1
Source lines: 4016 - 4024
Type subroutine
Call error1(s, a)
Modulescheme_lang
Notes
 Miniscm

init_scheme {scheme_lang}

Name of routine: init_scheme
Source lines: 4026 - 4029
Type subroutine
Call init_scheme()
Modulescheme_lang
Notes
 Miniscm

repl_scheme {scheme_lang}

Name of routine: repl_scheme
Source lines: 4033 - 4100
Type subroutine
Call repl_scheme(inline, ple)
Modulescheme_lang
Notes
 Scheme read-eval-print loop

create_form {formula_class}

Name of routine: create_form
Source lines: 4140 - 4279
Type subroutine
Call create_form(sta, fin, terms, nloci, loc, formula)
Moduleformula_class
Notes
 read commands and write appropriate formula structure

cleanup_form {formula_class}

Name of routine: cleanup_form
Source lines: 4281 - 4292
Type subroutine
Call cleanup_form(formula)
Moduleformula_class
Notes
 Simple regression formula structure and parser

 formula and design matrix
 formula is:   a   b   c   a*b   a*c   b*c  a*b*c
         T1    1   2   3    1     1     2     1
         T2    .   .   .    2     3     3     2
         T3    .   .   .    .     .     .     3
    TERMDIM    1   1   1    2     2     2     3

 Effects       1    2     3
         NLEV  n1   n2    n3
         STA   1    n1+1  n1+n2+1
         FIN   n1   n1+n2 n1+n2+n3
       INFORM  1    1     1       

sumcols_form {formula_class}

Name of routine: sumcols_form
Source lines: 4296 - 4330
Type subroutine
Call sumcols_form(formula)
Moduleformula_class
Notes
 If levels available, evaluate total number of model parameters
 

show_form {formula_class}

Name of routine: show_form
Source lines: 4332 - 4353
Type subroutine
Call show_form(formula)
Moduleformula_class
Notes
 Simple regression formula structure and parser

 formula and design matrix
 formula is:   a   b   c   a*b   a*c   b*c  a*b*c
         T1    1   2   3    1     1     2     1
         T2    .   .   .    2     3     3     2
         T3    .   .   .    .     .     .     3
    TERMDIM    1   1   1    2     2     2     3

 Effects       1    2     3
         NLEV  n1   n2    n3
         STA   1    n1+1  n1+n2+1
         FIN   n1   n1+n2 n1+n2+n3
       INFORM  1    1     1       

setup_props {mcmc_model}

Name of routine: setup_props
Source lines: 4495 - 4499
Type subroutine
Call setup_props(maxsiz)
Modulemcmc_model
Notes
 Allocate or deallocate work arrays

clean_props {mcmc_model}

Name of routine: clean_props
Source lines: 4500 - 4502
Type subroutine
Call clean_props()
Modulemcmc_model
Notes
 Allocate or deallocate work arrays

setup_mix {mcmc_model}

Name of routine: setup_mix
Source lines: 4506 - 4561
Type subroutine
Call setup_mix(ped, dataset, nchain, nqtl, nvar, family)
Modulemcmc_model
Notes
 Allocate a pedigree's data arrays

setup_ibd {ibd_class}

Name of routine: setup_ibd
Source lines: 4597 - 4609
Type subroutine
Call setup_ibd(ped, nobs, nvar, family)
Moduleibd_class
Notes
 Allocate a pedigree's data arrays

setup_table {contingency_table}

Name of routine: setup_table
Source lines: 4639 - 4650
Type subroutine
Call setup_table(ncat, maxcells, table)
Modulecontingency_table
Notes
 allocate space for contingency table

clean_table {contingency_table}

Name of routine: clean_table
Source lines: 4654 - 4664
Type subroutine
Call clean_table(table)
Modulecontingency_table
Notes
 deallocate space

expand_table {contingency_table}

Name of routine: expand_table
Source lines: 4668 - 4691
Type subroutine
Call expand_table(nextra, table)
Modulecontingency_table
Notes
 increase available space

insert_table {contingency_table}

Name of routine: insert_table
Source lines: 4695 - 4754
Type subroutine
Call insert_table(ncat, values, table, iwt)
Modulecontingency_table
Notes
 insert data

search_table {contingency_table}

Name of routine: search_table
Source lines: 4758 - 4796
Type function
Call search_table(ncat, values, table)
Modulecontingency_table
Notes
 Search table

incr_table {contingency_table}

Name of routine: incr_table
Source lines: 4800 - 4806
Type subroutine
Call incr_table(pos, table, iwt)
Modulecontingency_table
Notes
 Increment cell count if correct address already available

print_table {contingency_table}

Name of routine: print_table
Source lines: 4810 - 4818
Type subroutine
Call print_table(table)
Modulecontingency_table
Notes
 print a table

marginal_table {contingency_table}

Name of routine: marginal_table
Source lines: 4822 - 4831
Type subroutine
Call marginal_table(margin, table, martable)
Modulecontingency_table
Notes
 fill a table with marginal counts from another table

flat_table {contingency_table}

Name of routine: flat_table
Source lines: 4835 - 4863
Type subroutine
Call flat_table(mtable1, mtable2, margin1, margin2, table, mat)
Modulecontingency_table
Notes
 fill a marginal RxC table from another table

dim_table {contingency_table}

Name of routine: dim_table
Source lines: 4867 - 4878
Type function
Call dim_table(margin, table)
Modulecontingency_table
Notes
 get dimension of a margin

sort_table {contingency_table}

Name of routine: sort_table
Source lines: 4882 - 4894
Type subroutine
Call sort_table(cat, table)
Modulecontingency_table
Notes
 reorder values in 1-D table to match order in table index

findlev {contingency_table}

Name of routine: findlev
Source lines: 4898 - 4946
Type function
Call findlev(val, table)
Modulecontingency_table
Notes
 factor level based on position in (marginal) 1-D table

findrank {contingency_table}

Name of routine: findrank
Source lines: 4950 - 4969
Type function
Call findrank(val, table)
Modulecontingency_table
Notes
 find rank based on position in 1-D table

setup_pairs {pairlist_class}

Name of routine: setup_pairs
Source lines: 4988 - 4996
Type subroutine
Call setup_pairs(npairs, pairlist)
Modulepairlist_class
Notes
 allocate space for pairlist

clean_pairs {pairlist_class}

Name of routine: clean_pairs
Source lines: 5000 - 5004
Type subroutine
Call clean_pairs(pairlist)
Modulepairlist_class
Notes
 deallocate space

expand_pairs {pairlist_class}

Name of routine: expand_pairs
Source lines: 5008 - 5022
Type subroutine
Call expand_pairs(nextra, pairlist)
Modulepairlist_class
Notes
 increase available space

append_pair {pairlist_class}

Name of routine: append_pair
Source lines: 5026 - 5040
Type subroutine
Call append_pair(key1, key2, pairlist)
Modulepairlist_class
Notes
 
 append data, testing only latest entry for uniqueness

insert_pair {pairlist_class}

Name of routine: insert_pair
Source lines: 5044 - 5092
Type subroutine
Call insert_pair(key1, key2, pairlist)
Modulepairlist_class
Notes
 insert data

find_pair {pairlist_class}

Name of routine: find_pair
Source lines: 5096 - 5135
Type function
Call find_pair(key1, key2, pairlist)
Modulepairlist_class
Notes
 find a pair

clean_AS164 {AS164_class}

Name of routine: clean_AS164
Source lines: 5145 - 5152
Type subroutine
Call clean_AS164()
ModuleAS164_class
Notes
 Work arrays for AS164 -- allow passing of results to other routines

popgen_init {popgen_vcdata}

Name of routine: popgen_init
Source lines: 5181 - 5185
Type subroutine
Call popgen_init()
Modulepopgen_vcdata
Notes
 Cockerham-like multi-locus variance components

popgen_summary {popgen_vcdata}

Name of routine: popgen_summary
Source lines: 5186 - 5201
Type subroutine
Call popgen_summary(outstr, plevel)
Modulepopgen_vcdata
Notes
 Cockerham-like multi-locus variance components

popgen_homoz {popgen_vcdata}

Name of routine: popgen_homoz
Source lines: 5202 - 5215
Type subroutine
Call popgen_homoz(outstr, plevel)
Modulepopgen_vcdata
Notes
 Cockerham-like multi-locus variance components

pre_grapheps {grapheps}

Name of routine: pre_grapheps
Source lines: 5224 - 5555
Type subroutine
Call pre_grapheps(outstr, xbound, ybound)
Modulegrapheps
Notes
 The grapheps Postscript functions
 See http://swiss.csail.mit.edu/~jaffer/Docupage/grapheps

xy_grapheps {grapheps}

Name of routine: xy_grapheps
Source lines: 5561 - 5654
Type subroutine
Call xy_grapheps(outstr, nvals, xvals, yvals, xlab, ylab, title, gstyle, gratio, typ)
Modulegrapheps
Notes
 Draw simple plot

 typ 1=scatterplot 2=jittered dotplot 3=mountain 4=bargraph

countargs

Name of routine: countargs
Source lines: 12242 - 12312
Type function
Call countargs(s, typ)
ModuleNone
Notes
 count arguments in input string s

 typ=1  whitespace separated
 typ=2  whitespace separated or reserved character (id by opchar())
 typ=3  whitespace or slash separated (so genotypes can be written a/b) ped data
 typ=4  whitespace or slash separated (so genotypes can be written a/b) case data

args

Name of routine: args
Source lines: 12322 - 12409
Type subroutine
Call args(s, narg, arg, typ)
ModuleNone
Notes

 extracts narg arguments from input string s

 typ=1  whitespace separated
 typ=2  whitespace separated or reserved character (id by opchar())
 typ=3  whitespace or slash separated (so genotypes can be written a/b) ped data
 typ=4  whitespace or slash separated (so genotypes can be written a/b) case data

getword

Name of routine: getword
Source lines: 12413 - 12471
Type subroutine
Call getword(s, which, word)
ModuleNone
Notes
 extracts the nth whitespace-separated argument from input string s

opchar

Name of routine: opchar
Source lines: 12475 - 12485
Type function
Call opchar(ch)
ModuleNone
Notes
 is a reserved character for primitives?  "()*+-/<=>^:"

nextcmd

Name of routine: nextcmd
Source lines: 12490 - 12548
Type subroutine
Call nextcmd(commands, numcmd, linlen, s, more)
ModuleNone
Notes
 count number of commands on line and delineate next command 
 (using position of ";"'s) to be evaluated

ival

Name of routine: ival
Source lines: 12552 - 12571
Type function
Call ival(string)
ModuleNone
Notes
 character to integer conversion via internal read

fval

Name of routine: fval
Source lines: 12575 - 12600
Type function
Call fval(string)
ModuleNone
Notes
 character to float conversion via internal read

aval

Name of routine: aval
Source lines: 12604 - 12642
Type function
Call aval(string)
ModuleNone
Notes
 read allele values either numeric or letter code

locfmt

Name of routine: locfmt
Source lines: 12646 - 12673
Type subroutine
Call locfmt(str, rep, newtyp)
ModuleNone
Notes
 Read simplified locus declaration eg 10m 10 m -> 10 autosomal markers

sow

Name of routine: sow
Source lines: 12677 - 12687
Type function
Call sow(string)
ModuleNone
Notes
 skip leading whitespace

eow

Name of routine: eow
Source lines: 12691 - 12700
Type function
Call eow(string)
ModuleNone
Notes
 find end of string

sclean

Name of routine: sclean
Source lines: 12704 - 12712
Type subroutine
Call sclean(string)
ModuleNone
Notes
 scrub non-ASCII characters

ismiss

Name of routine: ismiss
Source lines: 12716 - 12720
Type function
Call ismiss(string)
ModuleNone
Notes
  See if a string is a missing value

isreal

Name of routine: isreal
Source lines: 12724 - 12743
Type function
Call isreal(string)
ModuleNone
Notes
  See if a string is a valid double precision number

wrsex

Name of routine: wrsex
Source lines: 12747 - 12756
Type subroutine
Call wrsex(sex,ch)
ModuleNone
Notes
  
 write sex as character
  

wrdate

Name of routine: wrdate
Source lines: 12760 - 12773
Type subroutine
Call wrdate(date,str,typ)
ModuleNone
Notes
 write date as character

wraff

Name of routine: wraff
Source lines: 12777 - 12788
Type subroutine
Call wraff(value, ch, typ)
ModuleNone
Notes
  
 binary trait as character
  

wrform

Name of routine: wrform
Source lines: 12792 - 12806
Type subroutine
Call wrform(typ, nwid, ndec, fstring)
ModuleNone
Notes
 Fortran format statement to write one number

idwidths

Name of routine: idwidths
Source lines: 12810 - 12838
Type subroutine
Call idwidths(dataset, widths, name_formats)
ModuleNone
Notes
 Get maximum lengths of ID strings

phist

Name of routine: phist
Source lines: 12842 - 12858
Type subroutine
Call phist(pval1, pval2, histo)
ModuleNone
Notes
  
 write P-values as a histogram: . + * ** ***
  

annotate

Name of routine: annotate
Source lines: 12862 - 12884
Type subroutine
Call annotate(sta, fin, words, note)
ModuleNone
Notes
 copy words to a string

append

Name of routine: append
Source lines: 12888 - 12898
Type subroutine
Call append(word, note)
ModuleNone
Notes
 append one word to a string if enough room

addlet

Name of routine: addlet
Source lines: 12903 - 12913
Type subroutine
Call addlet(old, new)
ModuleNone
Notes
  
 prepend "x" to a string if starts with an integer
 Loki and R for example do not allow variable names that start with a digit
  

shorten

Name of routine: shorten
Source lines: 12918 - 12959
Type subroutine
Call shorten(idx, nwords, words, newlen, res)
ModuleNone
Notes
  
 create a shorter unique version of a string eg locus name
 Old versions of MENDEL for instance wants 8 character locus names
  

makeind

Name of routine: makeind
Source lines: 12964 - 13010
Type subroutine
Call makeind(typ, idx, eos, los, string)
ModuleNone
Notes
  
 hash an integer to a two character string 01-99,A-Z,a-z,a-z...
 append to name: typ=1, appended with underscore; typ=2, appended directly
  

mknewfil

Name of routine: mknewfil
Source lines: 13014 - 13027
Type subroutine
Call mknewfil(str, filnam, wrkdir)
ModuleNone
Notes
  
 Create a new file (deleting old instances of that name
  

openlog

Name of routine: openlog
Source lines: 13031 - 13055
Type subroutine
Call openlog(lstr, logfil, nhis)
ModuleNone
Notes
 Open the standard log file "sib-pair.log"

findfile

Name of routine: findfile
Source lines: 13059 - 13088
Type subroutine
Call findfile(fil, stat)
ModuleNone
Notes
 Find a file along the search path -- check pwd, then HOME first

reclen

Name of routine: reclen
Source lines: 13095 - 13117
Type subroutine
Call reclen(strm, buffer, longest)
ModuleNone
Notes
 Return longest line of file
 Use lin as buffer
 Relies on iostat=-2 as eol

fchooser

Name of routine: fchooser
Source lines: 13123 - 13175
Type subroutine
Call fchooser(fil, gui, plevel)
ModuleNone
Notes
 GUI stuff
 Uses JAPI to call AWT, or PILIB to call GTK2 if present
 else simple file picker

fpicker

Name of routine: fpicker
Source lines: 13180 - 13284
Type subroutine
Call fpicker(fil, plevel)
ModuleNone
Notes
 Text based Windows file picker

fpicker

Name of routine: fpicker
Source lines: 13289 - 13371
Type subroutine
Call fpicker(fil, plevel)
ModuleNone
Notes
 Text based file picker

info

Name of routine: info
Source lines: 13376 - 13434
Type subroutine
Call info(lin, burnin, imp, iter, initix, initiy, initiz, ix, iy, iz, mapf, mincnt, plevel, showorig, addsex, chek, droperr, prompt, use2, gui, twintrait, sexmarker, datdir, version, wrkdir)
ModuleNone
Notes
 Info

help

Name of routine: help
Source lines: 13438 - 13828
Type subroutine
Call help(typ, regexp, lin, twrk)
ModuleNone
Notes
  
 brief online help
  

shell

Name of routine: shell
Source lines: 13832 - 13861
Type subroutine
Call shell(lin, plevel)
ModuleNone
Notes
 pass line to shell -- requires existence of fairly
                       standard routine system()

stamp

Name of routine: stamp
Source lines: 13865 - 13885
Type subroutine
Call stamp(t0)
ModuleNone
Notes
  
 write elapsed time since first/last asked
  

proct

Name of routine: proct
Source lines: 13889 - 13899
Type subroutine
Call proct(t1, plevel)
ModuleNone
Notes
  
 time a procedure
  

gettrait

Name of routine: gettrait
Source lines: 13905 - 13955
Type subroutine
Call gettrait(nam, typ1, typ2, nloci, loc, loctyp, trait, plevel)
ModuleNone
Notes
  
 determine if word is name of a trait locus
 typ1=10, any locus type
 typ1,typ2=1..5, that locus type only
  

isinuse

Name of routine: isinuse
Source lines: 13959 - 13988
Type function
Call isinuse(string, nloci, loc)
ModuleNone
Notes
  
 check if name is not already used or reserved
  

getbin

Name of routine: getbin
Source lines: 13992 - 14045
Type subroutine
Call getbin(sta, fin, words, nloci, loc, loctyp, trait, gt, thresh)
ModuleNone
Notes
  
 Get a single binary trait or dichotomized quantitative trait
  

loadnam

Name of routine: loadnam
Source lines: 14055 - 14228
Type subroutine
Call loadnam(sta, fin, words, nloci, loc, loctyp, map, chosen, nterms, terms, filter, typ)
ModuleNone
Notes
 
 Load list of traits into an array

 allows wild cards and spans
 filter= selection must also be of class eg LOC_CODOM, LOC_ANY
 typ=1 active loci, =2 inactive loci, =3 all loci (used by ls etc)

 output both as list (terms) and as index vector (chosen)
 

listloci

Name of routine: listloci
Source lines: 14232 - 14297
Type subroutine
Call listloci(nord, locord, nloci, loc, loctyp, locpos, locnotes, typ)
ModuleNone
Notes
 List loci

newlin

Name of routine: newlin
Source lines: 14301 - 14318
Type subroutine
Call newlin(sol, eol, pos, newpos)
ModuleNone
Notes
  
 format free output

cntclasses

Name of routine: cntclasses
Source lines: 14322 - 14358
Type subroutine
Call cntclasses(nloci, loctyp)
ModuleNone
Notes
  
 Output counts of class of loci
  

cntmark

Name of routine: cntmark
Source lines: 14362 - 14380
Type subroutine
Call cntmark(nloci, loctyp, nmark, typ)
ModuleNone
Notes
  
 Count active codominant markers or active loci
  

findmk

Name of routine: findmk
Source lines: 14384 - 14402
Type function
Call findmk(sta, fin, loctyp)
ModuleNone
Notes
  
 Find next active codominant marker in list
  

findml

Name of routine: findml
Source lines: 14406 - 14423
Type function
Call findml(nord, locord, loctyp)
ModuleNone
Notes
  
 Find first codominant or haploid marker in list
  

ldlist

Name of routine: ldlist
Source lines: 14428 - 14485
Type subroutine
Call ldlist(typ, loc1, loc2, nloci, loctyp, last)
ModuleNone
Notes
 produce next pair of markers from:
     1. named pair 2. One named 3. map order 4. all pairs 10. empty

complete

Name of routine: complete
Source lines: 14489 - 14513
Type function
Call complete(useimp, idx, nvar, terms, locpos, loctyp, dataset)
ModuleNone
Notes
  
 test if complete data for this individual
  

getlin

Name of routine: getlin
Source lines: 14517 - 14539
Type subroutine
Call getlin(strm, narg, words, lin, skipbl)
ModuleNone
Notes
  
 Get a line from the stream
  

rdmerloc

Name of routine: rdmerloc
Source lines: 14543 - 14624
Type subroutine
Call rdmerloc(strm, xli, lin, nloci, loc, locpos, loctyp, locnotes, numloc, twinning, twintype, twintrait)
ModuleNone
Notes
  
 Read a MERLIN locus file
  

readmap

Name of routine: readmap
Source lines: 14629 - 14817
Type subroutine
Call readmap(strm, units, lin, words, nloci, loc, loctyp, locnotes, map, plevel)
ModuleNone
Notes
  
 Read a mapfile -- attempts to intelligently decide
 what to read
  

rdlinloc

Name of routine: rdlinloc
Source lines: 14821 - 15013
Type subroutine
Call rdlinloc(strm, lin, words, numloc)
ModuleNone
Notes
  
 Read a Linkage locus file
  

rdfreq

Name of routine: rdfreq
Source lines: 15018 - 15098
Type subroutine
Call rdfreq(sta, fin, words, allele_buffer)
ModuleNone
Notes
 read a set of allele frequencies from the command line
 make up some numbers if necessary

ordvar

Name of routine: ordvar
Source lines: 15102 - 15143
Type subroutine
Call ordvar(twrk, nloci, loc, loctyp, locpos, nord, locord, map, locstat, locnotes, ord)
ModuleNone
Notes
  
 Make change in order of variables
  

packer

Name of routine: packer
Source lines: 15147 - 15255
Type subroutine
Call packer(typ, wrk, wrk2, nloci, loc, loctyp, locpos, map, locnotes, dataset, plevel)
ModuleNone
Notes
 pack pedigrees and loci

chfind

Name of routine: chfind
Source lines: 15259 - 15279
Type function
Call chfind(string, ch)
ModuleNone
Notes
 
 find an unescaped character in a string
 

strfind

Name of routine: strfind
Source lines: 15284 - 15363
Type function
Call strfind(regexp, targt, nocase)
ModuleNone
Notes
 
 Compare string to a search string, allowing wildcards '*.', and case
 matching
 

escape

Name of routine: escape
Source lines: 15367 - 15393
Type subroutine
Call escape(str, trget)
ModuleNone
Notes
 Escape a target character, usually "

string_hash

Name of routine: string_hash
Source lines: 15397 - 15408
Type function
Call string_hash(str, ibound)
ModuleNone
Notes
 String hash function (that used by SRFI-64)

bonf

Name of routine: bonf
Source lines: 15412 - 15421
Type function
Call bonf(ntest,alpha)
ModuleNone
Notes
 Calculate Bonferroni corrected P-value for given number of tests

dsort

Name of routine: dsort
Source lines: 15426 - 15545
Type subroutine
Call dsort(n, dx)
ModuleNone
Notes
  
 SLATEC quicksort routine.  Jones, Kahaner and Wisniewski.
 double precision
  

srank

Name of routine: srank
Source lines: 15552 - 15714
Type subroutine
Call srank(n, x, iy)
ModuleNone
Notes
  
 SLATEC quicksort routine.  Jones, Kahaner and Wisniewski.
 here allowing for a missing value indicator, and carrying an indicator along
 pulls down the missing data.  To sort test statistics retaining a pointer
 to the variable name

iscomp

Name of routine: iscomp
Source lines: 16110 - 16118
Type function
Call iscomp(op)
ModuleNone
Notes
  
 determine if trait being compared to a constant, for isaff
  

docomp

Name of routine: docomp
Source lines: 16124 - 16168
Type subroutine
Call docomp(pos, words, gt, thresh)
ModuleNone
Notes
  
 parse comparison in isaff
 15='<', 16='>', 17='ge', 18='le',19='ne',20='eq'
 21='odd', 22='even'
  

defpro

Name of routine: defpro
Source lines: 16172 - 16193
Type subroutine
Call defpro(gt, thresh)
ModuleNone
Notes
  
 Message defining proband based on comparison
  

isaff

Name of routine: isaff
Source lines: 16197 - 16229
Type function
Call isaff(val, thresh, gt)
ModuleNone
Notes
  
 determine if index person is affected or unaffected
  

isatwin

Name of routine: isatwin
Source lines: 16233 - 16241
Type function
Call isatwin(twintype, twinind)
ModuleNone
Notes
 Is an MZ twin?

order

Name of routine: order
Source lines: 16245 - 16254
Type subroutine
Call order(all1, all2)
ModuleNone
Notes
 swap alleles so ordered consistently

swap

Name of routine: swap
Source lines: 16258 - 16266
Type subroutine
Call swap(all1, all2)
ModuleNone
Notes
  
 swap alleles
  

lorder

Name of routine: lorder
Source lines: 16278 - 16346
Type subroutine
Call lorder(typ, addummy, liab, liabclass, nloci, loctyp, nord, locord)
ModuleNone
Notes
 Create order of loci for outputting a pedigree
  1 = as is
  2 = LINKAGE
  3 = GENEHUNTER
  4 = MENDEL
  5 = LINKAGE PPD
  6 = FBAT
  7 = MERLIN
  

isinenv

Name of routine: isinenv
Source lines: 16350 - 16361
Type function
Call isinenv(word,nvar,envnam)
ModuleNone
Notes
 Is a bound environmental variable? and if so where?

readcases

Name of routine: readcases
Source lines: 16367 - 16593
Type subroutine
Call readcases(strm, hassex, skipline, numloc, locord, dataset, longnam, longest, nwarn, plevel)
ModuleNone
Notes
 Read file containing just unrelated individuals
 Duplicates (if contiguous) are combined into the same "family"
 with appended copy numbers

readpeds

Name of routine: readpeds
Source lines: 16597 - 16963
Type subroutine
Call readpeds(strm, wrk, wrk2, addsex, skipline, link, unspecified, numloc, locord, dataset, longnam, longest, nwarn, plevel)
ModuleNone
Notes
 Read pedigree file

processfam

Name of routine: processfam
Source lines: 16967 - 17155
Type subroutine
Call processfam(wrk, wrk2, addsex, nped, pedigree, num, nfound, numloc, nobs, buffer, nid, higen, ord, key1, key2, plevel)
ModuleNone
Notes
 All members of pedigree now read in, error check and sort

tabid

Name of routine: tabid
Source lines: 17159 - 17199
Type subroutine
Call tabid(curid, nid, indx, id, counts, incr, idpos)
ModuleNone
Notes
  
 Tabulate alphanumeric IDs in order of appearance
  

famsort

Name of routine: famsort
Source lines: 17206 - 17369
Type subroutine
Call famsort(pedigree, num, nfound, nid, id, pid, fa, mo, key1, ord, higen, nerr, plevel)
ModuleNone
Notes
 
 Work out generation number ord(), then sort family on
 founder status, generation number, parental ID,
 and personal ID giving their position in ord().
 Returns the ranking in ord(), and the depth of the pedigree in higen
 

msdsort

Name of routine: msdsort
Source lines: 17373 - 17396
Type subroutine
Call msdsort(bot,top,key1,key2,ord)
ModuleNone
Notes
  
 MSD radix sort key1, key2
  

mkdummy

Name of routine: mkdummy
Source lines: 17400 - 17428
Type subroutine
Call mkdummy(num, nfound, sx, addsex, numloc, buffer)
ModuleNone
Notes
 Create dummy records for added individals

asstyp

Name of routine: asstyp
Source lines: 17432 - 17452
Type subroutine
Call asstyp(nloci, loctyp, locpos, numloc, coltyp)
ModuleNone
Notes
 Assign a locus type to every column of data file

addvar

Name of routine: addvar
Source lines: 17456 - 17505
Type subroutine
Call addvar(wrk, wrk2, newloc, dataset, plevel)
ModuleNone
Notes
  
 Add extra blank columns to the dataset
  

wrkout

Name of routine: wrkout
Source lines: 17509 - 17539
Type subroutine
Call wrkout(wrk, wrk2, ped, dataset, nped, nobs)
ModuleNone
Notes
 Write out current pedigree to a work file, updating number of records

pedin

Name of routine: pedin
Source lines: 17545 - 17592
Type subroutine
Call pedin(wrk, wrk2, nped, nobs, numloc, numcol, dataset)
ModuleNone
Notes
 Read pedigree back in from work files
 May allocate extra blank columns in dataset%locus for later use
   by numcol > numloc

replacedata

Name of routine: replacedata
Source lines: 17599 - 17781
Type subroutine
Call replacedata(wrk, nloci, loc, loctyp, locpos, chosen, lin, words, hashtab, dataset, plevel)
ModuleNone
Notes
 Read in data updates from a file
 file format: ped id loc1 loc2 ... locN, with header giving locus names
 uses hash to match up ids in file and current dataset
 and linear search to match locus names in file to current dataset

concat

Name of routine: concat
Source lines: 17785 - 17804
Type subroutine
Call concat(dirnam, filnam)
ModuleNone
Notes
 Prefix filnam

slash

Name of routine: slash
Source lines: 17809 - 17825
Type subroutine
Call slash(dirnam, lend)
ModuleNone
Notes
 Test what character used to separate directories
 and append to directory

display

Name of routine: display
Source lines: 17829 - 17856
Type subroutine
Call display(str)
ModuleNone
Notes
 Print a string, stripping out C-style escapes

cat

Name of routine: cat
Source lines: 17860 - 17878
Type subroutine
Call cat(strm, fil, linbuf)
ModuleNone
Notes
 Display contents of a file

wrmap

Name of routine: wrmap
Source lines: 17898 - 18132
Type subroutine
Call wrmap(ostr, typ, mapf, nloci, loc, loctyp, locnotes, nord, locord, map)
ModuleNone
Notes
  
 Write map
  
 10 = table for Sib-pair output
  0 = LINKAGE
  1 = LINKAGE plus dummy binary trait
  2 = GENEHUNTER plus dummy binary trait
  3 = GENEHUNTER
  4 = MENDEL
 14 = MENDEL free format
 20 = MENDEL .var file
  5 = ASPEX
  6 = MERLIN
  7 = LOKI
  8 = STRUCTURE
  9 = SOLAR
 11 = MORGAN
 12 = Haploview
  

pedhead

Name of routine: pedhead
Source lines: 18136 - 18210
Type subroutine
Call pedhead(name_widths, name_formats, nwid, nloci, loc, loctyp)
ModuleNone
Notes
 
 Write out pedigree header with locus names
 

pedout

Name of routine: pedout
Source lines: 18214 - 18379
Type subroutine
Call pedout(strm, typ, imp, nwid, ndec, misval, nrc, skip, nloci, loc, loctyp, locpos, dataset)
ModuleNone
Notes
 
 Write out GAS style pedigree

wrlink

Name of routine: wrlink
Source lines: 18396 - 18618
Type subroutine
Call wrlink(strm, typ, imp, addummy, liabclass, renumall, twinning, twintype, nwid, ndec, nloci, loctyp, locpos, nord, locord, dataset)
ModuleNone
Notes
 
 write out Linkage type file pre- or post- Makeped style

 style     typ property
 --------- --- --------
 lin, pre  1
 ppd       2   extra pedigree pointer fields
 gh        3   MISS='-', ordering binary_trait1, marker1...markerN, quantitative traits
 asp, tcl  4   marker names prepended to file
 hap       5   SNP alleles coded ACGT 1234
 mer       6   If present, zygosity indicator in column 6: 1,3,5...for each MZ set
 
 pre: ped id fa mo sex ...
 ppd: ped.n id.n fa.n mo.n child1.n patsibid.n matsibid.n sex proband.n ...
      where ped.n, id.n are sequential numerical ID number
 

wrphe

Name of routine: wrphe
Source lines: 18624 - 18688
Type subroutine
Call wrphe(strm, imp, nwid, ndec, nloci, loc, loctyp, locpos, dataset)
ModuleNone
Notes
  
 write out Mapmaker-Sibs/FBAT/etc phenotype file
 whitespace delimited ped id trait1...traitN  
 write out Mapmaker-Sibs phenotype file
  

wrcsv

Name of routine: wrcsv
Source lines: 18701 - 18902
Type subroutine
Call wrcsv(strm, typ, imp, nwid, ndec, sep, twinning, twintype, nloci, loc, loctyp, locpos, nord, locord, dataset)
ModuleNone
Notes
  
  
 Write out pedigree as character-delimited
 typ
 1   full pedigree
 2   id,fa,mo,sex,ped,mztwin,hhid (for SOLAR)
 3   ped, id, phenotype_data
 4   id, phenotype_data
 5   ped, id, genotype_data
 6   id, genotype_data
 10  full pedigree with mztwin, na=' ' (for MENDEL 8.0)
  

wrmorg

Name of routine: wrmorg
Source lines: 18909 - 19064
Type subroutine
Call wrmorg(strm, typ, nwid, ndec, nloci, loc, loctyp, locpos, smlfreq, smlpen, dataset)
ModuleNone
Notes
  
 Write out pedigree for Morgan
 typ
 1   pedigree and traits
 2   id, markers
  

wrdot

Name of routine: wrdot
Source lines: 19068 - 19137
Type subroutine
Call wrdot(strm, trait, gene, dataset)
ModuleNone
Notes
  
 Describe pedigree using dot graphics language
  

wrprd

Name of routine: wrprd
Source lines: 19141 - 19186
Type subroutine
Call wrprd(strm, typ, trait, nloci, loc, loctyp, locpos, dataset)
ModuleNone
Notes
 write out data file used by Jonathon Pritchard's structure program

wrbeagle

Name of routine: wrbeagle
Source lines: 19190 - 19259
Type subroutine
Call wrbeagle(strm, typ, nloci, loc, loctyp, locpos, dataset)
ModuleNone
Notes
 write out data file used by Browning and Browning's Beagle program

wrpap

Name of routine: wrpap
Source lines: 19263 - 19390
Type subroutine
Call wrpap(trip, phen, nloci, loc, loctyp, locpos, dataset)
ModuleNone
Notes
 Write out old-style PAP pedigree

simdata

Name of routine: simdata
Source lines: 19395 - 19455
Type subroutine
Call simdata(strm, nped, ngen, nminoff, nmaxoff, numloc)
ModuleNone
Notes
 end-of-wrpap

 Write a file of simulated pedigrees

showdata

Name of routine: showdata
Source lines: 19459 - 19523
Type subroutine
Call showdata(fped, fid, larg, words, nloci, loc, loctyp, locpos, dataset, nwid, ndec)
ModuleNone
Notes
  
 Write out data for particular pedigree or particular person
  

wrind

Name of routine: wrind
Source lines: 19527 - 19587
Type subroutine
Call wrind(idx, nloci, loc, loctyp, locpos, dataset, nwid, ndec)
ModuleNone
Notes
  
 Write out data for an individual
  

prdata

Name of routine: prdata
Source lines: 19591 - 19635
Type subroutine
Call prdata(idx, sta, fin, typ, nloci, loc, loctyp, locpos, dataset)
ModuleNone
Notes
  
 Print subset of data for an individual -- for messages
  

prgtp

Name of routine: prgtp
Source lines: 19639 - 19652
Type subroutine
Call prgtp(idx, gene, dataset, gtp)
ModuleNone
Notes
 print one genotype from dataset

wrid

Name of routine: wrid
Source lines: 19657 - 19677
Type subroutine
Call wrid(just, id, chid, sx)
ModuleNone
Notes
  
 Write id as justified (l,c,r) string, possibly indicating sex
 as male [101] or female (102)
  

decgtp

Name of routine: decgtp
Source lines: 19681 - 19694
Type subroutine
Call decgtp(value, g1, g2)
ModuleNone
Notes
  
 Decode genotype code
  

encgtp

Name of routine: encgtp
Source lines: 19698 - 19708
Type function
Call encgtp(a1, a2)
ModuleNone
Notes
 Hash a genotype
  

iencgtp

Name of routine: iencgtp
Source lines: 19712 - 19724
Type function
Call iencgtp(a1, a2)
ModuleNone
Notes
 Hash an integer genotype
  

wrpercent

Name of routine: wrpercent
Source lines: 19728 - 19738
Type function
Call wrpercent(num, den)
ModuleNone
Notes
 Write out a percentage

wrtrait

Name of routine: wrtrait
Source lines: 19742 - 19790
Type subroutine
Call wrtrait(value, str, typ, nwid, ndec)
ModuleNone
Notes
  
 Write out trait value to a string
  

wrgtp

Name of routine: wrgtp
Source lines: 19794 - 19841
Type subroutine
Call wrgtp(all1, all2, gtp, typ)
ModuleNone
Notes
 Write out a genotype

wrall

Name of routine: wrall
Source lines: 19845 - 19862
Type subroutine
Call wrall(iall, allel)
ModuleNone
Notes
 Write an allele 

juststr

Name of routine: juststr
Source lines: 19866 - 19890
Type subroutine
Call juststr(just,string,length)
ModuleNone
Notes
 Justify a string of characters within a string

ascend

Name of routine: ascend
Source lines: 19894 - 19901
Type subroutine
Call ascend(n, ia)
ModuleNone
Notes
 
 Initialize array with value of index
 

connect

Name of routine: connect
Source lines: 19905 - 20004
Type subroutine
Call connect(num, fa, mo, set, nsub, maxgrp)
ModuleNone
Notes
 See if all members of a pedigree are connected

addlist

Name of routine: addlist
Source lines: 20009 - 20019
Type subroutine
Call addlist(pos, idx, set)
ModuleNone
Notes
 Shift an individual from the list of ungrouped individuals
 to the appropriate group (subpedigree) nucleating around the index person.

findlist

Name of routine: findlist
Source lines: 20023 - 20038
Type subroutine
Call findlist(trget, num, set, pos)
ModuleNone
Notes
 Find list number <target>

badloop

Name of routine: badloop
Source lines: 20042 - 20110
Type subroutine
Call badloop(pedigree, num, id, key, fa, mo, nerr)
ModuleNone
Notes
 Find pathological loops in current pedigree

wrsubped

Name of routine: wrsubped
Source lines: 20114 - 20152
Type subroutine
Call wrsubped(pedigree, num, id, key, set, nsub, maxgrp, plevel)
ModuleNone
Notes
 List the members of pedigree(s)

gener

Name of routine: gener
Source lines: 20158 - 20328
Type subroutine
Call gener(pedigree, num, fa, mo, nsub, set, ord, higen, nerr, plevel)
ModuleNone
Notes
 Work out generation number ord().
 Visit every person in each subpedigree in turn.
 The missing value for generation must be a large negative value.

dogen

Name of routine: dogen
Source lines: 20333 - 20469
Type subroutine
Call dogen(dataset, trait, typ, plevel)
ModuleNone
Notes
 Write out pedigrees as list of nuclear families plus marry-ins by
 generation number

wrgen

Name of routine: wrgen
Source lines: 20474 - 20531
Type subroutine
Call wrgen(ped, dataset, curped, set, higen, ord)
ModuleNone
Notes
 Write out structure and generation numbers
   List of sibships by generation number

tidydata

Name of routine: tidydata
Source lines: 20535 - 20584
Type subroutine
Call tidydata(nloci, loctyp, locpos, dataset, tottyp)
ModuleNone
Notes
 Round up allele sizes etc

duplicates

Name of routine: duplicates
Source lines: 20588 - 20627
Type subroutine
Call duplicates(dataset, plevel)
ModuleNone
Notes
 Check for duplicate pedigrees or records

showdups

Name of routine: showdups
Source lines: 20631 - 20659
Type subroutine
Call showdups(pos, ncopies, pedname, pedpos, dataset, plevel)
ModuleNone
Notes
 Print the duplicates for current pedigree

testhap

Name of routine: testhap
Source lines: 20663 - 20861
Type subroutine
Call testhap(typ, nloci, loc, loctyp, locpos, dataset, inconsist, plevel)
ModuleNone
Notes
 Check haploid markers 1=Y 2=Mit

testsex

Name of routine: testsex
Source lines: 20884 - 21076
Type subroutine
Call testsex(sexcrit, sexmarker, nloci, loc, loctyp, locpos, dataset, allele_buffer, inconsist, plevel)
ModuleNone
Notes
 Check sex using sex-linked markers assuming false het call rate z

 Male outcomes     A        AB         B
                 p(1-z)     z         q(1-z)

 Female outcomes   A        AB         BB
                pp(1-z) 2pq+z(1-2pq)  qq(1-z)

 LR(G=AB) = Pr(AB|Sex=M)/Pr(AB|Sex=Female)
                  z
          = -----------------------
               2pq+z(1-2pq)
          = z/(2pq+z(1-2pq))

 LR(G=AA) = Pr(A|Sex=M)/Pr(AA|Sex=Female)
                  p
          = -----------------------
                 p^2
          = 1/p


mzgtp

Name of routine: mzgtp
Source lines: 21080 - 21237
Type subroutine
Call mzgtp(mztwin, gt, thresh, nloci, loc, loctyp, locpos, dataset, inconsist, plevel)
ModuleNone
Notes
 Test monozygotic twins

dropt2

Name of routine: dropt2
Source lines: 21242 - 21418
Type subroutine
Call dropt2(mztwin, gt, thresh, typ, nloci, loc, loctyp, locpos, dataset, plevel)
ModuleNone
Notes
  
 Delete MZ twin with least phenotype information out of pair
 or clean MZ genotypes
  

countmz

Name of routine: countmz
Source lines: 21422 - 21522
Type subroutine
Call countmz(mztwin, gt, thresh, dataset, plevel)
ModuleNone
Notes
 Count up MZ twins, triplets, quads, higher

testage

Name of routine: testage
Source lines: 21526 - 21582
Type subroutine
Call testage(typ, locnam, trait, thresh, dataset, droperr, plevel)
ModuleNone
Notes
 Test ages or DOB for consistency

testpage

Name of routine: testpage
Source lines: 21586 - 21635
Type subroutine
Call testpage(typ, locnam, trait, ped, idx, parent, thresh, dataset, droperr)
ModuleNone
Notes
 Test a parent

ckibs

Name of routine: ckibs
Source lines: 21640 - 21751
Type subroutine
Call ckibs(nloci, loctyp, locpos, allele_buffer, dataset)
ModuleNone
Notes
 Check if multilocus ibs sharing for pairs of sibs is consistent
 with purported relationship.  Again as per Bishop et al 1990

genmatch

Name of routine: genmatch
Source lines: 21756 - 21895
Type subroutine
Call genmatch(tped, tid, nloci, loc, loctyp, locpos, dataset)
ModuleNone
Notes
  
 Find closest match of genotypes between index person and all other
 active individuals
  

cntibs

Name of routine: cntibs
Source lines: 21899 - 21932
Type subroutine
Call cntibs(idx, nmark, geno, ord, locpos, dataset, nmatch, ibs)
ModuleNone
Notes
  
 IBS at specified set of markers
  

freq

Name of routine: freq
Source lines: 21940 - 22074
Type subroutine
Call freq(gene, loctyp, fndr, dataset, allele_buffer)
ModuleNone
Notes
  
 Count alleles in entire sample -- codominant system
 Either unweighted or weighted by number of founders in pedigree
  
 If imputation has been done and fndr=2, then return the
 count of alleles in the founders, both observed and imputed
  

tab

Name of routine: tab
Source lines: 22079 - 22114
Type subroutine
Call tab(curr, allele_buffer, wei)
ModuleNone
Notes
  
 update table of counts of alleles -- binary search and insertion sort
 if allele_buffer too small, increase size
  

wrfreq

Name of routine: wrfreq
Source lines: 22118 - 22346
Type subroutine
Call wrfreq(strm, locnam, mappos, locnote, allele_buffer, fstyle)
ModuleNone
Notes
  
 Write out frequencies in 16 different styles
  

getchr

Name of routine: getchr
Source lines: 22350 - 22369
Type subroutine
Call getchr(locnam, chr)
ModuleNone
Notes
 Get chromosome number from locus name of form "DnnSn"

precis

Name of routine: precis
Source lines: 22374 - 22408
Type subroutine
Call precis(numal, allele_freqs, ndec)
ModuleNone
Notes
  
 remove rounding errors in allele frequencies printed out to precision ndec
 from f3.1 to f9.7
  

uninf

Name of routine: uninf
Source lines: 22412 - 22423
Type function
Call uninf(numal, allele_freqs)
ModuleNone
Notes
  
 Frequency of uninformative matings for marker locus
  

getfreq

Name of routine: getfreq
Source lines: 22427 - 22445
Type function
Call getfreq(allele, allele_set)
ModuleNone
Notes
 
 find allele frequency
  

getnam

Name of routine: getnam
Source lines: 22449 - 22472
Type function
Call getnam(rall, allele_set)
ModuleNone
Notes
  
 find index for allele
  

match

Name of routine: match
Source lines: 22476 - 22497
Type subroutine
Call match(ival,num,key,pos)
ModuleNone
Notes
  
 Binary search for position of value in an ascending sorted array -- integer
  

dmatch

Name of routine: dmatch
Source lines: 22501 - 22522
Type subroutine
Call dmatch(val, num, key, pos)
ModuleNone
Notes
  
 Binary search for position of value in an ascending sorted array -- double precision
  

actped

Name of routine: actped
Source lines: 22526 - 22611
Type subroutine
Call actped(red, pedfil, nloci, loc, loctyp, locpos, locnotes, typed, dataset, plevel)
ModuleNone
Notes
  
 summarize current pedigree file
  

sumped

Name of routine: sumped
Source lines: 22615 - 22677
Type subroutine
Call sumped(nloci, loctyp, locpos, dataset)
ModuleNone
Notes
 Summary statistics on families
    

countships

Name of routine: countships
Source lines: 22681 - 22698
Type function
Call countships(ped, dataset)
ModuleNone
Notes
 Count matings/sibships in current family

listids

Name of routine: listids
Source lines: 22702 - 22795
Type subroutine
Call listids(dataset, ithresh, plevel)
ModuleNone
Notes
 Tabulate all IDs

listtwins

Name of routine: listtwins
Source lines: 22799 - 22825
Type subroutine
Call listtwins(dataset, plevel)
ModuleNone
Notes
 MZ Twins 

check

Name of routine: check
Source lines: 22838 - 23113
Type subroutine
Call check(nloci, loc, loctyp, locpos, locnotes, dataset, droperr, ndiscard, inconsist, plevel)
ModuleNone
Notes
 check for simple inconsistencies between child and parent
 if requested, delete any problem genotypes (up to and including
 all genotypes for a nuclear family)
  
 error                                     action if droperr
 ----------------------------------------  ----------------------------
 11=single parent-offspring inconsistency  delete child genotype
 12=Multiple p-o inconsistencies           delete all nuclear fam genos
 13=Inconsistencies between siblings       delete all nuclear fam genos
 14=More than 4 alleles segregating        delete all nuclear fam genos
  

addall

Name of routine: addall
Source lines: 23117 - 23133
Type subroutine
Call addall(iall,nall,allmax,allele)
ModuleNone
Notes
  
 identify parental alleles in nuclear family
  

nuchek

Name of routine: nuchek
Source lines: 23137 - 23220
Type subroutine
Call nuchek(xlinkd, ptyped, p11, p12, p21, p22, nkids, set, xmale, nall, allele, thiserr)
ModuleNone
Notes
  
 nuclear family consistency check (untyped parents)
  

famerr

Name of routine: famerr
Source lines: 23224 - 23264
Type subroutine
Call famerr(locnam, gene, xlinkd, ped, dataset, currf, currm, badchild, sta, fin, errtyp, plevel)
ModuleNone
Notes
  
 Write out nuclear family error
  

inderr

Name of routine: inderr
Source lines: 23268 - 23285
Type subroutine
Call inderr(pedigree, cid, locnam, all1, all2)
ModuleNone
Notes
  
 write genotype for an individual flagged as a Mendelian error
  

remove

Name of routine: remove
Source lines: 23289 - 23303
Type subroutine
Call remove(idx, gene, dataset, ndiscard)
ModuleNone
Notes
  
 Remove a genotype from data 
  

remfam

Name of routine: remfam
Source lines: 23307 - 23323
Type subroutine
Call remfam(currf, currm, sta, fin, gene, dataset, ndiscard)
ModuleNone
Notes
  
 drop a nuclear family's genotypes
  

parcon

Name of routine: parcon
Source lines: 23329 - 23348
Type function
Call parcon(c1, c2, p11, p12, p21, p22, xmale)
ModuleNone
Notes
  
 Tests if child genotype consistent with parental genotypes:
 parcon=4*Pr(Child_genotype|Father_genotype,Mother_genotype)
 if xmale  TRUE then X-linked locus *and* male child
  

opcon

Name of routine: opcon
Source lines: 23352 - 23359
Type function
Call opcon(c1,c2,p1,p2)
ModuleNone
Notes
  
 test if child genotype consistent with one parental genotype
  

shipcon

Name of routine: shipcon
Source lines: 23363 - 23380
Type function
Call shipcon(pg1, pg2, mg1, mg2, nkids, set, xmale)
ModuleNone
Notes
 test consistency of a sibship with parents

couple

Name of routine: couple
Source lines: 23385 - 23402
Type subroutine
Call couple(idx,tot,rang,i1,i2)
ModuleNone
Notes
  
 Enumerate all combinations of i ~ I(1..range) with itself
 If index=tot then return last tuple
  

whall

Name of routine: whall
Source lines: 23406 - 23421
Type function
Call whall(iall,nall,allele)
ModuleNone
Notes
  
 Find index of allele segregating in nuclear family
  

describe

Name of routine: describe
Source lines: 23425 - 23650
Type subroutine
Call describe(locnam, gene, xlinkd, ped, dataset, currf, currm, sta, fin, mesg)
ModuleNone
Notes
  
 write out genotypes in nuclear family and grandparents
  

famset

Name of routine: famset
Source lines: 23655 - 23816
Type subroutine
Call famset(ped, dataset, currf, currm, sta, fin, gene, set, gset)
ModuleNone
Notes
 Write out phenoset for a nuclear family (plus grandparents and halfsibs)
 Useful in detecting sources of long distance Mendelian inconsistencies.

indset

Name of routine: indset
Source lines: 23820 - 23863
Type subroutine
Call indset(idx, gene, pedoffset, dataset, set, gset)
ModuleNone
Notes
 write out phenoset for an individual

allinset

Name of routine: allinset
Source lines: 23867 - 23883
Type function
Call allinset(idx, iall, ngeno, gset)
ModuleNone
Notes
 see if particular allele in phenoset for idx person

cntbad

Name of routine: cntbad
Source lines: 23887 - 23899
Type subroutine
Call cntbad(idx, ngeno, gset)
ModuleNone
Notes
 If phenoset contains zero legal genotypes, reconstruct last state

wroddall

Name of routine: wroddall
Source lines: 23903 - 23923
Type subroutine
Call wroddall(pedigree, parent, child, iall, partyp)
ModuleNone
Notes
 If find an odd-allele-out, write out its location

start

Name of routine: start
Source lines: 23928 - 24050
Type subroutine
Call start(maxtry, nloci, loc, loctyp, locpos, dataset, allele_buffer, inconsist, plevel)
ModuleNone
Notes
  
 If Lange-Goradia algorithm not used, initialize genotypes for random walk
 algorithms via a conditional gene dropping algorithm
  

workpointers

Name of routine: workpointers
Source lines: 24054 - 24079
Type subroutine
Call workpointers(ped, dataset, fa, mo, imztwin)
ModuleNone
Notes
 make parental pointers offset for local work array

dattoset

Name of routine: dattoset
Source lines: 24083 - 24112
Type subroutine
Call dattoset(sta, fin, gene, dataset, allele_buffer, set)
ModuleNone
Notes
 transfer genotypes to working array

startone

Name of routine: startone
Source lines: 24116 - 24200
Type subroutine
Call startone(maxtry, allele_buffer, num, nfound, fa, mo, sex, set, sibd, key, failid, plevel)
ModuleNone
Notes
 start genotypes for one pedigree

genof3

Name of routine: genof3
Source lines: 24206 - 24300
Type subroutine
Call genof3(idx, fa, mo, xmale, set, sibd, key, failid)
ModuleNone
Notes
  
 Drop ibd-alleles conditional on observed markers
 and randomly where marker genotype not observed -- restart
 if later generates inconsistency
  

fillin

Name of routine: fillin
Source lines: 24304 - 24361
Type subroutine
Call fillin(allele_buffer, num, nfound, set, sibd, key, sta, fin, gene, dataset)
ModuleNone
Notes
  
 infer missing genotypes based on sibd values after run of start
  

found

Name of routine: found
Source lines: 24365 - 24378
Type subroutine
Call found(cumfrq, allele)
ModuleNone
Notes
  
 founder frequency
  

coutyp

Name of routine: coutyp
Source lines: 24382 - 24417
Type subroutine
Call coutyp(nloci, loctyp, locpos, dataset, typed)
ModuleNone
Notes
  
 Give counts of typed individuals for each locus
  

thetaf

Name of routine: thetaf
Source lines: 24427 - 24444
Type function
Call thetaf(het, n)
ModuleNone
Notes
  
 Xu and Fu 2004 correction for thetaf=4Nu=1/2(1/F^2-1)
 where F is the observed homozygosity for the locus is:
 1/2 (1/F^2-1) = a thetaf + b sqrt(thetaf)
 where
 thetaf <=10                        >10
    a   1.1313+3.4882/n+28.2878/n^2 1.1675+3.3232/n+63.698/n^2
    b   0.3998                      0.2569
  

qtlpars

Name of routine: qtlpars
Source lines: 24448 - 24493
Type subroutine
Call qtlpars(p,m1,m2,m3,sd1,sd2,sd3)
ModuleNone
Notes
  
 Calculate variances for a given SML model
  

ccpen

Name of routine: ccpen
Source lines: 24498 - 24512
Type subroutine
Call ccpen(prev, pca, pco)
ModuleNone
Notes
  
 Calculate penetrances for a particular prevalence and 
 case and control allele frequencies
  

grrpen

Name of routine: grrpen
Source lines: 24516 - 24549
Type subroutine
Call grrpen(model, prev, q, grr)
ModuleNone
Notes
  
 Calculate penetrances for a particular prevalence and genotypic RR
  

recrisk

Name of routine: recrisk
Source lines: 24553 - 24639
Type subroutine
Call recrisk(q,f1,f2,f3)
ModuleNone
Notes
  
 Calculate recurrence risks and risk ratios for given SML model
  

doito

Name of routine: doito
Source lines: 24643 - 24695
Type subroutine
Call doito(typ, pars)
ModuleNone
Notes
  
 Calculate GPE for a relative: ITO method
  

ito

Name of routine: ito
Source lines: 24699 - 24738
Type subroutine
Call ito(rel, q, r)
ModuleNone
Notes
 ITO calculation

mixup

Name of routine: mixup
Source lines: 24742 - 24757
Type subroutine
Call mixup(n, ia)
ModuleNone
Notes
  
 Permute the contents of an integer array
  

randn

Name of routine: randn
Source lines: 24767 - 24790
Type function
Call randn()
ModuleNone

uniqnam

Name of routine: uniqnam
Source lines: 24794 - 24803
Type subroutine
Call uniqnam(nchar, str)
ModuleNone
Notes
 Random character string

rantri

Name of routine: rantri
Source lines: 24807 - 24811
Type function
Call rantri()
ModuleNone
Notes
  
 Triangular random number generator
  

random

Name of routine: random
Source lines: 24830 - 24840
Type function
Call random()
ModuleNone
Notes
  
 Algorithm AS 183 Appl Stat 1982; 31:188
 Returns a pseudo-random number from U(0,1)
  
 ix,iy,iz should be "randomly" initialised to 1-30000
 eg via time
  

dataset_uses

Name of routine: dataset_uses
Source lines: 24844 - 24856
Type function
Call dataset_uses(dataset)
ModuleNone
Notes
 size of pedigree structure
 

macsub

Name of routine: macsub
Source lines: 24860 - 24970
Type subroutine
Call macsub(narg, words, commands, plevel)
ModuleNone
Notes
 Perform simple macro substitutions on contents of command buffer

macloop

Name of routine: macloop
Source lines: 24978 - 25075
Type subroutine
Call macloop(lin, nloci, loc, loctyp, commands, plevel)
ModuleNone
Notes
 Expand an iterator list of tokens in a command
 These implicit loops are signalled by a list surrounded by braces
 Implemented as a macro expansion so:
   {1 2} + 1 -> 1 + 1; 2 + 1
   {1 2} + {1 2} -> 1 + {1 2}; 2 + {1 2} requiring further evaluation

macvar

Name of routine: macvar
Source lines: 25080 - 25147
Type subroutine
Call macvar(lin, commands, plevel)
ModuleNone
Notes
 Perform simple macro variable substitutions on contents of command buffer
 cf macro functions which are handled by macsub

parser

Name of routine: parser
Source lines: 25158 - 25291
Type subroutine
Call parser(nterm, wtyp, expr, error)
ModuleNone
Notes
  
 Evaluate and apply simple expressions either
  
 (1) pure arithmetic, so no effect on pedigree file
 (2) Dry run, so can test if will lead to a legal effect on pedigree file
         all variables set to MISS
 (3) Pedigree operation -- individual-wise calculation and update
  
 The parser
  

simpev

Name of routine: simpev
Source lines: 25295 - 25513
Type subroutine
Call simpev(sta, fin, nterm, wtyp, expr, error)
ModuleNone
Notes
  
 The non-compound evaluator
  

wrans

Name of routine: wrans
Source lines: 25517 - 25550
Type subroutine
Call wrans(prefix, nterm, expr, wtyp)
ModuleNone
Notes
  
 write out results of command line expression evaluation
  

legall

Name of routine: legall
Source lines: 25554 - 25568
Type function
Call legall(xall)
ModuleNone
Notes
  
 the legal range of alleles
  

isdata

Name of routine: isdata
Source lines: 25572 - 25577
Type function
Call isdata(idx)
ModuleNone
Notes
  
 Is a stack element a number, variable or operator
  

isenv

Name of routine: isenv
Source lines: 25581 - 25586
Type function
Call isenv(idx)
ModuleNone
Notes
 Is a stack element an automatic variable

isvar

Name of routine: isvar
Source lines: 25590 - 25597
Type function
Call isvar(idx)
ModuleNone
Notes
 Is a stack element data

isop

Name of routine: isop
Source lines: 25601 - 25606
Type function
Call isop(idx)
ModuleNone
Notes
 Is a stack element an operator

isvec

Name of routine: isvec
Source lines: 25610 - 25616
Type function
Call isvec(idx)
ModuleNone
Notes
 Is a stack element a genotype - both values of interest
  

ismis

Name of routine: ismis
Source lines: 25620 - 25625
Type function
Call ismis(idx)
ModuleNone
Notes
  
 Is a stack element missing data
  

addcolon

Name of routine: addcolon
Source lines: 25629 - 25661
Type subroutine
Call addcolon(nterm, wtyp, expr)
ModuleNone
Notes
 Convert (expr) (expr) to (expr : expr)

compop

Name of routine: compop
Source lines: 25665 - 25711
Type subroutine
Call compop(pos, sta, fin, nterm, wtyp, expr, error)
ModuleNone
Notes
  
 compound operators eg <= >= == ^=
  

zerop

Name of routine: zerop
Source lines: 25715 - 25757
Type subroutine
Call zerop(pos, wtyp, expr, error)
ModuleNone
Notes
  
 zero argument functions
  

unop

Name of routine: unop
Source lines: 25761 - 25916
Type subroutine
Call unop(pos, sta, fin, nterm, wtyp, expr, error)
ModuleNone
Notes
  
 unary operators
  

binop

Name of routine: binop
Source lines: 25920 - 26127
Type subroutine
Call binop(pos, sta, fin, nterm, wtyp, expr, error)
ModuleNone
Notes
  
 binary operators
  

typwords

Name of routine: typwords
Source lines: 26146 - 26199
Type subroutine
Call typwords(farg, larg, words, nloci, loc, loctyp, wtyp, expr, actn)
ModuleNone
Notes
  
 Evaluate type of each term in expression word(farg...larg) and actn
 actn=0 error  =1 purely arithmetic  =2 legal
  
 Types are:         wtyp                 expr
                    -----------------    --------
 tokens             0      + 0...TOKNUM    -
 env                100000 + 1...ENVNUM   (value)
 constant           200000                 value
 trait data         200000 + 1...NLOCI    (value)
 constant genotype  300000                 value, value
 genotype data      300000 + 1...NLOCI    (value, value)
 MISS               400000                 MISS
 missing trait      400000 + 1...NLOCI     MISS
 MISS genotype      500000                 MISS/MISS
 missing trait      500000 + 1...NLOCI     MISS/MISS
 NUM                600000                 -
  

dryrun

Name of routine: dryrun
Source lines: 26204 - 26215
Type subroutine
Call dryrun(farg,larg,wtyp)
ModuleNone
Notes
  
 If checking arguments via dry run of parser,
 replace variable values with (generic) NUM
  

pull

Name of routine: pull
Source lines: 26219 - 26235
Type subroutine
Call pull(pos, dec, fin, nterm, typ, expr)
ModuleNone
Notes
  
 Pull up expr
  

isgeno

Name of routine: isgeno
Source lines: 26239 - 26266
Type function
Call isgeno(string)
ModuleNone
Notes
  
  See if a string is a valid genotype
  

getgeno

Name of routine: getgeno
Source lines: 26270 - 26305
Type subroutine
Call getgeno(string, a1, a2, wtyp)
ModuleNone
Notes
  
  Get a valid genotype
  

incpos

Name of routine: incpos
Source lines: 26309 - 26318
Type subroutine
Call incpos(pos,minpos,maxpos)
ModuleNone
Notes
  
 Increment counter mod maxpos
  

getrelval

Name of routine: getrelval
Source lines: 26322 - 26535
Type subroutine
Call getrelval(relate, summary, locnam, loctyp, trait, sumval, dataset, plevel)
ModuleNone
Notes
 Get values for trait in relatives

priallval

Name of routine: priallval
Source lines: 26539 - 26617
Type subroutine
Call priallval(summary, trait, loctyp, ped, sumval, totobs, dataset, plevel)
ModuleNone
Notes
 Output single summary value for entire pedigree
 

prirelval

Name of routine: prirelval
Source lines: 26621 - 26789
Type subroutine
Call prirelval(relate, summary, trait, loctyp, ped, nobs, relid, sumval, totobs, dataset, plevel)
ModuleNone
Notes
 Output values for each eligible persion
 

evalped

Name of routine: evalped
Source lines: 26793 - 27082
Type subroutine
Call evalped(narg, words, nloci, loc, loctyp, locpos, locn