# a Jrna template file, ver 0.02
# remove the "#" to uncomment a line!
# check the Jrna.pm source for a better idea of what you need to pass each function (nice help, eh?)

package jrna_template;

use Jrna;
use Jrna_objs;
use strict;
use warnings;


my $data = Jrna->input (
			"data/mydata.nex",			# full path to input file
			"data/myhelixindex.txt",	# full path to stem file
			"model",					# model "name" - this is used in many places, keep it short (<5 chars)
			99							# number of terminal (IMPORTANT, this is n-1)
		);

		# replace all "{something here}" with appropriate data, as seen in examples

my $all_data = slice->new;   			# declare a new slice, which is just a taxa/block set
$all_data->blocks(0..{last_block_in_matrix});	# give the range of blocks you want
$all_data->taxa(0..{n-1 terminals});

#$all_data->blocks(0..211);
#$all_data->taxa(0..59);

# This is a legal set range too:  (0..14 12..55 45 34 2 23 99).  Overlapping values are included only once! Thus the blocks or taxa for this set would be 0 to 55 and 99.  Note that order doesn't matter!

# as many slices as needed can be generated, you could also generate slices randomly, with variables etc.

#my $COI = slice->new;    # 
#$COI->blocks(0..33);
#$COI->taxa(0..99);

#my $rna28S = slice->new;    
#$rna28S->blocks(34..113);
#$rna28S->taxa(0..99);

# end partitions 

my $my_data = $all_data;			# point to the slice you want to use 

$data->init();					# required, initializes the matrix
$data->init_stems($my_data);			# required  for output using helices (at this point, for everything)

#$data->out_web($my_data, 1, 0);		# best to start with this one as a test

#&Jrna::mx_safenames();				# translate long taxon names to unique short ones that are TNT legal,
									# a translation key is a written to file

# Various example calls are provided below.  For details on the required parameters examing the Jrna.pm file.
						
#$data->out_tnt($my_data, 0);
#$data->out_phylip($my_data, 0);
#$data->out_poy($my_data, 0);
#$data->out_phase($my_data, 0, "ichs", 2); 
#$data->out_nexus($working_slice, 0 , "myoutput.nex");
#&Jrna::out_slice_stats2($my_data);
#&Jrna::calc_stem_bp_stats($my_data, 0);
#$data->out_stockholm($my_data);
#$data->out_gde($my_data);

#$data->out_poy(
#		'-slice' => $my_data,
#		'-min_terminals' => 0, 				# a *percentage* cutoff, blocks without this perecentage of data rows will be excluded
#		'-output_mode' => 0, 				# 0 - DO on all blocks; 1- DO on unbracketed, FSO on bracketed; 2- FSO on all blocks; 3- DO on all unbracketed; 4-DO on bracketed; FSO on unbracketed
#		'-block_mode' => 0,					# see slice_stems for description, 0 includes all data
#		'-use_prealigned' => 1,				# use the prealigned flag on prealignable blocks (unbracketed blocks where there are no gaps in any sequence)
#		'-strip_bracketed_gaps' => 1,		# strip gaps from bracketed blocks
#		'-use_deletegapsfrominput' => 1,	# place a '-deletegapsfrominput in front of *all* blocks (overrides -strip_bracketed_gaps), likely safest now, but note alignment consequences
#		'-fileroot' => 'sometexthere'
#);

#$data->out_column_stats($my_data,  	
#					'-exclude' => \@exclude,       # excluded alphabet (also '-alphabet'=> \@alphabet 		
#					#	'-alphabet'=> \@alphabet       
#					'-type' => 'figure',		   # 'concensus' | 'max' | 'count' | 'percent' | 'combined' | 'tstv' | 'figure' | 'score'  
#					'-concensuscutoff' => 0.099,	   # range 0-1 (%/100)	
#					'-concensusminrows' => 0,	   # range 0-1 (%/100) - 'X' concensus returned if this % of rows (compared to total) do not have @alphabet characters
#					'-concensustype' => 'iupac',  	   # 'iupac' | 'residue' (option has no effect in non 'concensus' tables)
#					'-header' => 'true',		   # 'true' | 'false' (formating only)
#					'-blockgaps' => 'true'		   # 'true' | 'false' (formating only)
#					)


1;

__END__

