Click or drag to resize
RunBlastAlignWithLocalFile Method
Executes a Blast Alignement with local file.

Namespace:  Biolomics.BioCallback
Assembly:  Biolomics.BioCallback (in Biolomics.BioCallback.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static int BlastAlignWithLocalFile(
	List<List<XBlastHit>> p_Results,
	string p_AlignmentsResultsFile,
	string p_QueryFastaFile,
	string p_ReferenceFullFileName,
	XBlastOptions p_Options,
	EnumerationsBlastTypeEnum p_Algorithm = EnumerationsBlastTypeEnum.Blastn,
	EnumerationsBlastRefFileFormatEnum p_FormatingReferenceDB = EnumerationsBlastRefFileFormatEnum.None
)

Parameters

p_Results
Type: System.Collections.GenericListListXBlastHit
The result of the alignement as a Generic.List(Of Generic.List(Of XBlastHit)) .
p_AlignmentsResultsFile
Type: SystemString
The alignments results file.
p_QueryFastaFile
Type: SystemString
The query for fasta file.
p_ReferenceFullFileName
Type: SystemString
Full reference file name.
p_Options
Type: Biolomics.SharedClassesXBlastOptions
Blast options for executing blast alignement.
p_Algorithm (Optional)
Type: Biolomics.SharedClassesEnumerationsBlastTypeEnum
The algorithm to be used in the blast alignement .
p_FormatingReferenceDB (Optional)
Type: Biolomics.SharedClassesEnumerationsBlastRefFileFormatEnum
The the reference file format .

Return Value

Type: Int32
System.Int32.
Examples
This is an example of use of BlastAlignWithLocalFile to executes a Blast Alignement with local file.
Example VB.Net
Imports System
Imports BioloMICS.BioCallback
Imports BioloMICS.SharedClasses
Imports System.Collections

Public Class Program

    <STAThread()>
    Shared Sub Main()
        '    Create an instance of class Program and call its functions
        Dim c As New Program
        c.BlastAlign()
    End Sub

    Public Sub BlastAlign()
        '    **********    Blast align with local file    ****************

        Dim Options As New XBlastOptions
        '    for your information, default values are:
        Options.GapCreationPenalty = 12
        Options.GapExtensionPenalty = 2
        Options.PenaltyMisMatch = -2
        Options.RewardMatch = 1
        Options.WordSize = 11
        Options.MaxSequencesDisplayed = 100
        Options.MaxTimeMinutesAllowed = 5
        Options.SortingMode = BlastSortingModeEnum.Rating
        '    you can change these options for a fine tuning of the alignment
        Options.MaxSequencesDisplayed = 5

        '    Alignment against a local reference fasta file
        Dim QueryFastaFile As String = "Your path to your fasta file\fastafilename.fas" 'full path of Fasta formatted file to be aligned with a reference database available on disk
        Dim ReferenceFullFastaFile As String = "Your path to your ReferenceFasta  file\AllRefSequences.fas"

        Dim AlignementResultFile As String = "Result fasta file name.fas"

        Dim ResultArray As New Generic.List(Of Generic.List(Of XBlastHit))
        '    last parameter must be set only once, especially if the reference file is big
        Run.BlastAlignWithLocalFile(ResultArray, AlignementResultFile, QueryFastaFile, ReferenceFullFastaFile, Options, BlastTypeEnum.Blastn, BlastRefFileFormatEnum.Dna)
        '     the result files are located in path given by     XConfig.TempFilePath()
        '    Scan ResultArray to read each alignment result
        If ResultArray.Count > 0 Then
            Console.WriteLine("new results")
        End If
        For Each elemnt As Generic.List(Of XBlastHit) In ResultArray
            For Each newelem As XBlastHit In elemnt
                Console.WriteLine(newelem.Num)
            Next
        Next

    End Sub
End Class
See Also