RunBlastAlignWithGenbank Method |
Namespace: Biolomics.BioCallback
public static int BlastAlignWithGenbank( List<List<XBlastHit>> p_Results, string p_ResultFastaFile, string p_QueryFastaFile, XBlastOptions p_Options, EnumerationsGenBankDBNameEnum p_GenbankDB = EnumerationsGenBankDBNameEnum.nr )
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