Skip to content

Commit

Permalink
dont require splitstree
Browse files Browse the repository at this point in the history
  • Loading branch information
pfh committed Jan 22, 2015
1 parent 60d796d commit 5593471
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
1 change: 1 addition & 0 deletions nesoni/CHANGES
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 3 additions & 0 deletions nesoni/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
42 changes: 24 additions & 18 deletions nesoni/runr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -1822,14 +1827,15 @@ def report(self, reporter):
)
)

reporter.p(
reporter.get(self.prefix + '.svg',
title = 'Split Network visualization of sample similarity.',
image = True
) +
'<br>(Visualization of euclidean distances as a split network. '
'Note: This is <i>not</i> 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
) +
'<br>(Visualization of euclidean distances as a split network. '
'Note: This is <i>not</i> a phylogenetic network.)'
)



Expand Down

0 comments on commit 5593471

Please sign in to comment.