Monday, December 29, 2014

.Fasta Data Grabber

This will download .fasta files from a site and you can add the web crawler I demonstrated earlier or use a pseudo random string generator if the final ALPHANUMERIC piece is very diverse.


browser.Navigate("http://www.organization.org/whatever/ALPHANUMERIC.fasta")

Dim delLineIndex As New List(Of Integer)
delLineIndex.Add(1)


Adress.text=browser.document.Title;
Adress.text=Replace(Adress.text,"http://www.ORGANIZATION.org/WHATEVER/","")
Adress.text=Replace(Adress.text,".fasta","")



Dim openStream = New StreamReader("F:\Latest.txt")
Dim saveStream = New StreamWriter("F:\"+Adress.text+".txt")


Dim lineStr As String = ""
Dim lineIndex As Integer = 0
Do
    lineStr = openStream.ReadLine()
    If lineStr Is Nothing Then
        Exit Do
    Else
        lineIndex += 1
        If Not delLineIndex.Contains(lineIndex) Then
            saveStream.WriteLine(lineStr)


        End If


    End If
Loop Until lineStr Is Nothing
openStream.Close()
saveStream.Close()

No comments:

Post a Comment