Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
33
Task/FASTA-format/BASIC256/fasta-format.basic
Normal file
33
Task/FASTA-format/BASIC256/fasta-format.basic
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
open 1, "input.fasta"
|
||||
|
||||
first = True
|
||||
|
||||
while not eof(1)
|
||||
ln = readline(1)
|
||||
if left(ln, 1) = ">" then
|
||||
if not first then print
|
||||
print mid(ln, 2, length(ln)-2) & ": ";
|
||||
if first then first = False
|
||||
else
|
||||
if first then
|
||||
print "Error : File does not begin with '>'"
|
||||
exit while
|
||||
else
|
||||
if checkNoSpaces(ln) then
|
||||
print left(ln, length(ln)-2);
|
||||
else
|
||||
print "Error : Sequence contains space(s)"
|
||||
exit while
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end while
|
||||
close 1
|
||||
end
|
||||
|
||||
function checkNoSpaces(s)
|
||||
for i = 1 to length(s) - 1
|
||||
if chr(mid(s,i,1)) = 32 or chr(mid(s,i,1)) = 9 then return False
|
||||
next i
|
||||
return True
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue