Click or drag to resize
Run. SaveClusteringTree Method
Saves the clustering tree in specific path as an image.

Namespace:  Biolomics.BioCallback
Assembly:  Biolomics.BioCallback (in Biolomics.BioCallback.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
Public Shared Sub SaveClusteringTree ( 
	p_SimMx As XMatrix,
	p_ClusteringMethod As Enumerations.ClusteringMethods,
	p_FileName As String,
	Optional p_ShowDescription As Boolean = true,
	Optional p_Thresholds As List(Of Double) = Nothing,
	Optional p_Colors As List(Of Color) = Nothing,
	Optional p_FieldKeys As List(Of Long) = Nothing,
	Optional p_ColumnWidths As List(Of Integer) = Nothing
)

Parameters

p_SimMx
Type: Biolomics.SharedClasses.XMatrix
The similarity matrix.
p_ClusteringMethod
Type: Biolomics.SharedClasses.Enumerations.ClusteringMethods
The clustering method.
p_FileName
Type: System.String
Name of the file to save the tree into.
p_ShowDescription (Optional)
Type: System.Boolean
[Optional]if set to trueshow description.
p_Thresholds (Optional)
Type: System.Collections.Generic.List(Of Double)
[Optional]The thresholds.
p_Colors (Optional)
Type: System.Collections.Generic.List(Of Color)
[Optional]The colors.
p_FieldKeys (Optional)
Type: System.Collections.Generic.List(Of Int64)
[Optional]The field keys.
p_ColumnWidths (Optional)
Type: System.Collections.Generic.List(Of Int32)
[Optional]The column widths.
Examples
The example below will compute a clustering tree between 10 records, generate a Nexus string and open a clustering page in BioloMICS and saves the clustering tree to a file.
Example VB.Net
Imports System
Imports System.Collections
Imports System.Text  '    for StringBuilder

Imports Biolomics.BioCallback
Imports Biolomics.SharedClasses
Imports Biolomics.Utility.databaseConstants

Public Class Program

    <STAThread()>
    Shared Sub Main()
        Dim program As New Program()
        program.Test()
    End Sub

    '    Write sub functions here
    Public Sub Test()
        '    get the current connection
        Dim SqlCo As XConnection = Run.GetCurrentConnection()
        If SqlCo Is Nothing Then
            Return
        End If

        '    get a table from its User name
        Dim TableDef As XTableDef = SqlCo.GetTableDefByUserNameEng("Your_Table_Name")
        If TableDef Is Nothing Then   '    may happen if that table doesn't exist
            Return
        End If

        '    load records #1 to #10 in the reference record map
        Dim RefRecMap As XRecordMap = Run.LoadRecords(TableDef.Key, Nothing, XWhere.GTE(StaticFields.id, 1).And_(StaticFields.id, XWhere.OperationEnum.LTE, 10))

        '    create 3 matrices
        Dim SimMx As New XMatrix
        Dim NumMx As New XMatrix
        Dim DenomMx As New XMatrix

        '    compute the similarity matrix between all reference records, this will return three 10*10 matrices
        '    SimMx contains the similarity between all 10 records
        '    NumMx contains the number of identical bases found during DNA alignments
        '    DenomMx contains the denominator used to compare DNA
        Run.Classification(SimMx, NumMx, DenomMx, RefRecMap, "Your_Saved_Scenario_Name")

        '    compute a Nexus string describing a clustering tree
        Dim NexusStr As String = Run.NexusStr(SimMx, ClusteringMethods.UPGMA)
        '    this Nexus string can be used to export result to other software

        'save the clustering tree to an image
        run.SaveClusteringTree(SimMx, ClusteringMethods.UPGMA, "Your_Result_Path_To Save_Image\result.png")

        '    open a clustering form displaying the result
        Run.OpenClusteringForm(SimMx, ClusteringMethods.UPGMA)

    End Sub

End Class
See Also