
triPOD Installation and Usage Instructions

triPOD is designed for use on Unix-based operating systems.  It was
developed and tested on Red Hat Enterprise Linux 6 using perl v5.10.1
and R version 2.14.1.

Required perl and R libraries - The following perl modules need to be
	installed: Algorithm::Cluster, threads, and Tree::Interval.
	The following R libraries need to be installed: library(shape)
	and library(TTR).

Extraction - Extract the files. You should now have a directory named 
	/triPOD_current, which contains the files necessary to run triPOD. 
	Be sure to keep these files in a single directory. 

Run triPOD - triPOD is run by executing the Perl script, which makes
	use of the R script and the genome build files.  Example :
	perl triPOD.pl your_data.txt

Help - triPOD.pl --help The help function provides the following
	information regarding optional parameters and expected input
	formatting

	Usage: perl triPOD.pl [--options] [INPUT_FILE]

	--alpha 	A threshold for which a p-value <= alpha is considered
			significant.  Default = --alpha=0.1
	--batch 	Submit a file containing a list of file names to be
			run sequentially
	--build 	The path to a file containing the UCSC Genome assembly
			for centromere locations.  			
			Default = --build=./genome_build/hg18_centromeres.txt
	--cores 	Number of CPU cores to employ 
			Default = maximum cores - 1 (e.g. --cores=8)
	--gender 	Gender designation for sample (M or F) 
			Default = NA
	--graph 	Creates graphic output of results in PNG or PDF format
			(--graph=none, --graph=png, --graph=pdf, or --graph=both)
            		Default = --graph=none
	--hd 		Abnormality detection by homozygous deletion analysis
			(PODhd) (--hd or --nohd) Default = --hd
	--help 	Prints a help message and exits
	--hetSD 	Heterozygous SNP threshold. StDevs from mean BAF
			Default = --hetSD=1.414213562373095 (sqrt of 2)
	--homSD 	Homozygous SNP threshold. StDevs from mean BAF 
			Default = --homSD=4
	--mi1 		Abnormality detection by Mendelian "error" analysis
			(PODmi1) (--mi1 or --nomi1) Default = --mi1
	--nc 		Samples must have a No Call rate below this threshold 
			to be analyzed.  Default = --nc=0.03
	--out 		Specify an output directory (e.g. --out=results) 
			Default = --out=triPOD_Results
	--pod 		Abnormality detection by standard POD algorithm 
			(--pod or --nopod) Default = --pod
	--podcr 	Abnormality detection by cryptic POD algorithm (PODcr)
			(--podcr or --nopodcr) Default = --podcr
	--stats 	Create a file including calculated parameters, etc.
			(--stats) Not default.
	--verbose 	Prints progress info to screen. Negated using
			--noverbose. --Default = --verbose.	
			--batch mode will run in --noverbose mode.
	--win 		Number of SNPs per window for sliding window analysis
			Default = --win=100

Note -  It is highly recommended that parameters such as --alpha, --hetSD,
       --homSD, and --win are altered only be experienced users.

Input - The input file must be tab delimited, sorted by chromosome and
	position, and in the following order (columns): SNP Name, Chromosome,
	Position, Father GType, Father BAF, Father LRR, Mother GType,
	Mother BAF, Mother LRR, Child GType, Child BAF, Child LRR.
	The genotypes must be AA, AB, BB, NC or NoCall.  B allele
	frequencies must be >= 0 and <= 1 for polymorphic markers.  A
	header line is expected but is not used to determine column
	identity.

	triPOD has been developed using genotypes annotated by the 
	Illumina method described in "TOP/BOT" Strand and "A/B" Allele.
	Illumina Technical Note. 2006. If converting from HapMap format
	(ATCG) to Illumina format (AB): use simple replacement (AA = AA, TT; 
	BB = CC, GG; AB = AC, AG, TC, TG; -- = NC). Any markers with 
	alternative genotyping combinations (e.g. CG or TA) should be 
	discarded unless the user performs an additional analysis of 
	the surrounding sequence.

Output - Several types of output are produced by triPOD.
	1. *triPOD_Results.txt A tabular listing of detected abnormalities
	including the following information:
	Sample Name, Chromosome, Abnormal region start position, Abnormal
	region end position, Type of Abnormality, Parental Origin,
	Inheritance Pattern, Size of abnormal region (SNPs), Number of
	Informative SNPs, Size of abnormal region (bps), Detection
	Method, Descriptive statistics for the abnormal region: 
	Child's normalized median mirrored BAF (mBAF) and LRR, 
	Father's normalized median mirrored BAF (mBAF) and LRR,
	Mother's normalized median mirrored BAF (mBAF) and LRR.
	
	The results file also provides the date and time, the command
	line information, and the parameters employed.
	
	2. *triPOD_Results.bed 
	A .bed file is provided for visualization with genome browsers.  
	
	3. *triPOD_stats.txt 
	An optional file which contains sample-specific calculations and
	parameters.  See the paper for explanations of rate and
	probability calculations. The following information is
	included for each trio: file name, trio member names, NoCall
	rates, nonadjacent homozygous deletion (HD) and single
	Mendelian error (MI1) rates, minimum region sizes, calculated
	MI1 BAF thresholds, initial and corrected alpha values for FDR
	control, estimated error rate, acceptable errors for POD
	region extension, global BAF thresholds for detecting
	informative SNPs, counts of regions detected by each detection
	method.  
	
	4. ./log_files/*triPOD_log.txt 
	STDERR is redirected to a log file.  
	
	5. *.png and/or *.pdf 
	Optional graphical output is generated for each chromosome 
	harboring an abnormality. The upper panel is a plot of the log 
	R ratio (LRR) values with the LRR moving average plotted in green
	and a black horizontal line at y=0 to assist with visualization of
	copy number changes. The center panel is a plot of the B allele 
	frequency (BAF), in which abnormalities can frequently be 
	visualized as splitting of the heterozygous (center) BAF band. The 
	lower panel is a plot of the abnormalities detected by triPOD. 
	Abnormalities with known parental origin or contribution are 
	plotted adjacent to the Father and Mother axis labels. 
	Abnormalities with unknown contribution or abnormal contribution 
	from both parents are plotted along the y=0.5 axis, between the 
	Father and Mother labels. The types of abnormalities are color 
	coded as follows: red = deletion, blue = amplification, gray = 
	homozygous deletion, purple = uniparental heterodisomy, green = 
	uniparental isodisomy, and black = all other abnormalities for 
	which a type cannot be assigned (including low-level mosaic 
	events of all types). 
