Click or drag to resize
RunBlastAlignWithGenbank Method
Align sequences stored in a given FASTA formatted file against Genbank/NCBI.

Namespace:  Biolomics.BioCallback
Assembly:  Biolomics.BioCallback (in Biolomics.BioCallback.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static int BlastAlignWithGenbank(
	List<List<XBlastHit>> p_Results,
	string p_ResultFastaFile,
	string p_QueryFastaFile,
	XBlastOptions p_Options,
	EnumerationsGenBankDBNameEnum p_GenbankDB = EnumerationsGenBankDBNameEnum.nr
)

Parameters

p_Results
Type: System.Collections.GenericListListXBlastHit
The result of the alignement as a Generic.List(Of Generic.List(Of XBlastHit)).
p_ResultFastaFile
Type: SystemString
The file name of the result fasta file.
p_QueryFastaFile
Type: SystemString
The full path of Fasta formatted file to be aligned with a reference database available from Genbank.
p_Options
Type: Biolomics.SharedClassesXBlastOptions
Blast options for executing blast alignement.
p_GenbankDB (Optional)
Type: Biolomics.SharedClassesEnumerationsGenBankDBNameEnum
The Genbank database. Possible options are: "nr", "pat", "pdb", "month", "refseq_rna", "refseq_genomic", "est", "est_human", "est_mouse", "est_others", "gss", "htgs", "dbsts", "chromosome", "wgs", "env_nt" .

Return Value

Type: Int32
Error code
Examples
Code sample below is compete and is a demonstration of how to align sequences stored in a given FASTA formatted file against Genbank/NCBI.
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.PairwiseAlignmentAgainstGenbank()
    End Sub
    Public Sub PairwiseAlignmentAgainstGenbank()

        '    **********    Align with Genbank    ********
        Dim QueryFastaFile As String = "Your_Fasta_File_Path\Sequences.fas" 'full path of Fasta formatted file to be aligned with a reference database available from Genbank
        Dim resultFastaFile As String = "Your_ResultFastaFile_Name.fas" 'full path of Fasta formatted file to be aligned with a reference database available from Genbank
        '    Genbank database. Possible options are:
        '"nr", "pat", "pdb", "month", "refseq_rna", "refseq_genomic", "est", "est_human", "est_mouse", "est_others", "gss", "htgs", "dbsts", "chromosome", "wgs", "env_nt"
        Dim MaxTimeMinutesAllowed As Integer = 2 ' maximum allowed time in minutes for a single query to be done. If longer, process will be canceled

        Dim StartTime As System.DateTime = System.DateTime.Now

        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:
        Options.MaxSequencesDisplayed = 5
        '    make a list for the results
        Dim Results As New Generic.List(Of Generic.List(Of XBlastHit))
        '    query Genbank
        Dim ErrorCode As Integer = Run.BlastAlignWithGenbank(Results, resultFastaFile, QueryFastaFile, Options, GenBankDBNameEnum.nr)

        Dim ElapsedTicks As Long = System.DateTime.Now.Ticks - StartTime.Ticks
        Dim ElapsedSpan As New TimeSpan(ElapsedTicks)

        If ErrorCode = 0 Then
            Console.Write("Job done in " & CStr(ElapsedSpan.TotalSeconds) & " seconds")
            Console.Write("Results can then be viewed using the 'Open previous pairwise alignments (NxM)' menu under the 'Sequences' menu of the main BioloMICS Editor window")
            '    but you can also use the XBlastHit properties directly.
        Else
            For Each Err As String In Run.GetLastErrorMessage()
                Console.Write(Err)
            Next
        End If

    End Sub
End Class
See Also