FASTA format: Difference between revisions
Content added Content deleted
Walterpachl (talk | contribs) (→version 1: rewritten) |
Walterpachl (talk | contribs) (→version 2: rewritten) |
||
Line 2,011: | Line 2,011: | ||
::* sequences that contain blanks, tabs, and other whitespace |
::* sequences that contain blanks, tabs, and other whitespace |
||
::* sequence names that are identified with a semicolon [''';'''] |
::* sequence names that are identified with a semicolon [''';'''] |
||
<syntaxhighlight lang="rexx">/*REXX program reads a |
<syntaxhighlight lang="rexx">/*REXX program reads a (bio-informational) FASTA file and displays the contents. */ |
||
Parse Arg iFID . /*iFID: the input file to be read. */ |
|||
If iFID=='' Then iFID='FASTA2.IN' /*Not specified? Then use the default.*/ |
|||
name= |
name='' /*the name of an output file (so far). */ |
||
data='' |
|||
$= /*the value of the output file's stuff.*/ |
|||
/*the value of the output file's stuff.*/ |
|||
Do While lines(iFID)\==0 /*process the FASTA file contents. */ |
|||
x=strip(linein(iFID),'T') /*read a line (a record) from the file,*/ |
|||
/*───────── and strip trailing blanks. */ |
|||
/*--------- and strip trailing blanks. */ |
|||
Select |
|||
⚫ | |||
When x=='' Then /* If the line is all blank, */ |
|||
Nop /* ignore it. */ |
|||
When left(x,1)==';' Then Do |
|||
iterate |
|||
⚫ | |||
end |
|||
Say x |
|||
End |
|||
⚫ | |||
⚫ | |||
⚫ | |||
If data\=='' Then |
|||
$= |
|||
Say name':' data |
|||
name=substr(x,2) |
|||
⚫ | |||
data='' |
|||
end /*j*/ /* [↓] show output of last file used. */ |
|||
End |
|||
if $\=='' then say name':' $ /*stick a fork in it, we're all done. */</syntaxhighlight> |
|||
Otherwise |
|||
⚫ | |||
End |
|||
End |
|||
If data\=='' Then |
|||
⚫ | |||
</syntaxhighlight> |
|||
<pre> |
<pre> |
||
'''input:''' The '''FASTA2.IN''' file is shown below: |
'''input:''' The '''FASTA2.IN''' file is shown below: |