]> git.donarmstrong.com Git - mothur.git/commitdiff
adding treeclimber and unifrac pieces
authorwestcott <westcott>
Wed, 11 Feb 2009 15:42:13 +0000 (15:42 +0000)
committerwestcott <westcott>
Wed, 11 Feb 2009 15:42:13 +0000 (15:42 +0000)
36 files changed:
Mothur.xcodeproj/project.pbxproj
calculator.h
collect.cpp
commandfactory.cpp
errorchecking.cpp
errorchecking.h
globaldata.cpp
globaldata.hpp
inputdata.cpp
npshannon.cpp
parsimony.cpp [new file with mode: 0644]
parsimony.h [new file with mode: 0644]
parsimonycommand.cpp [new file with mode: 0644]
parsimonycommand.h [new file with mode: 0644]
raredisplay.cpp
readtree.cpp
readtree.h
readtreecommand.cpp
sharedsabundvector.cpp
tree.cpp
tree.h
treecalculator.h [new file with mode: 0644]
treemap.cpp
treemap.h
treenode.cpp
treenode.h
unifracunweightedcommand.cpp [new file with mode: 0644]
unifracunweightedcommand.h [new file with mode: 0644]
unifracweightedcommand.cpp [new file with mode: 0644]
unifracweightedcommand.h [new file with mode: 0644]
unweighted.cpp [new file with mode: 0644]
unweighted.h [new file with mode: 0644]
validcommands.cpp
validparameter.cpp
weighted.cpp [new file with mode: 0644]
weighted.h [new file with mode: 0644]

index e773981a535e6c8b4d5332e1ce6a87266f1618c4..1e473468b4ac8e88d11435958e464b8e88909932 100644 (file)
                372E12700F26365B0095CF7E /* readotucommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E126F0F26365B0095CF7E /* readotucommand.cpp */; };
                372E12960F263D5A0095CF7E /* readdistcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E12950F263D5A0095CF7E /* readdistcommand.cpp */; };
                372E12ED0F264D320095CF7E /* commandfactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372E12EC0F264D320095CF7E /* commandfactory.cpp */; };
+               374610780F40645300460C57 /* unifracweightedcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 374610770F40645300460C57 /* unifracweightedcommand.cpp */; };
+               3746107E0F4064D100460C57 /* weighted.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3746107D0F4064D100460C57 /* weighted.cpp */; };
+               374610830F40652400460C57 /* unweighted.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 374610820F40652400460C57 /* unweighted.cpp */; };
+               3746109D0F40657600460C57 /* unifracunweightedcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3746109C0F40657600460C57 /* unifracunweightedcommand.cpp */; };
                379293C30F2DE73400B9034A /* treemap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379293C20F2DE73400B9034A /* treemap.cpp */; };
+               379294700F2E191800B9034A /* parsimonycommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3792946F0F2E191800B9034A /* parsimonycommand.cpp */; };
+               3792948A0F2E258500B9034A /* parsimony.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379294890F2E258500B9034A /* parsimony.cpp */; };
                37AD4CE40F28AEA300AA2D49 /* sharedlistvector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37AD4CE30F28AEA300AA2D49 /* sharedlistvector.cpp */; };
                37AD4DBB0F28E2FE00AA2D49 /* tree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37AD4DBA0F28E2FE00AA2D49 /* tree.cpp */; };
                37AD4DCA0F28F3DD00AA2D49 /* readtree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37AD4DC90F28F3DD00AA2D49 /* readtree.cpp */; };
@@ -85,7 +91,6 @@
                37D9289F0F21331F001D4494 /* validparameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37D928530F21331F001D4494 /* validparameter.cpp */; };
                37E5F3E30F29FD4200F8D827 /* treenode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37E5F3E20F29FD4200F8D827 /* treenode.cpp */; };
                37E5F4920F2A3DA800F8D827 /* readtreecommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37E5F4910F2A3DA800F8D827 /* readtreecommand.cpp */; };
