Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
38
Task/FASTA-format/FreeBASIC/fasta-format.basic
Normal file
38
Task/FASTA-format/FreeBASIC/fasta-format.basic
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
Function checkNoSpaces(s As String) As Boolean
|
||||
For i As UInteger = 0 To Len(s) - 1
|
||||
If s[i] = 32 OrElse s[i] = 9 Then Return False '' check for spaces or tabs
|
||||
Next
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Open "input.fasta" For Input As # 1
|
||||
|
||||
Dim As String ln, seq
|
||||
Dim first As Boolean = True
|
||||
|
||||
While Not Eof(1)
|
||||
Line Input #1, ln
|
||||
If Left(ln, 1) = ">" Then
|
||||
If Not first Then Print
|
||||
Print Mid(ln, 2); ": ";
|
||||
If first Then first = False
|
||||
ElseIf first Then
|
||||
Print: Print "Error : File does not begin with '>'";
|
||||
Exit While
|
||||
Else
|
||||
If checkNoSpaces(ln) Then
|
||||
Print ln;
|
||||
Else
|
||||
Print : Print "Error : Sequence contains space(s)";
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
Wend
|
||||
|
||||
Close #1
|
||||
|
||||
Print : Print
|
||||
Print "Press any key to quit"
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue