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.
| Name of routine: | handler |
|---|---|
| Source lines: | 336 - 342 |
| Type | subroutine |
| Call | handler() |
| Module | interrupt |
| Notes | keyboard interrupt handler (exits after 6 interrupts, usually ctrl-C) |
| Name of routine: | loccode |
|---|---|
| Source lines: | 378 - 395 |
| Type | function |
| Call | loccode(ch) |
| Module | locus_types |
| Notes | Locus types loctyp 1=marker 2=X-marker 3=quant 4=affection 5=mito/Y-marker 11-15=deleted |
| Name of routine: | setup_loci |
|---|---|
| Source lines: | 421 - 428 |
| Type | subroutine |
| Call | setup_loci(n) |
| Module | locus_data |
| Notes | Allocate storage for locus descriptions |
| Name of routine: | cleanup_loci |
|---|---|
| Source lines: | 432 - 436 |
| Type | subroutine |
| Call | cleanup_loci() |
| Module | locus_data |
| Notes | Deallocate storage for locus descriptions |
| Name of routine: | expand_loci |
|---|---|
| Source lines: | 440 - 471 |
| Type | subroutine |
| Call | expand_loci(nextra, plevel) |
| Module | locus_data |
| Notes | Expand arrays for locus descriptions |
| Name of routine: | insloc |
|---|---|
| Source lines: | 476 - 485 |
| Type | subroutine |
| Call | insloc(pos) |
| Module | locus_data |
| Notes | insert a locus into the locus list other details of the slot are left blank |
| Name of routine: | setupmer |
|---|---|
| Source lines: | 489 - 519 |
| Type | subroutine |
| Call | setupmer(strm) |
| Module | locus_data |
| Notes | Allocate arrays for locus descriptions from MERLIN locus file |
| Name of routine: | setup_stat |
|---|---|
| Source lines: | 523 - 526 |
| Type | subroutine |
| Call | setup_stat() |
| Module | locus_data |
| Notes | initialize locstat (stores test statistic for each locus) |
| Name of routine: | setup_peds |
|---|---|
| Source lines: | 568 - 600 |
| Type | subroutine |
| Call | setup_peds(nped, nobs, numloc, numcol, dataset, astat) |
| Module | ped_class |
| Notes | allocate pedigree data |
| Name of routine: | copy_peds |
|---|---|
| Source lines: | 604 - 631 |
| Type | subroutine |
| Call | copy_peds(set1, set2) |
| Module | ped_class |
| Notes | copy pedigree data |
| Name of routine: | cleanup_peds |
|---|---|
| Source lines: | 635 - 659 |
| Type | subroutine |
| Call | cleanup_peds(dataset) |
| Module | ped_class |
| Notes | deallocate pedigree structure arrays |
| Name of routine: | show_ped_allocation |
|---|---|
| Source lines: | 663 - 686 |
| Type | subroutine |
| Call | show_ped_allocation(dataset) |
| Module | ped_class |
| Notes | Diagnostics for structure |
| Name of routine: | copyfreq |
|---|---|
| Source lines: | 713 - 733 |
| Type | subroutine |
| Call | copyfreq(allele_buffer, allele_buffer2) |
| Module | alleles_class |
| Notes | Copy allele frequency data from one structure to another |
| Name of routine: | expand_alleles |
|---|---|
| Source lines: | 737 - 760 |
| Type | subroutine |
| Call | expand_alleles(allele_buffer, nextra) |
| Module | alleles_class |
| Notes | expand size of an allele frequency structure |
| Name of routine: | cleanup_alleles |
|---|---|
| Source lines: | 764 - 781 |
| Type | subroutine |
| Call | cleanup_alleles(allele_buffer) |
| Module | alleles_class |
| Notes | release memory held by an allele frequency structure |
| Name of routine: | genot |
|---|---|
| Source lines: | 785 - 799 |
| Type | subroutine |
| Call | genot(allele_buffer, gfrq) |
| Module | alleles_class |
| Notes | produce genotype frequencies for Metropolis algorithm |
| Name of routine: | calc_gtp_freqs |
|---|---|
| Source lines: | 802 - 820 |
| Type | subroutine |
| Call | calc_gtp_freqs(allele_buffer) |
| Module | alleles_class |
| Notes | or for sequential imputation |
| Name of routine: | setup_hash |
|---|---|
| Source lines: | 838 - 874 |
| Type | subroutine |
| Call | setup_hash(nrec, hashtab, load) |
| Module | idhash_class |
| Notes | Allocate an open addressed hash table number of buckets is prime probe using exponential hash following Muehlbacher 2004 JUCS 10: 1239-1249 |
| Name of routine: | cleanup_hash |
|---|---|
| Source lines: | 878 - 886 |
| Type | subroutine |
| Call | cleanup_hash(hashtab) |
| Module | idhash_class |
| Notes | release memory held by a hash table |
| Name of routine: | setup_mem |
|---|---|
| Source lines: | 1146 - 1212 |
| Type | subroutine |
| Call | setup_mem(siz) |
| Module | scheme_lang |
| Notes | Memory management |
| Name of routine: | cleanup_bank |
|---|---|
| Source lines: | 1218 - 1233 |
| Type | subroutine |
| Call | cleanup_bank(sta, fin) |
| Module | scheme_lang |
| Notes | Clean up memory arrays Zero a block of cells, including deallocating strings |
| Name of routine: | cleanup_mem |
|---|---|
| Source lines: | 1237 - 1240 |
| Type | subroutine |
| Call | cleanup_mem() |
| Module | scheme_lang |
| Notes | Free all memory |
| Name of routine: | gc_mark |
|---|---|
| Source lines: | 1246 - 1285 |
| Type | subroutine |
| Call | gc_mark(a) |
| Module | scheme_lang |
| Notes | Mark-sweep garbage collector Mark cells to be saved |
| Name of routine: | gc |
|---|---|
| Source lines: | 1290 - 1323 |
| Type | subroutine |
| Call | gc(a, b, plevel) |
| Module | scheme_lang |
| Notes | Copy all registers to free memory Reset pointers from old addresses to new addresses |
| Name of routine: | getcell |
|---|---|
| Source lines: | 1327 - 1345 |
| Type | function |
| Call | getcell(a, b) |
| Module | scheme_lang |
| Notes | Get next free cell |
| Name of routine: | set_type |
|---|---|
| Source lines: | 1350 - 1354 |
| Type | subroutine |
| Call | set_type(p, iflag) |
| Module | scheme_lang |
| Notes | Cell type operations Setting values |
| Name of routine: | set_ivalue |
|---|---|
| Source lines: | 1355 - 1359 |
| Type | subroutine |
| Call | set_ivalue(p, ivalue) |
| Module | scheme_lang |
| Notes | Cell type operations Setting values |
| Name of routine: | set_string |
|---|---|
| Source lines: | 1360 - 1373 |
| Type | subroutine |
| Call | set_string(p, str) |
| Module | scheme_lang |
| Notes | Cell type operations Setting values |
| Name of routine: | set_substring |
|---|---|
| Source lines: | 1374 - 1384 |
| Type | subroutine |
| Call | set_substring(p, sta, fin, str) |
| Module | scheme_lang |
| Notes | Cell type operations Setting values |
| Name of routine: | set_car |
|---|---|
| Source lines: | 1386 - 1389 |
| Type | subroutine |
| Call | set_car(p, icar) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | set_cdr |
|---|---|
| Source lines: | 1390 - 1393 |
| Type | subroutine |
| Call | set_cdr(p, icdr) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | set_caar |
|---|---|
| Source lines: | 1394 - 1397 |
| Type | subroutine |
| Call | set_caar(p, icaar) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | set_cdar |
|---|---|
| Source lines: | 1398 - 1401 |
| Type | subroutine |
| Call | set_cdar(p, icdar) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | set_syntaxnum |
|---|---|
| Source lines: | 1402 - 1405 |
| Type | subroutine |
| Call | set_syntaxnum(p, op) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | get_ivalue |
|---|---|
| Source lines: | 1409 - 1413 |
| Type | function |
| Call | get_ivalue(p) |
| Module | scheme_lang |
| Notes | Getting values |
| Name of routine: | get_string |
|---|---|
| Source lines: | 1417 - 1427 |
| Type | function |
| Call | get_string(p) |
| Module | scheme_lang |
| Notes | Strings |
| Name of routine: | get_substr |
|---|---|
| Source lines: | 1429 - 1441 |
| Type | function |
| Call | get_substr(p, sta, fin) |
| Module | scheme_lang |
| Notes | Substring |
| Name of routine: | get_strlen |
|---|---|
| Source lines: | 1443 - 1447 |
| Type | function |
| Call | get_strlen(p) |
| Module | scheme_lang |
| Notes | String length |
| Name of routine: | get_listlen |
|---|---|
| Source lines: | 1449 - 1461 |
| Type | function |
| Call | get_listlen(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | get_var |
|---|---|
| Source lines: | 1467 - 1540 |
| Type | subroutine |
| Call | get_var(string, pos, fin, istat) |
| Module | scheme_lang |
| Notes | allowing access to Scheme environment from Sib-pair accessible variables are atomic result inserted into passed string |
| Name of routine: | list_var |
|---|---|
| Source lines: | 1544 - 1587 |
| Type | subroutine |
| Call | list_var(typ) |
| Module | scheme_lang |
| Notes | List Sib-pair accessible (atomic or pair) variables |
| Name of routine: | isafun |
|---|---|
| Source lines: | 1591 - 1620 |
| Type | function |
| Call | isafun(nam) |
| Module | scheme_lang |
| Notes | Test if a macro function exists |
| Name of routine: | procnum |
|---|---|
| Source lines: | 1622 - 1626 |
| Type | function |
| Call | procnum(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | syntaxnum |
|---|---|
| Source lines: | 1627 - 1631 |
| Type | function |
| Call | syntaxnum(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | typeof |
|---|---|
| Source lines: | 1635 - 1639 |
| Type | function |
| Call | typeof(p) |
| Module | scheme_lang |
| Notes | Underlying primitives for Scheme |
| Name of routine: | isstring |
|---|---|
| Source lines: | 1640 - 1644 |
| Type | function |
| Call | isstring(p) |
| Module | scheme_lang |
| Notes | Underlying primitives for Scheme |
| Name of routine: | isnumber |
|---|---|
| Source lines: | 1645 - 1649 |
| Type | function |
| Call | isnumber(p) |
| Module | scheme_lang |
| Notes | Underlying primitives for Scheme |
| Name of routine: | ispair |
|---|---|
| Source lines: | 1650 - 1654 |
| Type | function |
| Call | ispair(p) |
| Module | scheme_lang |
| Notes | Underlying primitives for Scheme |
| Name of routine: | car |
|---|---|
| Source lines: | 1658 - 1662 |
| Type | function |
| Call | car(p) |
| Module | scheme_lang |
| Notes | car, cdr etc |
| Name of routine: | cdr |
|---|---|
| Source lines: | 1663 - 1667 |
| Type | function |
| Call | cdr(p) |
| Module | scheme_lang |
| Notes | car, cdr etc |
| Name of routine: | caar |
|---|---|
| Source lines: | 1669 - 1674 |
| Type | function |
| Call | caar(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | cadr |
|---|---|
| Source lines: | 1675 - 1680 |
| Type | function |
| Call | cadr(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | cdar |
|---|---|
| Source lines: | 1681 - 1686 |
| Type | function |
| Call | cdar(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | cddr |
|---|---|
| Source lines: | 1687 - 1692 |
| Type | function |
| Call | cddr(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | cadar |
|---|---|
| Source lines: | 1693 - 1699 |
| Type | function |
| Call | cadar(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | caddr |
|---|---|
| Source lines: | 1700 - 1706 |
| Type | function |
| Call | caddr(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | cadaar |
|---|---|
| Source lines: | 1707 - 1714 |
| Type | function |
| Call | cadaar(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | cadddr |
|---|---|
| Source lines: | 1715 - 1722 |
| Type | function |
| Call | cadddr(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | cddddr |
|---|---|
| Source lines: | 1723 - 1730 |
| Type | function |
| Call | cddddr(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | issymbol |
|---|---|
| Source lines: | 1732 - 1736 |
| Type | function |
| Call | issymbol(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | issyntax |
|---|---|
| Source lines: | 1737 - 1741 |
| Type | function |
| Call | issyntax(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | isproc |
|---|---|
| Source lines: | 1742 - 1746 |
| Type | function |
| Call | isproc(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | isclosure |
|---|---|
| Source lines: | 1747 - 1751 |
| Type | function |
| Call | isclosure(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | iscontinuation |
|---|---|
| Source lines: | 1752 - 1756 |
| Type | function |
| Call | iscontinuation(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | ispromise |
|---|---|
| Source lines: | 1757 - 1761 |
| Type | function |
| Call | ispromise(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | isport |
|---|---|
| Source lines: | 1762 - 1766 |
| Type | function |
| Call | isport(p) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | istrue |
|---|---|
| Source lines: | 1768 - 1772 |
| Type | function |
| Call | istrue(p) |
| Module | scheme_lang |
| Notes | true or false value functions |
| Name of routine: | isfalse |
|---|---|
| Source lines: | 1773 - 1777 |
| Type | function |
| Call | isfalse(p) |
| Module | scheme_lang |
| Notes | true or false value functions |
| Name of routine: | isatom |
|---|---|
| Source lines: | 1781 - 1785 |
| Type | function |
| Call | isatom(p) |
| Module | scheme_lang |
| Notes | Garbage collection |
| Name of routine: | setatom |
|---|---|
| Source lines: | 1786 - 1789 |
| Type | subroutine |
| Call | setatom(p) |
| Module | scheme_lang |
| Notes | Garbage collection |
| Name of routine: | clratom |
|---|---|
| Source lines: | 1790 - 1793 |
| Type | subroutine |
| Call | clratom(p) |
| Module | scheme_lang |
| Notes | Garbage collection |
| Name of routine: | ismark |
|---|---|
| Source lines: | 1794 - 1798 |
| Type | function |
| Call | ismark(p) |
| Module | scheme_lang |
| Notes | Garbage collection |
| Name of routine: | setmark |
|---|---|
| Source lines: | 1799 - 1802 |
| Type | subroutine |
| Call | setmark(p) |
| Module | scheme_lang |
| Notes | Garbage collection |
| Name of routine: | clrmark |
|---|---|
| Source lines: | 1803 - 1806 |
| Type | subroutine |
| Call | clrmark(p) |
| Module | scheme_lang |
| Notes | Garbage collection |
| Name of routine: | cons |
|---|---|
| Source lines: | 1810 - 1817 |
| Type | function |
| Call | cons(reg1, reg2) |
| Module | scheme_lang |
| Notes | Cons |
| Name of routine: | ceqstr |
|---|---|
| Source lines: | 1821 - 1838 |
| Type | function |
| Call | ceqstr(cstr, reg) |
| Module | scheme_lang |
| Notes | Contents of a Lisp string cell equal to a Fortran string |
| Name of routine: | streq |
|---|---|
| Source lines: | 1842 - 1858 |
| Type | function |
| Call | streq(a, b) |
| Module | scheme_lang |
| Notes | Contents of a Lisp string equal to a Lisp string |
| Name of routine: | mk_number |
|---|---|
| Source lines: | 1862 - 1870 |
| Type | function |
| Call | mk_number(num) |
| Module | scheme_lang |
| Notes | Declare a number |
| Name of routine: | mk_string |
|---|---|
| Source lines: | 1874 - 1882 |
| Type | function |
| Call | mk_string(nam) |
| Module | scheme_lang |
| Notes | Declare a string |
| Name of routine: | mk_symbol |
|---|---|
| Source lines: | 1886 - 1902 |
| Type | function |
| Call | mk_symbol(nam) |
| Module | scheme_lang |
| Notes | Declare a symbol |
| Name of routine: | mk_atom |
|---|---|
| Source lines: | 1906 - 1935 |
| Type | function |
| Call | mk_atom(str) |
| Module | scheme_lang |
| Notes | make symbol or number atom from string |
| Name of routine: | mk_const |
|---|---|
| Source lines: | 1939 - 1951 |
| Type | function |
| Call | mk_const(nam) |
| Module | scheme_lang |
| Notes | Make a constant |
| Name of routine: | mk_closure |
|---|---|
| Source lines: | 1955 - 1964 |
| Type | function |
| Call | mk_closure(c, e) |
| Module | scheme_lang |
| Notes | make closure, c is code, e is environment |
| Name of routine: | mk_continuation |
|---|---|
| Source lines: | 1968 - 1976 |
| Type | function |
| Call | mk_continuation(d) |
| Module | scheme_lang |
| Notes | make continuation |
| Name of routine: | mk_port |
|---|---|
| Source lines: | 1980 - 1990 |
| Type | function |
| Call | mk_port(iport, nam) |
| Module | scheme_lang |
| Notes | make a port |
| Name of routine: | test_port |
|---|---|
| Source lines: | 1993 - 2004 |
| Type | function |
| Call | test_port(iport) |
| Module | scheme_lang |
| Notes | Test a port - return location in portaddress |
| Name of routine: | reverse |
|---|---|
| Source lines: | 2008 - 2023 |
| Type | function |
| Call | reverse(a) |
| Module | scheme_lang |
| Notes | Reverse list |
| Name of routine: | non_alloc_rev |
|---|---|
| Source lines: | 2027 - 2043 |
| Type | function |
| Call | non_alloc_rev(term, list) |
| Module | scheme_lang |
| Notes | Reverse list -- no new cell generated |
| Name of routine: | append |
|---|---|
| Source lines: | 2047 - 2063 |
| Type | function |
| Call | append(a, b) |
| Module | scheme_lang |
| Notes | append list -- make new cells |
| Name of routine: | eqv |
|---|---|
| Source lines: | 2067 - 2082 |
| Type | function |
| Call | eqv(a, b) |
| Module | scheme_lang |
| Notes | equivalence of atoms |
| Name of routine: | inchar |
|---|---|
| Source lines: | 2086 - 2104 |
| Type | subroutine |
| Call | inchar(ch) |
| Module | scheme_lang |
| Notes | get a new character from input file or stdin |
| Name of routine: | clearinput |
|---|---|
| Source lines: | 2108 - 2110 |
| Type | subroutine |
| Call | clearinput() |
| Module | scheme_lang |
| Notes | clear input buffer |
| Name of routine: | flushinput |
|---|---|
| Source lines: | 2114 - 2116 |
| Type | subroutine |
| Call | flushinput() |
| Module | scheme_lang |
| Notes | back to standard input |
| Name of routine: | backchar |
|---|---|
| Source lines: | 2120 - 2122 |
| Type | subroutine |
| Call | backchar() |
| Module | scheme_lang |
| Notes | backstep one character in input buffer |
| Name of routine: | skipspace |
|---|---|
| Source lines: | 2126 - 2136 |
| Type | subroutine |
| Call | skipspace() |
| Module | scheme_lang |
| Notes | skip whitespace |
| Name of routine: | token |
|---|---|
| Source lines: | 2140 - 2178 |
| Type | function |
| Call | token() |
| Module | scheme_lang |
| Notes | get next token |
| Name of routine: | scheme_delim |
|---|---|
| Source lines: | 2182 - 2191 |
| Type | function |
| Call | scheme_delim(ch) |
| Module | scheme_lang |
| Notes | read characters to delimiter -- hard coded to work on Windows as well |
| Name of routine: | readstr |
|---|---|
| Source lines: | 2193 - 2208 |
| Type | subroutine |
| Call | readstr(res) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | readstrexp |
|---|---|
| Source lines: | 2212 - 2235 |
| Type | subroutine |
| Call | readstrexp(res, reslen) |
| Module | scheme_lang |
| Notes | read rest of a quoted string |
| Name of routine: | printatom |
|---|---|
| Source lines: | 2239 - 2269 |
| Type | subroutine |
| Call | printatom(l) |
| Module | scheme_lang |
| Notes | print an atom |
| Name of routine: | ok_abbrev |
|---|---|
| Source lines: | 2271 - 2275 |
| Type | function |
| Call | ok_abbrev(x) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | s_save |
|---|---|
| Source lines: | 2277 - 2282 |
| Type | subroutine |
| Call | s_save(a, b, c) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | s_return |
|---|---|
| Source lines: | 2283 - 2291 |
| Type | subroutine |
| Call | s_return(a) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | s_retbool |
|---|---|
| Source lines: | 2292 - 2299 |
| Type | subroutine |
| Call | s_retbool(tf) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | opexe0 |
|---|---|
| Source lines: | 2303 - 2590 |
| Type | subroutine |
| Call | opexe0(op, inline) |
| Module | scheme_lang |
| Notes | Apply Scheme commands - split into opexe0 to opexe10 |
| Name of routine: | opexe1 |
|---|---|
| Source lines: | 2592 - 2770 |
| Type | subroutine |
| Call | opexe1(op) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | opexe2 |
|---|---|
| Source lines: | 2772 - 2937 |
| Type | subroutine |
| Call | opexe2(op) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | opexe3 |
|---|---|
| Source lines: | 2939 - 3019 |
| Type | subroutine |
| Call | opexe3(op) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | opexe4 |
|---|---|
| Source lines: | 3021 - 3090 |
| Type | subroutine |
| Call | opexe4(op, plevel) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | opexe5 |
|---|---|
| Source lines: | 3092 - 3228 |
| Type | subroutine |
| Call | opexe5(op, plevel) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | opexe6 |
|---|---|
| Source lines: | 3230 - 3277 |
| Type | subroutine |
| Call | opexe6(op) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | opexe7 |
|---|---|
| Source lines: | 3281 - 3304 |
| Type | subroutine |
| Call | opexe7(op) |
| Module | scheme_lang |
| Notes | Mathematical functions |
| Name of routine: | opexe8 |
|---|---|
| Source lines: | 3308 - 3348 |
| Type | subroutine |
| Call | opexe8(op) |
| Module | scheme_lang |
| Notes | A few other library functions eg min, max |
| Name of routine: | opexe9 |
|---|---|
| Source lines: | 3352 - 3509 |
| Type | subroutine |
| Call | opexe9(op) |
| Module | scheme_lang |
| Notes | string functions |
| Name of routine: | opexe10 |
|---|---|
| Source lines: | 3513 - 3746 |
| Type | subroutine |
| Call | opexe10(op) |
| Module | scheme_lang |
| Notes | Nonstandard library additions for system interface such as system, readline |
| Name of routine: | mk_syntax |
|---|---|
| Source lines: | 3750 - 3758 |
| Type | subroutine |
| Call | mk_syntax(op, nam) |
| Module | scheme_lang |
| Notes | Initialization of internal keywords |
| Name of routine: | mk_proc |
|---|---|
| Source lines: | 3760 - 3769 |
| Type | subroutine |
| Call | mk_proc(op, nam) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | init_vars_global |
|---|---|
| Source lines: | 3773 - 3778 |
| Type | subroutine |
| Call | init_vars_global() |
| Module | scheme_lang |
| Notes | Initiate global environment |
| Name of routine: | init_syntax |
|---|---|
| Source lines: | 3782 - 3799 |
| Type | subroutine |
| Call | init_syntax() |
| Module | scheme_lang |
| Notes | Initiate syntax |
| Name of routine: | init_procs |
|---|---|
| Source lines: | 3803 - 3890 |
| Type | subroutine |
| Call | init_procs() |
| Module | scheme_lang |
| Notes | Initiate procedures |
| Name of routine: | init_scm |
|---|---|
| Source lines: | 3894 - 3988 |
| Type | subroutine |
| Call | init_scm() |
| Module | scheme_lang |
| Notes | Inlined init.scm |
| Name of routine: | init_globals |
|---|---|
| Source lines: | 3992 - 4003 |
| Type | subroutine |
| Call | init_globals() |
| Module | scheme_lang |
| Notes | Initiate procedures |
| Name of routine: | error0 |
|---|---|
| Source lines: | 4007 - 4014 |
| Type | subroutine |
| Call | error0(s) |
| Module | scheme_lang |
| Notes | Error handling |
| Name of routine: | error1 |
|---|---|
| Source lines: | 4016 - 4024 |
| Type | subroutine |
| Call | error1(s, a) |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | init_scheme |
|---|---|
| Source lines: | 4026 - 4029 |
| Type | subroutine |
| Call | init_scheme() |
| Module | scheme_lang |
| Notes | Miniscm |
| Name of routine: | repl_scheme |
|---|---|
| Source lines: | 4033 - 4100 |
| Type | subroutine |
| Call | repl_scheme(inline, ple) |
| Module | scheme_lang |
| Notes | Scheme read-eval-print loop |
| Name of routine: | create_form |
|---|---|
| Source lines: | 4140 - 4279 |
| Type | subroutine |
| Call | create_form(sta, fin, terms, nloci, loc, formula) |
| Module | formula_class |
| Notes | read commands and write appropriate formula structure |
| Name of routine: | cleanup_form |
|---|---|
| Source lines: | 4281 - 4292 |
| Type | subroutine |
| Call | cleanup_form(formula) |
| Module | formula_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
|
| Name of routine: | sumcols_form |
|---|---|
| Source lines: | 4296 - 4330 |
| Type | subroutine |
| Call | sumcols_form(formula) |
| Module | formula_class |
| Notes | If levels available, evaluate total number of model parameters |
| Name of routine: | show_form |
|---|---|
| Source lines: | 4332 - 4353 |
| Type | subroutine |
| Call | show_form(formula) |
| Module | formula_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
|
| Name of routine: | setup_props |
|---|---|
| Source lines: | 4495 - 4499 |
| Type | subroutine |
| Call | setup_props(maxsiz) |
| Module | mcmc_model |
| Notes | Allocate or deallocate work arrays |
| Name of routine: | clean_props |
|---|---|
| Source lines: | 4500 - 4502 |
| Type | subroutine |
| Call | clean_props() |
| Module | mcmc_model |
| Notes | Allocate or deallocate work arrays |
| Name of routine: | setup_mix |
|---|---|
| Source lines: | 4506 - 4561 |
| Type | subroutine |
| Call | setup_mix(ped, dataset, nchain, nqtl, nvar, family) |
| Module | mcmc_model |
| Notes | Allocate a pedigree's data arrays |
| Name of routine: | setup_ibd |
|---|---|
| Source lines: | 4597 - 4609 |
| Type | subroutine |
| Call | setup_ibd(ped, nobs, nvar, family) |
| Module | ibd_class |
| Notes | Allocate a pedigree's data arrays |
| Name of routine: | setup_table |
|---|---|
| Source lines: | 4639 - 4650 |
| Type | subroutine |
| Call | setup_table(ncat, maxcells, table) |
| Module | contingency_table |
| Notes | allocate space for contingency table |
| Name of routine: | clean_table |
|---|---|
| Source lines: | 4654 - 4664 |
| Type | subroutine |
| Call | clean_table(table) |
| Module | contingency_table |
| Notes | deallocate space |
| Name of routine: | expand_table |
|---|---|
| Source lines: | 4668 - 4691 |
| Type | subroutine |
| Call | expand_table(nextra, table) |
| Module | contingency_table |
| Notes | increase available space |
| Name of routine: | insert_table |
|---|---|
| Source lines: | 4695 - 4754 |
| Type | subroutine |
| Call | insert_table(ncat, values, table, iwt) |
| Module | contingency_table |
| Notes | insert data |
| Name of routine: | search_table |
|---|---|
| Source lines: | 4758 - 4796 |
| Type | function |
| Call | search_table(ncat, values, table) |
| Module | contingency_table |
| Notes | Search table |
| Name of routine: | incr_table |
|---|---|
| Source lines: | 4800 - 4806 |
| Type | subroutine |
| Call | incr_table(pos, table, iwt) |
| Module | contingency_table |
| Notes | Increment cell count if correct address already available |
| Name of routine: | print_table |
|---|---|
| Source lines: | 4810 - 4818 |
| Type | subroutine |
| Call | print_table(table) |
| Module | contingency_table |
| Notes | print a table |
| Name of routine: | marginal_table |
|---|---|
| Source lines: | 4822 - 4831 |
| Type | subroutine |
| Call | marginal_table(margin, table, martable) |
| Module | contingency_table |
| Notes | fill a table with marginal counts from another table |
| Name of routine: | flat_table |
|---|---|
| Source lines: | 4835 - 4863 |
| Type | subroutine |
| Call | flat_table(mtable1, mtable2, margin1, margin2, table, mat) |
| Module | contingency_table |
| Notes | fill a marginal RxC table from another table |
| Name of routine: | dim_table |
|---|---|
| Source lines: | 4867 - 4878 |
| Type | function |
| Call | dim_table(margin, table) |
| Module | contingency_table |
| Notes | get dimension of a margin |
| Name of routine: | sort_table |
|---|---|
| Source lines: | 4882 - 4894 |
| Type | subroutine |
| Call | sort_table(cat, table) |
| Module | contingency_table |
| Notes | reorder values in 1-D table to match order in table index |
| Name of routine: | findlev |
|---|---|
| Source lines: | 4898 - 4946 |
| Type | function |
| Call | findlev(val, table) |
| Module | contingency_table |
| Notes | factor level based on position in (marginal) 1-D table |
| Name of routine: | findrank |
|---|---|
| Source lines: | 4950 - 4969 |
| Type | function |
| Call | findrank(val, table) |
| Module | contingency_table |
| Notes | find rank based on position in 1-D table |
| Name of routine: | setup_pairs |
|---|---|
| Source lines: | 4988 - 4996 |
| Type | subroutine |
| Call | setup_pairs(npairs, pairlist) |
| Module | pairlist_class |
| Notes | allocate space for pairlist |
| Name of routine: | clean_pairs |
|---|---|
| Source lines: | 5000 - 5004 |
| Type | subroutine |
| Call | clean_pairs(pairlist) |
| Module | pairlist_class |
| Notes | deallocate space |
| Name of routine: | expand_pairs |
|---|---|
| Source lines: | 5008 - 5022 |
| Type | subroutine |
| Call | expand_pairs(nextra, pairlist) |
| Module | pairlist_class |
| Notes | increase available space |
| Name of routine: | append_pair |
|---|---|
| Source lines: | 5026 - 5040 |
| Type | subroutine |
| Call | append_pair(key1, key2, pairlist) |
| Module | pairlist_class |
| Notes | append data, testing only latest entry for uniqueness |
| Name of routine: | insert_pair |
|---|---|
| Source lines: | 5044 - 5092 |
| Type | subroutine |
| Call | insert_pair(key1, key2, pairlist) |
| Module | pairlist_class |
| Notes | insert data |
| Name of routine: | find_pair |
|---|---|
| Source lines: | 5096 - 5135 |
| Type | function |
| Call | find_pair(key1, key2, pairlist) |
| Module | pairlist_class |
| Notes | find a pair |
| Name of routine: | clean_AS164 |
|---|---|
| Source lines: | 5145 - 5152 |
| Type | subroutine |
| Call | clean_AS164() |
| Module | AS164_class |
| Notes | Work arrays for AS164 -- allow passing of results to other routines |
| Name of routine: | popgen_init |
|---|---|
| Source lines: | 5181 - 5185 |
| Type | subroutine |
| Call | popgen_init() |
| Module | popgen_vcdata |
| Notes | Cockerham-like multi-locus variance components |
| Name of routine: | popgen_summary |
|---|---|
| Source lines: | 5186 - 5201 |
| Type | subroutine |
| Call | popgen_summary(outstr, plevel) |
| Module | popgen_vcdata |
| Notes | Cockerham-like multi-locus variance components |
| Name of routine: | popgen_homoz |
|---|---|
| Source lines: | 5202 - 5215 |
| Type | subroutine |
| Call | popgen_homoz(outstr, plevel) |
| Module | popgen_vcdata |
| Notes | Cockerham-like multi-locus variance components |
| Name of routine: | pre_grapheps |
|---|---|
| Source lines: | 5224 - 5555 |
| Type | subroutine |
| Call | pre_grapheps(outstr, xbound, ybound) |
| Module | grapheps |
| Notes | The grapheps Postscript functions See http://swiss.csail.mit.edu/~jaffer/Docupage/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) |
| Module | grapheps |
| Notes | Draw simple plot typ 1=scatterplot 2=jittered dotplot 3=mountain 4=bargraph |
| Name of routine: | countargs |
|---|---|
| Source lines: | 12242 - 12312 |
| Type | function |
| Call | countargs(s, typ) |
| Module | None |
| 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 |
| Name of routine: | args |
|---|---|
| Source lines: | 12322 - 12409 |
| Type | subroutine |
| Call | args(s, narg, arg, typ) |
| Module | None |
| 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 |
| Name of routine: | getword |
|---|---|
| Source lines: | 12413 - 12471 |
| Type | subroutine |
| Call | getword(s, which, word) |
| Module | None |
| Notes | extracts the nth whitespace-separated argument from input string s |
| Name of routine: | opchar |
|---|---|
| Source lines: | 12475 - 12485 |
| Type | function |
| Call | opchar(ch) |
| Module | None |
| Notes | is a reserved character for primitives? "()*+-/<=>^:" |
| Name of routine: | nextcmd |
|---|---|
| Source lines: | 12490 - 12548 |
| Type | subroutine |
| Call | nextcmd(commands, numcmd, linlen, s, more) |
| Module | None |
| Notes | count number of commands on line and delineate next command (using position of ";"'s) to be evaluated |
| Name of routine: | ival |
|---|---|
| Source lines: | 12552 - 12571 |
| Type | function |
| Call | ival(string) |
| Module | None |
| Notes | character to integer conversion via internal read |
| Name of routine: | fval |
|---|---|
| Source lines: | 12575 - 12600 |
| Type | function |
| Call | fval(string) |
| Module | None |
| Notes | character to float conversion via internal read |
| Name of routine: | aval |
|---|---|
| Source lines: | 12604 - 12642 |
| Type | function |
| Call | aval(string) |
| Module | None |
| Notes | read allele values either numeric or letter code |
| Name of routine: | locfmt |
|---|---|
| Source lines: | 12646 - 12673 |
| Type | subroutine |
| Call | locfmt(str, rep, newtyp) |
| Module | None |
| Notes | Read simplified locus declaration eg 10m 10 m -> 10 autosomal markers |
| Name of routine: | sow |
|---|---|
| Source lines: | 12677 - 12687 |
| Type | function |
| Call | sow(string) |
| Module | None |
| Notes | skip leading whitespace |
| Name of routine: | eow |
|---|---|
| Source lines: | 12691 - 12700 |
| Type | function |
| Call | eow(string) |
| Module | None |
| Notes | find end of string |
| Name of routine: | sclean |
|---|---|
| Source lines: | 12704 - 12712 |
| Type | subroutine |
| Call | sclean(string) |
| Module | None |
| Notes | scrub non-ASCII characters |
| Name of routine: | ismiss |
|---|---|
| Source lines: | 12716 - 12720 |
| Type | function |
| Call | ismiss(string) |
| Module | None |
| Notes | See if a string is a missing value |
| Name of routine: | isreal |
|---|---|
| Source lines: | 12724 - 12743 |
| Type | function |
| Call | isreal(string) |
| Module | None |
| Notes | See if a string is a valid double precision number |
| Name of routine: | wrsex |
|---|---|
| Source lines: | 12747 - 12756 |
| Type | subroutine |
| Call | wrsex(sex,ch) |
| Module | None |
| Notes | write sex as character |
| Name of routine: | wrdate |
|---|---|
| Source lines: | 12760 - 12773 |
| Type | subroutine |
| Call | wrdate(date,str,typ) |
| Module | None |
| Notes | write date as character |
| Name of routine: | wraff |
|---|---|
| Source lines: | 12777 - 12788 |
| Type | subroutine |
| Call | wraff(value, ch, typ) |
| Module | None |
| Notes | binary trait as character |
| Name of routine: | wrform |
|---|---|
| Source lines: | 12792 - 12806 |
| Type | subroutine |
| Call | wrform(typ, nwid, ndec, fstring) |
| Module | None |
| Notes | Fortran format statement to write one number |
| Name of routine: | idwidths |
|---|---|
| Source lines: | 12810 - 12838 |
| Type | subroutine |
| Call | idwidths(dataset, widths, name_formats) |
| Module | None |
| Notes | Get maximum lengths of ID strings |
| Name of routine: | phist |
|---|---|
| Source lines: | 12842 - 12858 |
| Type | subroutine |
| Call | phist(pval1, pval2, histo) |
| Module | None |
| Notes | write P-values as a histogram: . + * ** *** |
| Name of routine: | annotate |
|---|---|
| Source lines: | 12862 - 12884 |
| Type | subroutine |
| Call | annotate(sta, fin, words, note) |
| Module | None |
| Notes | copy words to a string |
| Name of routine: | append |
|---|---|
| Source lines: | 12888 - 12898 |
| Type | subroutine |
| Call | append(word, note) |
| Module | None |
| Notes | append one word to a string if enough room |
| Name of routine: | addlet |
|---|---|
| Source lines: | 12903 - 12913 |
| Type | subroutine |
| Call | addlet(old, new) |
| Module | None |
| 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 |
| Name of routine: | shorten |
|---|---|
| Source lines: | 12918 - 12959 |
| Type | subroutine |
| Call | shorten(idx, nwords, words, newlen, res) |
| Module | None |
| Notes | create a shorter unique version of a string eg locus name Old versions of MENDEL for instance wants 8 character locus names |
| Name of routine: | makeind |
|---|---|
| Source lines: | 12964 - 13010 |
| Type | subroutine |
| Call | makeind(typ, idx, eos, los, string) |
| Module | None |
| 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 |
| Name of routine: | mknewfil |
|---|---|
| Source lines: | 13014 - 13027 |
| Type | subroutine |
| Call | mknewfil(str, filnam, wrkdir) |
| Module | None |
| Notes | Create a new file (deleting old instances of that name |
| Name of routine: | openlog |
|---|---|
| Source lines: | 13031 - 13055 |
| Type | subroutine |
| Call | openlog(lstr, logfil, nhis) |
| Module | None |
| Notes | Open the standard log file "sib-pair.log" |
| Name of routine: | findfile |
|---|---|
| Source lines: | 13059 - 13088 |
| Type | subroutine |
| Call | findfile(fil, stat) |
| Module | None |
| Notes | Find a file along the search path -- check pwd, then HOME first |
| Name of routine: | reclen |
|---|---|
| Source lines: | 13095 - 13117 |
| Type | subroutine |
| Call | reclen(strm, buffer, longest) |
| Module | None |
| Notes | Return longest line of file Use lin as buffer Relies on iostat=-2 as eol |
| Name of routine: | fchooser |
|---|---|
| Source lines: | 13123 - 13175 |
| Type | subroutine |
| Call | fchooser(fil, gui, plevel) |
| Module | None |
| Notes | GUI stuff Uses JAPI to call AWT, or PILIB to call GTK2 if present else simple file picker |
| Name of routine: | fpicker |
|---|---|
| Source lines: | 13180 - 13284 |
| Type | subroutine |
| Call | fpicker(fil, plevel) |
| Module | None |
| Notes | Text based Windows file picker |
| Name of routine: | fpicker |
|---|---|
| Source lines: | 13289 - 13371 |
| Type | subroutine |
| Call | fpicker(fil, plevel) |
| Module | None |
| Notes | Text based file picker |
| 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) |
| Module | None |
| Notes | Info |
| Name of routine: | help |
|---|---|
| Source lines: | 13438 - 13828 |
| Type | subroutine |
| Call | help(typ, regexp, lin, twrk) |
| Module | None |
| Notes | brief online help |
| Name of routine: | shell |
|---|---|
| Source lines: | 13832 - 13861 |
| Type | subroutine |
| Call | shell(lin, plevel) |
| Module | None |
| Notes |
pass line to shell -- requires existence of fairly
standard routine system()
|
| Name of routine: | stamp |
|---|---|
| Source lines: | 13865 - 13885 |
| Type | subroutine |
| Call | stamp(t0) |
| Module | None |
| Notes | write elapsed time since first/last asked |
| Name of routine: | proct |
|---|---|
| Source lines: | 13889 - 13899 |
| Type | subroutine |
| Call | proct(t1, plevel) |
| Module | None |
| Notes | time a procedure |
| Name of routine: | gettrait |
|---|---|
| Source lines: | 13905 - 13955 |
| Type | subroutine |
| Call | gettrait(nam, typ1, typ2, nloci, loc, loctyp, trait, plevel) |
| Module | None |
| Notes | determine if word is name of a trait locus typ1=10, any locus type typ1,typ2=1..5, that locus type only |
| Name of routine: | isinuse |
|---|---|
| Source lines: | 13959 - 13988 |
| Type | function |
| Call | isinuse(string, nloci, loc) |
| Module | None |
| Notes | check if name is not already used or reserved |
| Name of routine: | getbin |
|---|---|
| Source lines: | 13992 - 14045 |
| Type | subroutine |
| Call | getbin(sta, fin, words, nloci, loc, loctyp, trait, gt, thresh) |
| Module | None |
| Notes | Get a single binary trait or dichotomized quantitative trait |
| Name of routine: | loadnam |
|---|---|
| Source lines: | 14055 - 14228 |
| Type | subroutine |
| Call | loadnam(sta, fin, words, nloci, loc, loctyp, map, chosen, nterms, terms, filter, typ) |
| Module | None |
| 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) |
| Name of routine: | listloci |
|---|---|
| Source lines: | 14232 - 14297 |
| Type | subroutine |
| Call | listloci(nord, locord, nloci, loc, loctyp, locpos, locnotes, typ) |
| Module | None |
| Notes | List loci |
| Name of routine: | newlin |
|---|---|
| Source lines: | 14301 - 14318 |
| Type | subroutine |
| Call | newlin(sol, eol, pos, newpos) |
| Module | None |
| Notes | format free output |
| Name of routine: | cntclasses |
|---|---|
| Source lines: | 14322 - 14358 |
| Type | subroutine |
| Call | cntclasses(nloci, loctyp) |
| Module | None |
| Notes | Output counts of class of loci |
| Name of routine: | cntmark |
|---|---|
| Source lines: | 14362 - 14380 |
| Type | subroutine |
| Call | cntmark(nloci, loctyp, nmark, typ) |
| Module | None |
| Notes | Count active codominant markers or active loci |
| Name of routine: | findmk |
|---|---|
| Source lines: | 14384 - 14402 |
| Type | function |
| Call | findmk(sta, fin, loctyp) |
| Module | None |
| Notes | Find next active codominant marker in list |
| Name of routine: | findml |
|---|---|
| Source lines: | 14406 - 14423 |
| Type | function |
| Call | findml(nord, locord, loctyp) |
| Module | None |
| Notes | Find first codominant or haploid marker in list |
| Name of routine: | ldlist |
|---|---|
| Source lines: | 14428 - 14485 |
| Type | subroutine |
| Call | ldlist(typ, loc1, loc2, nloci, loctyp, last) |
| Module | None |
| Notes |
produce next pair of markers from:
1. named pair 2. One named 3. map order 4. all pairs 10. empty
|
| Name of routine: | complete |
|---|---|
| Source lines: | 14489 - 14513 |
| Type | function |
| Call | complete(useimp, idx, nvar, terms, locpos, loctyp, dataset) |
| Module | None |
| Notes | test if complete data for this individual |
| Name of routine: | getlin |
|---|---|
| Source lines: | 14517 - 14539 |
| Type | subroutine |
| Call | getlin(strm, narg, words, lin, skipbl) |
| Module | None |
| Notes | Get a line from the stream |
| Name of routine: | rdmerloc |
|---|---|
| Source lines: | 14543 - 14624 |
| Type | subroutine |
| Call | rdmerloc(strm, xli, lin, nloci, loc, locpos, loctyp, locnotes, numloc, twinning, twintype, twintrait) |
| Module | None |
| Notes | Read a MERLIN locus file |
| Name of routine: | readmap |
|---|---|
| Source lines: | 14629 - 14817 |
| Type | subroutine |
| Call | readmap(strm, units, lin, words, nloci, loc, loctyp, locnotes, map, plevel) |
| Module | None |
| Notes | Read a mapfile -- attempts to intelligently decide what to read |
| Name of routine: | rdlinloc |
|---|---|
| Source lines: | 14821 - 15013 |
| Type | subroutine |
| Call | rdlinloc(strm, lin, words, numloc) |
| Module | None |
| Notes | Read a Linkage locus file |
| Name of routine: | rdfreq |
|---|---|
| Source lines: | 15018 - 15098 |
| Type | subroutine |
| Call | rdfreq(sta, fin, words, allele_buffer) |
| Module | None |
| Notes | read a set of allele frequencies from the command line make up some numbers if necessary |
| Name of routine: | ordvar |
|---|---|
| Source lines: | 15102 - 15143 |
| Type | subroutine |
| Call | ordvar(twrk, nloci, loc, loctyp, locpos, nord, locord, map, locstat, locnotes, ord) |
| Module | None |
| Notes | Make change in order of variables |
| Name of routine: | packer |
|---|---|
| Source lines: | 15147 - 15255 |
| Type | subroutine |
| Call | packer(typ, wrk, wrk2, nloci, loc, loctyp, locpos, map, locnotes, dataset, plevel) |
| Module | None |
| Notes | pack pedigrees and loci |
| Name of routine: | chfind |
|---|---|
| Source lines: | 15259 - 15279 |
| Type | function |
| Call | chfind(string, ch) |
| Module | None |
| Notes | find an unescaped character in a string |
| Name of routine: | strfind |
|---|---|
| Source lines: | 15284 - 15363 |
| Type | function |
| Call | strfind(regexp, targt, nocase) |
| Module | None |
| Notes | Compare string to a search string, allowing wildcards '*.', and case matching |
| Name of routine: | escape |
|---|---|
| Source lines: | 15367 - 15393 |
| Type | subroutine |
| Call | escape(str, trget) |
| Module | None |
| Notes | Escape a target character, usually " |
| Name of routine: | string_hash |
|---|---|
| Source lines: | 15397 - 15408 |
| Type | function |
| Call | string_hash(str, ibound) |
| Module | None |
| Notes | String hash function (that used by SRFI-64) |
| Name of routine: | bonf |
|---|---|
| Source lines: | 15412 - 15421 |
| Type | function |
| Call | bonf(ntest,alpha) |
| Module | None |
| Notes | Calculate Bonferroni corrected P-value for given number of tests |
| Name of routine: | dsort |
|---|---|
| Source lines: | 15426 - 15545 |
| Type | subroutine |
| Call | dsort(n, dx) |
| Module | None |
| Notes | SLATEC quicksort routine. Jones, Kahaner and Wisniewski. double precision |
| Name of routine: | srank |
|---|---|
| Source lines: | 15552 - 15714 |
| Type | subroutine |
| Call | srank(n, x, iy) |
| Module | None |
| 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 |
| Name of routine: | iscomp |
|---|---|
| Source lines: | 16110 - 16118 |
| Type | function |
| Call | iscomp(op) |
| Module | None |
| Notes | determine if trait being compared to a constant, for isaff |
| Name of routine: | docomp |
|---|---|
| Source lines: | 16124 - 16168 |
| Type | subroutine |
| Call | docomp(pos, words, gt, thresh) |
| Module | None |
| Notes | parse comparison in isaff 15='<', 16='>', 17='ge', 18='le',19='ne',20='eq' 21='odd', 22='even' |
| Name of routine: | defpro |
|---|---|
| Source lines: | 16172 - 16193 |
| Type | subroutine |
| Call | defpro(gt, thresh) |
| Module | None |
| Notes | Message defining proband based on comparison |
| Name of routine: | isaff |
|---|---|
| Source lines: | 16197 - 16229 |
| Type | function |
| Call | isaff(val, thresh, gt) |
| Module | None |
| Notes | determine if index person is affected or unaffected |
| Name of routine: | isatwin |
|---|---|
| Source lines: | 16233 - 16241 |
| Type | function |
| Call | isatwin(twintype, twinind) |
| Module | None |
| Notes | Is an MZ twin? |
| Name of routine: | order |
|---|---|
| Source lines: | 16245 - 16254 |
| Type | subroutine |
| Call | order(all1, all2) |
| Module | None |
| Notes | swap alleles so ordered consistently |
| Name of routine: | swap |
|---|---|
| Source lines: | 16258 - 16266 |
| Type | subroutine |
| Call | swap(all1, all2) |
| Module | None |
| Notes | swap alleles |
| Name of routine: | lorder |
|---|---|
| Source lines: | 16278 - 16346 |
| Type | subroutine |
| Call | lorder(typ, addummy, liab, liabclass, nloci, loctyp, nord, locord) |
| Module | None |
| 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 |
| Name of routine: | isinenv |
|---|---|
| Source lines: | 16350 - 16361 |
| Type | function |
| Call | isinenv(word,nvar,envnam) |
| Module | None |
| Notes | Is a bound environmental variable? and if so where? |
| Name of routine: | readcases |
|---|---|
| Source lines: | 16367 - 16593 |
| Type | subroutine |
| Call | readcases(strm, hassex, skipline, numloc, locord, dataset, longnam, longest, nwarn, plevel) |
| Module | None |
| Notes | Read file containing just unrelated individuals Duplicates (if contiguous) are combined into the same "family" with appended copy numbers |
| 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) |
| Module | None |
| Notes | Read pedigree file |
| 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) |
| Module | None |
| Notes | All members of pedigree now read in, error check and sort |
| Name of routine: | tabid |
|---|---|
| Source lines: | 17159 - 17199 |
| Type | subroutine |
| Call | tabid(curid, nid, indx, id, counts, incr, idpos) |
| Module | None |
| Notes | Tabulate alphanumeric IDs in order of appearance |
| 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) |
| Module | None |
| 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 |
| Name of routine: | msdsort |
|---|---|
| Source lines: | 17373 - 17396 |
| Type | subroutine |
| Call | msdsort(bot,top,key1,key2,ord) |
| Module | None |
| Notes | MSD radix sort key1, key2 |
| Name of routine: | mkdummy |
|---|---|
| Source lines: | 17400 - 17428 |
| Type | subroutine |
| Call | mkdummy(num, nfound, sx, addsex, numloc, buffer) |
| Module | None |
| Notes | Create dummy records for added individals |
| Name of routine: | asstyp |
|---|---|
| Source lines: | 17432 - 17452 |
| Type | subroutine |
| Call | asstyp(nloci, loctyp, locpos, numloc, coltyp) |
| Module | None |
| Notes | Assign a locus type to every column of data file |
| Name of routine: | addvar |
|---|---|
| Source lines: | 17456 - 17505 |
| Type | subroutine |
| Call | addvar(wrk, wrk2, newloc, dataset, plevel) |
| Module | None |
| Notes | Add extra blank columns to the dataset |
| Name of routine: | wrkout |
|---|---|
| Source lines: | 17509 - 17539 |
| Type | subroutine |
| Call | wrkout(wrk, wrk2, ped, dataset, nped, nobs) |
| Module | None |
| Notes | Write out current pedigree to a work file, updating number of records |
| Name of routine: | pedin |
|---|---|
| Source lines: | 17545 - 17592 |
| Type | subroutine |
| Call | pedin(wrk, wrk2, nped, nobs, numloc, numcol, dataset) |
| Module | None |
| Notes | Read pedigree back in from work files May allocate extra blank columns in dataset%locus for later use by numcol > numloc |
| Name of routine: | replacedata |
|---|---|
| Source lines: | 17599 - 17781 |
| Type | subroutine |
| Call | replacedata(wrk, nloci, loc, loctyp, locpos, chosen, lin, words, hashtab, dataset, plevel) |
| Module | None |
| 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 |
| Name of routine: | concat |
|---|---|
| Source lines: | 17785 - 17804 |
| Type | subroutine |
| Call | concat(dirnam, filnam) |
| Module | None |
| Notes | Prefix filnam |
| Name of routine: | slash |
|---|---|
| Source lines: | 17809 - 17825 |
| Type | subroutine |
| Call | slash(dirnam, lend) |
| Module | None |
| Notes | Test what character used to separate directories and append to directory |
| Name of routine: | display |
|---|---|
| Source lines: | 17829 - 17856 |
| Type | subroutine |
| Call | display(str) |
| Module | None |
| Notes | Print a string, stripping out C-style escapes |
| Name of routine: | cat |
|---|---|
| Source lines: | 17860 - 17878 |
| Type | subroutine |
| Call | cat(strm, fil, linbuf) |
| Module | None |
| Notes | Display contents of a file |
| Name of routine: | wrmap |
|---|---|
| Source lines: | 17898 - 18132 |
| Type | subroutine |
| Call | wrmap(ostr, typ, mapf, nloci, loc, loctyp, locnotes, nord, locord, map) |
| Module | None |
| 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 |
| Name of routine: | pedhead |
|---|---|
| Source lines: | 18136 - 18210 |
| Type | subroutine |
| Call | pedhead(name_widths, name_formats, nwid, nloci, loc, loctyp) |
| Module | None |
| Notes | Write out pedigree header with locus names |
| 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) |
| Module | None |
| Notes | Write out GAS style pedigree |
| 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) |
| Module | None |
| 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
|
| Name of routine: | wrphe |
|---|---|
| Source lines: | 18624 - 18688 |
| Type | subroutine |
| Call | wrphe(strm, imp, nwid, ndec, nloci, loc, loctyp, locpos, dataset) |
| Module | None |
| Notes | write out Mapmaker-Sibs/FBAT/etc phenotype file whitespace delimited ped id trait1...traitN write out Mapmaker-Sibs phenotype file |
| 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) |
| Module | None |
| 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) |
| Name of routine: | wrmorg |
|---|---|
| Source lines: | 18909 - 19064 |
| Type | subroutine |
| Call | wrmorg(strm, typ, nwid, ndec, nloci, loc, loctyp, locpos, smlfreq, smlpen, dataset) |
| Module | None |
| Notes | Write out pedigree for Morgan typ 1 pedigree and traits 2 id, markers |
| Name of routine: | wrdot |
|---|---|
| Source lines: | 19068 - 19137 |
| Type | subroutine |
| Call | wrdot(strm, trait, gene, dataset) |
| Module | None |
| Notes | Describe pedigree using dot graphics language |
| Name of routine: | wrprd |
|---|---|
| Source lines: | 19141 - 19186 |
| Type | subroutine |
| Call | wrprd(strm, typ, trait, nloci, loc, loctyp, locpos, dataset) |
| Module | None |
| Notes | write out data file used by Jonathon Pritchard's structure program |
| Name of routine: | wrbeagle |
|---|---|
| Source lines: | 19190 - 19259 |
| Type | subroutine |
| Call | wrbeagle(strm, typ, nloci, loc, loctyp, locpos, dataset) |
| Module | None |
| Notes | write out data file used by Browning and Browning's Beagle program |
| Name of routine: | wrpap |
|---|---|
| Source lines: | 19263 - 19390 |
| Type | subroutine |
| Call | wrpap(trip, phen, nloci, loc, loctyp, locpos, dataset) |
| Module | None |
| Notes | Write out old-style PAP pedigree |
| Name of routine: | simdata |
|---|---|
| Source lines: | 19395 - 19455 |
| Type | subroutine |
| Call | simdata(strm, nped, ngen, nminoff, nmaxoff, numloc) |
| Module | None |
| Notes | end-of-wrpap Write a file of simulated pedigrees |
| Name of routine: | showdata |
|---|---|
| Source lines: | 19459 - 19523 |
| Type | subroutine |
| Call | showdata(fped, fid, larg, words, nloci, loc, loctyp, locpos, dataset, nwid, ndec) |
| Module | None |
| Notes | Write out data for particular pedigree or particular person |
| Name of routine: | wrind |
|---|---|
| Source lines: | 19527 - 19587 |
| Type | subroutine |
| Call | wrind(idx, nloci, loc, loctyp, locpos, dataset, nwid, ndec) |
| Module | None |
| Notes | Write out data for an individual |
| Name of routine: | prdata |
|---|---|
| Source lines: | 19591 - 19635 |
| Type | subroutine |
| Call | prdata(idx, sta, fin, typ, nloci, loc, loctyp, locpos, dataset) |
| Module | None |
| Notes | Print subset of data for an individual -- for messages |
| Name of routine: | prgtp |
|---|---|
| Source lines: | 19639 - 19652 |
| Type | subroutine |
| Call | prgtp(idx, gene, dataset, gtp) |
| Module | None |
| Notes | print one genotype from dataset |
| Name of routine: | wrid |
|---|---|
| Source lines: | 19657 - 19677 |
| Type | subroutine |
| Call | wrid(just, id, chid, sx) |
| Module | None |
| Notes | Write id as justified (l,c,r) string, possibly indicating sex as male [101] or female (102) |
| Name of routine: | decgtp |
|---|---|
| Source lines: | 19681 - 19694 |
| Type | subroutine |
| Call | decgtp(value, g1, g2) |
| Module | None |
| Notes | Decode genotype code |
| Name of routine: | encgtp |
|---|---|
| Source lines: | 19698 - 19708 |
| Type | function |
| Call | encgtp(a1, a2) |
| Module | None |
| Notes | Hash a genotype |
| Name of routine: | iencgtp |
|---|---|
| Source lines: | 19712 - 19724 |
| Type | function |
| Call | iencgtp(a1, a2) |
| Module | None |
| Notes | Hash an integer genotype |
| Name of routine: | wrpercent |
|---|---|
| Source lines: | 19728 - 19738 |
| Type | function |
| Call | wrpercent(num, den) |
| Module | None |
| Notes | Write out a percentage |
| Name of routine: | wrtrait |
|---|---|
| Source lines: | 19742 - 19790 |
| Type | subroutine |
| Call | wrtrait(value, str, typ, nwid, ndec) |
| Module | None |
| Notes | Write out trait value to a string |
| Name of routine: | wrgtp |
|---|---|
| Source lines: | 19794 - 19841 |
| Type | subroutine |
| Call | wrgtp(all1, all2, gtp, typ) |
| Module | None |
| Notes | Write out a genotype |
| Name of routine: | wrall |
|---|---|
| Source lines: | 19845 - 19862 |
| Type | subroutine |
| Call | wrall(iall, allel) |
| Module | None |
| Notes | Write an allele |
| Name of routine: | juststr |
|---|---|
| Source lines: | 19866 - 19890 |
| Type | subroutine |
| Call | juststr(just,string,length) |
| Module | None |
| Notes | Justify a string of characters within a string |
| Name of routine: | ascend |
|---|---|
| Source lines: | 19894 - 19901 |
| Type | subroutine |
| Call | ascend(n, ia) |
| Module | None |
| Notes | Initialize array with value of index |
| Name of routine: | connect |
|---|---|
| Source lines: | 19905 - 20004 |
| Type | subroutine |
| Call | connect(num, fa, mo, set, nsub, maxgrp) |
| Module | None |
| Notes | See if all members of a pedigree are connected |
| Name of routine: | addlist |
|---|---|
| Source lines: | 20009 - 20019 |
| Type | subroutine |
| Call | addlist(pos, idx, set) |
| Module | None |
| Notes | Shift an individual from the list of ungrouped individuals to the appropriate group (subpedigree) nucleating around the index person. |
| Name of routine: | findlist |
|---|---|
| Source lines: | 20023 - 20038 |
| Type | subroutine |
| Call | findlist(trget, num, set, pos) |
| Module | None |
| Notes | Find list number <target> |
| Name of routine: | badloop |
|---|---|
| Source lines: | 20042 - 20110 |
| Type | subroutine |
| Call | badloop(pedigree, num, id, key, fa, mo, nerr) |
| Module | None |
| Notes | Find pathological loops in current pedigree |
| Name of routine: | wrsubped |
|---|---|
| Source lines: | 20114 - 20152 |
| Type | subroutine |
| Call | wrsubped(pedigree, num, id, key, set, nsub, maxgrp, plevel) |
| Module | None |
| Notes | List the members of pedigree(s) |
| Name of routine: | gener |
|---|---|
| Source lines: | 20158 - 20328 |
| Type | subroutine |
| Call | gener(pedigree, num, fa, mo, nsub, set, ord, higen, nerr, plevel) |
| Module | None |
| 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. |
| Name of routine: | dogen |
|---|---|
| Source lines: | 20333 - 20469 |
| Type | subroutine |
| Call | dogen(dataset, trait, typ, plevel) |
| Module | None |
| Notes | Write out pedigrees as list of nuclear families plus marry-ins by generation number |
| Name of routine: | wrgen |
|---|---|
| Source lines: | 20474 - 20531 |
| Type | subroutine |
| Call | wrgen(ped, dataset, curped, set, higen, ord) |
| Module | None |
| Notes | Write out structure and generation numbers List of sibships by generation number |
| Name of routine: | tidydata |
|---|---|
| Source lines: | 20535 - 20584 |
| Type | subroutine |
| Call | tidydata(nloci, loctyp, locpos, dataset, tottyp) |
| Module | None |
| Notes | Round up allele sizes etc |
| Name of routine: | duplicates |
|---|---|
| Source lines: | 20588 - 20627 |
| Type | subroutine |
| Call | duplicates(dataset, plevel) |
| Module | None |
| Notes | Check for duplicate pedigrees or records |
| Name of routine: | showdups |
|---|---|
| Source lines: | 20631 - 20659 |
| Type | subroutine |
| Call | showdups(pos, ncopies, pedname, pedpos, dataset, plevel) |
| Module | None |
| Notes | Print the duplicates for current pedigree |
| Name of routine: | testhap |
|---|---|
| Source lines: | 20663 - 20861 |
| Type | subroutine |
| Call | testhap(typ, nloci, loc, loctyp, locpos, dataset, inconsist, plevel) |
| Module | None |
| Notes | Check haploid markers 1=Y 2=Mit |
| Name of routine: | testsex |
|---|---|
| Source lines: | 20884 - 21076 |
| Type | subroutine |
| Call | testsex(sexcrit, sexmarker, nloci, loc, loctyp, locpos, dataset, allele_buffer, inconsist, plevel) |
| Module | None |
| 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
|
| Name of routine: | mzgtp |
|---|---|
| Source lines: | 21080 - 21237 |
| Type | subroutine |
| Call | mzgtp(mztwin, gt, thresh, nloci, loc, loctyp, locpos, dataset, inconsist, plevel) |
| Module | None |
| Notes | Test monozygotic twins |
| Name of routine: | dropt2 |
|---|---|
| Source lines: | 21242 - 21418 |
| Type | subroutine |
| Call | dropt2(mztwin, gt, thresh, typ, nloci, loc, loctyp, locpos, dataset, plevel) |
| Module | None |
| Notes | Delete MZ twin with least phenotype information out of pair or clean MZ genotypes |
| Name of routine: | countmz |
|---|---|
| Source lines: | 21422 - 21522 |
| Type | subroutine |
| Call | countmz(mztwin, gt, thresh, dataset, plevel) |
| Module | None |
| Notes | Count up MZ twins, triplets, quads, higher |
| Name of routine: | testage |
|---|---|
| Source lines: | 21526 - 21582 |
| Type | subroutine |
| Call | testage(typ, locnam, trait, thresh, dataset, droperr, plevel) |
| Module | None |
| Notes | Test ages or DOB for consistency |
| Name of routine: | testpage |
|---|---|
| Source lines: | 21586 - 21635 |
| Type | subroutine |
| Call | testpage(typ, locnam, trait, ped, idx, parent, thresh, dataset, droperr) |
| Module | None |
| Notes | Test a parent |
| Name of routine: | ckibs |
|---|---|
| Source lines: | 21640 - 21751 |
| Type | subroutine |
| Call | ckibs(nloci, loctyp, locpos, allele_buffer, dataset) |
| Module | None |
| Notes | Check if multilocus ibs sharing for pairs of sibs is consistent with purported relationship. Again as per Bishop et al 1990 |
| Name of routine: | genmatch |
|---|---|
| Source lines: | 21756 - 21895 |
| Type | subroutine |
| Call | genmatch(tped, tid, nloci, loc, loctyp, locpos, dataset) |
| Module | None |
| Notes | Find closest match of genotypes between index person and all other active individuals |
| Name of routine: | cntibs |
|---|---|
| Source lines: | 21899 - 21932 |
| Type | subroutine |
| Call | cntibs(idx, nmark, geno, ord, locpos, dataset, nmatch, ibs) |
| Module | None |
| Notes | IBS at specified set of markers |
| Name of routine: | freq |
|---|---|
| Source lines: | 21940 - 22074 |
| Type | subroutine |
| Call | freq(gene, loctyp, fndr, dataset, allele_buffer) |
| Module | None |
| 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 |
| Name of routine: | tab |
|---|---|
| Source lines: | 22079 - 22114 |
| Type | subroutine |
| Call | tab(curr, allele_buffer, wei) |
| Module | None |
| Notes | update table of counts of alleles -- binary search and insertion sort if allele_buffer too small, increase size |
| Name of routine: | wrfreq |
|---|---|
| Source lines: | 22118 - 22346 |
| Type | subroutine |
| Call | wrfreq(strm, locnam, mappos, locnote, allele_buffer, fstyle) |
| Module | None |
| Notes | Write out frequencies in 16 different styles |
| Name of routine: | getchr |
|---|---|
| Source lines: | 22350 - 22369 |
| Type | subroutine |
| Call | getchr(locnam, chr) |
| Module | None |
| Notes | Get chromosome number from locus name of form "DnnSn" |
| Name of routine: | precis |
|---|---|
| Source lines: | 22374 - 22408 |
| Type | subroutine |
| Call | precis(numal, allele_freqs, ndec) |
| Module | None |
| Notes | remove rounding errors in allele frequencies printed out to precision ndec from f3.1 to f9.7 |
| Name of routine: | uninf |
|---|---|
| Source lines: | 22412 - 22423 |
| Type | function |
| Call | uninf(numal, allele_freqs) |
| Module | None |
| Notes | Frequency of uninformative matings for marker locus |
| Name of routine: | getfreq |
|---|---|
| Source lines: | 22427 - 22445 |
| Type | function |
| Call | getfreq(allele, allele_set) |
| Module | None |
| Notes | find allele frequency |
| Name of routine: | getnam |
|---|---|
| Source lines: | 22449 - 22472 |
| Type | function |
| Call | getnam(rall, allele_set) |
| Module | None |
| Notes | find index for allele |
| Name of routine: | match |
|---|---|
| Source lines: | 22476 - 22497 |
| Type | subroutine |
| Call | match(ival,num,key,pos) |
| Module | None |
| Notes | Binary search for position of value in an ascending sorted array -- integer |
| Name of routine: | dmatch |
|---|---|
| Source lines: | 22501 - 22522 |
| Type | subroutine |
| Call | dmatch(val, num, key, pos) |
| Module | None |
| Notes | Binary search for position of value in an ascending sorted array -- double precision |
| Name of routine: | actped |
|---|---|
| Source lines: | 22526 - 22611 |
| Type | subroutine |
| Call | actped(red, pedfil, nloci, loc, loctyp, locpos, locnotes, typed, dataset, plevel) |
| Module | None |
| Notes | summarize current pedigree file |
| Name of routine: | sumped |
|---|---|
| Source lines: | 22615 - 22677 |
| Type | subroutine |
| Call | sumped(nloci, loctyp, locpos, dataset) |
| Module | None |
| Notes |
Summary statistics on families
|
| Name of routine: | countships |
|---|---|
| Source lines: | 22681 - 22698 |
| Type | function |
| Call | countships(ped, dataset) |
| Module | None |
| Notes | Count matings/sibships in current family |
| Name of routine: | listids |
|---|---|
| Source lines: | 22702 - 22795 |
| Type | subroutine |
| Call | listids(dataset, ithresh, plevel) |
| Module | None |
| Notes | Tabulate all IDs |
| Name of routine: | listtwins |
|---|---|
| Source lines: | 22799 - 22825 |
| Type | subroutine |
| Call | listtwins(dataset, plevel) |
| Module | None |
| Notes | MZ Twins |
| Name of routine: | check |
|---|---|
| Source lines: | 22838 - 23113 |
| Type | subroutine |
| Call | check(nloci, loc, loctyp, locpos, locnotes, dataset, droperr, ndiscard, inconsist, plevel) |
| Module | None |
| 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 |
| Name of routine: | addall |
|---|---|
| Source lines: | 23117 - 23133 |
| Type | subroutine |
| Call | addall(iall,nall,allmax,allele) |
| Module | None |
| Notes | identify parental alleles in nuclear family |
| Name of routine: | nuchek |
|---|---|
| Source lines: | 23137 - 23220 |
| Type | subroutine |
| Call | nuchek(xlinkd, ptyped, p11, p12, p21, p22, nkids, set, xmale, nall, allele, thiserr) |
| Module | None |
| Notes | nuclear family consistency check (untyped parents) |
| Name of routine: | famerr |
|---|---|
| Source lines: | 23224 - 23264 |
| Type | subroutine |
| Call | famerr(locnam, gene, xlinkd, ped, dataset, currf, currm, badchild, sta, fin, errtyp, plevel) |
| Module | None |
| Notes | Write out nuclear family error |
| Name of routine: | inderr |
|---|---|
| Source lines: | 23268 - 23285 |
| Type | subroutine |
| Call | inderr(pedigree, cid, locnam, all1, all2) |
| Module | None |
| Notes | write genotype for an individual flagged as a Mendelian error |
| Name of routine: | remove |
|---|---|
| Source lines: | 23289 - 23303 |
| Type | subroutine |
| Call | remove(idx, gene, dataset, ndiscard) |
| Module | None |
| Notes | Remove a genotype from data |
| Name of routine: | remfam |
|---|---|
| Source lines: | 23307 - 23323 |
| Type | subroutine |
| Call | remfam(currf, currm, sta, fin, gene, dataset, ndiscard) |
| Module | None |
| Notes | drop a nuclear family's genotypes |
| Name of routine: | parcon |
|---|---|
| Source lines: | 23329 - 23348 |
| Type | function |
| Call | parcon(c1, c2, p11, p12, p21, p22, xmale) |
| Module | None |
| 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 |
| Name of routine: | opcon |
|---|---|
| Source lines: | 23352 - 23359 |
| Type | function |
| Call | opcon(c1,c2,p1,p2) |
| Module | None |
| Notes | test if child genotype consistent with one parental genotype |
| Name of routine: | shipcon |
|---|---|
| Source lines: | 23363 - 23380 |
| Type | function |
| Call | shipcon(pg1, pg2, mg1, mg2, nkids, set, xmale) |
| Module | None |
| Notes | test consistency of a sibship with parents |
| Name of routine: | couple |
|---|---|
| Source lines: | 23385 - 23402 |
| Type | subroutine |
| Call | couple(idx,tot,rang,i1,i2) |
| Module | None |
| Notes | Enumerate all combinations of i ~ I(1..range) with itself If index=tot then return last tuple |
| Name of routine: | whall |
|---|---|
| Source lines: | 23406 - 23421 |
| Type | function |
| Call | whall(iall,nall,allele) |
| Module | None |
| Notes | Find index of allele segregating in nuclear family |
| Name of routine: | describe |
|---|---|
| Source lines: | 23425 - 23650 |
| Type | subroutine |
| Call | describe(locnam, gene, xlinkd, ped, dataset, currf, currm, sta, fin, mesg) |
| Module | None |
| Notes | write out genotypes in nuclear family and grandparents |
| Name of routine: | famset |
|---|---|
| Source lines: | 23655 - 23816 |
| Type | subroutine |
| Call | famset(ped, dataset, currf, currm, sta, fin, gene, set, gset) |
| Module | None |
| Notes | Write out phenoset for a nuclear family (plus grandparents and halfsibs) Useful in detecting sources of long distance Mendelian inconsistencies. |
| Name of routine: | indset |
|---|---|
| Source lines: | 23820 - 23863 |
| Type | subroutine |
| Call | indset(idx, gene, pedoffset, dataset, set, gset) |
| Module | None |
| Notes | write out phenoset for an individual |
| Name of routine: | allinset |
|---|---|
| Source lines: | 23867 - 23883 |
| Type | function |
| Call | allinset(idx, iall, ngeno, gset) |
| Module | None |
| Notes | see if particular allele in phenoset for idx person |
| Name of routine: | cntbad |
|---|---|
| Source lines: | 23887 - 23899 |
| Type | subroutine |
| Call | cntbad(idx, ngeno, gset) |
| Module | None |
| Notes | If phenoset contains zero legal genotypes, reconstruct last state |
| Name of routine: | wroddall |
|---|---|
| Source lines: | 23903 - 23923 |
| Type | subroutine |
| Call | wroddall(pedigree, parent, child, iall, partyp) |
| Module | None |
| Notes | If find an odd-allele-out, write out its location |
| Name of routine: | start |
|---|---|
| Source lines: | 23928 - 24050 |
| Type | subroutine |
| Call | start(maxtry, nloci, loc, loctyp, locpos, dataset, allele_buffer, inconsist, plevel) |
| Module | None |
| Notes | If Lange-Goradia algorithm not used, initialize genotypes for random walk algorithms via a conditional gene dropping algorithm |
| Name of routine: | workpointers |
|---|---|
| Source lines: | 24054 - 24079 |
| Type | subroutine |
| Call | workpointers(ped, dataset, fa, mo, imztwin) |
| Module | None |
| Notes | make parental pointers offset for local work array |
| Name of routine: | dattoset |
|---|---|
| Source lines: | 24083 - 24112 |
| Type | subroutine |
| Call | dattoset(sta, fin, gene, dataset, allele_buffer, set) |
| Module | None |
| Notes | transfer genotypes to working array |
| 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) |
| Module | None |
| Notes | start genotypes for one pedigree |
| Name of routine: | genof3 |
|---|---|
| Source lines: | 24206 - 24300 |
| Type | subroutine |
| Call | genof3(idx, fa, mo, xmale, set, sibd, key, failid) |
| Module | None |
| Notes | Drop ibd-alleles conditional on observed markers and randomly where marker genotype not observed -- restart if later generates inconsistency |
| Name of routine: | fillin |
|---|---|
| Source lines: | 24304 - 24361 |
| Type | subroutine |
| Call | fillin(allele_buffer, num, nfound, set, sibd, key, sta, fin, gene, dataset) |
| Module | None |
| Notes | infer missing genotypes based on sibd values after run of start |
| Name of routine: | found |
|---|---|
| Source lines: | 24365 - 24378 |
| Type | subroutine |
| Call | found(cumfrq, allele) |
| Module | None |
| Notes | founder frequency |
| Name of routine: | coutyp |
|---|---|
| Source lines: | 24382 - 24417 |
| Type | subroutine |
| Call | coutyp(nloci, loctyp, locpos, dataset, typed) |
| Module | None |
| Notes | Give counts of typed individuals for each locus |
| Name of routine: | thetaf |
|---|---|
| Source lines: | 24427 - 24444 |
| Type | function |
| Call | thetaf(het, n) |
| Module | None |
| 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
|
| Name of routine: | qtlpars |
|---|---|
| Source lines: | 24448 - 24493 |
| Type | subroutine |
| Call | qtlpars(p,m1,m2,m3,sd1,sd2,sd3) |
| Module | None |
| Notes | Calculate variances for a given SML model |
| Name of routine: | ccpen |
|---|---|
| Source lines: | 24498 - 24512 |
| Type | subroutine |
| Call | ccpen(prev, pca, pco) |
| Module | None |
| Notes | Calculate penetrances for a particular prevalence and case and control allele frequencies |
| Name of routine: | grrpen |
|---|---|
| Source lines: | 24516 - 24549 |
| Type | subroutine |
| Call | grrpen(model, prev, q, grr) |
| Module | None |
| Notes | Calculate penetrances for a particular prevalence and genotypic RR |
| Name of routine: | recrisk |
|---|---|
| Source lines: | 24553 - 24639 |
| Type | subroutine |
| Call | recrisk(q,f1,f2,f3) |
| Module | None |
| Notes | Calculate recurrence risks and risk ratios for given SML model |
| Name of routine: | doito |
|---|---|
| Source lines: | 24643 - 24695 |
| Type | subroutine |
| Call | doito(typ, pars) |
| Module | None |
| Notes | Calculate GPE for a relative: ITO method |
| Name of routine: | ito |
|---|---|
| Source lines: | 24699 - 24738 |
| Type | subroutine |
| Call | ito(rel, q, r) |
| Module | None |
| Notes | ITO calculation |
| Name of routine: | mixup |
|---|---|
| Source lines: | 24742 - 24757 |
| Type | subroutine |
| Call | mixup(n, ia) |
| Module | None |
| Notes | Permute the contents of an integer array |
| Name of routine: | randn |
|---|---|
| Source lines: | 24767 - 24790 |
| Type | function |
| Call | randn() |
| Module | None |
| Name of routine: | uniqnam |
|---|---|
| Source lines: | 24794 - 24803 |
| Type | subroutine |
| Call | uniqnam(nchar, str) |
| Module | None |
| Notes | Random character string |
| Name of routine: | rantri |
|---|---|
| Source lines: | 24807 - 24811 |
| Type | function |
| Call | rantri() |
| Module | None |
| Notes | Triangular random number generator |
| Name of routine: | random |
|---|---|
| Source lines: | 24830 - 24840 |
| Type | function |
| Call | random() |
| Module | None |
| 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 |
| Name of routine: | dataset_uses |
|---|---|
| Source lines: | 24844 - 24856 |
| Type | function |
| Call | dataset_uses(dataset) |
| Module | None |
| Notes | size of pedigree structure |
| Name of routine: | macsub |
|---|---|
| Source lines: | 24860 - 24970 |
| Type | subroutine |
| Call | macsub(narg, words, commands, plevel) |
| Module | None |
| Notes | Perform simple macro substitutions on contents of command buffer |
| Name of routine: | macloop |
|---|---|
| Source lines: | 24978 - 25075 |
| Type | subroutine |
| Call | macloop(lin, nloci, loc, loctyp, commands, plevel) |
| Module | None |
| 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
|
| Name of routine: | macvar |
|---|---|
| Source lines: | 25080 - 25147 |
| Type | subroutine |
| Call | macvar(lin, commands, plevel) |
| Module | None |
| Notes | Perform simple macro variable substitutions on contents of command buffer cf macro functions which are handled by macsub |
| Name of routine: | parser |
|---|---|
| Source lines: | 25158 - 25291 |
| Type | subroutine |
| Call | parser(nterm, wtyp, expr, error) |
| Module | None |
| 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
|
| Name of routine: | simpev |
|---|---|
| Source lines: | 25295 - 25513 |
| Type | subroutine |
| Call | simpev(sta, fin, nterm, wtyp, expr, error) |
| Module | None |
| Notes | The non-compound evaluator |
| Name of routine: | wrans |
|---|---|
| Source lines: | 25517 - 25550 |
| Type | subroutine |
| Call | wrans(prefix, nterm, expr, wtyp) |
| Module | None |
| Notes | write out results of command line expression evaluation |
| Name of routine: | legall |
|---|---|
| Source lines: | 25554 - 25568 |
| Type | function |
| Call | legall(xall) |
| Module | None |
| Notes | the legal range of alleles |
| Name of routine: | isdata |
|---|---|
| Source lines: | 25572 - 25577 |
| Type | function |
| Call | isdata(idx) |
| Module | None |
| Notes | Is a stack element a number, variable or operator |
| Name of routine: | isenv |
|---|---|
| Source lines: | 25581 - 25586 |
| Type | function |
| Call | isenv(idx) |
| Module | None |
| Notes | Is a stack element an automatic variable |
| Name of routine: | isvar |
|---|---|
| Source lines: | 25590 - 25597 |
| Type | function |
| Call | isvar(idx) |
| Module | None |
| Notes | Is a stack element data |
| Name of routine: | isop |
|---|---|
| Source lines: | 25601 - 25606 |
| Type | function |
| Call | isop(idx) |
| Module | None |
| Notes | Is a stack element an operator |
| Name of routine: | isvec |
|---|---|
| Source lines: | 25610 - 25616 |
| Type | function |
| Call | isvec(idx) |
| Module | None |
| Notes | Is a stack element a genotype - both values of interest |
| Name of routine: | ismis |
|---|---|
| Source lines: | 25620 - 25625 |
| Type | function |
| Call | ismis(idx) |
| Module | None |
| Notes | Is a stack element missing data |
| Name of routine: | addcolon |
|---|---|
| Source lines: | 25629 - 25661 |
| Type | subroutine |
| Call | addcolon(nterm, wtyp, expr) |
| Module | None |
| Notes | Convert (expr) (expr) to (expr : expr) |
| Name of routine: | compop |
|---|---|
| Source lines: | 25665 - 25711 |
| Type | subroutine |
| Call | compop(pos, sta, fin, nterm, wtyp, expr, error) |
| Module | None |
| Notes | compound operators eg <= >= == ^= |
| Name of routine: | zerop |
|---|---|
| Source lines: | 25715 - 25757 |
| Type | subroutine |
| Call | zerop(pos, wtyp, expr, error) |
| Module | None |
| Notes | zero argument functions |
| Name of routine: | unop |
|---|---|
| Source lines: | 25761 - 25916 |
| Type | subroutine |
| Call | unop(pos, sta, fin, nterm, wtyp, expr, error) |
| Module | None |
| Notes | unary operators |
| Name of routine: | binop |
|---|---|
| Source lines: | 25920 - 26127 |
| Type | subroutine |
| Call | binop(pos, sta, fin, nterm, wtyp, expr, error) |
| Module | None |
| Notes | binary operators |
| Name of routine: | typwords |
|---|---|
| Source lines: | 26146 - 26199 |
| Type | subroutine |
| Call | typwords(farg, larg, words, nloci, loc, loctyp, wtyp, expr, actn) |
| Module | None |
| 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 -
|
| Name of routine: | dryrun |
|---|---|
| Source lines: | 26204 - 26215 |
| Type | subroutine |
| Call | dryrun(farg,larg,wtyp) |
| Module | None |
| Notes | If checking arguments via dry run of parser, replace variable values with (generic) NUM |
| Name of routine: | pull |
|---|---|
| Source lines: | 26219 - 26235 |
| Type | subroutine |
| Call | pull(pos, dec, fin, nterm, typ, expr) |
| Module | None |
| Notes | Pull up expr |
| Name of routine: | isgeno |
|---|---|
| Source lines: | 26239 - 26266 |
| Type | function |
| Call | isgeno(string) |
| Module | None |
| Notes | See if a string is a valid genotype |
| Name of routine: | getgeno |
|---|---|
| Source lines: | 26270 - 26305 |
| Type | subroutine |
| Call | getgeno(string, a1, a2, wtyp) |
| Module | None |
| Notes | Get a valid genotype |
| Name of routine: | incpos |
|---|---|
| Source lines: | 26309 - 26318 |
| Type | subroutine |
| Call | incpos(pos,minpos,maxpos) |
| Module | None |
| Notes | Increment counter mod maxpos |
| Name of routine: | getrelval |
|---|---|
| Source lines: | 26322 - 26535 |
| Type | subroutine |
| Call | getrelval(relate, summary, locnam, loctyp, trait, sumval, dataset, plevel) |
| Module | None |
| Notes | Get values for trait in relatives |
| Name of routine: | priallval |
|---|---|
| Source lines: | 26539 - 26617 |
| Type | subroutine |
| Call | priallval(summary, trait, loctyp, ped, sumval, totobs, dataset, plevel) |
| Module | None |
| Notes | Output single summary value for entire pedigree |
| Name of routine: | prirelval |
|---|---|
| Source lines: | 26621 - 26789 |
| Type | subroutine |
| Call | prirelval(relate, summary, trait, loctyp, ped, nobs, relid, sumval, totobs, dataset, plevel) |
| Module | None |
| Notes | Output values for each eligible persion |
| Name of routine: | evalped |
|---|---|
| Source lines: | 26793 - 27082 |
| Type | subroutine |
| Call | evalped(narg, words, nloci, loc, loctyp, locpos, locn |