-               7E44EBD10F3235D900B0D45D /* makefile in Sources */ = {isa = PBXBuildFile; fileRef = 7E44EBD00F32358B00B0D45D /* makefile */; };
                8DD76F6A0486A84900D96B5E /* Mothur.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859E8B029090EE04C91782 /* Mothur.1 */; };
 /* End PBXBuildFile section */
 
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
-               372E126E0F26365B0095CF7E /* readotucommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotucommand.h; sourceTree = SOURCE_ROOT; };
-               372E126F0F26365B0095CF7E /* readotucommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readotucommand.cpp; sourceTree = SOURCE_ROOT; };
-               372E12940F263D5A0095CF7E /* readdistcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readdistcommand.h; sourceTree = SOURCE_ROOT; };
-               372E12950F263D5A0095CF7E /* readdistcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readdistcommand.cpp; sourceTree = SOURCE_ROOT; };
-               372E12EC0F264D320095CF7E /* commandfactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = commandfactory.cpp; sourceTree = SOURCE_ROOT; };
-               379293C10F2DE73400B9034A /* treemap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = treemap.h; sourceTree = SOURCE_ROOT; };
-               379293C20F2DE73400B9034A /* treemap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = treemap.cpp; sourceTree = SOURCE_ROOT; };
-               37AD4CE20F28AEA300AA2D49 /* sharedlistvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedlistvector.h; sourceTree = SOURCE_ROOT; };
-               37AD4CE30F28AEA300AA2D49 /* sharedlistvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedlistvector.cpp; sourceTree = SOURCE_ROOT; };
-               37AD4DB90F28E2FE00AA2D49 /* tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tree.h; sourceTree = SOURCE_ROOT; };
-               37AD4DBA0F28E2FE00AA2D49 /* tree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tree.cpp; sourceTree = SOURCE_ROOT; };
-               37AD4DC80F28F3DD00AA2D49 /* readtree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readtree.h; sourceTree = SOURCE_ROOT; };
-               37AD4DC90F28F3DD00AA2D49 /* readtree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readtree.cpp; sourceTree = SOURCE_ROOT; };
-               37B28F660F27590100808A62 /* deconvolutecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = deconvolutecommand.h; sourceTree = SOURCE_ROOT; };
-               37B28F670F27590100808A62 /* deconvolutecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = deconvolutecommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D927B80F21331F001D4494 /* ace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ace.cpp; sourceTree = SOURCE_ROOT; };
-               37D927B90F21331F001D4494 /* ace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ace.h; sourceTree = SOURCE_ROOT; };
-               37D927BA0F21331F001D4494 /* averagelinkage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = averagelinkage.cpp; sourceTree = SOURCE_ROOT; };
-               37D927BB0F21331F001D4494 /* bootstrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bootstrap.cpp; sourceTree = SOURCE_ROOT; };
-               37D927BC0F21331F001D4494 /* bootstrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootstrap.h; sourceTree = SOURCE_ROOT; };
-               37D927BD0F21331F001D4494 /* calculator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = calculator.cpp; sourceTree = SOURCE_ROOT; };
-               37D927BE0F21331F001D4494 /* calculator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = calculator.h; sourceTree = SOURCE_ROOT; };
-               37D927BF0F21331F001D4494 /* chao1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chao1.cpp; sourceTree = SOURCE_ROOT; };
-               37D927C00F21331F001D4494 /* chao1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chao1.h; sourceTree = SOURCE_ROOT; };
-               37D927C10F21331F001D4494 /* cluster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cluster.cpp; sourceTree = SOURCE_ROOT; };
-               37D927C20F21331F001D4494 /* cluster.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cluster.hpp; sourceTree = SOURCE_ROOT; };
-               37D927C30F21331F001D4494 /* clustercommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = clustercommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D927C40F21331F001D4494 /* clustercommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clustercommand.h; sourceTree = SOURCE_ROOT; };
-               37D927C50F21331F001D4494 /* collect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = collect.cpp; sourceTree = SOURCE_ROOT; };
-               37D927C60F21331F001D4494 /* collect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = collect.h; sourceTree = SOURCE_ROOT; };
-               37D927C70F21331F001D4494 /* collectcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = collectcommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D927C80F21331F001D4494 /* collectcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = collectcommand.h; sourceTree = SOURCE_ROOT; };
-               37D927C90F21331F001D4494 /* collectdisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = collectdisplay.h; sourceTree = SOURCE_ROOT; };
-               37D927CA0F21331F001D4494 /* collectorscurvedata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = collectorscurvedata.h; sourceTree = SOURCE_ROOT; };
-               37D927CB0F21331F001D4494 /* collectsharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = collectsharedcommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D927CC0F21331F001D4494 /* collectsharedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = collectsharedcommand.h; sourceTree = SOURCE_ROOT; };
-               37D927CD0F21331F001D4494 /* command.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = command.hpp; sourceTree = SOURCE_ROOT; };
-               37D927CF0F21331F001D4494 /* commandfactory.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = commandfactory.hpp; sourceTree = SOURCE_ROOT; };
-               37D927D00F21331F001D4494 /* commandoptionparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = commandoptionparser.cpp; sourceTree = SOURCE_ROOT; };
-               37D927D10F21331F001D4494 /* commandoptionparser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = commandoptionparser.hpp; sourceTree = SOURCE_ROOT; };
-               37D927D20F21331F001D4494 /* completelinkage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = completelinkage.cpp; sourceTree = SOURCE_ROOT; };
-               37D927D30F21331F001D4494 /* database.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = database.cpp; sourceTree = SOURCE_ROOT; };
-               37D927D40F21331F001D4494 /* database.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = database.hpp; sourceTree = SOURCE_ROOT; };
-               37D927D50F21331F001D4494 /* datavector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = datavector.hpp; sourceTree = SOURCE_ROOT; };
-               37D927D60F21331F001D4494 /* display.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = display.h; sourceTree = SOURCE_ROOT; };
-               37D927D70F21331F001D4494 /* engine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = engine.cpp; sourceTree = SOURCE_ROOT; };
-               37D927D80F21331F001D4494 /* engine.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = engine.hpp; sourceTree = SOURCE_ROOT; };
-               37D927D90F21331F001D4494 /* errorchecking.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = errorchecking.cpp; sourceTree = SOURCE_ROOT; };
-               37D927DA0F21331F001D4494 /* errorchecking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = errorchecking.h; sourceTree = SOURCE_ROOT; };
-               37D927DB0F21331F001D4494 /* fastamap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fastamap.cpp; sourceTree = SOURCE_ROOT; };
-               37D927DC0F21331F001D4494 /* fastamap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fastamap.h; sourceTree = SOURCE_ROOT; };
-               37D927DD0F21331F001D4494 /* fileoutput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileoutput.cpp; sourceTree = SOURCE_ROOT; };
-               37D927DE0F21331F001D4494 /* fileoutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fileoutput.h; sourceTree = SOURCE_ROOT; };
-               37D927DF0F21331F001D4494 /* globaldata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = globaldata.cpp; sourceTree = SOURCE_ROOT; };
-               37D927E00F21331F001D4494 /* globaldata.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = globaldata.hpp; sourceTree = SOURCE_ROOT; };
-               37D927E10F21331F001D4494 /* groupmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = groupmap.cpp; sourceTree = SOURCE_ROOT; };
-               37D927E20F21331F001D4494 /* groupmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = groupmap.h; sourceTree = SOURCE_ROOT; };
-               37D927E30F21331F001D4494 /* helpcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = helpcommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D927E40F21331F001D4494 /* helpcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = helpcommand.h; sourceTree = SOURCE_ROOT; };
-               37D927E50F21331F001D4494 /* inputdata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = inputdata.cpp; sourceTree = SOURCE_ROOT; };
-               37D927E60F21331F001D4494 /* inputdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inputdata.h; sourceTree = SOURCE_ROOT; };
-               37D927E70F21331F001D4494 /* jackknife.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jackknife.cpp; sourceTree = SOURCE_ROOT; };
-               37D927E80F21331F001D4494 /* jackknife.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jackknife.h; sourceTree = SOURCE_ROOT; };
-               37D927E90F21331F001D4494 /* kmer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kmer.cpp; sourceTree = SOURCE_ROOT; };
-               37D927EA0F21331F001D4494 /* kmer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = kmer.hpp; sourceTree = SOURCE_ROOT; };
-               37D927EB0F21331F001D4494 /* kmerdb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kmerdb.cpp; sourceTree = SOURCE_ROOT; };
-               37D927EC0F21331F001D4494 /* kmerdb.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = kmerdb.hpp; sourceTree = SOURCE_ROOT; };
-               37D927ED0F21331F001D4494 /* listvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listvector.cpp; sourceTree = SOURCE_ROOT; };
-               37D927EE0F21331F001D4494 /* listvector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = listvector.hpp; sourceTree = SOURCE_ROOT; };
-               37D927EF0F21331F001D4494 /* mothur.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mothur.cpp; sourceTree = SOURCE_ROOT; };
-               37D927F00F21331F001D4494 /* nameassignment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nameassignment.cpp; sourceTree = SOURCE_ROOT; };
-               37D927F10F21331F001D4494 /* nameassignment.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = nameassignment.hpp; sourceTree = SOURCE_ROOT; };
-               37D927F20F21331F001D4494 /* nocommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nocommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D927F30F21331F001D4494 /* nocommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nocommand.h; sourceTree = SOURCE_ROOT; };
-               37D927F40F21331F001D4494 /* npshannon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = npshannon.cpp; sourceTree = SOURCE_ROOT; };
-               37D927F50F21331F001D4494 /* npshannon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = npshannon.h; sourceTree = SOURCE_ROOT; };
-               37D927F60F21331F001D4494 /* observable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = observable.h; sourceTree = SOURCE_ROOT; };
-               37D927F70F21331F001D4494 /* ordervector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ordervector.cpp; sourceTree = SOURCE_ROOT; };
-               37D927F80F21331F001D4494 /* ordervector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ordervector.hpp; sourceTree = SOURCE_ROOT; };
-               37D927F90F21331F001D4494 /* parselistcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parselistcommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D927FA0F21331F001D4494 /* parselistcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parselistcommand.h; sourceTree = SOURCE_ROOT; };
-               37D927FB0F21331F001D4494 /* progress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = progress.cpp; sourceTree = SOURCE_ROOT; };
-               37D927FC0F21331F001D4494 /* progress.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = progress.hpp; sourceTree = SOURCE_ROOT; };
-               37D927FD0F21331F001D4494 /* quitcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = quitcommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D927FE0F21331F001D4494 /* quitcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = quitcommand.h; sourceTree = SOURCE_ROOT; };
-               37D927FF0F21331F001D4494 /* rabundvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rabundvector.cpp; sourceTree = SOURCE_ROOT; };
-               37D928000F21331F001D4494 /* rabundvector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = rabundvector.hpp; sourceTree = SOURCE_ROOT; };
-               37D928010F21331F001D4494 /* rarecalc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rarecalc.cpp; sourceTree = SOURCE_ROOT; };
-               37D928020F21331F001D4494 /* rarecalc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarecalc.h; sourceTree = SOURCE_ROOT; };
-               37D928030F21331F001D4494 /* raredisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = raredisplay.cpp; sourceTree = SOURCE_ROOT; };
-               37D928040F21331F001D4494 /* raredisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = raredisplay.h; sourceTree = SOURCE_ROOT; };
-               37D928050F21331F001D4494 /* rarefact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rarefact.cpp; sourceTree = SOURCE_ROOT; };
-               37D928060F21331F001D4494 /* rarefact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefact.h; sourceTree = SOURCE_ROOT; };
-               37D928070F21331F001D4494 /* rarefactcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rarefactcommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D928080F21331F001D4494 /* rarefactcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefactcommand.h; sourceTree = SOURCE_ROOT; };
-               37D928090F21331F001D4494 /* rarefactioncurvedata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefactioncurvedata.h; sourceTree = SOURCE_ROOT; };
-               37D9280A0F21331F001D4494 /* rarefactsharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rarefactsharedcommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D9280B0F21331F001D4494 /* rarefactsharedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefactsharedcommand.h; sourceTree = SOURCE_ROOT; };
-               37D928120F21331F001D4494 /* readmatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readmatrix.cpp; sourceTree = SOURCE_ROOT; };
-               37D928130F21331F001D4494 /* readmatrix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = readmatrix.hpp; sourceTree = SOURCE_ROOT; };
-               37D9281A0F21331F001D4494 /* sabundvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sabundvector.cpp; sourceTree = SOURCE_ROOT; };
-               37D9281B0F21331F001D4494 /* sabundvector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sabundvector.hpp; sourceTree = SOURCE_ROOT; };
-               37D9281C0F21331F001D4494 /* sequence.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sequence.cpp; sourceTree = SOURCE_ROOT; };
-               37D9281D0F21331F001D4494 /* sequence.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sequence.hpp; sourceTree = SOURCE_ROOT; };
-               37D9281E0F21331F001D4494 /* shannon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shannon.cpp; sourceTree = SOURCE_ROOT; };
-               37D9281F0F21331F001D4494 /* shannon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shannon.h; sourceTree = SOURCE_ROOT; };
-               37D928200F21331F001D4494 /* shared.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shared.cpp; sourceTree = SOURCE_ROOT; };
-               37D928210F21331F001D4494 /* shared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shared.h; sourceTree = SOURCE_ROOT; };
-               37D928220F21331F001D4494 /* sharedace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedace.cpp; sourceTree = SOURCE_ROOT; };
-               37D928230F21331F001D4494 /* sharedace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedace.h; sourceTree = SOURCE_ROOT; };
-               37D928240F21331F001D4494 /* sharedchao1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedchao1.cpp; sourceTree = SOURCE_ROOT; };
-               37D928250F21331F001D4494 /* sharedchao1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedchao1.h; sourceTree = SOURCE_ROOT; };
-               37D928260F21331F001D4494 /* sharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedcommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D928270F21331F001D4494 /* sharedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedcommand.h; sourceTree = SOURCE_ROOT; };
-               37D928280F21331F001D4494 /* sharedjabund.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedjabund.cpp; sourceTree = SOURCE_ROOT; };
-               37D928290F21331F001D4494 /* sharedjabund.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedjabund.h; sourceTree = SOURCE_ROOT; };
-               37D9282A0F21331F001D4494 /* sharedjclass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedjclass.cpp; sourceTree = SOURCE_ROOT; };
-               37D9282B0F21331F001D4494 /* sharedjclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedjclass.h; sourceTree = SOURCE_ROOT; };
-               37D9282C0F21331F001D4494 /* sharedjest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedjest.cpp; sourceTree = SOURCE_ROOT; };
-               37D9282D0F21331F001D4494 /* sharedjest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedjest.h; sourceTree = SOURCE_ROOT; };
-               37D9282E0F21331F001D4494 /* sharedordervector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedordervector.cpp; sourceTree = SOURCE_ROOT; };
-               37D9282F0F21331F001D4494 /* sharedordervector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedordervector.h; sourceTree = SOURCE_ROOT; };
-               37D928300F21331F001D4494 /* sharedrabundvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedrabundvector.cpp; sourceTree = SOURCE_ROOT; };
-               37D928310F21331F001D4494 /* sharedrabundvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedrabundvector.h; sourceTree = SOURCE_ROOT; };
-               37D928320F21331F001D4494 /* sharedsabundvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedsabundvector.cpp; sourceTree = SOURCE_ROOT; };
-               37D928330F21331F001D4494 /* sharedsabundvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedsabundvector.h; sourceTree = SOURCE_ROOT; };
-               37D928340F21331F001D4494 /* sharedsobs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedsobs.cpp; sourceTree = SOURCE_ROOT; };
-               37D928350F21331F001D4494 /* sharedsobs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedsobs.h; sourceTree = SOURCE_ROOT; };
-               37D928360F21331F001D4494 /* sharedsorabund.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedsorabund.cpp; sourceTree = SOURCE_ROOT; };
-               37D928370F21331F001D4494 /* sharedsorabund.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedsorabund.h; sourceTree = SOURCE_ROOT; };
-               37D928380F21331F001D4494 /* sharedsorclass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedsorclass.cpp; sourceTree = SOURCE_ROOT; };
-               37D928390F21331F001D4494 /* sharedsorclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedsorclass.h; sourceTree = SOURCE_ROOT; };
-               37D9283A0F21331F001D4494 /* sharedsorest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedsorest.cpp; sourceTree = SOURCE_ROOT; };
-               37D9283B0F21331F001D4494 /* sharedsorest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedsorest.h; sourceTree = SOURCE_ROOT; };
-               37D9283C0F21331F001D4494 /* sharedthetan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedthetan.cpp; sourceTree = SOURCE_ROOT; };
-               37D9283D0F21331F001D4494 /* sharedthetan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedthetan.h; sourceTree = SOURCE_ROOT; };
-               37D9283E0F21331F001D4494 /* sharedthetayc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedthetayc.cpp; sourceTree = SOURCE_ROOT; };
-               37D9283F0F21331F001D4494 /* sharedthetayc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedthetayc.h; sourceTree = SOURCE_ROOT; };
-               37D928400F21331F001D4494 /* simpson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = simpson.cpp; sourceTree = SOURCE_ROOT; };
-               37D928410F21331F001D4494 /* simpson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = simpson.h; sourceTree = SOURCE_ROOT; };
-               37D928420F21331F001D4494 /* singlelinkage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = singlelinkage.cpp; sourceTree = SOURCE_ROOT; };
-               37D928430F21331F001D4494 /* sobs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sobs.h; sourceTree = SOURCE_ROOT; };
-               37D928440F21331F001D4494 /* sparsematrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sparsematrix.cpp; sourceTree = SOURCE_ROOT; };
-               37D928450F21331F001D4494 /* sparsematrix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sparsematrix.hpp; sourceTree = SOURCE_ROOT; };
-               37D928460F21331F001D4494 /* summarycommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = summarycommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D928470F21331F001D4494 /* summarycommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = summarycommand.h; sourceTree = SOURCE_ROOT; };
-               37D928480F21331F001D4494 /* summarydata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = summarydata.h; sourceTree = SOURCE_ROOT; };
-               37D928490F21331F001D4494 /* summarydisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = summarydisplay.h; sourceTree = SOURCE_ROOT; };
-               37D9284A0F21331F001D4494 /* summarysharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = summarysharedcommand.cpp; sourceTree = SOURCE_ROOT; };
-               37D9284B0F21331F001D4494 /* summarysharedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = summarysharedcommand.h; sourceTree = SOURCE_ROOT; };
-               37D9284C0F21331F001D4494 /* utilities.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = utilities.hpp; sourceTree = SOURCE_ROOT; };
-               37D9284D0F21331F001D4494 /* uvest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = uvest.cpp; sourceTree = SOURCE_ROOT; };
-               37D9284E0F21331F001D4494 /* uvest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uvest.h; sourceTree = SOURCE_ROOT; };
-               37D9284F0F21331F001D4494 /* validcalculator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = validcalculator.cpp; sourceTree = SOURCE_ROOT; };
-               37D928500F21331F001D4494 /* validcalculator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = validcalculator.h; sourceTree = SOURCE_ROOT; };
-               37D928510F21331F001D4494 /* validcommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = validcommands.cpp; sourceTree = SOURCE_ROOT; };
-               37D928520F21331F001D4494 /* validcommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = validcommands.h; sourceTree = SOURCE_ROOT; };
-               37D928530F21331F001D4494 /* validparameter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = validparameter.cpp; sourceTree = SOURCE_ROOT; };
-               37D928540F21331F001D4494 /* validparameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = validparameter.h; sourceTree = SOURCE_ROOT; };
-               37E5F3E10F29FD4200F8D827 /* treenode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = treenode.h; sourceTree = SOURCE_ROOT; };
-               37E5F3E20F29FD4200F8D827 /* treenode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = treenode.cpp; sourceTree = SOURCE_ROOT; };
-               37E5F4900F2A3DA800F8D827 /* readtreecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readtreecommand.h; sourceTree = SOURCE_ROOT; };
-               37E5F4910F2A3DA800F8D827 /* readtreecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readtreecommand.cpp; sourceTree = SOURCE_ROOT; };
-               7E44EBD00F32358B00B0D45D /* makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = makefile; sourceTree = "<group>"; };
+               372E126E0F26365B0095CF7E /* readotucommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotucommand.h; sourceTree = "<group>"; };
+               372E126F0F26365B0095CF7E /* readotucommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readotucommand.cpp; sourceTree = "<group>"; };
+               372E12940F263D5A0095CF7E /* readdistcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readdistcommand.h; sourceTree = "<group>"; };
+               372E12950F263D5A0095CF7E /* readdistcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readdistcommand.cpp; sourceTree = "<group>"; };
+               372E12EC0F264D320095CF7E /* commandfactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = commandfactory.cpp; sourceTree = "<group>"; };
+               374610760F40645300460C57 /* unifracweightedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unifracweightedcommand.h; sourceTree = "<group>"; };
+               374610770F40645300460C57 /* unifracweightedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unifracweightedcommand.cpp; sourceTree = "<group>"; };
+               3746107C0F4064D100460C57 /* weighted.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = weighted.h; sourceTree = "<group>"; };
+               3746107D0F4064D100460C57 /* weighted.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = weighted.cpp; sourceTree = "<group>"; };
+               374610810F40652400460C57 /* unweighted.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unweighted.h; sourceTree = "<group>"; };
+               374610820F40652400460C57 /* unweighted.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unweighted.cpp; sourceTree = "<group>"; };
+               3746109B0F40657600460C57 /* unifracunweightedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unifracunweightedcommand.h; sourceTree = "<group>"; };
+               3746109C0F40657600460C57 /* unifracunweightedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unifracunweightedcommand.cpp; sourceTree = "<group>"; };
+               379293C10F2DE73400B9034A /* treemap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = treemap.h; sourceTree = "<group>"; };
+               379293C20F2DE73400B9034A /* treemap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = treemap.cpp; sourceTree = "<group>"; };
+               3792946E0F2E191800B9034A /* parsimonycommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parsimonycommand.h; sourceTree = "<group>"; };
+               3792946F0F2E191800B9034A /* parsimonycommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parsimonycommand.cpp; sourceTree = "<group>"; };
+               379294880F2E258500B9034A /* parsimony.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parsimony.h; sourceTree = "<group>"; };
+               379294890F2E258500B9034A /* parsimony.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parsimony.cpp; sourceTree = "<group>"; };
+               3792948D0F2E271100B9034A /* treecalculator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = treecalculator.h; sourceTree = "<group>"; };
+               37AD4CE20F28AEA300AA2D49 /* sharedlistvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedlistvector.h; sourceTree = "<group>"; };
+               37AD4CE30F28AEA300AA2D49 /* sharedlistvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedlistvector.cpp; sourceTree = "<group>"; };
+               37AD4DB90F28E2FE00AA2D49 /* tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tree.h; sourceTree = "<group>"; };
+               37AD4DBA0F28E2FE00AA2D49 /* tree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tree.cpp; sourceTree = "<group>"; };
+               37AD4DC80F28F3DD00AA2D49 /* readtree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readtree.h; sourceTree = "<group>"; };
+               37AD4DC90F28F3DD00AA2D49 /* readtree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readtree.cpp; sourceTree = "<group>"; };
+               37B28F660F27590100808A62 /* deconvolutecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = deconvolutecommand.h; sourceTree = "<group>"; };
+               37B28F670F27590100808A62 /* deconvolutecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = deconvolutecommand.cpp; sourceTree = "<group>"; };
+               37D927B80F21331F001D4494 /* ace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ace.cpp; sourceTree = "<group>"; };
+               37D927B90F21331F001D4494 /* ace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ace.h; sourceTree = "<group>"; };
+               37D927BA0F21331F001D4494 /* averagelinkage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = averagelinkage.cpp; sourceTree = "<group>"; };
+               37D927BB0F21331F001D4494 /* bootstrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bootstrap.cpp; sourceTree = "<group>"; };
+               37D927BC0F21331F001D4494 /* bootstrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootstrap.h; sourceTree = "<group>"; };
+               37D927BD0F21331F001D4494 /* calculator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = calculator.cpp; sourceTree = "<group>"; };
+               37D927BE0F21331F001D4494 /* calculator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = calculator.h; sourceTree = "<group>"; };
+               37D927BF0F21331F001D4494 /* chao1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = chao1.cpp; sourceTree = "<group>"; };
+               37D927C00F21331F001D4494 /* chao1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chao1.h; sourceTree = "<group>"; };
+               37D927C10F21331F001D4494 /* cluster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cluster.cpp; sourceTree = "<group>"; };
+               37D927C20F21331F001D4494 /* cluster.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cluster.hpp; sourceTree = "<group>"; };
+               37D927C30F21331F001D4494 /* clustercommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = clustercommand.cpp; sourceTree = "<group>"; };
+               37D927C40F21331F001D4494 /* clustercommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clustercommand.h; sourceTree = "<group>"; };
+               37D927C50F21331F001D4494 /* collect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = collect.cpp; sourceTree = "<group>"; };
+               37D927C60F21331F001D4494 /* collect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = collect.h; sourceTree = "<group>"; };
+               37D927C70F21331F001D4494 /* collectcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = collectcommand.cpp; sourceTree = "<group>"; };
+               37D927C80F21331F001D4494 /* collectcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = collectcommand.h; sourceTree = "<group>"; };
+               37D927C90F21331F001D4494 /* collectdisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = collectdisplay.h; sourceTree = "<group>"; };
+               37D927CA0F21331F001D4494 /* collectorscurvedata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = collectorscurvedata.h; sourceTree = "<group>"; };
+               37D927CB0F21331F001D4494 /* collectsharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = collectsharedcommand.cpp; sourceTree = "<group>"; };
+               37D927CC0F21331F001D4494 /* collectsharedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = collectsharedcommand.h; sourceTree = "<group>"; };
+               37D927CD0F21331F001D4494 /* command.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = command.hpp; sourceTree = "<group>"; };
+               37D927CF0F21331F001D4494 /* commandfactory.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = commandfactory.hpp; sourceTree = "<group>"; };
+               37D927D00F21331F001D4494 /* commandoptionparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = commandoptionparser.cpp; sourceTree = "<group>"; };
+               37D927D10F21331F001D4494 /* commandoptionparser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = commandoptionparser.hpp; sourceTree = "<group>"; };
+               37D927D20F21331F001D4494 /* completelinkage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = completelinkage.cpp; sourceTree = "<group>"; };
+               37D927D30F21331F001D4494 /* database.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = database.cpp; sourceTree = "<group>"; };
+               37D927D40F21331F001D4494 /* database.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = database.hpp; sourceTree = "<group>"; };
+               37D927D50F21331F001D4494 /* datavector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = datavector.hpp; sourceTree = "<group>"; };
+               37D927D60F21331F001D4494 /* display.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = display.h; sourceTree = "<group>"; };
+               37D927D70F21331F001D4494 /* engine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = engine.cpp; sourceTree = "<group>"; };
+               37D927D80F21331F001D4494 /* engine.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = engine.hpp; sourceTree = "<group>"; };
+               37D927D90F21331F001D4494 /* errorchecking.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = errorchecking.cpp; sourceTree = "<group>"; };
+               37D927DA0F21331F001D4494 /* errorchecking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = errorchecking.h; sourceTree = "<group>"; };
+               37D927DB0F21331F001D4494 /* fastamap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fastamap.cpp; sourceTree = "<group>"; };
+               37D927DC0F21331F001D4494 /* fastamap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fastamap.h; sourceTree = "<group>"; };
+               37D927DD0F21331F001D4494 /* fileoutput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fileoutput.cpp; sourceTree = "<group>"; };
+               37D927DE0F21331F001D4494 /* fileoutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fileoutput.h; sourceTree = "<group>"; };
+               37D927DF0F21331F001D4494 /* globaldata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = globaldata.cpp; sourceTree = "<group>"; };
+               37D927E00F21331F001D4494 /* globaldata.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = globaldata.hpp; sourceTree = "<group>"; };
+               37D927E10F21331F001D4494 /* groupmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = groupmap.cpp; sourceTree = "<group>"; };
+               37D927E20F21331F001D4494 /* groupmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = groupmap.h; sourceTree = "<group>"; };
+               37D927E30F21331F001D4494 /* helpcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = helpcommand.cpp; sourceTree = "<group>"; };
+               37D927E40F21331F001D4494 /* helpcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = helpcommand.h; sourceTree = "<group>"; };
+               37D927E50F21331F001D4494 /* inputdata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = inputdata.cpp; sourceTree = "<group>"; };
+               37D927E60F21331F001D4494 /* inputdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inputdata.h; sourceTree = "<group>"; };
+               37D927E70F21331F001D4494 /* jackknife.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jackknife.cpp; sourceTree = "<group>"; };
+               37D927E80F21331F001D4494 /* jackknife.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jackknife.h; sourceTree = "<group>"; };
+               37D927E90F21331F001D4494 /* kmer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kmer.cpp; sourceTree = "<group>"; };
+               37D927EA0F21331F001D4494 /* kmer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = kmer.hpp; sourceTree = "<group>"; };
+               37D927EB0F21331F001D4494 /* kmerdb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kmerdb.cpp; sourceTree = "<group>"; };
+               37D927EC0F21331F001D4494 /* kmerdb.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = kmerdb.hpp; sourceTree = "<group>"; };
+               37D927ED0F21331F001D4494 /* listvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = listvector.cpp; sourceTree = "<group>"; };
+               37D927EE0F21331F001D4494 /* listvector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = listvector.hpp; sourceTree = "<group>"; };
+               37D927EF0F21331F001D4494 /* mothur.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mothur.cpp; sourceTree = "<group>"; };
+               37D927F00F21331F001D4494 /* nameassignment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nameassignment.cpp; sourceTree = "<group>"; };
+               37D927F10F21331F001D4494 /* nameassignment.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = nameassignment.hpp; sourceTree = "<group>"; };
+               37D927F20F21331F001D4494 /* nocommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nocommand.cpp; sourceTree = "<group>"; };
+               37D927F30F21331F001D4494 /* nocommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nocommand.h; sourceTree = "<group>"; };
+               37D927F40F21331F001D4494 /* npshannon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = npshannon.cpp; sourceTree = "<group>"; };
+               37D927F50F21331F001D4494 /* npshannon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = npshannon.h; sourceTree = "<group>"; };
+               37D927F60F21331F001D4494 /* observable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = observable.h; sourceTree = "<group>"; };
+               37D927F70F21331F001D4494 /* ordervector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ordervector.cpp; sourceTree = "<group>"; };
+               37D927F80F21331F001D4494 /* ordervector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ordervector.hpp; sourceTree = "<group>"; };
+               37D927F90F21331F001D4494 /* parselistcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parselistcommand.cpp; sourceTree = "<group>"; };
+               37D927FA0F21331F001D4494 /* parselistcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parselistcommand.h; sourceTree = "<group>"; };
+               37D927FB0F21331F001D4494 /* progress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = progress.cpp; sourceTree = "<group>"; };
+               37D927FC0F21331F001D4494 /* progress.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = progress.hpp; sourceTree = "<group>"; };
+               37D927FD0F21331F001D4494 /* quitcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = quitcommand.cpp; sourceTree = "<group>"; };
+               37D927FE0F21331F001D4494 /* quitcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = quitcommand.h; sourceTree = "<group>"; };
+               37D927FF0F21331F001D4494 /* rabundvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rabundvector.cpp; sourceTree = "<group>"; };
+               37D928000F21331F001D4494 /* rabundvector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = rabundvector.hpp; sourceTree = "<group>"; };
+               37D928010F21331F001D4494 /* rarecalc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rarecalc.cpp; sourceTree = "<group>"; };
+               37D928020F21331F001D4494 /* rarecalc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarecalc.h; sourceTree = "<group>"; };
+               37D928030F21331F001D4494 /* raredisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = raredisplay.cpp; sourceTree = "<group>"; };
+               37D928040F21331F001D4494 /* raredisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = raredisplay.h; sourceTree = "<group>"; };
+               37D928050F21331F001D4494 /* rarefact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rarefact.cpp; sourceTree = "<group>"; };
+               37D928060F21331F001D4494 /* rarefact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefact.h; sourceTree = "<group>"; };
+               37D928070F21331F001D4494 /* rarefactcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rarefactcommand.cpp; sourceTree = "<group>"; };
+               37D928080F21331F001D4494 /* rarefactcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefactcommand.h; sourceTree = "<group>"; };
+               37D928090F21331F001D4494 /* rarefactioncurvedata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefactioncurvedata.h; sourceTree = "<group>"; };
+               37D9280A0F21331F001D4494 /* rarefactsharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rarefactsharedcommand.cpp; sourceTree = "<group>"; };
+               37D9280B0F21331F001D4494 /* rarefactsharedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rarefactsharedcommand.h; sourceTree = "<group>"; };
+               37D928120F21331F001D4494 /* readmatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readmatrix.cpp; sourceTree = "<group>"; };
+               37D928130F21331F001D4494 /* readmatrix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = readmatrix.hpp; sourceTree = "<group>"; };
+               37D9281A0F21331F001D4494 /* sabundvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sabundvector.cpp; sourceTree = "<group>"; };
+               37D9281B0F21331F001D4494 /* sabundvector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sabundvector.hpp; sourceTree = "<group>"; };
+               37D9281C0F21331F001D4494 /* sequence.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sequence.cpp; sourceTree = "<group>"; };
+               37D9281D0F21331F001D4494 /* sequence.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sequence.hpp; sourceTree = "<group>"; };
+               37D9281E0F21331F001D4494 /* shannon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shannon.cpp; sourceTree = "<group>"; };
+               37D9281F0F21331F001D4494 /* shannon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shannon.h; sourceTree = "<group>"; };
+               37D928200F21331F001D4494 /* shared.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shared.cpp; sourceTree = "<group>"; };
+               37D928210F21331F001D4494 /* shared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shared.h; sourceTree = "<group>"; };
+               37D928220F21331F001D4494 /* sharedace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedace.cpp; sourceTree = "<group>"; };
+               37D928230F21331F001D4494 /* sharedace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedace.h; sourceTree = "<group>"; };
+               37D928240F21331F001D4494 /* sharedchao1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedchao1.cpp; sourceTree = "<group>"; };
+               37D928250F21331F001D4494 /* sharedchao1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedchao1.h; sourceTree = "<group>"; };
+               37D928260F21331F001D4494 /* sharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedcommand.cpp; sourceTree = "<group>"; };
+               37D928270F21331F001D4494 /* sharedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedcommand.h; sourceTree = "<group>"; };
+               37D928280F21331F001D4494 /* sharedjabund.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedjabund.cpp; sourceTree = "<group>"; };
+               37D928290F21331F001D4494 /* sharedjabund.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedjabund.h; sourceTree = "<group>"; };
+               37D9282A0F21331F001D4494 /* sharedjclass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedjclass.cpp; sourceTree = "<group>"; };
+               37D9282B0F21331F001D4494 /* sharedjclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedjclass.h; sourceTree = "<group>"; };
+               37D9282C0F21331F001D4494 /* sharedjest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedjest.cpp; sourceTree = "<group>"; };
+               37D9282D0F21331F001D4494 /* sharedjest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedjest.h; sourceTree = "<group>"; };
+               37D9282E0F21331F001D4494 /* sharedordervector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedordervector.cpp; sourceTree = "<group>"; };
+               37D9282F0F21331F001D4494 /* sharedordervector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedordervector.h; sourceTree = "<group>"; };
+               37D928300F21331F001D4494 /* sharedrabundvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedrabundvector.cpp; sourceTree = "<group>"; };
+               37D928310F21331F001D4494 /* sharedrabundvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedrabundvector.h; sourceTree = "<group>"; };
+               37D928320F21331F001D4494 /* sharedsabundvector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedsabundvector.cpp; sourceTree = "<group>"; };
+               37D928330F21331F001D4494 /* sharedsabundvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedsabundvector.h; sourceTree = "<group>"; };
+               37D928340F21331F001D4494 /* sharedsobs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedsobs.cpp; sourceTree = "<group>"; };
+               37D928350F21331F001D4494 /* sharedsobs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedsobs.h; sourceTree = "<group>"; };
+               37D928360F21331F001D4494 /* sharedsorabund.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedsorabund.cpp; sourceTree = "<group>"; };
+               37D928370F21331F001D4494 /* sharedsorabund.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedsorabund.h; sourceTree = "<group>"; };
+               37D928380F21331F001D4494 /* sharedsorclass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedsorclass.cpp; sourceTree = "<group>"; };
+               37D928390F21331F001D4494 /* sharedsorclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedsorclass.h; sourceTree = "<group>"; };
+               37D9283A0F21331F001D4494 /* sharedsorest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedsorest.cpp; sourceTree = "<group>"; };
+               37D9283B0F21331F001D4494 /* sharedsorest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedsorest.h; sourceTree = "<group>"; };
+               37D9283C0F21331F001D4494 /* sharedthetan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedthetan.cpp; sourceTree = "<group>"; };
+               37D9283D0F21331F001D4494 /* sharedthetan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedthetan.h; sourceTree = "<group>"; };
+               37D9283E0F21331F001D4494 /* sharedthetayc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sharedthetayc.cpp; sourceTree = "<group>"; };
+               37D9283F0F21331F001D4494 /* sharedthetayc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sharedthetayc.h; sourceTree = "<group>"; };
+               37D928400F21331F001D4494 /* simpson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = simpson.cpp; sourceTree = "<group>"; };
+               37D928410F21331F001D4494 /* simpson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = simpson.h; sourceTree = "<group>"; };
+               37D928420F21331F001D4494 /* singlelinkage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = singlelinkage.cpp; sourceTree = "<group>"; };
+               37D928430F21331F001D4494 /* sobs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sobs.h; sourceTree = "<group>"; };
+               37D928440F21331F001D4494 /* sparsematrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sparsematrix.cpp; sourceTree = "<group>"; };
+               37D928450F21331F001D4494 /* sparsematrix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sparsematrix.hpp; sourceTree = "<group>"; };
+               37D928460F21331F001D4494 /* summarycommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = summarycommand.cpp; sourceTree = "<group>"; };
+               37D928470F21331F001D4494 /* summarycommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = summarycommand.h; sourceTree = "<group>"; };
+               37D928480F21331F001D4494 /* summarydata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = summarydata.h; sourceTree = "<group>"; };
+               37D928490F21331F001D4494 /* summarydisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = summarydisplay.h; sourceTree = "<group>"; };
+               37D9284A0F21331F001D4494 /* summarysharedcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = summarysharedcommand.cpp; sourceTree = "<group>"; };
+               37D9284B0F21331F001D4494 /* summarysharedcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = summarysharedcommand.h; sourceTree = "<group>"; };
+               37D9284C0F21331F001D4494 /* utilities.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = utilities.hpp; sourceTree = "<group>"; };
+               37D9284D0F21331F001D4494 /* uvest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = uvest.cpp; sourceTree = "<group>"; };
+               37D9284E0F21331F001D4494 /* uvest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uvest.h; sourceTree = "<group>"; };
+               37D9284F0F21331F001D4494 /* validcalculator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = validcalculator.cpp; sourceTree = "<group>"; };
+               37D928500F21331F001D4494 /* validcalculator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = validcalculator.h; sourceTree = "<group>"; };
+               37D928510F21331F001D4494 /* validcommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = validcommands.cpp; sourceTree = "<group>"; };
+               37D928520F21331F001D4494 /* validcommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = validcommands.h; sourceTree = "<group>"; };
+               37D928530F21331F001D4494 /* validparameter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = validparameter.cpp; sourceTree = "<group>"; };
+               37D928540F21331F001D4494 /* validparameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = validparameter.h; sourceTree = "<group>"; };
+               37E5F3E10F29FD4200F8D827 /* treenode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = treenode.h; sourceTree = "<group>"; };
+               37E5F3E20F29FD4200F8D827 /* treenode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = treenode.cpp; sourceTree = "<group>"; };
+               37E5F4900F2A3DA800F8D827 /* readtreecommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readtreecommand.h; sourceTree = "<group>"; };
+               37E5F4910F2A3DA800F8D827 /* readtreecommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readtreecommand.cpp; sourceTree = "<group>"; };
                8DD76F6C0486A84900D96B5E /* mothur */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mothur; sourceTree = BUILT_PRODUCTS_DIR; };
                C6859E8B029090EE04C91782 /* Mothur.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = Mothur.1; sourceTree = "<group>"; };
 /* End PBXFileReference section */
                                37D927D60F21331F001D4494 /* display.h */,
                                37D927D80F21331F001D4494 /* engine.hpp */,
                                37D927D70F21331F001D4494 /* engine.cpp */,
