diff --git a/nesoni/CHANGES b/nesoni/CHANGES index 08a8750..c6d7b60 100644 --- a/nesoni/CHANGES +++ b/nesoni/CHANGES @@ -1,5 +1,6 @@ 0.129 - slight tweak to error reporting + don't require SplitsTree to be installed 0.128 - modify-features: feature start can't be shifted to negative location diff --git a/nesoni/annotation.py b/nesoni/annotation.py index 52ecdd1..77b416c 100644 --- a/nesoni/annotation.py +++ b/nesoni/annotation.py @@ -53,6 +53,9 @@ def __repr__(self): #' '.join( key+'='+val for key,val in self.attr.items() ) ) + def copy(self): + return copy.deepcopy(self) + def get_id(self): for key in ('ID','id','locus_tag'): if key in self.attr: diff --git a/nesoni/runr.py b/nesoni/runr.py index 2c2cf9b..97f7148 100644 --- a/nesoni/runr.py +++ b/nesoni/runr.py @@ -1795,16 +1795,21 @@ def run(self): ORDER=samples, ) - io.execute( - 'SplitsTree +g -i INPUT -x COMMAND', - no_display=True, - INPUT=self.prefix + '.nex', - COMMAND='UPDATE; ' - 'SAVE FILE=\'%s.nex\' REPLACE=yes; ' - 'EXPORTGRAPHICS format=svg file=\'%s.svg\' REPLACE=yes TITLE=\'NeighborNet of expression levels\'; ' - 'QUIT' - % (self.prefix, self.prefix), - ) + try: + io.execute( + 'SplitsTree +g -i INPUT -x COMMAND', + no_display=True, + INPUT=self.prefix + '.nex', + COMMAND='UPDATE; ' + 'SAVE FILE=\'%s.nex\' REPLACE=yes; ' + 'EXPORTGRAPHICS format=svg file=\'%s.svg\' REPLACE=yes TITLE=\'NeighborNet of expression levels\'; ' + 'QUIT' + % (self.prefix, self.prefix), + ) + except grace.Error: + #It's ok if it's not installed. + pass + def report(self, reporter): reporter.heading('Sample similarity') @@ -1822,14 +1827,15 @@ def report(self, reporter): ) ) - reporter.p( - reporter.get(self.prefix + '.svg', - title = 'Split Network visualization of sample similarity.', - image = True - ) + - '
(Visualization of euclidean distances as a split network. ' - 'Note: This is not a phylogenetic network.)' - ) + if os.path.exists(self.prefix+'.svg'): + reporter.p( + reporter.get(self.prefix + '.svg', + title = 'Split Network visualization of sample similarity.', + image = True + ) + + '
(Visualization of euclidean distances as a split network. ' + 'Note: This is not a phylogenetic network.)' + )