net_diversity.pl 19/05/2017
Kristina Wicke and Mareike Fischer

DESCRIPTION
-------------------
This tools computes a variety of generalized measures of phylogenetic diversity and generalized biodiversity indices for binary 
hybridization networks in the extended Newick format (for information on the extended Newick format for phylogenetic networks,
please see http://dmi.uib.es/~gcardona/BioInfo/enewick.html).

For generalized measures of phylogenetic diversity, you can choose between
	phylogenetic net diversity,
    phylogenetic subnet diversity,
	embedded phylogenetic diversity (min, max, sum, mean),
	LSA associated phylogenetic diversity.
	
For generalized measures of biodiversity indices, you can choose between
	embedded Fair Proportion Index (min, max, sum, mean),
	LSA associated Fair Proportion Index,
	embedded (original/modified/unrooted rooted) Shapley Value (min, max, sum, mean),
	LSA associated (original/modified/unrooted rooted) Shapley Value (min, max, sum, mean),
	generalized (original/modified) Shapley Value (from PND, PSD, PD_TN^min, PD_TN^max, PD_TN^sum, PD_TN^mean, PD^LSA).
	
-----------------------------------------------------------------------------------------------------------------------------------------------------

REQUIREMENTS
-------------------
net_diversity.pl is written in the programming language Perl, including modules from BioPerl.

Modules needed to run the script are:
	warnings						(a Perl pragma to control optional warnings)
	strict							(a Perl pragma to restrict unsafe constructions)
	Try::Tiny						(error handling)
	Getopt::Long 					(command line arguments)
	List::MoreUtils qw(first_index) (functionality on lists) 
    use List::MoreUtils qw(uniq);
    List::Compare 					(comparison of lists)	
	Bio::PhyloNetwork;				(module to compute with phylogenetic networks)

Please make sure, that Perl, BioPerl and the modules mentioned above, are installed on your machine.
For further information on the installation see http://www.cpan.org/modules/.

Please also make sure, that the representation of your phylogenetic hybridization network in the Extended Newick format is correct.
In particular, use distinct taxon names and distinct labels for the hybrdization nodes. 
If you wish to label internal nodes as well, these labels must also be distinct. 
Also assure, that all tree edges of your network have edge lengths >= 0 assigend to them.

-----------------------------------------------------------------------------------------------------------------------------------------------------

RUNNING THE SCRIPT
-------------------
To execute net_diversity.pl, please call
	
	~$./net_diversity.pl --in=filename --measure=value (--help)

where ~$ denotes the directory, where the file net_diversity.pl is stored.


Thereby 
	
	--in=filename
		Path to the input file, containing the network(s) 
		in the extended Newick format.

	--measure=value
		Choose the measure of generalized phylogenetic diversity or 
		generalized biodiversity index to calculate.

		
		Options for measure:
			 0 phylogenetic net diversity 
             1 phylogenetic subnet diversity
			 2 embedded phylogenetic diversity (min)
			 3 embedded phylogenetic diversity (max)
			 4 embedded phylogenetic diversity (sum)
			 5 embedded phylogenetic diversity (mean)
			 6 LSA associated phylogenetic diversity

			
			 7 embedded Fair Proportion Index (min)
			 8 embedded Fair Proportion Index (max)
			 9 embedded Fair Proportion Index (sum)
			10 embedded Fair Proportion Index (mean)
			11 LSA associated Fair Proportion Index


			12 embedded original Shapley Value (min)
			13 embedded original Shapley Value (max)
			14 embedded original Shapley Value (sum)
			15 embedded original Shapley Value (mean)
			16 LSA associated Shapley Value

			17 embedded modified Shapley Value (min)
			18 embedded modified Shapley Value (max)
			19 embedded modified Shapley Value (sum)
			20 embedded modified Shapley Value (mean)
			21 LSA associated modified Shapley Value

			22 embedded unrooted rooted Shapley Value (min)
			23 embedded unrooted rooted Shapley Value (max)
			24 embedded unrooted rooted Shapley Value (sum)
			25 embedded unrooted rooted Shapley Value (mean)
			26 LSA associated unrooted rooted Shapley Value

			27 generalized original Shapley Value (PND)
            28 generalized original Shapley Value (PSD)
			29 generalized original Shapley Value (PD_TN^min)
			30 generalized original Shapley Value (PD_TN^max)
			31 generalized original Shapley Value (PD_TN^sum)
			32 generalized original Shapley Value (PD_TN^mean)
			33 generalized original Shapely Value (PD^LSA)

			34 generalized modified Shapley Value (PND)
            35 generalized modified Shapley Value (PSD)
			36 generalized modified Shapley Value (PD_TN^min)
			37 generalized modified Shapley Value (PD_TN^max)
			38 generalized modified Shapley Value (PD_TN^sum)
			39 generalized modified Shapley Value (PD_TN^mean)
			40 generalized modified Shapely Value (PD^LSA)


The argument --help is optional and shows the usage of net_diversity.pl.


Example: ~$./net_diversity.pl --in=myInputNetwork --measure=0

-----------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------
NetDiversity.pl can be reached at:
Web site: 
E-Mail: kristina.wicke@uni-greifswald.de, email@mareikefischer.de