-                               7E44EBD00F32358B00B0D45D /* makefile */,
                                37D928B10F213472001D4494 /* errorcheckor */,
                                37D927DE0F21331F001D4494 /* fileoutput.h */,
                                37D927DD0F21331F001D4494 /* fileoutput.cpp */,
                                37D9284C0F21331F001D4494 /* utilities.hpp */,
                        );
                        name = Source;
-                       sourceTree = SOURCE_ROOT;
+                       sourceTree = "<group>";
                };
                1AB674ADFE9D54B511CA2CBB /* Products */ = {
                        isa = PBXGroup;
                        isa = PBXGroup;
                        children = (
                                37D927BE0F21331F001D4494 /* calculator.h */,
+                               3792948D0F2E271100B9034A /* treecalculator.h */,
                                37D927BD0F21331F001D4494 /* calculator.cpp */,
                                37D927B90F21331F001D4494 /* ace.h */,
                                37D927B80F21331F001D4494 /* ace.cpp */,
                                37D927E70F21331F001D4494 /* jackknife.cpp */,
                                37D927F50F21331F001D4494 /* npshannon.h */,
                                37D927F40F21331F001D4494 /* npshannon.cpp */,
+                               379294880F2E258500B9034A /* parsimony.h */,
+                               379294890F2E258500B9034A /* parsimony.cpp */,
                                37D928020F21331F001D4494 /* rarecalc.h */,
                                37D928010F21331F001D4494 /* rarecalc.cpp */,
                                37D9281F0F21331F001D4494 /* shannon.h */,
                                37D928410F21331F001D4494 /* simpson.h */,
                                37D928400F21331F001D4494 /* simpson.cpp */,
                                37D928430F21331F001D4494 /* sobs.h */,
+                               374610810F40652400460C57 /* unweighted.h */,
+                               374610820F40652400460C57 /* unweighted.cpp */,
                                37D9284E0F21331F001D4494 /* uvest.h */,
                                37D9284D0F21331F001D4494 /* uvest.cpp */,
+                               3746107C0F4064D100460C57 /* weighted.h */,
+                               3746107D0F4064D100460C57 /* weighted.cpp */,
                        );
                        name = calculators;
-                       sourceTree = SOURCE_ROOT;
+                       sourceTree = "<group>";
                };
                37D928A90F2133E5001D4494 /* commands */ = {
                        isa = PBXGroup;
                                37D927F30F21331F001D4494 /* nocommand.h */,
                                37D927FA0F21331F001D4494 /* parselistcommand.h */,
                                37D927F90F21331F001D4494 /* parselistcommand.cpp */,
+                               3792946E0F2E191800B9034A /* parsimonycommand.h */,
+                               3792946F0F2E191800B9034A /* parsimonycommand.cpp */,
+                               37D927FE0F21331F001D4494 /* quitcommand.h */,
+                               37D927FD0F21331F001D4494 /* quitcommand.cpp */,
                                37D928080F21331F001D4494 /* rarefactcommand.h */,
                                37D928070F21331F001D4494 /* rarefactcommand.cpp */,
                                37D9280B0F21331F001D4494 /* rarefactsharedcommand.h */,
                                37D928460F21331F001D4494 /* summarycommand.cpp */,
                                37D9284B0F21331F001D4494 /* summarysharedcommand.h */,
                                37D9284A0F21331F001D4494 /* summarysharedcommand.cpp */,
-                               37D927FE0F21331F001D4494 /* quitcommand.h */,
-                               37D927FD0F21331F001D4494 /* quitcommand.cpp */,
+                               3746109B0F40657600460C57 /* unifracunweightedcommand.h */,
+                               3746109C0F40657600460C57 /* unifracunweightedcommand.cpp */,
+                               374610760F40645300460C57 /* unifracweightedcommand.h */,
+                               374610770F40645300460C57 /* unifracweightedcommand.cpp */,
                        );
                        name = commands;
-                       sourceTree = SOURCE_ROOT;
+                       sourceTree = "<group>";
                };
                37D928AC0F213420001D4494 /* containers */ = {
                        isa = PBXGroup;
                                37E5F3E20F29FD4200F8D827 /* treenode.cpp */,
                        );
                        name = containers;
-                       sourceTree = SOURCE_ROOT;
+                       sourceTree = "<group>";
                };
                37D928B10F213472001D4494 /* errorcheckor */ = {
                        isa = PBXGroup;
                                37D928530F21331F001D4494 /* validparameter.cpp */,
                        );
                        name = errorcheckor;
