Data update

This commit is contained in:
Ingy döt Net 2024-03-06 22:25:12 -08:00
parent ed705008a8
commit 0df55f9f24
2196 changed files with 32999 additions and 3075 deletions

View file

@ -0,0 +1,20 @@
repeat
s$ = input
until s$ = ""
if substr s$ 1 1 = ">"
if stat = 1
print ""
.
stat = 1
print s$
else
write s$
.
.
input_data
>Rosetta_Example_1
THERECANBENOSPACE
>Rosetta_Example_2
THERECANBESEVERAL
LINESBUTTHEYALLMUST
BECONCATENATED

View file

@ -0,0 +1,39 @@
MODULE Fasta;
IMPORT Files, Streams, Strings, Commands;
PROCEDURE PrintOn*(filename: ARRAY OF CHAR; wr: Streams.Writer);
VAR
rd: Files.Reader;
f: Files.File;
line: ARRAY 1024 OF CHAR;
res: BOOLEAN;
BEGIN
f := Files.Old(filename);
ASSERT(f # NIL);
NEW(rd,f,0);
res := rd.GetString(line);
WHILE rd.res # Streams.EOF DO
IF line[0] = '>' THEN
wr.Ln;
wr.String(Strings.Substring2(1,line)^);
wr.String(": ")
ELSE
wr.String(line)
END;
res := rd.GetString(line)
END
END PrintOn;
PROCEDURE Do*;
VAR
ctx: Commands.Context;
filename: ARRAY 256 OF CHAR;
res: BOOLEAN
BEGIN
ctx := Commands.GetContext();
res := ctx.arg.GetString(filename);
PrintOn(filename,ctx.out)
END Do;
END Fasta.

View file

@ -1,16 +1,24 @@
/*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='FASTA.IN' /*Not specified? Then use the default.*/
name= /*the name of an output file (so far). */
$= /*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. */
if left(x, 1)=='>' then do
if $\=='' then say name':' $
name=substr(x, 2)
$=
end
else $=$ || x
end /*j*/ /* [↓] show output of last file used. */
if $\=='' then say name':' $ /*stick a fork in it, we're all done. */
/*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='FASTA.IN' /* Not specified? Then use the default */
name='' /* the name of an output file (so far) */
d='' /* the value of the output file's */
Do While lines(ifid)\==0 /* process the FASTA file contents */
x=strip(linein(ifid),'T') /* read a line (a record) from the input */
/* and strip trailing blanks */
If left(x,1)=='>' Then Do /* a new file id */
Call out /* show output name and data */
name=substr(x,2) /* and get the new (or first) output name */
d='' /* start with empty contents */
End
Else /* a line with data */
d=d||x /* append it to output */
End
Call out /* show output of last file used. */
Exit
out:
If d\=='' Then /* if there ara data */
Say name':' d /* show output name and data */
Return

View file

@ -1,22 +1,28 @@
/*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= /*the name of an output file (so far). */
$= /*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. */
if x=='' then iterate /*If the line is all blank, ignore it. */
if left(x, 1)==';' then do
if name=='' then name=substr(x,2)
say x
iterate
end
if left(x, 1)=='>' then do
if $\=='' then say name':' $
name=substr(x, 2)
$=
end
else $=space($ || translate(x, , '*'), 0)
end /*j*/ /* [↓] show output of last file used. */
if $\=='' then say name':' $ /*stick a fork in it, we're all done. */
/*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='' /*the name of an output file (so far). */
data=''
/*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. */
Select
When x=='' Then /* If the line is all blank, */
Nop /* ignore it. */
When left(x,1)==';' Then Do
If name=='' Then name=substr(x,2)
Say x
End
When left(x,1)=='>' Then Do
If data\=='' Then
Say name':' data
name=substr(x,2)
data=''
End
Otherwise
data=space(data||translate(x, ,'*'),0)
End
End
If data\=='' Then
Say name':' data /* [?] show output of last file used. */

View file

@ -0,0 +1,10 @@
FileLocator home / aFilename readStreamDo: [ :stream |
[ stream atEnd ] whileFalse: [
| line |
((line := stream nextLine) beginsWith: '>')
ifTrue: [
Transcript
cr;
show: (line copyFrom: 2 to: line size);
show: ': ' ]
ifFalse: [ Transcript show: line ] ] ]