# genotf cheatsheet
Every export of @skiffyard/genotf. Guides are listed in the introduction .
jennifer import "@skiffyard/genotf/" as genotf;
import "@skiffyard/genotf/genotyper.j" as genotyper;
import "@skiffyard/genotf/genescan.j" as genescan;
import "@skiffyard/genotf/genemapper.j" as genemapper;
import "@skiffyard/genotf/gmtable.j" as gmtable;
import "@skiffyard/genotf/osiris.j" as osiris;
import "@skiffyard/genotf/macalias.j" as macalias;
Every failure is Error{kind: "genotf"}, except what the dependencies throw for broken input: @deckyard/abif (kind "abif") under genescan, @skiffyard/javaser (kind "javaser" or "limit") under genemapper, and xml's "limit" under osiris.
Function Returns Does genotf.formatOf(data)string"genotyper", "genemapper", "abif", "java-serialization", or "", from the first bytes
# genotf.Typing
What gmtable.typings and osiris.typings return: one sample's alleles per locus, the shape of @deckyard/forensicgenetics' Mixture.loci.
Field Meaning sample as stringthe sample's name file as stringits sample file, "" when the source names none loci as map of string to list of stringlocus -> allele names, first-seen order, no repeats; loci without alleles left out
# Genotyper documents (genotyper)
Constant Value Meaning genotyper.MAGIC"0000001000020008"the first 8 bytes of every document, as hex
Function Returns Does genotyper.isDocument(data)boolwhether the bytes start like a Genotyper document genotyper.read(data)genotyper.Documentdecode a document: categories, lanes with peaks, labels and calls, the results table genotyper.open(path)genotyper.Documentread of a file
# genotyper.Document
Field Meaning byteOrder as string"be", or "le" when class numbers are little-endian (some Windows-saved files)records as intthe number of records categories as list of Categorythe categories lanes as list of Lanethe dye lanes table as list of list of stringthe results table as displayed, header row first; empty when none issues as list of stringwhat could not be read; empty for a clean document
# genotyper.Category
Field Meaning name as stringits name fromBp as floatthe size range's start, bp toBp as floatthe size range's end, bp dyeMask as intbit 1 << dye per dye it covers colour as stringdisplay colour, #rrrrggggbbbb
# genotyper.Lane
Field Meaning index as intposition in the document, from 1 number as intlane or capillary number on the run dye as intthe dye, from 1 (blue) name as stringthe lane's name info as stringa second text, often empty sourceFile as stringthe sample or results file it came from sourcePath as stringthat file's full classic Mac path, "" when unknown sourceType as stringthat file's type code (FSAm, RSLT) peaks as list of Peakits peak table labels as list of Labelits labels calls as list of Callits labelled peaks
# genotyper.Peak
Field Meaning row as introw, from 0 scan as intapex scan startScan as intfirst scan endScan as intlast scan height as intheight, RFU area as intarea sizeBp as floatsize, bp
# genotyper.Label
Field Meaning scan as intthe scan the label names peakRow as intits peak's row sizeBp as floatits peak's size, bp kind as string"category", "size", "height", or a numbertext as stringthe label as displayed
# genotyper.Call
Field Meaning peakRow as intits peak's row sizeBp as floatsize, bp height as intheight, RFU area as intarea scan as intapex scan categories as list of stringcategories of the lane's dye holding its size labels as list of stringits labels' texts
# GeneScan documents (genescan)
Function Returns Does genescan.kindOf(data)string"sample-sheet", "injection-list", "project", "sample" or "" for an ABIF filegenescan.readSheet(data)genescan.Sheeta sample sheet, or the sheet inside an injection list, row by row genescan.readInjectionList(data)genescan.InjectionListan injection list: its sheet, sample names and comments genescan.readProject(data)genescan.Projecta GeneScan project's sample files
# genescan.Sheet
Field Meaning name as stringthe sheet's name text codes as list of stringeach column's four-character code (SmIn, SSNM, ...) rows as list of list of stringthe cells, row by row
# genescan.InjectionList
Field Meaning sheet as Sheetits sample sheet samples as list of stringthe sample names (SMPL) comments as list of stringthe comments (CMNT)
# genescan.SampleFile
Field Meaning fileName as stringits name path as stringits full classic Mac path, "" when unknown fileType as stringits type code creator as stringits creator code
# genescan.Project
Field Meaning samples as list of SampleFileits sample files
# GeneMapper projects (genemapper)
Function Returns Does genemapper.isProject(data)boola GeneMapper header and a Java serialization stream at byte 64 genemapper.read(data)genemapper.Projectdecode a project: samples, markers, calls, history, dropped peaks genemapper.open(path)genemapper.Projectread of a file
# genemapper.Project
Field Meaning header as stringthe header text (GeneMapper4.000) name as stringthe project's name samples as list of Sampleits samples
# genemapper.Sample
Field Meaning file as stringits sample file's name name as stringits name panel as stringits panel markers as list of Markerits markers
# genemapper.Marker
Field Meaning name as stringthe marker calls as list of Allelethe calls in force history as list of Allelethe edit history (original calls and their deletion records) dropped as list of Allelepeaks the caller dropped
# genemapper.Allele
Field Meaning name as stringthe allele sizeBp as floatsize, bp height as intits peak's height, RFU; -1 without a peak quality as floatthe stored quality value origin as string"HEURISTIC_ENGINE", "USER"operation as stringthe algorithm or "Delete Operation"; "" if none status as string"Created", "Deleted", "Edited" or ""
# GeneMapper and Peak Scanner tables (gmtable)
Function Returns Does gmtable.read(data)gmtable.Tableparse an exported tab-delimited table: header and cells gmtable.open(path)gmtable.Tableread of a filegmtable.cell(t, row, name)stringthe cell of row row (from 0) under the column named name gmtable.genotypes(t)list of gmtable.Genotypethe rows of a Genotypes table, numbered columns collapsed into peaks gmtable.sizing(t)list of gmtable.SizedPeakthe rows of a Sizing table, GeneMapper's or Peak Scanner's gmtable.typings(rows)list of genotf.Typingalleles per marker for each sample file; empty and off-ladder alleles left out
# gmtable.Table
Field Meaning kind as string"genotypes", "sizing" or ""columns as list of stringthe header names; a trailing empty one dropped rows as list of list of stringthe cells, unquoted
# gmtable.Peak
Field Meaning allele as stringAllele n: "15", "OL", "?", or ""sizeBp as floatSize n, bp; -1.0 if emptyheight as intHeight n, RFU; -1 if emptyarea as floatPeak Area n or Area n; -1.0 if emptydataPoint as intData Point n; -1 if emptyoffLadder as boolthe allele is OL or ?
# gmtable.Genotype
Field Meaning sampleFile as stringSample FilesampleName as stringSample Namepanel as stringPanelmarker as stringMarkerdye as stringDyepeaks as list of Peakone per number with a non-empty cell fields as map of string to stringevery other column, by name
# gmtable.SizedPeak
Field Meaning dye as stringfrom Dye/Sample Peak peak as intfrom Dye/Sample Peak sizeStandard as boolDye/Sample Peak ends in *: a size-standard peaksampleFile as stringSample File NamesampleName as stringSample Namemarker as stringMarkerallele as stringAllelesizeBp as floatSize, bp; -1.0 if emptyheight as intHeight, RFU; -1 if emptyarea as floatArea or Area in Point; -1.0 if emptydataPoint as intData Point; -1 if emptyoffLadder as boolthe allele is OL or ? fields as map of string to stringevery other column, by name
# OSIRIS reports (osiris)
Function Returns Does osiris.isReport(data)boolan OsirisAnalysisReport root element in the first 1024 bytes osiris.read(data)osiris.Reportdecode an .oar or .oer report osiris.open(path)osiris.Reportread of a fileosiris.texts(r, numbers)list of stringthe texts of notices osiris.typings(r)list of genotf.Typingalleles per locus for each sample that is no ladder; disabled and off-ladder calls left out
# osiris.Report
Field Meaning version as string"2.16 for Linux"fullVersion as string"OSIRIS 2.16 for Linux", "" if absentfileName as stringthe report's path when written creationTime as intseconds since 1970, UTC kit as stringthe marker set ils as stringthe internal lane standard, "" if absent ilsChannel as intthe ILS's channel dyes as list of Dyethe kit's channels and loci samples as list of Samplethe samples notices as list of intnotices about the folder messages as map of int to Messageevery notice's message, by number
# osiris.Dye
Field Meaning number as intthe channel, from 1 dye as stringthe dye's name, "" if absent loci as list of stringits loci
# osiris.Sample
Field Meaning name as stringthe sample file's name, no path or extension sampleName as stringthe sample name, "" if absent type as string"Sample", "Ladder", "+Control", "-Control", "Unknown"runStart as stringthe run's start, "" if absent positiveControl as stringthe positive control's name, else "" notices as list of intsample notices ilsNotices as list of intILS notices channels as list of Channelchannels with notices or artifacts loci as list of Locusits loci notes as stringsample notes, "" for none
# osiris.Channel
Field Meaning number as intthe channel, from 1 notices as list of intchannel notices artifacts as list of Artifactflagged peaks
# osiris.Locus
Field Meaning name as stringthe locus notices as list of intlocus notices alleles as list of Allelethe calls in force edited as list of Allelecalls edits replaced (OldAllele) notes as stringlocus notes, "" for none
# osiris.Allele
Field Meaning id as intthe peak's id name as stringthe allele sizeBp as floatsize, bp meanBp as floatsize from the mean ladder; -1.0 if absent height as intRFU, rounded area as floatpeak area; -1.0 if absent time as floatseconds; -1.0 if absent fit as floatcurve fit; -1.0 if absent offLadder as string"true", "false", "accepted", or ""count as int2 for a homozygote's single peak, else 1 disabled as booldisabled by a user interLocus as stringthe adjacent locus of a call between two, else "" notices as list of intthe call's notices
# osiris.Artifact
Field Meaning id as intthe peak's id level as inthighest notice priority, 1 most severe height as intRFU, rounded meanBp as floatsize, bp area as floatpeak area; -1.0 if absent time as floatseconds fit as floatcurve fit; -1.0 if absent label as stringits notices' texts, one per line disabled as booldisabled by a user notices as list of intits notices calls as list of ArtifactCallthe allele it is or resembles
# osiris.ArtifactCall
Field Meaning name as stringthe allele name offLadder as string"true", "false", "accepted", or ""sizeBp as floatsize, bp locus as stringthe locus location as int0 inside it, -1 left, 1 right
# osiris.Message
Field Meaning number as intits number text as stringits text name as stringmessage-book name (smStutter), "" if absent hidden as boolhidden by OSIRIS enabled as boolin force critical as boolcritical
# Mac alias records (macalias)
Constant Value Meaning macalias.FIXED_SIZE150bytes of an alias record before its extras
Function Returns Does macalias.isAlias(data, at)boolwhether an alias record (version 2, either byte order) starts at at macalias.read(data, at)macalias.Aliasdecode the alias record at at macalias.findPath(data, from, stop)stringthe full-path extra in bytes the fixed layout does not fit, "" if none
# macalias.Alias
Field Meaning size as intthe record's size kind as int0 file, 1 folder volume as stringthe volume's name fileName as stringthe target's name, leading control characters removed fileType as stringthe target's type code creator as stringthe target's creator code folder as stringthe parent folder's name, "" without it path as stringthe full path, "" without it byteOrder as string"be" or "le" (fixed fields of a Windows port)