-                       sourceTree = SOURCE_ROOT;
+                       sourceTree = "<group>";
                };
                C6859E8C029090F304C91782 /* Documentation */ = {
                        isa = PBXGroup;
                                37E5F3E30F29FD4200F8D827 /* treenode.cpp in Sources */,
                                37E5F4920F2A3DA800F8D827 /* readtreecommand.cpp in Sources */,
                                379293C30F2DE73400B9034A /* treemap.cpp in Sources */,
-                               7E44EBD10F3235D900B0D45D /* makefile in Sources */,
+                               379294700F2E191800B9034A /* parsimonycommand.cpp in Sources */,
+                               3792948A0F2E258500B9034A /* parsimony.cpp in Sources */,
+                               374610780F40645300460C57 /* unifracweightedcommand.cpp in Sources */,
+                               3746107E0F4064D100460C57 /* weighted.cpp in Sources */,
+                               374610830F40652400460C57 /* unweighted.cpp in Sources */,
+                               3746109D0F40657600460C57 /* unifracunweightedcommand.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                        ppc,
                                        i386,
                                );
-                               GCC_OPTIMIZATION_LEVEL = 3;
+                               GCC_OPTIMIZATION_LEVEL = 0;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
                                PREBINDING = NO;
index 06c3a2425a2a56cbfce3ac3b19b83591dd288c7c..c11989289197661f164564024cdc8d7f0eafc768 100644 (file)
@@ -17,7 +17,7 @@ using namespace std;
 #include "rabundvector.hpp"
 #include "uvest.h"
 
-/* The calculator class is the parent class for all the different estimators implemented in mothur.
+/* The calculator class is the parent class for all the different estimators implemented in mothur except the tree calculators.
 It has 2 pure functions EstOutput getValues(SAbundVector*), which works on a single group, and 
 EstOutput getValues(SharedRAbundVector* shared1, SharedRAbundVector* shared2), which compares 2 groups. */ 
 
index 0a922180fe566f0ec7b1f7cf56c2f293f7484125..a06c320f37f952c527533abae162e13af5a438b1 100644 (file)
@@ -3,7 +3,7 @@
  *  Dotur
  *
  *  Created by Sarah Westcott on 11/18/08.
- *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
 
index 0a065cdf36524ca775649cf2f3e863c02839be38..dbcfb54be8c09fbf6177ad2d4ed10be8773d0358 100644 (file)
@@ -24,6 +24,9 @@
 #include "helpcommand.h"
 #include "commandfactory.hpp"
 #include "deconvolutecommand.h"
+#include "parsimonycommand.h"
+#include "unifracunweightedcommand.h"
+#include "unifracweightedcommand.h"
 #include <exception>
 
 
@@ -49,21 +52,24 @@ Command* CommandFactory::getCommand(string commandName){
        try {
                delete command;   //delete the old command
 
-                        if(commandName == "read.dist")                         {       command = new ReadDistCommand();                }
-               else if(commandName == "read.otu")                              {       command = new ReadOtuCommand();                 }
-               //else if(commandName == "read.tree")                           {       command = new ReadTreeCommand();                }
-               else if(commandName == "cluster")                               {       command = new ClusterCommand();                 }
-               else if(commandName == "deconvolute")                   {       command = new DeconvoluteCommand();             }
-               else if(commandName == "help")                                  {       command = new HelpCommand();                    }
-               else if(commandName == "quit")                                  {       command = new QuitCommand();                    }
-               else if(commandName == "collect.single")                {       command = new CollectCommand();                 }
-               else if(commandName == "collect.shared")                {       command = new CollectSharedCommand();   }
-               else if(commandName == "rarefaction.single")    {       command = new RareFactCommand();                }
-               else if(commandName == "rarefaction.shared")    {       command = new RareFactSharedCommand();  }
-               else if(commandName == "summary.single")                {       command = new SummaryCommand();                 }
-               else if(commandName == "summary.shared")                {       command = new SummarySharedCommand();   }
-               else                                                                                    {       command = new NoCommand();                              }
-
+                        if(commandName == "read.dist")                         {       command = new ReadDistCommand();                        }
+               else if(commandName == "read.otu")                              {       command = new ReadOtuCommand();                         }
+               else if(commandName == "read.tree")                             {       command = new ReadTreeCommand();                        }
+               else if(commandName == "cluster")                               {       command = new ClusterCommand();                         }
+               else if(commandName == "deconvolute")                   {       command = new DeconvoluteCommand();                     }
+               else if(commandName == "parsimony")                             {       command = new ParsimonyCommand();                       }
+               else if(commandName == "help")                                  {       command = new HelpCommand();                            }
+               else if(commandName == "quit")                                  {       command = new QuitCommand();                            }
+               else if(commandName == "collect.single")                {       command = new CollectCommand();                         }
+               else if(commandName == "collect.shared")                {       command = new CollectSharedCommand();           }
+               else if(commandName == "rarefaction.single")    {       command = new RareFactCommand();                        }
+               else if(commandName == "rarefaction.shared")    {       command = new RareFactSharedCommand();          }
+               else if(commandName == "summary.single")                {       command = new SummaryCommand();                         }
+               else if(commandName == "summary.shared")                {       command = new SummarySharedCommand();           }
+               else if(commandName == "unifrac.weighted")              {       command = new UnifracWeightedCommand();         }
+               else if(commandName == "unifrac.unweighted")    {       command = new UnifracUnweightedCommand();       }
+               else                                                                                    {       command = new NoCommand();                                      }
+                       
                return command;
        }
        catch(exception& e) {
index 7d63e9b5a53b77afcb277963f31418ac8bdfccd9..03844d5fa5b132e21ad1ae60e1c9e7b43e343aa2 100644 (file)
@@ -18,6 +18,12 @@ ErrorCheck::ErrorCheck() {
        validCommand = new ValidCommands();
        validParameter = new ValidParameters();
        validCalculator = new ValidCalculators();
+}
+/*******************************************************/
+
+/******************************************************/
+
+void ErrorCheck::refresh() {
        columnfile = globaldata->getColumnFile();
        phylipfile = globaldata->getPhylipFile();
        listfile = globaldata->getListFile();
@@ -31,8 +37,9 @@ ErrorCheck::ErrorCheck() {
        cutoff = globaldata->getCutOff();
        format = globaldata->getFormat();
        method = globaldata->getMethod();
-
+       randomtree = globaldata->getRandomTree();
 }
+
 /*******************************************************/
 
 /******************************************************/
@@ -46,7 +53,10 @@ ErrorCheck::~ErrorCheck() {}
 bool ErrorCheck::checkInput(string input) {
                errorFree = true;
                clear();
-
+               
+               //refresh variable
+               refresh();
+               
                //get command name and parameters
                int openParen = input.find_first_of('(');
                int closeParen = input.find_last_of(')');
@@ -91,6 +101,7 @@ bool ErrorCheck::checkInput(string input) {
                                if (parameter == "fileroot" )           { fileroot = value; }
                                if (parameter == "line" )                       { line = value; }
                                if (parameter == "label" )                      { label = value; }
+                               if (parameter == "randomtree" )         { randomtree = value;   }
 
                                if (parameter == "single") {//stores estimators in a vector
                                        singleEsimators.clear(); //clears out old values
@@ -160,6 +171,7 @@ bool ErrorCheck::checkInput(string input) {
                                if (parameter == "fileroot" )           { fileroot = value; }
                                if (parameter == "line" )                       { line = value; }
                                if (parameter == "label" )                      { label = value; }
+                               if (parameter == "randomtree" )         { randomtree = value;   }
 
                                if (parameter == "single") {//stores estimators in a vector
                                        singleEsimators.clear(); //clears out old values
@@ -234,6 +246,14 @@ bool ErrorCheck::checkInput(string input) {
                                errorFree = false;
                } 
                
+               if (commandName == "parsimony") {
+                       //are you trying to use parsimony without reading a tree or saying you want random distribution
+                       if (randomtree == "0")  {
+                               if ((globaldata->getTreeFile() == "") || (globaldata->getGroupFile() == "")) {
+                                       cout << "You must read a treefile and a groupfile or set the randomtree parameter to 1, before you may execute the parsimony command." << endl; return false;  }
+                       }
+               }
+               
                //check for valid method
                if (commandName == "cluster") {
                        if ((method == "furthest") || (method == "nearest") || (method == "average")) { }
index d1e2f82451cc3f5d5e4be6d7496894d6b884e9cc..9387bc5954124d00612b5874bb7f084a90ca329d 100644 (file)
@@ -36,8 +36,9 @@ class ErrorCheck {
                void validateParseFiles();
                void validateTreeFiles();
                void clear();
+               void refresh();
                string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile, treefile, cutoff, format; 
-               string precision, method, fileroot, label, line, iters, jumble, freq, single, rarefaction, shared, summary;
+               string precision, method, fileroot, label, line, iters, jumble, freq, single, rarefaction, shared, summary, randomtree;
                string commandName, optionText;
                bool errorFree;
                vector<string> singleEsimators, sharedEstimators, rareEstimators, summaryEstimators, sharedRareEstimators;
index f706b5308765cc01db2196c92192f22fb1f86302..bc836e854cb3c4f1b7cc184789b0d49d6e8e3f45 100644 (file)
@@ -114,6 +114,8 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                                if (key == "freq" )                     { freq = value;                 }
                                if (key == "method" )           { method = value;               }
                                if (key == "fileroot" )         { fileroot = value;             }
+                               if (key == "randomtree" )       { randomtree = value;   }
+                               if (key == "groups" )           { groups = value;       }
                                
                                if (key == "single") {//stores estimators in a vector
                                        singleEstimators.clear(); //clears out old values
@@ -145,20 +147,26 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                                        if (value == "default") { value = "sharedobserved"; }
                                        splitAtDash(value, sharedRareEstimators);
                                }
-                               if (key == "line") {//stores lines to be used in a vector
+                               if (key == "line") {//stores lines to be used in a set
                                        lines.clear();
                                        line = value;
                                        label = "";
                                        splitAtDash(value, lines);
                                        allLines = 0;
                                }
-                               if (key == "label") {//stores lines to be used in a vector
+                               if (key == "label") {//stores lines to be used in a set
                                        labels.clear();
                                        label = value;
                                        line = "";
                                        splitAtDash(value, labels);
                                        allLines = 0;
                                }
+                               if (key == "groups") {//stores lines to be used in a vector
+                                       Groups.clear();
+                                       groups = value;
+                                       splitAtDash(value, Groups);
+                               }
+
                        }
                        
                        //saves the last parameter
@@ -181,7 +189,8 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        if (key == "freq" )                     { freq = value;                 }
                        if (key == "method" )           { method = value;               }
                        if (key == "fileroot" )         { fileroot = value;             }
-
+                       if (key == "randomtree" )       { randomtree = value;   }
+                       
                        if (key == "single") {//stores estimators in a vector
                                singleEstimators.clear(); //clears out old values
                                if (value == "default") { value = "sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson-rarefraction"; }
@@ -293,14 +302,16 @@ string GlobalData::getFileRoot()          {       return fileroot;        }
 string GlobalData::getIters()                  {       return iters;           }
 string GlobalData::getJumble()                 {       return jumble;          }
 string GlobalData::getFreq()                   {       return freq;            }
+string GlobalData::getRandomTree()             {       return randomtree;      }
 void GlobalData::setListFile(string file)      {       listfile = file;        inputFileName = file;}
 void GlobalData::setRabundFile(string file)    {       rabundfile = file;      inputFileName = file;}
 void GlobalData::setSabundFile(string file)    {       sabundfile = file;      inputFileName = file;}
 void GlobalData::setPhylipFile(string file)    {       phylipfile = file;    inputFileName = file;}
 void GlobalData::setColumnFile(string file)    {       columnfile = file;    inputFileName = file;}
-//void GlobalData::setGroupFile(string file)   {       groupfile = file;       }
-void GlobalData::setNameFile(string file)      {       namefile = file;        }
-void GlobalData::setFormat(string Format)      {       format = Format;        }
+//void GlobalData::setGroupFile(string file)   {       groupfile = file;               }
+void GlobalData::setNameFile(string file)              {       namefile = file;                }
+void GlobalData::setFormat(string Format)              {       format = Format;                }
+void GlobalData::setRandomTree(string Random)  {       randomtree = Random;    }
 
 
 /*******************************************************/
@@ -334,7 +345,8 @@ void GlobalData::clear() {
        iters                   =       "1000"; 
        line                    =   "";
        label                   =       "";
-       jumble                  =       "1";
+       jumble                  =       "1";    //0 means don't jumble, 1 means jumble.
+       randomtree              =       "0";  //0 means user will enter some user trees, 1 means they just want the random tree distribution.
        freq                    =       "100";
        method                  =       "furthest";
        fileroot                =       "";
index f513d526c478e9b2160c51e42f9ce9bac6f58fdb..80891677d6e27d9f9e1e9671df4b128a962da116 100644 (file)
@@ -27,7 +27,7 @@ public:
        InputData* ginput;
        OrderVector* gorder;
        ListVector* glist;
-       Tree* gTree;
+       vector<Tree*> gTree;
        SharedListVector* gSharedList;
        SAbundVector* sabund;
        GroupMap* gGroupmap;
@@ -37,6 +37,7 @@ public:
        vector<string> singleEstimators, summaryEstimators, sharedEstimators, rareEstimators, sharedRareEstimators, sharedSummaryEstimators; //holds estimators to be used
        set<int> lines; //hold lines to be used
        set<string> labels; //holds labels to be used
+       vector<string> Groups;
        
        string getPhylipFile();
        string getColumnFile();
@@ -56,6 +57,7 @@ public:
        string getIters();
        string getJumble();
        string getFreq();
+       string getRandomTree();
        void setListFile(string);
        void setPhylipFile(string);
        void setColumnFile(string);
@@ -63,6 +65,7 @@ public:
        void setRabundFile(string);
        void setSabundFile(string);
        void setFormat(string);
+       void setRandomTree(string);
 
        
        void setListVector(ListVector*);
@@ -77,7 +80,7 @@ public:
        void splitAtDash(string&, set<string>&);
        
 private:
-       string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile, treefile, line, label;
+       string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile, treefile, line, label, randomtree, groups;
        string cutoff, format, precision, method, fileroot, iters, jumble, freq, single, rarefaction, shared, summary, sharedsummary, sharedrarefaction;
        static GlobalData* _uniqueInstance;
        GlobalData( const GlobalData& ); // Disable copy constructor
index e5513ab99610f79762f0809c886cf326ad2cda5e..4ed9c2711d2f11b0182ec165884d3747eeb0be80 100644 (file)
@@ -3,7 +3,7 @@
  *  Dotur
  *
  *  Created by Sarah Westcott on 11/18/08.
- *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
 
index 4ff26110d20ee42914d9bfb20a0b523a945f4216..80c83728adccbcc691d1a082d95e4c07521a263f 100644 (file)
@@ -3,7 +3,7 @@
  *  Dotur
  *
  *  Created by John Westcott on 1/7/09.
- *  Copyright 2009 __MyCompanyName__. All rights reserved.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
 
diff --git a/parsimony.cpp b/parsimony.cpp
new file mode 100644 (file)
index 0000000..6c18470
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ *  parsimony.cpp
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 1/26/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "parsimony.h"
+
+/**************************************************************************************************/
+EstOutput Parsimony::getValues(Tree* t) {
+       try {
+               data.resize(1,0);
+                       
+               int score = 0;
+                       
+               for(int i=t->getNumLeaves();i<t->getNumNodes();i++){
+                       int lc = t->tree[i].getLChild();
+                       int rc = t->tree[i].getRChild();
+                       
+                        if(t->tree[i].pGroups.size() > t->tree[rc].pGroups.size() || t->tree[i].pGroups.size() > t->tree[lc].pGroups.size()){
+                               score++;
+                       }
+               } 
+               
+               data[0] = score;
+               
+               return data;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Parsimony class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Parsimony class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+
+}
+/**************************************************************************************************/
diff --git a/parsimony.h b/parsimony.h
new file mode 100644 (file)
index 0000000..b5d7e20
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef PARSIMONY_H
+#define PARSIMONY_H
+
+
+/*
+ *  parsimony.h
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 1/26/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "treecalculator.h"
+#include "treemap.h"
+
+/***********************************************************************/
+
+class Parsimony : public TreeCalculator  {
+       
+       public:
+               Parsimony(TreeMap* t) : tmap(t) {};
+               ~Parsimony() {};
+               EstOutput getValues(Tree*);
+               
+       private:
+               EstOutput data;
+               TreeMap* tmap;
+};
+
+/***********************************************************************/
+#endif
\ No newline at end of file
diff --git a/parsimonycommand.cpp b/parsimonycommand.cpp
new file mode 100644 (file)
index 0000000..4632019
--- /dev/null
@@ -0,0 +1,284 @@
+/*
+ *  parsimonycommand.cpp
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 1/26/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "parsimonycommand.h"
+
+/***********************************************************/
+ParsimonyCommand::ParsimonyCommand() {
+       try {
+               globaldata = GlobalData::getInstance();
+               
+               //randomtree will tell us if user had their own treefile or if they just want the random distribution
+               convert(globaldata->getRandomTree(), randomtree);
+               
+               //user has entered their own tree
+               if (randomtree == 0) { 
+                       T = globaldata->gTree;
+                       tmap = globaldata->gTreemap;
+                       parsFile = globaldata->getTreeFile() + ".parsimony";
+                       openOutputFile(parsFile, out);
+                       sumFile = globaldata->getTreeFile() + ".psummary";
+                       openOutputFile(sumFile, outSum);
+                       distFile = globaldata->getTreeFile() + ".pdistrib";
+                       openOutputFile(distFile, outDist);
+
+               }else { //user wants random distribution
+                       getUserInput();
+                       parsFile = "rd_parsimony";
+                       openOutputFile(parsFile, out);
+               }
+               
+               convert(globaldata->getIters(), iters);  //how many random trees to generate
+               pars = new Parsimony(tmap);
+
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the ParsimonyCommand class Function ParsimonyCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the ParsimonyCommand class function ParsimonyCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+/***********************************************************/
+int ParsimonyCommand::execute() {
+       try {
+               
+               //get pscore for users tree
+               userData.resize(1,0);  //data[0] = pscore.
+               randomData.resize(1,0);  //data[0] = pscore.
+               
+               //format output
+               outDist.setf(ios::fixed, ios::floatfield); outDist.setf(ios::showpoint);
+               outDist << "RandomTree#" << '\t' << "ParsScore" << endl;
+               
+               if (randomtree == 0) {
+                       //get pscores for users trees
+                       for (int i = 0; i < T.size(); i++) {
+                               cout << "Processing tree " << i+1 << endl;
+                               userData = pars->getValues(T[i]);  //userData[0] = pscore
+                               //update uscoreFreq
+                               it = uscoreFreq.find(userData[0]);
+                               if (it == uscoreFreq.end()) {//new score
+                                       uscoreFreq[userData[0]] = 1;
+                               }else{ uscoreFreq[userData[0]]++; }
+                       
+                               //add users score to valid scores
+                               validScores[userData[0]] = userData[0];
+                               
+                               //save score for summary file
+                               userTreeScores.push_back(userData[0]);
+                       
+                       }
+                       
+                       //get pscores for random trees
+                       for (int j = 0; j < iters; j++) {
+                               //create new tree with same num nodes and leaves as users
+                               randT = new Tree();
+                               //create random relationships between nodes
+                               randT->assembleRandomTree();
+                               //get pscore of random tree
+                               randomData = pars->getValues(randT);
+                       
+                               //add trees pscore to map of scores
+                               it2 = rscoreFreq.find(randomData[0]);
+                               if (it2 != rscoreFreq.end()) {//already have that score
+                                       rscoreFreq[randomData[0]]++;
+                               }else{//first time we have seen this score
+                                       rscoreFreq[randomData[0]] = 1;
+                               }
+                       
+                               //add randoms score to validscores
+                               validScores[randomData[0]] = randomData[0];
+                               
+                               //output info to pdistrib file
+                               outDist << j+1 << '\t'<< '\t' << randomData[0] << endl;
+                                       
+                               delete randT;
+                       }
+               }else {
+                       //get pscores for random trees
+                       for (int j = 0; j < iters; j++) {
+                               //create new tree with same num nodes and leaves as users
+                               randT = new Tree();
+                               //create random relationships between nodes
+                               randT->assembleRandomTree();
+                               //get pscore of random tree
+                               randomData = pars->getValues(randT);
+                       
+                               //add trees pscore to map of scores
+                               it2 = rscoreFreq.find(randomData[0]);
+                               if (it2 != rscoreFreq.end()) {//already have that score
+                                       rscoreFreq[randomData[0]]++;
+                               }else{//first time we have seen this score
+                                       rscoreFreq[randomData[0]] = 1;
+                               }
+                       
+                               //add randoms score to validscores
+                               validScores[randomData[0]] = randomData[0];
+                                       
+                               delete randT;
+                       }
+               }
+               
+               float rcumul = 0.0000;
+               float ucumul = 0.0000;
+               
+               //this loop fills the cumulative maps and put 0.0000 in the score freq map to make it easier to print.
+               for (it = validScores.begin(); it != validScores.end(); it++) { 
+                       if (randomtree == 0) {
+                               it2 = uscoreFreq.find(it->first);
+                               //user data has that score 
+                               if (it2 != uscoreFreq.end()) { uscoreFreq[it->first] /= T.size(); ucumul+= it2->second;  }
+                               else { uscoreFreq[it->first] = 0.0000; } //no user trees with that score
+                               //make uCumul map
+                               uCumul[it->first] = ucumul;
+                       }
+                       
+                       //make rscoreFreq map and rCumul
+                       it2 = rscoreFreq.find(it->first);
+                       //get percentage of random trees with that info
+                       if (it2 != rscoreFreq.end()) {  rscoreFreq[it->first] /= iters; rcumul+= it2->second;  }
+                       else { rscoreFreq[it->first] = 0.0000; } //no random trees with that score
+                       rCumul[it->first] = rcumul;
+               }
+               
+               //find the signifigance of each user trees score when compared to the random trees and save for printing the summary file
+               for (int h = 0; h < userTreeScores.size(); h++) {
+                       UScoreSig.push_back(rCumul[userTreeScores[h]]);
+               }
+
+               printParsimonyFile();
+               printUSummaryFile();
+               
+               //reset randomTree parameter to 0
+               globaldata->setRandomTree("0");
+               
+               return 0;
+               
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the ParsimonyCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the ParsimonyCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+
+/***********************************************************/
+void ParsimonyCommand::printParsimonyFile() {
+       try {
+               //column headers
+               if (randomtree == 0) {
+                       out << "Score" << '\t' << "UserFreq" << '\t' << "UserCumul" << '\t' << "RandFreq" << '\t' << "RandCumul" << endl;
+               }else {
+                       out << "Score" << '\t' << "RandFreq" << '\t' << "RandCumul" << endl;
+               }
+               
+               //format output
+               out.setf(ios::fixed, ios::floatfield); out.setf(ios::showpoint);
+               
+               //print each line
+               for (it = validScores.begin(); it != validScores.end(); it++) { 
+                       if (randomtree == 0) {
+                               out << setprecision(6) << it->first << '\t' << '\t' << uscoreFreq[it->first] << '\t' << uCumul[it->first] << '\t' << rscoreFreq[it->first] << '\t' << rCumul[it->first] << endl; 
+                       }else{
+                               out << setprecision(6) << it->first << '\t' << '\t' << rscoreFreq[it->first] << '\t' << rCumul[it->first] << endl;      
+                       }
+               } 
+               
+               out.close();
+               
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the ParsimonyCommand class Function printParsimonyFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the ParsimonyCommand class function printParsimonyFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+/***********************************************************/
+void ParsimonyCommand::printUSummaryFile() {
+       try {
+               //column headers
+               outSum << "Tree#" << '\t'  <<  "ParsScore" << '\t' << '\t' << "ParsSig" <<  endl;
+               
+               //format output
+               outSum.setf(ios::fixed, ios::floatfield); outSum.setf(ios::showpoint);
+               
+               //print each line
+               for (int i = 0; i< T.size(); i++) {
+                       outSum << setprecision(6) << i+1 << '\t' << '\t' << userTreeScores[i] << '\t' << UScoreSig[i] << endl; 
+               }
+               
+               outSum.close();
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the ParsimonyCommand class Function printUSummaryFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the ParsimonyCommand class function printUSummaryFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+
+/***********************************************************/
+void ParsimonyCommand::getUserInput() {
+       try {
+       
+               //create treemap
+               tmap = new TreeMap();
+
+               cout << "Please enter the number of groups you would like to analyze: ";
+               cin >> numGroups;
+                       
+               int num, count;
+               count = 1;
+               numEachGroup.resize(numGroups, 0);  
+               
+               for (int i = 1; i <= numGroups; i++) {
+                       cout << "Please enter the number of sequences in group " << i <<  ": ";
+                       cin >> num;
+                               
+                       //set tmaps seqsPerGroup
+                       tmap->seqsPerGroup[toString(i)] = num;
+                       
+                       //set tmaps namesOfSeqs
+                       for (int j = 0; j < num; j++) {
+                               tmap->namesOfSeqs.push_back(toString(count));
+                               tmap->treemap[toString(count)].groupname = toString(i);
+                               count++;
+                       }
+               }
+               
+               //clears buffer so next command doesn't have error
+               string s;       
+               getline(cin, s);
+               
+               //save tmap for later
+               globaldata->gTreemap = tmap;
+               
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the ParsimonyCommand class Function getUserInput. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the ParsimonyCommand class function getUserInput. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+/***********************************************************/
+
diff --git a/parsimonycommand.h b/parsimonycommand.h
new file mode 100644 (file)
index 0000000..5429e77
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef PARSIMONYCOMMAND_H
+#define PARSIMONYCOMMAND_H
+/*
+ *  parsimonycommand.h
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 1/26/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include <iostream>
+#include <fstream>
+#include <vector>
+#include <map>
+#include <cmath>
+#include "command.hpp"
+#include "parsimony.h"
+#include "treemap.h"
+
+using namespace std;
+
+class GlobalData;
+
+class ParsimonyCommand : public Command {
+       
+       public:
+               ParsimonyCommand();     
+               ~ParsimonyCommand() { delete pars; }
+               int execute();  
+       
+       private:
+               GlobalData* globaldata;
+               vector<Tree*> T;           //user trees
+               Tree* randT;  //random tree
+               TreeMap* tmap;
+               Parsimony* pars;
+               string parsFile, sumFile, distFile;
+               int iters, randomtree, numGroups;
+               vector<int> numEachGroup; //vector containing the number of sequences in each group the users wants for random distrib.
+               vector<float> userTreeScores; //scores for users trees
+               vector<float> UScoreSig;  //tree score signifigance when compared to random trees - percentage of random trees with that score or lower.
+               EstOutput userData;                     //pscore info for user tree
+               EstOutput randomData;           //pscore info for random trees
+               map<int, float> validScores;  //contains scores from both user and random
+               map<int, float> rscoreFreq;  //pscore, number of random trees with that score.
+               map<int, float> uscoreFreq;  //pscore, number of user trees with that score.
+               map<int, float> rCumul;  //pscore, cumulative percentage of number of random trees with that score or lower.
+               map<int, float> uCumul;  //pscore, cumulative percentage of number of user trees with that score or lower .
+               map<int, float>::iterator it;
+               map<int, float>::iterator it2;
+               
+               ofstream out, outSum, outDist;
+               
+               void printParsimonyFile();  
+               void printUSummaryFile();
+               void getUserInput();
+               
+};
+
+
+#endif
index e2c75e9d0d78e11de49ad96e72d0455dc4f90a5c..0b8030795f09e0ab774f4016101c646f516b49e4 100644 (file)
@@ -3,7 +3,7 @@
  *  Dotur
  *
  *  Created by Sarah Westcott on 11/18/08.
- *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
 
index 47da6d6c81886e84961c5170267d5908199dd135..77277e71a889171e8b248de4d7ad19c0a78babb3 100644 (file)
 #include "readtree.h"
 
 /***********************************************************************/
-//Parent Class
-// The following functions are used by all reading formats.
-/***********************************************************************/
-ReadTree::ReadTree() { 
+ReadTree::ReadTree() {
        try {
-               globaldata = GlobalData::getInstance(); 
-               T = new Tree(); 
-               numNodes = T->getNumNodes();
-               numLeaves = T->getNumLeaves();
+               globaldata = GlobalData::getInstance();
+               globaldata->gTree.clear();
        }
        catch(exception& e) {
                cout << "Standard Error: " << e.what() << " has occurred in the ReadTree class Function ReadTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
@@ -117,6 +112,115 @@ float ReadTree::readBranchLength(istream& f) {
 
 void ReadNewickTree::read() {
        try {
+               int c;
+               int comment = 0;
+               
+               //if you are not a nexus file 
+               if ((c = filehandle.peek()) != '#') {  
+                       while((c = filehandle.peek()) != EOF) { 
+                               //make new tree
+                               T = new Tree(); 
+                               numNodes = T->getNumNodes();
+                               numLeaves = T->getNumLeaves();
+                               
+                               readTreeString();  
+                               //save trees for later commands
+                               globaldata->gTree.push_back(T); 
+                       }
+               //if you are a nexus file
+               }else if ((c = filehandle.peek()) == '#') {
+                       nexusTranslation();  //reads file through the translation and updates treemap
+                       while((c = filehandle.peek()) != EOF) { 
+                               // get past comments
+                               while ((c = filehandle.peek()) != EOF) {        
+                                       if(holder == "[" || holder == "[!"){
+                                               comment = 1;
+                                       }
+                                       if(holder == "]"){
+                                               comment = 0;
+                                       }
+                                       if((holder == "tree" || holder == "end;") && comment != 1){ holder = ""; comment = 0; break;}
+                                       filehandle >> holder;
+                               }
+                       
+                               //pass over the "tree rep.6878900 = "
+                               while (((c = filehandle.get()) != '(') && ((c = filehandle.peek()) != EOF) ) {;}
+                                       
+                               if (c == EOF ) { break; }
+                               filehandle.putback(c);  //put back first ( of tree.
+                               
+                               //make new tree
+                               T = new Tree(); 
+                               numNodes = T->getNumNodes();
+                               numLeaves = T->getNumLeaves();
+                               
+                               //read tree info
+                               readTreeString();  
+                               //save trees for later commands
+                               globaldata->gTree.push_back(T); 
+                       }
+               }
+               
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the ReadNewickTree class Function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the ReadNewickTree class function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }               
+}
+/**************************************************************************************************/
+//This function read the file through the translation of the sequences names and updates treemap.
+void ReadNewickTree::nexusTranslation() {
+       try {
+               
+               holder = "";
+               int numSeqs = globaldata->gTreemap->getNumSeqs(); //must save this some when we clear old names we can still know how many sequences there were
+               int comment = 0;
+               
+               // get past comments
+               while(holder != "translate" && holder != "Translate"){  
+                       if(holder == "[" || holder == "[!"){
+                               comment = 1;
+                       }
+                       if(holder == "]"){
+                               comment = 0;
+                       }
+                       filehandle >> holder; 
+                       if(holder == "tree" && comment != 1){return;}
+               }
+               
+               //update treemap
+               globaldata->gTreemap->namesOfSeqs.clear();
+               for(int i=0;i<numSeqs;i++){
+                       string number, name;
+                       filehandle >> number;
+                       filehandle >> name;
+                       name.erase(name.end()-1);  //erase the comma
+                       //insert new one with new name
+                       globaldata->gTreemap->treemap[toString(number)].groupname = globaldata->gTreemap->treemap[name].groupname;
+                       globaldata->gTreemap->treemap[toString(number)].vectorIndex = globaldata->gTreemap->treemap[name].vectorIndex;
+                       //erase old one.  so treemap[sarah].groupnumber is now treemap[1].groupnumber. if number is 1 and name is sarah.
+                       globaldata->gTreemap->treemap.erase(name);
+                       globaldata->gTreemap->namesOfSeqs.push_back(number);
+               }
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the ReadNewickTree class Function nexus. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the ReadNewickTree class function nexus. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }               
+}
+
+/**************************************************************************************************/
+void ReadNewickTree::readTreeString() {
+       try {
+               
                int n = 0;
                int lc, rc; 
                
@@ -143,7 +247,7 @@ void ReadNewickTree::read() {
                        }                                                                                               
                }
                //note: treeclimber had the code below added - not sure why?
-                else{
+               else{
                        filehandle.putback(ch);
                        char name[MAX_LINE];
                        filehandle.get(name, MAX_LINE,'\n');
@@ -166,18 +270,17 @@ void ReadNewickTree::read() {
                        if(lc!=-1){             T->tree[lc].setParent(n);               }
                        if(rc!=-1){             T->tree[rc].setParent(n);               }
                }
-               
-               //save tree for later commands
-               globaldata->gTree = T;
+       
        }
        catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the ReadNewickTree class Function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               cout << "Standard Error: " << e.what() << " has occurred in the ReadNewickTree class Function readTreeString. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }
        catch(...) {
-               cout << "An unknown error has occurred in the ReadNewickTree class function read. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               cout << "An unknown error has occurred in the ReadNewickTree class function readTreeString. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
                exit(1);
        }               
+
 }
 /**************************************************************************************************/
 
index 1abef8a179478b9db980ee6c21e6e6b9855a024b..02b6129b21b0bc960e1d16f9d028baab374bb465 100644 (file)
@@ -32,15 +32,11 @@ class ReadTree {
                int readSpecialChar(istream&, char, string);
                int readNodeChar(istream& f);
                float readBranchLength(istream& f);
-
-                               
-               Tree* getTree()  { return T; }
                
-               int numNodes, numLeaves;
+       protected:
                GlobalData* globaldata;
+               int numNodes, numLeaves;
                
-       protected:
-               Tree* T;
 };
 
 /****************************************************************************/
@@ -48,14 +44,18 @@ class ReadTree {
 class ReadNewickTree : public ReadTree {
        
 public:
-       ReadNewickTree(string file) : treeFile(file) { openInputFile(file, filehandle); }
+       ReadNewickTree(string file) : treeFile(file) { openInputFile(file, filehandle);  } 
        ~ReadNewickTree() {};
        void read();
        
 private:
+       Tree* T;
        int readNewickInt(istream&, int&, Tree*);
+       void readTreeString();
+       void nexusTranslation();
        ifstream filehandle;
        string treeFile;
+       string holder;
 };
 
 /****************************************************************************/
index 7cca943274aa929e6bfb5acf29f4c12988b8e965..a540c7444a4b2b67a03ca3be29120138faf43ef5 100644 (file)
@@ -46,8 +46,12 @@ int ReadTreeCommand::execute(){
        
                read->read(); 
                
-               Tree* T = globaldata->gTree;
-//             T->createNewickFile();
+               vector<Tree*> T = globaldata->gTree;
+               
+               //assemble users trees
+               for (int i = 0; i < T.size(); i++) {
+                       T[i]->assembleTree();
+               }
                
                return 0;
        }
index c581d939870abeb8f880824c6df263c60e021a72..8b6f8faa8695b8acb4a36730519ea6e751df8fb3 100644 (file)
@@ -3,7 +3,7 @@
  *  Dotur
  *
  *  Created by Sarah Westcott on 12/10/08.
- *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
 
index 03eb17127d5ebc174c8c3018452eb36290fb9346..94ab326d8f6ba32ededf4f5b2240dc5852e4816c 100644 (file)
--- a/tree.cpp
+++ b/tree.cpp
@@ -13,8 +13,8 @@
 /*****************************************************************/
 Tree::Tree() {
        try {
+       
                globaldata = GlobalData::getInstance();
-
                numLeaves = globaldata->gTreemap->getNumSeqs();
                numNodes = 2*numLeaves - 1;
                
@@ -22,15 +22,18 @@ Tree::Tree() {
 
                //initialize tree with correct number of nodes, name and group info.
                for (int i = 0; i < numNodes; i++) {
-
                        //initialize leaf nodes
                        if (i <= (numLeaves-1)) {
                                tree[i].setName(globaldata->gTreemap->namesOfSeqs[i]);
                                tree[i].setGroup(globaldata->gTreemap->getGroup(globaldata->gTreemap->namesOfSeqs[i]));
                                //the node knows its index
                                tree[i].setIndex(i);
+                               //set pcount and pGroup for groupname to 1.
+                               tree[i].pcount[globaldata->gTreemap->getGroup(globaldata->gTreemap->namesOfSeqs[i])] = 1;
+                               tree[i].pGroups[globaldata->gTreemap->getGroup(globaldata->gTreemap->namesOfSeqs[i])] = 1;
                                //Treemap knows name, group and index to speed up search
                                globaldata->gTreemap->setIndex(globaldata->gTreemap->namesOfSeqs[i], i);
+       
                        //intialize non leaf nodes
                        }else if (i > (numLeaves-1)) {
                                tree[i].setName("");
@@ -85,7 +88,262 @@ void Tree::setIndex(string searchName, int index) {
                exit(1);
        }               
 }
+/*****************************************************************/
+void Tree::assembleTree() {
+       try {
+               //build the pGroups in non leaf nodes to be used in the parsimony calcs.
+               for (int i = numLeaves; i < numNodes; i++) {
+                       tree[i].pGroups = (mergeGroups(i));
+                       tree[i].pcount = (mergeGcounts(i));
+               }
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Tree class Function assembleTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Tree class function assembleTree. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }               
+}
+/*****************************************************************/
+void Tree::getCopy(Tree* copy) {
+       try {
+       
+               //for each node in the tree copy its info
+               for (int i = 0; i < numNodes; i++) {
+                       //copy name
+                       tree[i].setName(copy->tree[i].getName());
+               
+                       //copy group
+                       tree[i].setGroup(copy->tree[i].getGroup());
+                       
+                       //copy branch length
+                       tree[i].setBranchLength(copy->tree[i].getBranchLength());
+               
+                       //copy parent
+                       tree[i].setParent(copy->tree[i].getParent());
+               
+                       //copy children
+                       tree[i].setChildren(copy->tree[i].getLChild(), copy->tree[i].getRChild());
+               
+                       //copy index in node and tmap
+                       tree[i].setIndex(copy->tree[i].getIndex());
+                       setIndex(copy->tree[i].getName(), getIndex(copy->tree[i].getName()));
+                       
+                       //copy pGroups
+                       tree[i].pGroups = copy->tree[i].pGroups;
+               
+                       //copy pcount
+                       tree[i].pcount = copy->tree[i].pcount;
+               }
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Tree class Function getCopy. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Tree class function getCopy. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }               
+}
+/*****************************************************************/
+//returns a map with a groupname and the number of times that group was seen in the children
+//for instance if your children are white and black then it would return a map with 2 entries
+// p[white] = 1 and p[black] = 1.  Now go up a level and merge that with a node who has p[white] = 1
+//and you get p[white] = 2, p[black] = 1, but you erase the p[black] because you have a p value higher than 1.
+
+map<string, int> Tree::mergeGroups(int i) {
+       try {
+       
+               int lc = tree[i].getLChild();
+               int rc = tree[i].getRChild();
+               
+               //set parsimony groups to left child
+               map<string,int> parsimony = tree[lc].pGroups;
+               
+               int maxPars = 1;
+
+               //look at right child groups and update maxPars if right child has something higher for that group.
+               for(it=tree[rc].pGroups.begin();it!=tree[rc].pGroups.end();it++){
+                       parsimony[it->first]++;
+                       
+                       if(parsimony[it->first] > maxPars){
+                               maxPars = parsimony[it->first];
+                       }
+               }
+       
+               // this is true if right child had a greater parsimony for a certain group
+               if(maxPars > 1){
+                       //erase all the groups that are only 1 because you found something with 2.
+                       for(it=parsimony.begin();it!=parsimony.end();it++){
+                               if(it->second == 1){
+                                       parsimony.erase(it->first);
+                                       it--;
+                               }
+                       }
+                       //set one remaining groups to 1
+                       //so with our above example p[white] = 2 would be left and it would become p[white] = 1
+                       for(it=parsimony.begin();it!=parsimony.end();it++){
+                               parsimony[it->first] = 1;
+                       }
+               
+               }
+       
+               return parsimony;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Tree class Function mergeGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Tree class function mergeGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }               
+}
+
+/**************************************************************************************************/
 
+map<string,int> Tree::mergeGcounts(int position) {
+       try{
+               map<string,int>::iterator pos;
+       
+               int lc = tree[position].getLChild();
+               int rc = tree[position].getRChild();
+       
+               map<string,int> sum = tree[lc].pcount;
+    
+               for(it=tree[rc].pcount.begin();it!=tree[rc].pcount.end();it++){
+                       sum[it->first] += it->second;
+               }
+               return sum;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Tree class Function mergeGcounts. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Tree class function mergeGcounts. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }               
+}
+/**************************************************************************************************/
+
+void Tree::randomLabels() {
+       try {
+               for(int i=numLeaves-1;i>=0;i--){
+                       if(tree[i].pGroups.size() == 0){
+                               continue;
+                       }
+               
+                       int escape = 1;
+                       int z;
+               
+                       while(escape == 1){
+                               z = int((float)(i+1) * (float)(rand()) / ((float)RAND_MAX+1.0));        
+                       
+                               if(tree[z].pGroups.size() != 0){
+                                       escape = 0;
+                               }
+                       }
+               
+               
+                       map<string,int> lib_hold = tree[z].pGroups;
+                       tree[z].pGroups = (tree[i].pGroups);
+                       tree[i].pGroups = (lib_hold);
+               
+                       tree[z].setGroup(tree[z].pGroups.begin()->first);
+                       tree[i].setGroup(tree[i].pGroups.begin()->first);
+               
+                       map<string,int> gcount_hold = tree[z].pcount;
+                       tree[z].pcount = (tree[i].pcount);
+                       tree[i].pcount = (gcount_hold);
+               }
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Tree class Function randomLabels. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Tree class function randomLabels. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }               
+}
+/**************************************************************************************************/
+
+void Tree::randomBlengths()  {
+       try {
+               for(int i=numNodes-1;i>=0;i--){
+                       int z = int((float)(i+1) * (float)(rand()) / ((float)RAND_MAX+1.0));    
+               
+                       float bl_hold = tree[z].getBranchLength();
+                       tree[z].setBranchLength(tree[i].getBranchLength());
+                       tree[i].setBranchLength(bl_hold);
+               }
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Tree class Function randomBlengths. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Tree class function randomBlengths. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }               
+}
+/*************************************************************************************************/
+void Tree::assembleRandomUnifracTree() {
+       randomLabels();
+       assembleTree();
+}
+
+/*************************************************************************************************/
+//for now it's just random topology but may become random labels as well later that why this is such a simple function now...
+void Tree::assembleRandomTree() {
+       randomTopology();
+       assembleTree();
+}
+/**************************************************************************************************/
+
+void Tree::randomTopology() {
+       try {
+               for(int i=0;i<numNodes;i++){
+                       tree[i].setParent(-1);
+               }
+               for(int i=numLeaves;i<numNodes;i++){
+                       tree[i].setChildren(-1, -1); 
+               }
+    
+               for(int i=numLeaves;i<numNodes;i++){
+                       int escape =0;
+                       int rnd_index1, rnd_index2;
+                       while(escape == 0){
+                               rnd_index1 = (int)(((double)rand() / (double) RAND_MAX)*i);
+                               if(tree[rnd_index1].getParent() == -1){escape = 1;}
+                       }
+               
+                       escape = 0;
+                       while(escape == 0){
+                               rnd_index2 = (int)(((double)rand() / (double) RAND_MAX)*i);
+                               if(rnd_index2 != rnd_index1 && tree[rnd_index2].getParent() == -1){
+                                       escape = 1;
+                               }               
+                       }
+               
+                       tree[i].setChildren(rnd_index1,rnd_index2);
+                       tree[i].setParent(-1);
+                       tree[rnd_index1].setParent(i);
+                       tree[rnd_index2].setParent(i);
+               }
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Tree class Function randomTopology. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Tree class function randomTopology. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }               
+}
 
 /*****************************************************************/
 // This prints out the tree in Newick form.
diff --git a/tree.h b/tree.h
index 872283dc95cccd5ba8cc3ea7faef058048bc4418..2ef8b23e94d0ad3921456c75518294c464a7ec0a 100644 (file)
--- a/tree.h
+++ b/tree.h
@@ -15,33 +15,50 @@ using namespace std;
 #include <string>
 #include <iostream>
 #include <vector>
+#include <fstream>
+#include <iomanip>
+#include <sstream>
+#include <map>
+
 #include "treenode.h"
 #include "globaldata.hpp"
 
 /* This class represents the treefile. */
 
-
-
 class Tree {
        public: 
-               Tree();  
+               Tree();         //to generate a tree from a file
                ~Tree() {};
                
-               Tree generateRandomTree();
+               
+               void getCopy(Tree*);  //makes tree a copy of the one passed in.
+               void assembleRandomTree();
+               void assembleRandomUnifracTree();
                void createNewickFile();
                int getIndex(string);
                void setIndex(string, int);
                int getNumNodes() { return numNodes; }
-               int getNumLeaves(){     return numLeaves;}
+               int getNumLeaves(){     return numLeaves; }
+               
+               //this function takes the leaf info and populates the non leaf nodes
+               void assembleTree();            
+               
                vector<Node> tree;              //the first n nodes are the leaves, where n is the number of sequences.
                
        private:
                GlobalData* globaldata;
-               int findRoot();  //return index of root node
-               void printBranch(int);  //recursively print out tree
                int numNodes, numLeaves;
                ofstream out;
                string filename;
+               
+               map<string, int>::iterator it;
+               map<string, int> mergeGroups(int);  //returns a map with a groupname and the number of times that group was seen in the children
+               map<string,int> Tree::mergeGcounts(int);
+               void randomTopology();
+               void randomBlengths();
+               void randomLabels();
+               int findRoot();  //return index of root node
+               void printBranch(int);  //recursively print out tree
 };
 
 #endif
diff --git a/treecalculator.h b/treecalculator.h
new file mode 100644 (file)
index 0000000..0bc41d9
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef TREECALCULATOR_H
+#define TREECALCULATOR_H
+
+/*
+ *  treecalculator.h
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 1/26/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+using namespace std;
+
+#include <vector>
+#include <cmath>
+#include <math.h>
+#include <string>
+#include <map>
+#include <algorithm>
+#include "utilities.hpp"
+#include "tree.h"
+
+/* The tree calculator class is the parent class for tree calculators in mothur. */ 
+
+typedef vector<double> EstOutput;
+
+/***********************************************************************/
+
+class TreeCalculator {
+
+public:
+       TreeCalculator(){};
+       TreeCalculator(string n) : name(n) {};
+       ~TreeCalculator(){};
+       virtual EstOutput getValues(Tree*) = 0; 
+       
+       virtual string getName()                {       return name;    }
+               
+protected:
+       EstOutput data;
+       string name;
+
+};
+
+/***********************************************************************/
+
+#endif
\ No newline at end of file
index 6fb853682e7c468c2ef5227eb48b9688317a61bb..bee0d11ed21323ee9dff1bc38c860a3042231150 100644 (file)
@@ -31,7 +31,14 @@ void TreeMap::readMap() {
                        setNamesOfGroups(seqGroup);
                                                
                        treemap[seqName].groupname = seqGroup;  //store data in map
-               
+                       
+                       it2 = seqsPerGroup.find(seqGroup);
+                       if (it2 == seqsPerGroup.end()) { //if it's a new group
+                               seqsPerGroup[seqGroup] = 1;
+                       }else {//it's a group we already have
+                               seqsPerGroup[seqGroup]++;
+                       }
+
                        gobble(fileHandle);
                }
                fileHandle.close();
@@ -40,7 +47,7 @@ void TreeMap::readMap() {
 
 int TreeMap::getNumGroups() {
                        
-       return namesOfGroups.size();    
+       return seqsPerGroup.size();     
                
 }
 /************************************************************/
index d9617f5455e03f0f5fc702fffaf3516335351b15..60f75b388571aff503ac95b96df5946e6fcfa89f 100644 (file)
--- a/treemap.h
+++ b/treemap.h
@@ -26,6 +26,7 @@ struct GroupIndex {
 
 class TreeMap {
 public:
+       TreeMap() {};
        TreeMap(string);
        ~TreeMap();
        void readMap();
@@ -36,6 +37,8 @@ public:
        string getGroup(string);
        vector<string> namesOfGroups;
        vector<string> namesOfSeqs;
+    map<string,int> seqsPerGroup;      //groupname, number of seqs in that group.
+       map<string, GroupIndex> treemap; //sequence name and groupname
        void print(ostream&);
        
 private:
@@ -43,8 +46,9 @@ private:
        string groupFileName;
        int numGroups;
        map<string, GroupIndex>::iterator it;
+       map<string, int>::iterator it2;
        void setNamesOfGroups(string); 
-       map<string, GroupIndex> treemap; //sequence name and groupname
+       
 };
 
 #endif
index b31fefd43a2806f19dc691b51ee802fe996a5385..ae7d0e4ec6731a78967a46004aed02e61ceaf984 100644 (file)
@@ -23,8 +23,7 @@ Node::Node() {
 /****************************************************************/
 void Node::setName(string Name) {  name = Name; }
 /****************************************************************/
-//non leaf nodes will belong to multiple groups, leaf nodes will only belong to one.
-void Node::setGroup(string groups)  { group.push_back(groups); }
+void Node::setGroup(string groups)  { group =groups; }
 /****************************************************************/
 void Node::setBranchLength(float l) { branchLength = l; }
 /****************************************************************/
@@ -36,7 +35,7 @@ void Node::setChildren(int lc, int rc) { lchild = lc; rchild = rc; }  //leftchild
 /****************************************************************/
 string Node::getName() { return name; }
 /****************************************************************/
-vector<string> Node::getGroup() { return group; }
+string Node::getGroup() { return group; }
 /****************************************************************/
 float Node::getBranchLength() { return branchLength; }
 /****************************************************************/
index 8bd055931be0ead0d8dc8a2c08d9f8e9ba637aba..799595646268d40dbf64bb118774931ea4ae1098 100644 (file)
@@ -17,6 +17,7 @@ using namespace std;
 #include <fstream>
 #include <iomanip>
 #include <vector>
+#include <map>
 
 /* This class represents a node on a tree. */
 
@@ -27,25 +28,34 @@ class Node  {
                ~Node() {};
                
                void setName(string);
-               void setGroup(string);  //non leaf nodes will belong to multiple groups, leaf nodes will only belong to one.
+               void setGroup(string);  
                void setBranchLength(float);
                void setParent(int);
                void setChildren(int, int);             //leftchild, rightchild
                void setIndex(int);
                
                string getName();
-               vector<string> getGroup();    //leaf nodes will only have 1 group, but branch nodes may have multiple groups.
+               string getGroup();  
                float getBranchLength();
                int getParent();
                int getLChild();
                int getRChild();
                int getIndex();
-               
                void printNode(ostream&);   //prints out the name and the branch length
                
+               
+               //pGroup is the parsimony group info.  i.e. for a leaf node it would contain 1 enter pGroup["groupname"] = 1;
+               //but for a branch node it may contain several entries so if the nodes children are from different groups it
+               //would have at least two entries pgroup["groupnameOfLeftChild"] = 1, pgroup["groupnameOfRightChild"] = 1.
+               //pCount is the nodes descendant group infomation.  i.e. pCount["black"] = 20 would mean that 20 of the nodes 
+               //descendant are from group black.
+
+               map<string, int> pGroups; //leaf nodes will only have 1 group, but branch nodes may have multiple groups.
+               map<string, int> pcount;        
+                       
        private:
                string                  name;
-               vector<string>  group;
+               string                  group;
                float                   branchLength;
                int                             parent;
                int                             lchild;
diff --git a/unifracunweightedcommand.cpp b/unifracunweightedcommand.cpp
new file mode 100644 (file)
index 0000000..8adff2d
--- /dev/null
@@ -0,0 +1,232 @@
+/*
+ *  unifracunweightedcommand.cpp
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 2/9/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "unifracunweightedcommand.h"
+
+/***********************************************************/
+UnifracUnweightedCommand::UnifracUnweightedCommand() {
+       try {
+               globaldata = GlobalData::getInstance();
+               
+               T = globaldata->gTree;
+               tmap = globaldata->gTreemap;
+               unweightedFile = globaldata->getTreeFile() + ".unweighted";
+               openOutputFile(unweightedFile, out);
+               sumFile = globaldata->getTreeFile() + ".uwsummary";
+               openOutputFile(sumFile, outSum);
+               distFile = globaldata->getTreeFile() + ".uwdistrib";
+               openOutputFile(distFile, outDist);
+
+               convert(globaldata->getIters(), iters);  //how many random trees to generate
+               unweighted = new Unweighted(tmap);
+
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the UnifracUnweightedCommand class Function UnifracUnweightedCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the UnifracUnweightedCommand class function UnifracUnweightedCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+/***********************************************************/
+int UnifracUnweightedCommand::execute() {
+       try {
+               
+               //get unweighted for users tree
+               userData.resize(1,0);  //data[0] = unweightedscore 
+               randomData.resize(1,0); //data[0] = unweightedscore
+               
+               //format output
+               outDist.setf(ios::fixed, ios::floatfield); outDist.setf(ios::showpoint);
+               outDist << "Tree#" << '\t' << "Iter" << '\t' << "UWScore" << endl;
+               
+               //create new tree with same num nodes and leaves as users
+               randT = new Tree();
+                       
+               //get pscores for users trees
+               for (int i = 0; i < T.size(); i++) {
+                       cout << "Processing tree " << i+1 << endl;
+                       userData = unweighted->getValues(T[i]);  //userData[0] = unweightedscore
+                       
+                       //update uscoreFreq
+                       it = uscoreFreq.find(userData[0]);
+                       if (it == uscoreFreq.end()) {//new score
+                               uscoreFreq[userData[0]] = 1;
+                       }else{ uscoreFreq[userData[0]]++; }
+                       
+                       //add users score to valid scores
+                       validScores[userData[0]] = userData[0];
+                       
+                       //saves users score
+                       utreeScores.push_back(userData[0]);
+                       
+                       //copy T[i]'s info.
+                       randT->getCopy(T[i]); 
+                       
+                       //get unweighted scores for random trees
+                       for (int j = 0; j < iters; j++) {
+                               //create a random tree with same topology as T[i], but different labels
+                               randT->assembleRandomUnifracTree();
+                               //get pscore of random tree
+                               randomData = unweighted->getValues(randT);
+                       
+                               //add trees unweighted score to map of scores
+                               it2 = rscoreFreq.find(randomData[0]);
+                               if (it2 != rscoreFreq.end()) {//already have that score
+                                       rscoreFreq[randomData[0]]++;
+                               }else{//first time we have seen this score
+                                       rscoreFreq[randomData[0]] = 1;
+                               }
+                               
+                               //add randoms score to validscores
+                               validScores[randomData[0]] = randomData[0];
+                               
+                               //output info to uwdistrib file
+                               outDist << i+1 << '\t' << '\t'<< j+1 << '\t' << '\t' << randomData[0] << endl;
+                       }
+                       
+                       //find the signifigance of the score
+                       float rcumul = 0.0000;
+                       for (it = rscoreFreq.begin(); it != rscoreFreq.end(); it++) { 
+                               //get percentage of random trees with that info
+                               rscoreFreq[it->first] /= iters; 
+                               rcumul+= it->second;  
+                               rCumul[it->first] = rcumul;
+                       }
+                       
+                       //save the signifigance of the users score for printing later
+                       UWScoreSig.push_back(rCumul[userData[0]]);
+                       
+                       saveRandomScores(); //save all random scores for unweighted file
+               
+                       //clear random data
+                       rscoreFreq.clear();  //you clear this because in the summary file you want the unweighted signifinance to be relative to these 1000 trees.
+                       rCumul.clear();
+               }
+               
+               float ucumul = 0.0000;
+               float rcumul = 0.0000;
+               //this loop fills the cumulative maps and put 0.0000 in the score freq map to make it easier to print.
+               for (it = validScores.begin(); it != validScores.end(); it++) { 
+                       it2 = uscoreFreq.find(it->first);
+                       //user data has that score 
+                       if (it2 != uscoreFreq.end()) { uscoreFreq[it->first] /= T.size(); ucumul+= it2->second;  }
+                       else { uscoreFreq[it->first] = 0.0000; } //no user trees with that score
+                       //make uCumul map
+                       uCumul[it->first] = ucumul;
+                       
+                       //make rscoreFreq map and rCumul
+                       it2 = totalrscoreFreq.find(it->first);
+                       //get percentage of random trees with that info
+                       if (it2 != totalrscoreFreq.end()) {  totalrscoreFreq[it->first] /= (iters*T.size()); rcumul+= it2->second;  }
+                       else { totalrscoreFreq[it->first] = 0.0000; } //no random trees with that score
+                       rCumul[it->first] = rcumul;
+               }
+               
+               printUnweightedFile();
+               printUWSummaryFile();
+               
+               //reset randomTree parameter to 0
+               globaldata->setRandomTree("0");
+               
+               delete randT;
+               
+               return 0;
+               
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the UnifracUnweightedCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the UnifracUnweightedCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+/***********************************************************/
+void UnifracUnweightedCommand::printUnweightedFile() {
+       try {
+               //column headers
+               
+               out << "Score" << '\t' << "UserFreq" << '\t' << "UserCumul" << '\t' << "RandFreq" << '\t' << "RandCumul" << endl;
+                               
+               //format output
+               out.setf(ios::fixed, ios::floatfield); out.setf(ios::showpoint);
+               
+               //print each line
+               for (it = validScores.begin(); it != validScores.end(); it++) { 
+                       out << setprecision(6) << it->first << '\t' << '\t' << uscoreFreq[it->first] << '\t' << uCumul[it->first] << '\t' << totalrscoreFreq[it->first] << '\t' << rCumul[it->first] << endl; 
+               } 
+               
+               out.close();
+               
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the UnifracUnweightedCommand class Function printUnweightedFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the UnifracUnweightedCommand class function printUnweightedFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+
+/***********************************************************/
+void UnifracUnweightedCommand::printUWSummaryFile() {
+       try {
+               //column headers
+               outSum << "Tree#" << '\t'  <<  "UWScore" << '\t' << '\t' << "UWSig" <<  endl;
+               
+               //format output
+               outSum.setf(ios::fixed, ios::floatfield); outSum.setf(ios::showpoint);
+               
+               //print each line
+               for (int i = 0; i< T.size(); i++) {
+                       outSum << setprecision(6) << i+1 << '\t' << '\t' << utreeScores[i] << '\t' << UWScoreSig[i] << endl; 
+               }
+               
+               outSum.close();
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the UnifracUnweightedCommand class Function printUWSummaryFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the UnifracUnweightedCommand class function printUWSummaryFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+/***********************************************************/
+void UnifracUnweightedCommand::saveRandomScores() {
+       try {
+               //update total map with new random scores
+               for (it = rscoreFreq.begin(); it != rscoreFreq.end(); it++) { 
+                       //does this score already exist in the total map
+                       it2 = totalrscoreFreq.find(it->first);
+                       //if yes then add them
+                       if (it2 != totalrscoreFreq.end()) { 
+                               it2->second += it->second;
+                       }else{ //its a new score
+                               totalrscoreFreq[it->first] = 1;
+                       }
+               }
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the UnifracUnweightedCommand class Function saveRandomScores. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the UnifracUnweightedCommand class function saveRandomScores. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+
+/***********************************************************/
\ No newline at end of file
diff --git a/unifracunweightedcommand.h b/unifracunweightedcommand.h
new file mode 100644 (file)
index 0000000..cc01aab
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef UNIFRACUNWEIGHTEDCOMMAND_H
+#define UNIFRACUNWEIGHTEDCOMMAND_H
+
+/*
+ *  unifracunweightedcommand.h
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 2/9/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include <iostream>
+#include <fstream>
+#include <vector>
+#include <map>
+#include <cmath>
+#include "command.hpp"
+#include "unweighted.h"
+#include "treemap.h"
+
+using namespace std;
+
+class GlobalData;
+
+class UnifracUnweightedCommand : public Command {
+       
+       public:
+               UnifracUnweightedCommand();     
+               ~UnifracUnweightedCommand() { delete unweighted; }
+               int execute();  
+       
+       private:
+               GlobalData* globaldata;
+               vector<Tree*> T;           //user trees
+               vector<float> utreeScores;  //user tree unweighted scores
+               vector<float> UWScoreSig;  //tree unweighted score signifigance when compared to random trees - percentage of random trees with that score or lower.
+               Tree* randT;  //random tree
+               TreeMap* tmap;
+               Unweighted* unweighted;
+               string sumFile, distFile, unweightedFile;
+               int iters;
+               EstOutput userData;                     //unweighted score info for user tree
+               EstOutput randomData;           //unweighted score info for random trees
+               map<float, float> validScores;  //contains scores from both user and random
+               map<float, float> rscoreFreq;  //unweighted score, number of random trees with that score.
+               map<float, float> uscoreFreq;  //unweighted, number of user trees with that score.
+               map<float, float> totalrscoreFreq;  //unweighted score, number of random trees with that score.
+               map<float, float> rCumul;               //unweighted score, cumulative percentage of number of random trees with that score or lower.
+               map<float, float> uCumul;  //unweighted, cumulative percentage of number of user trees with that score or lower .
+               map<float, float>::iterator it;
+               map<float, float>::iterator it2;
+               
+               ofstream outSum, outDist, out;
+               
+               void printUWSummaryFile();
+               void printUnweightedFile();
+               void saveRandomScores();    
+               
+};
+
+
+
+#endif
\ No newline at end of file
diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp
new file mode 100644 (file)
index 0000000..ff2c245
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ *  unifracweightedcommand.cpp
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 2/9/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "unifracweightedcommand.h"
+
+/***********************************************************/
+UnifracWeightedCommand::UnifracWeightedCommand() {
+       try {
+               globaldata = GlobalData::getInstance();
+               
+               T = globaldata->gTree;
+               tmap = globaldata->gTreemap;
+               weightedFile = globaldata->getTreeFile() + ".weighted";
+               openOutputFile(weightedFile, out);
+               sumFile = globaldata->getTreeFile() + ".wsummary";
+               openOutputFile(sumFile, outSum);
+               distFile = globaldata->getTreeFile() + ".wdistrib";
+               openOutputFile(distFile, outDist);
+
+               numGroups = tmap->getNumGroups();
+               
+               //calculate number of comparisons i.e. with groups A,B,C = AB, AC, BC = 3;
+               numComp = 0;
+               int n = 1;
+               for (int i=1; i<numGroups; i++) { 
+                       numComp += i; 
+                       for (int l = n; l < numGroups; l++) {
+                               //set group comparison labels
+                               groupComb.push_back(tmap->namesOfGroups[i-1]+tmap->namesOfGroups[l]);
+                       }
+                       n++;
+               }
+                       
+               convert(globaldata->getIters(), iters);  //how many random trees to generate
+               weighted = new Weighted(tmap);
+
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the UnifracWeightedCommand class Function UnifracWeightedCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the UnifracWeightedCommand class function UnifracWeightedCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+/***********************************************************/
+int UnifracWeightedCommand::execute() {
+       try {
+               
+               //get weighted for users tree
+               userData.resize(numComp,0);  //data[0] = weightedscore AB, data[1] = weightedscore AC...
+               randomData.resize(numComp,0); //data[0] = weightedscore AB, data[1] = weightedscore AC...
+               uscoreFreq.resize(numComp);  
+               validScores.resize(numComp);  
+               totalrscoreFreq.resize(numComp); 
+               uCumul.resize(numComp);         
+               
+               //format output
+               outDist.setf(ios::fixed, ios::floatfield); outDist.setf(ios::showpoint);
+               outDist << "Tree#" << '\t' << "Iter" << '\t' << "Groups"<< '\t' << "WScore" << endl;
+
+               
+               //create new tree with same num nodes and leaves as users
+               randT = new Tree();
+               
+               //get pscores for users trees
+               for (int i = 0; i < T.size(); i++) {
+                       rscoreFreq.resize(numComp);  //data[0] = weightedscore AB, data[1] = weightedscore AC...
+                       rCumul.resize(numComp); //data[0] = weightedscore AB, data[1] = weightedscore AC...     
+                               
+                       cout << "Processing tree " << i+1 << endl;
+                       userData = weighted->getValues(T[i]);  //userData[0] = weightedscore
+                       
+                       //save users score
+                       for (int s=0; s<numComp; s++) {
+                               //update uscoreFreq
+                               it = uscoreFreq[s].find(userData[s]);
+                               if (it == uscoreFreq[s].end()) {//new score
+                                       uscoreFreq[s][userData[s]] = 1;
+                               }else{ uscoreFreq[s][userData[s]]++; }
+                               
+                               //add user score to valid scores
+                               validScores[s][userData[s]] = userData[s];
+
+                               //save users tree score for summary file
+                               utreeScores.push_back(userData[s]);
+                       }
+                       
+                       //copy T[i]'s info.
+                       randT->getCopy(T[i]); 
+                       
+                       //get pscores for random trees
+                       for (int j = 0; j < iters; j++) {
+                               //create a random tree with same topology as T[i], but different labels
+                               randT->assembleRandomUnifracTree();
+                               //get pscore of random tree
+                               randomData = weighted->getValues(randT);
+                               
+                               //save ramdoms score
+                               for (int p=0; p<numComp; p++) {
+                                       //add trees weighted score random score freq
+                                       it2 = rscoreFreq[p].find(randomData[p]);
+                                       if (it2 != rscoreFreq[p].end()) {//already have that score
+                                               rscoreFreq[p][randomData[p]]++;
+                                       }else{//first time we have seen this score
+                                               rscoreFreq[p][randomData[p]] = 1;
+                                       }
+                                       
+                                       //add random score to valid scores
+                                       validScores[p][randomData[p]] = randomData[p];
+                                       
+                                       //output info to uwdistrib file
+                                       outDist << i+1 << '\t' << '\t'<< j+1 << '\t' << '\t' << groupComb[p] << '\t'<< randomData[p] << endl;
+                               }
+                       }
+                       
+                       saveRandomScores(); //save all random scores for weighted file
+                       
+                       //find the signifigance of the score for summary file
+                       for (int t = 0; t < numComp; t++) {
+                               float rcumul = 0.0000;
+                               for (it = validScores[t].begin(); it != validScores[t].end(); it++) { 
+                                       //make rscoreFreq map and rCumul
+                                       it2 = rscoreFreq[t].find(it->first);
+                                       //get percentage of random trees with that info
+                                       if (it2 != rscoreFreq[t].end()) {  rscoreFreq[t][it->first] /= iters; rcumul+= it2->second;  }
+                                       else { rscoreFreq[t][it->first] = 0.0000; } //no random trees with that score
+                                       rCumul[t][it->first] = rcumul;
+                               }
+                       }
+                       
+                       //save the signifigance of the users score for printing later
+                       for (int f = 0; f < numComp; f++) {
+                               WScoreSig.push_back(rCumul[f][userData[f]]);
+                       }
+                       
+                       
+                       //clear random data
+                       rscoreFreq.clear();
+                       rCumul.clear();
+               }
+               
+               rCumul.resize(numComp);
+               for (int b = 0; b < numComp; b++) {
+                       float ucumul = 0.0000;
+                       float rcumul = 0.0000;
+                       //this loop fills the cumulative maps and put 0.0000 in the score freq map to make it easier to print.
+                       for (it = validScores[b].begin(); it != validScores[b].end(); it++) { 
+                               it2 = uscoreFreq[b].find(it->first);
+                               //user data has that score 
+                               if (it2 != uscoreFreq[b].end()) { uscoreFreq[b][it->first] /= T.size(); ucumul+= it2->second;  }
+                               else { uscoreFreq[b][it->first] = 0.0000; } //no user trees with that score
+                               //make uCumul map
+                               uCumul[b][it->first] = ucumul;
+                       
+                               //make rscoreFreq map and rCumul
+                               it2 = totalrscoreFreq[b].find(it->first);
+                               //get percentage of random trees with that info
+                               if (it2 != totalrscoreFreq[b].end()) {  totalrscoreFreq[b][it->first] /= (iters * T.size()); rcumul+= it2->second;  }
+                               else { totalrscoreFreq[b][it->first] = 0.0000; } //no random trees with that score
+                               rCumul[b][it->first] = rcumul;
+                       }
+               }
+               
+               printWeightedFile();
+               printWSummaryFile();
+               
+               //reset randomTree parameter to 0
+               globaldata->setRandomTree("0");
+               
+               delete randT;
+               
+               return 0;
+               
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the UnifracWeightedCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the UnifracWeightedCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+/***********************************************************/
+void UnifracWeightedCommand::printWeightedFile() {
+       try {
+               //column headers
+               
+               out << "Group" << '\t' << "Score" << '\t' << "UserFreq" << '\t' << "UserCumul" << '\t' << "RandFreq" << '\t' << "RandCumul" << endl;
+                               
+               //format output
+               out.setf(ios::fixed, ios::floatfield); out.setf(ios::showpoint);
+               
+               //for each group
+               for (int e = 0; e < numComp; e++) {
+                       //print each line in that group
+                       for (it = validScores[e].begin(); it != validScores[e].end(); it++) { 
+                               out << setprecision(6) <<  groupComb[e] << '\t' << it->first << '\t' << '\t' << uscoreFreq[e][it->first] << '\t' << uCumul[e][it->first] << '\t' << totalrscoreFreq[e][it->first] << '\t' << rCumul[e][it->first] << endl; 
+                       } 
+               }
+               
+               out.close();
+               
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the UnifracWeightedCommand class Function printWeightedFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the UnifracWeightedCommand class function printWeightedFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+
+
+/***********************************************************/
+void UnifracWeightedCommand::printWSummaryFile() {
+       try {
+               //column headers
+               outSum << "Tree#" << '\t' << "Groups" << '\t' << '\t' << "WScore" << '\t' << '\t' << "WSig" <<  endl;
+               
+               //format output
+               outSum.setf(ios::fixed, ios::floatfield); outSum.setf(ios::showpoint);
+               
+               //print each line
+               int count = 0;
+               for (int i = 0; i < T.size(); i++) { 
+                       for (int j = 0; j < numComp; j++) {
+                               outSum << setprecision(6) << i+1 << '\t' << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << WScoreSig[count] << endl; 
+                               count++;
+                       }
+               }
+               outSum.close();
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the UnifracWeightedCommand class Function printWeightedFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the UnifracWeightedCommand class function printWeightedFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+
+/***********************************************************/
+void UnifracWeightedCommand::saveRandomScores() {
+       try {
+               for (int e = 0; e < numComp; e++) {
+                       //update total map with new random scores
+                       for (it = rscoreFreq[e].begin(); it != rscoreFreq[e].end(); it++) { 
+                               //does this score already exist in the total map
+                               it2 = totalrscoreFreq[e].find(it->first);
+                               //if yes then add them
+                               if (it2 != totalrscoreFreq[e].end()) { 
+                                       totalrscoreFreq[e][it->first] += rscoreFreq[e][it->first];
+                               }else{ //its a new score
+                                       totalrscoreFreq[e][it->first] = rscoreFreq[e][it->first];
+                               }
+                       }
+               }
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the UnifracWeightedCommand class Function saveRandomScores. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the UnifracWeightedCommand class function saveRandomScores. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+
+/***********************************************************/
diff --git a/unifracweightedcommand.h b/unifracweightedcommand.h
new file mode 100644 (file)
index 0000000..047c92b
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef UNIFRACWEIGHTEDCOMMAND_H
+#define UNIFRACWEIGHTEDCOMMAND_H
+
+/*
+ *  unifracweightedcommand.h
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 2/9/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include <iostream>
+#include <fstream>
+#include <vector>
+#include <map>
+#include <cmath>
+#include "command.hpp"
+#include "weighted.h"
+#include "treemap.h"
+
+using namespace std;
+
+class GlobalData;
+
+class UnifracWeightedCommand : public Command {
+       
+       public:
+               UnifracWeightedCommand();       
+               ~UnifracWeightedCommand() { delete weighted; }
+               int execute();  
+       
+       private:
+               GlobalData* globaldata;
+               vector<Tree*> T;           //user trees
+               vector<float> utreeScores;  //user tree unweighted scores
+               vector<float> WScoreSig;  //tree weighted score signifigance when compared to random trees - percentage of random trees with that score or lower.
+               vector<string> groupComb; // AB. AC, BC...
+               Tree* randT;  //random tree
+               TreeMap* tmap;
+               Weighted* weighted;
+               string weightedFile, sumFile, distFile;
+               int iters, numGroups, numComp;
+               EstOutput userData;                     //weighted score info for user tree
+               EstOutput randomData;           //weighted score info for random trees
+               vector< map<float, float> > validScores;  //vector<contains scores from both user and random> each group comb has an entry
+               vector< map<float, float> > rscoreFreq;  //vector<weighted score, number of random trees with that score.> each group comb has an entry
+               vector< map<float, float> > uscoreFreq;  //vector<weighted, number of user trees with that score.> each group comb has an entry
+               vector< map<float, float> > totalrscoreFreq;  //vector<weighted score, number of random trees with that score.> each group comb has an entry
+               vector< map<float, float> > rCumul;  //vector<weighted score, number of random trees with that score.> each group comb has an entry
+               vector< map<float, float> > uCumul;  //vector<weighted, cumulative percentage of number of user trees with that score or lower.> each group comb has an entry
+               map<float, float>::iterator it;
+               map<float, float>::iterator it2;
+               
+               ofstream outSum, outDist, out;
+               
+               void printWSummaryFile();
+               void printWeightedFile();  
+               void saveRandomScores(); 
+};
+
+
+
+#endif
diff --git a/unweighted.cpp b/unweighted.cpp
new file mode 100644 (file)
index 0000000..a7cf9c9
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ *  unweighted.cpp
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 2/9/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "unweighted.h"
+
+/**************************************************************************************************/
+
+EstOutput Unweighted::getValues(Tree* t) {
+       try {
+       
+               //clear out old values
+               data.resize(1,0); 
+               penalty.resize(t->getNumLeaves(), 0);
+               
+               map<string,double> unique;  //group, total of all branch lengths of nodes with that group.
+               double shared = 0.0000;
+               double UW=0.0000;
+               
+               //add up the branch lengths for each group. 
+               for(int i=0;i<t->getNumLeaves();i++){
+                       if(t->tree[i].pGroups.size() > 0){
+                               unique[t->tree[i].pGroups.begin()->first] += t->tree[i].getBranchLength();
+                       }
+               }
+               
+               //for each non-leaf node
+               for(int i=t->getNumLeaves();i<t->getNumNodes();i++){
+               
+                       int lc = t->tree[i].getLChild();  //lc = vector index of left child
+                       int rc = t->tree[i].getRChild();  //rc = vector index of right child
+                       
+                       //get penalty values
+                       if(t->tree[rc].pGroups.size() == 0 || t->tree[lc].pGroups.size() == 0){
+                               penalty.push_back(penalty[t->tree[rc].getIndex()]+penalty[t->tree[lc].getIndex()]);
+                       }
+                       else if(t->tree[i].pGroups.size() > t->tree[rc].pGroups.size() || t->tree[i].pGroups.size() > t->tree[lc].pGroups.size()){
+                               penalty.push_back(penalty[t->tree[rc].getIndex()]+penalty[t->tree[lc].getIndex()]+1);
+                       }
+                       else{
+                               penalty.push_back(penalty[t->tree[rc].getIndex()]+penalty[t->tree[lc].getIndex()]);
+                       }
+
+                       //not sure when this would ever be true??? if your parent is root could be, but pGroups.size() should never be 0.
+                       if(t->tree[i].getParent() == -1 && (t->tree[lc].pGroups.size() == 0 || t->tree[rc].pGroups.size() == 0)){
+                               shared -= 1; 
+                       }
+                       else if(penalty[i] != 0 && t->tree[i].pGroups.size() != 0){
+                               shared += t->tree[i].getBranchLength();
+                       }
+                       else if( t->tree[i].pGroups.size() != 0){
+                               unique[t->tree[i].pGroups.begin()->first] += t->tree[i].getBranchLength();          
+                       }
+               }
+    
+               map<string,double>::iterator pos;
+               for(pos=unique.begin();pos!=unique.end();pos++){
+                       if(pos->first!="xxx"){      
+                               UW += unique[pos->first];
+                       }
+               }
+       
+               UW /= (UW + shared);
+       
+               if (isnan(UW) || isinf(UW)) { UW = 0; }
+       
+               data[0] = UW;
+               
+               return data;
+       
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Unweighted class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Unweighted class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+
+}
+
+/**************************************************************************************************/
\ No newline at end of file
diff --git a/unweighted.h b/unweighted.h
new file mode 100644 (file)
index 0000000..d39b5e7
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef UNWEIGHTED_H
+#define UNWEIGHTED_H
+
+
+/*
+ *  unweighted.h
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 2/9/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "treecalculator.h"
+#include "treemap.h"
+
+/***********************************************************************/
+
+class Unweighted : public TreeCalculator  {
+       
+       public:
+               Unweighted(TreeMap* t) : tmap(t) {};
+               ~Unweighted() {};
+               EstOutput getValues(Tree*);
+               
+       private:
+               EstOutput data;
+               vector<int> penalty;
+               TreeMap* tmap;
+
+};
+
+/***********************************************************************/
+
+
+
+#endif
\ No newline at end of file
index 734e0ce697a5dff86261ef2451d2fbcdd323b0a0..8f06fefee54330386e9fed5109603e1a2335d1e9 100644 (file)
@@ -16,9 +16,10 @@ ValidCommands::ValidCommands() {
        
                commands["read.dist"]                   = "read.dist"; 
                commands["read.otu"]                    = "read.otu";
-       //      commands["read.tree"]                   = "read.tree"; 
+               commands["read.tree"]                   = "read.tree"; 
                commands["cluster"]                             = "cluster"; 
                commands["deconvolute"]                 = "deconvolute"; 
+               commands["parsimony"]                   = "parsimony";
                commands["help"]                                = "help"; 
                commands["quit"]                                = "quit"; 
                commands["collect.single"]              = "collect.single"; 
@@ -27,6 +28,9 @@ ValidCommands::ValidCommands() {
                commands["rarefaction.shared"]  = "rarefaction.shared"; 
                commands["summary.single"]              = "summary.single"; 
                commands["summary.shared"]              = "summary.shared"; 
+               commands["unifrac.weighted"]    = "unifrac.weighted"; 
+               commands["unifrac.unweighted"]  = "unifrac.unweighted"; 
+
                                
        }
        catch(exception& e) {
index 1f6e1ef550a9e8ed7b6677a1636e3e7980d2015c..7072825c69a9186af91f893834f62a0eb18e5acb 100644 (file)
@@ -40,7 +40,9 @@ ValidParameters::ValidParameters() {
                parameters["shared"]                    = "shared"; 
                parameters["summary"]                   = "summary"; 
                parameters["sharedsummary"]             = "sharedsummary";
-
+               parameters["randomtree"]                = "randomtree";
+               parameters["groups"]                    = "groups";
+               
        }
        catch(exception& e) {
                cout << "Standard Error: " << e.what() << " has occurred in the ValidParameters class Function ValidParameters. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
diff --git a/weighted.cpp b/weighted.cpp
new file mode 100644 (file)
index 0000000..481b34e
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ *  weighted.cpp
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 2/9/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "weighted.h"
+
+/**************************************************************************************************/
+
+EstOutput Weighted::getValues(Tree* t) {
+    try {
+       
+               int numGroups = tmap->getNumGroups();
+               
+               //calculate number of comparisons i.e. with groups A,B,C = AB, AC, BC = 3;
+               int n = 1;
+               for (int i=1; i<numGroups; i++) { 
+                       for (int l = n; l < numGroups; l++) {
+                               //initialize weighted scores
+                               WScore[tmap->namesOfGroups[i-1]+tmap->namesOfGroups[l]] = 0.0;
+                       }
+               }
+
+               data.clear(); //clear out old values
+       
+               double D = 0.0000;
+       
+               for(int i=0;i<t->getNumLeaves();i++){
+                       int index = i;
+                       double sum = 0.0000;
+               
+                       //while you aren't at root
+                       while(t->tree[index].getParent() != -1){
+               
+                               if(t->tree[index].pGroups.size() != 0){
+                                       sum += t->tree[index].getBranchLength();
+                               }
+                       
+                               //old_index = you
+                               int old_index = index; 
+                               //index = your parent   
+                               index = t->tree[index].getParent();
+                       
+                               //if you grandparent is the root 
+                               if(t->tree[index].getParent() == -1 && t->tree[old_index].pGroups.size() != 0){
+                                       int lc = t->tree[t->tree[index].getLChild()].pGroups.size();
+                                       int rc = t->tree[t->tree[index].getRChild()].pGroups.size();
+                               
+                               
+                                       if(lc == 0 || rc == 0){
+                                               sum -= t->tree[old_index].getBranchLength();
+                                       }
+                               }
+                       }
+       
+                       if(t->tree[i].getGroup() != ""){
+                               sum /= (double)tmap->seqsPerGroup[t->tree[i].getGroup()];
+                               D += sum; 
+                       }
+               }
+       
+       
+               for(int i=0;i<t->getNumNodes();i++){
+                       //calculate weighted score for each of the group comb i.e. with groups A,B,C = AB, AC, BC.
+                       n = 1;
+                       for (int b=1; b<numGroups; b++) { 
+                               for (int l = n; l < numGroups; l++) {
+                                       double u;
+                                       //does this node have descendants from group b-1
+                                       it = t->tree[i].pcount.find(tmap->namesOfGroups[b-1]);
+                                       //if it does u = # of its descendants with a certain group / total number in tree with a certain group
+                                       if (it != t->tree[i].pcount.end()) {
+                                               u = (double) t->tree[i].pcount[tmap->namesOfGroups[b-1]] / (double) tmap->seqsPerGroup[tmap->namesOfGroups[b-1]];
+                                       }else { u = 0.00; }
+               
+                                       //does this node have descendants from group l
+                                       it = t->tree[i].pcount.find(tmap->namesOfGroups[l]);
+                                       //if it does subtract their percentage from u
+                                       if (it != t->tree[i].pcount.end()) {
+                                               u -= (double) t->tree[i].pcount[tmap->namesOfGroups[l]] / (double) tmap->seqsPerGroup[tmap->namesOfGroups[l]];
+                                       }
+                                               
+                                       u = abs(u) * t->tree[i].getBranchLength();
+                                       
+                                       //save groupcombs u value
+                                       WScore[tmap->namesOfGroups[b-1]+tmap->namesOfGroups[l]] += u;
+
+                               }
+                               n++;
+                       }
+               }
+  
+               //calculate weighted score for each group combination
+               double UN;      
+               n = 1;
+               for (int i=1; i<numGroups; i++) { 
+                       for (int l = n; l < numGroups; l++) {
+                               UN = (WScore[tmap->namesOfGroups[i-1]+tmap->namesOfGroups[l]] / D);
+                               if (isnan(UN) || isinf(UN)) { UN = 0; } 
+                               data.push_back(UN);
+                       }
+               }
+
+               return data;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Weighted class Function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Weighted class function getValues. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+
+}
+
+/**************************************************************************************************/
\ No newline at end of file
diff --git a/weighted.h b/weighted.h
new file mode 100644 (file)
index 0000000..b0d4433
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef WEIGHTED_H
+#define WEIGHTED_H
+
+
+/*
+ *  weighted.h
+ *  Mothur
+ *
+ *  Created by Sarah Westcott on 2/9/09.
+ *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
+ *
+ */
+
+#include "treecalculator.h"
+#include "treemap.h"
+
+/***********************************************************************/
+
+class Weighted : public TreeCalculator  {
+       
+       public:
+               Weighted(TreeMap* t) : tmap(t) {};
+               ~Weighted() {};
+               EstOutput getValues(Tree*);
+               
+       private:
+               EstOutput data;
+               TreeMap* tmap;
+               map<string, int>::iterator it;
+               map<string, float> WScore; //a score for each group combination i.e. AB, AC, BC.
+};
+
+/***********************************************************************/
+
+
+#endif
\ No newline at end of file