RunBlastAlignWithLocalFile Method |
Namespace: Biolomics.BioCallback
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 )
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