Created
May 4, 2015 22:09
-
-
Save kissmygritts/2bee24485d6d99c6f0a9 to your computer and use it in GitHub Desktop.
Write DAO.recordset to text file in FASTA format for nucleotide alignment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub writefasta() | |
Dim fso As Object, ofile As Object | |
Dim rs As DAO.Recordset | |
Set rs = CurrentDb.OpenRecordset("SELECT ('>' & WHNO & '_' & Tisssue & '_' & Gene) AS ID, Sequence FROM Sheet1 WHERE Gene = 'IGS';") | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set ofile = fso.createtextfile("C:\Users\Mgritts\Documents\WildlifeHealth\BigGame\Sequences\fasta.txt") | |
rs.MoveFirst | |
With rs | |
Do Until .EOF | |
ofile.writeline !ID | |
ofile.writeline !Sequence | |
.MoveNext | |
Loop | |
End With | |
rs.Close | |
ofile.Close | |
Set fso = Nothing | |
Set ofile = Nothing | |
Set rs = Nothing | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment