self.m_staticline4 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
fgSizer1.Add( self.m_staticline4, 0, wx.EXPAND |wx.ALL, 5 )
+
+ self.text_format_image = wx.StaticText( self, wx.ID_ANY, _(u"Image format").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
+ self.text_format_image.Wrap( -1 )
+ fgSizer1.Add( self.text_format_image, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+
+ self.choice_format = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, ['png', 'svg'], 0 )
+ self.choice_format.SetSelection( 0 )
+ fgSizer1.Add( self.choice_format, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
+
+ self.m_staticline31 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+ fgSizer1.Add( self.m_staticline31, 0, wx.EXPAND |wx.ALL, 5 )
+
+ self.m_staticline41 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+ fgSizer1.Add( self.m_staticline41, 0, wx.EXPAND |wx.ALL, 5 )
+
self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, _(u"Color or black and white").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText5.Wrap( -1 )
self.m_radioBox1.SetSelection(self.param['color_nb'])
self.m_checkBox1.SetValue(self.param['taille_classe'])
self.m_radioBox2.SetSelection(self.param['type_tclasse'])
+ self.choice_format.SetSelection(self.param['svg'])
def __del__( self ):
pass
self.uceids = uceids
self.ira = wx.GetApp().GetTopWindow()
self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
-
+ self.items = items
self.html = ""
#self.HtmlPage=wx.html.HtmlWindow(self, -1)
self.HtmlPage = ConcordList(self, items)
)
dlg.SetFilterIndex(2)
dlg.CenterOnParent()
+ self.html = '<br>'.join([self.items[i] for i in range(0,len(self.items))])
if dlg.ShowModal() == wx.ID_OK:
path = dlg.GetPath()
with open(path, 'w') as f :
if wordlist is not None :
self.listcol = ListForSpec(self, self, wordlist, ['eff'])
self.listcol.SetMinSize( wx.Size( 270,-1 ) )
- bSizer16.Add( self.listcol, 0, wx.ALL|wx.EXPAND, 5 )
+ listsizer = wx.BoxSizer( wx.VERTICAL )
+ countsizer = wx.BoxSizer( wx.HORIZONTAL )
+ self.butcount = wx.Button(self, -1, "count")
+ self.textcount = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size( 100,-1 ), wx.TE_READONLY )
+ countsizer.Add(self.butcount, 0, wx.ALL, 5)
+ countsizer.Add(self.textcount, 0, wx.ALL, 5 )
+ listsizer.Add(countsizer, 0, wx.ALL, 5)
+ listsizer.Add(self.listcol, 2, wx.ALL|wx.EXPAND, 5 )
+ #bSizer16.Add( self.listcol, 0, wx.ALL|wx.EXPAND, 5 )
+ bSizer16.Add( listsizer, 0, wx.ALL|wx.EXPAND, 5)
if selected is None :
for row in xrange(self.listcol.GetItemCount()):
self.listcol.Select(row)
self.checki.Bind( wx.EVT_CHECKBOX, self.OnChecki )
self.check_vcex.Bind( wx.EVT_CHECKBOX, self.OnCheck_vcex )
self.check_s_size.Bind( wx.EVT_CHECKBOX, self.OnCheck_s_size )
+ self.listcol.Bind( wx.EVT_LIST_ITEM_SELECTED, self.ChangeCount)
+ self.listcol.Bind( wx.EVT_LIST_ITEM_DESELECTED, self.ChangeCount)
+ self.butcount.Bind( wx.EVT_BUTTON, self.ChangeCount)
+ self.ChangeCount(wx.EVT_BUTTON)
+
def __set_properties(self):
self.choice1.SetSelection(self.paramsimi['coeff'])
self.comcheck.SetValue(self.paramsimi['com'])
self.choix_com.SetSelection(self.paramsimi['communities'])
self.halo.SetValue(self.paramsimi['halo'])
+
+ def ChangeCount(self, evt) :
+ self.textcount.SetValue('%i' % self.listcol.GetSelectedItemCount())
def OnCheck_s_size(self, evt):
if self.check_s_size.GetValue() :
else :
svg = 1
typegraph = dial.choicetype.GetSelection()
- typefile = '.png'
+ if svg :
+ typefile = '.svg'
+ else :
+ typefile = '.png'
if self.clnb <= 3 and typegraph == 1 :
typegraph = 2
if typegraph == 2:
ira = wx.GetApp().GetTopWindow()
self.page.tgens, etoiles = ReadList(parametres['tgenspec'], ira.syscoding, sep="\t")
tgentab = False
+ gparent = None
for i in range(page.GetPageCount()) :
tab = page.GetPage(i)
+ if 'gparent' in dir(tab) :
+ if tab.gparent is not None :
+ gparent = tab.gparent
if 'tgen' in dir(tab) :
if tab.tgen :
tgentab = tab
self.page.tgentab.RefreshData(self.page.tgens)
self.page.SetSelection(i)
else :
- self.page.tgentab = ListForSpec(ira, None, self.page.tgens, etoiles[1:])
+ self.page.tgentab = ListForSpec(ira, gparent, self.page.tgens, etoiles[1:])
self.page.tgentab.tgen = True
self.page.AddPage(self.page.tgentab, u'Tgens Specificities')
self.page.SetSelection(self.page.GetPageCount() - 1)
self.ListPanEff = ListForSpec(ira, self, self.DictEff, self.etoiles)
self.ListPanEffType = ListForSpec(ira, self, self.DictEffType, self.etoiles)
self.ListPanEffRelForme = ListForSpec(ira, self, self.DictEffRelForme, self.etoiles)
- self.ListPanEffRelType = ListForSpec(ira, self.parent, self.DictEffRelType, self.etoiles)
+ self.ListPanEffRelType = ListForSpec(ira, self, self.DictEffRelType, self.etoiles)
self.TabStat.AddPage(self.ListPan, u'formes')
if os.path.exists(self.pathout['banalites.csv']) :
for i in range(0,len(list_graph)):
if os.path.exists(os.path.join(self.dirout,list_graph[i][0])) :
- self.listimg.append(wx.StaticBitmap(self.panel_1, -1, wx.Bitmap(os.path.join(self.dirout,list_graph[i][0]), wx.BITMAP_TYPE_ANY)))
+ filename, ext = os.path.splitext(list_graph[i][0])
+ if ext == '.svg' :
+ self.listimg.append(hl.HyperLinkCtrl(self.panel_1, -1, os.path.join(self.dirout,list_graph[i][0]), URL=os.path.join(self.dirout,list_graph[i][0])))
+ else :
+ self.listimg.append(wx.StaticBitmap(self.panel_1, -1, wx.Bitmap(os.path.join(self.dirout,list_graph[i][0]), wx.BITMAP_TYPE_ANY)))
self.labels.append(wx.StaticText(self.panel_1, -1, list_graph[i][1]))
self.__set_properties()
'type_dendro': 0,
'color_nb': 0,
'taille_classe' : True,
- 'type_tclasse' : 0
+ 'type_tclasse' : 0,
+ 'svg' : 0
}
self.type_dendro = [ u"phylogram", u"cladogram", u"fan", u"unrooted", u"radial" ]
self.param['color_nb'] = dial.m_radioBox1.GetSelection()
self.param['taille_classe'] = dial.m_checkBox1.GetValue()
self.param['type_tclasse'] = dial.m_radioBox2.GetSelection()
+ self.param['svg'] = dial.choice_format.GetSelection()
def make_dendro(self, dendro = 'simple') :
- while os.path.exists(os.path.join(self.dirout, 'dendrogramme_' + str(self.graphnb)+'.png')) :
+ if self.param['svg'] :
+ typefile = '.svg'
+ else :
+ typefile = '.png'
+ while os.path.exists(os.path.join(self.dirout, 'dendrogramme_' + str(self.graphnb)+typefile)) :
self.graphnb += 1
- fileout = ffr(os.path.join(self.dirout,'dendrogramme_' + str(self.graphnb)+'.png'))
+ fileout = ffr(os.path.join(self.dirout,'dendrogramme_' + str(self.graphnb)+typefile))
width = self.param['width']
height = self.param['height']
type_dendro = self.type_dendro[self.param['type_dendro']]
histo='FALSE'
else :
histo = 'TRUE'
+ if self.param['svg'] :
+ svg = 'TRUE'
+ else :
+ svg = 'FALSE'
dendro_path = self.dictpathout['Rdendro']
classe_path = self.dictpathout['uce']
txt = """
load("%s")
source("%s")
chistable <- chistabletot[1:(debsup-1),]
- open_file_graph("%s", width=%i, height=%i)
+ open_file_graph("%s", width=%i, height=%i, svg = %s)
plot.dendro.prof(tree.cut1$tree.cl, classes, chistable, nbbycl = 60, type.dendro="%s", bw=%s, lab=NULL)
- """ % (ffr(self.dictpathout['RData.RData']), ffr(self.ira.RscriptsPath['Rgraph']), ffr(fileout), width, height, type_dendro, bw)
+ """ % (ffr(self.dictpathout['RData.RData']), ffr(self.ira.RscriptsPath['Rgraph']), ffr(fileout), width, height, svg, type_dendro, bw)
elif dendro == 'cloud' :
txt += """
load("%s")
source("%s")
chistable <- chistabletot[1:(debsup-1),]
- open_file_graph("%s", width=%i, height=%i)
+ open_file_graph("%s", width=%i, height=%i, svg=%s)
plot.dendro.cloud(tree.cut1$tree.cl, classes, chistable, nbbycl = 300, type.dendro="%s", bw=%s, lab=NULL)
- """ % (ffr(self.dictpathout['RData.RData']), ffr(self.ira.RscriptsPath['Rgraph']), ffr(fileout), width, height, type_dendro, bw)
+ """ % (ffr(self.dictpathout['RData.RData']), ffr(self.ira.RscriptsPath['Rgraph']), ffr(fileout), width, height, svg, type_dendro, bw)
tmpfile = tempfile.mktemp()
check_Rresult(self.ira, error)
self.list_graph.append([fileout, 'Dendrogramme CHD1 - %s' % type_dendro])
print_liste(self.dictpathout['liste_graph_chd'], self.list_graph)
- self.sizer_3.Add(wx.StaticBitmap(self.panel_1, -1, wx.Bitmap(fileout, wx.BITMAP_TYPE_ANY)), 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
+ if self.param['svg'] :
+ self.sizer_3.Add(hl.HyperLinkCtrl(self.panel_1, -1, fileout, URL=fileout), 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
+ else :
+ self.sizer_3.Add(wx.StaticBitmap(self.panel_1, -1, wx.Bitmap(fileout, wx.BITMAP_TYPE_ANY)), 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
self.sizer_3.Add(wx.StaticText(self.panel_1,-1, 'Dendrogramme CHD1 - %s' % type_dendro), 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
self.sizer_3.Fit(self.panel_1)
self.Layout()