Constraint Tree


#NEXUS
	
	[starts PAUP]
	begin paup;

	
set 
autoclose     [closes the status window automatically]
nowarntree    [turns off the feature that prompts you to save trees in memory]
nowarnreset   [turns off feature that asks "do you really want to reset the data file"]
torder=right  [specifies the tree order to be ladderized to the right]
flush         [flushes the file buffer]
tcompress=yes [prints trees in a compressed format, which allows you to view large trees in a single page]
defaultmode;  [tells paup to use the default option when a dialog box is opened]


	[start writing to a log file; replace "your_log" with your log file name]
	log file=your_log.log;
	
	[execute your data file; replace "your_data" with your data file name]
	execute your_data.nex;
	
	[sets criterion to likelihood]
	set criterion=likelihood;
		
	[this is a model for HKY+I+G; insert your best-fit model and estimated parameters instead]
        lset tratio=1.39027 basefreq=(0.24756 0.26029 0.27310) rates=gamma shape=0.630891 pinvar=0.160243;
        
	[defines constraint group where 1-11 are taxa to constrain to monophyly; replace "constrained_group_name" with your constraint group name]
        constraints constrained_group_name=((1-11));
        
	[does 10 heuristic search replicates enforcing constraints on taxa 1-11(above) with tbr branch swapping and random addition of taxa]
	hs enforce constraints=constrained_group_name addseq=rand swap=tbr nreps=10;
	
	[saves your constrained tree with branch lengths; replace "your_tree" with your tree file name]
	savetrees brlens file=your_tree.tree;
	
	[describes trees]	
	describe;
	
	[stop writing to log file]
	log stop;
		
	[quit PAUP]
	quit;
end;