Click or drag to resize
RunSaveClusteringTree 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 static void SaveClusteringTree(
	XMatrix p_SimMx,
	EnumerationsClusteringMethods p_ClusteringMethod,
	string p_FileName,
	bool p_ShowDescription = true,
	List<double> p_Thresholds = null,
	List<Color> p_Colors = null,
	List<long> p_FieldKeys = null,
	List<int> p_ColumnWidths = null
)

Parameters

p_SimMx
Type: Biolomics.SharedClassesXMatrix
The similarity matrix.
p_ClusteringMethod
Type: Biolomics.SharedClassesEnumerationsClusteringMethods
The clustering method.
p_FileName
Type: SystemString
Name of the file to save the tree into.
p_ShowDescription (Optional)
Type: SystemBoolean
[Optional]if set to trueshow description.
p_Thresholds (Optional)
Type: System.Collections.GenericListDouble
[Optional]The thresholds.
p_Colors (Optional)
Type: System.Collections.GenericListColor
[Optional]The colors.
p_FieldKeys (Optional)
Type: System.Collections.GenericListInt64
[Optional]The field keys.
p_ColumnWidths (Optional)
Type: System.Collections.GenericListInt32
[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