module load stacks

###STACKS PIPELINE SCRIPT (flags varied for different data matrices)####

## STEP 1: Process Radtags (De-multiplexing): Run this for each set of fastq.gz and combine the outputs into 
	## a single directory (Ex. demultiplexed_all)
	
#process_radtags -f XXXXX.fastq.gz -i gzfastq -o ./demultiplexed_fastqs/ -b XXXXX.txt -e nlaIII -c -q -r

## STEP 2: Pass this portion with denovo_map.pl: It parses your individuals.txt (file with sample ID's) and 
## files in your combined directory into a list usable by denovo_map.pl
	
#all_XXX=""

#for x in `cat XXX_individuals.txt`;
#do
#all_XXX+="-s ./demultiplexed_all/$x.fq.gz "
#done

## Denovo assembly of loci, catalog generation, SNP flagging

#denovo_map.pl $all_XXX -o ./Genotypes/ -O XXX_populations.txt -b 2 -T 32 -S -m 3 -M 2 -n 3 -t

## STEP 3: Optional things like SNP/Loci filtering, basic pop. gen. stats, etc

#populations -b 2 -t 32 -P ./Genotypes/ -M ./XXX_populations.txt --renz nlaIII -m 10 -p 1 -r 0.5 -k --fstats -f p_value --genomic --ordered_export --write_random_snp --fasta --vcf --plink --genepop --structure --phylip