BioloMICS logo
×
BioloMICS menu

Pairwise Fasta alignment against local file

 
Code sample below shows how to align sequences stored in a given FASTA formatted file against a local file using Fasta.
 
Imports System
Imports System.Collections
Imports Biolomics.BioCallback
Imports Biolomics.SharedClasses
 
Public Class MyNewClass
 
     ' This function is called when running this script
     Shared Sub Main()
 
          '     Create an instance of class MyNewClass and call its functions
          Dim c As New MyNewClass
          c.FastaAlign()
     End Sub
 
     Public Sub FastaAlign()
          '     **********     Fasta 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 = "D:\Temp\Sequences.fas" 'full path of Fasta formatted file to be aligned with a reference database available on disk
          Dim ReferenceFastaFile As String = "D:\Temp\AllRefSequences.fas"
 
          Dim ResultList As New Generic.List(Of XFastaResultFile)
          '     last parameter must be set only once, especially if the reference file is big
          Run.FastaAlignWithLocalFile(ResultList, QueryFastaFile, ReferenceFastaFile, Options, BlastTypeEnum.Fastan, BlastRefFileFormatEnum.Dna)
          '      the names of the result files and the alignment results are stored in each XFastaResultFile object
     End Sub
 
End Class