提问:如何将original form转换成wanted form?
original form:
>yal1 t1 awd123456789
GATA
ACC
>yal2 t2 gfs12354687987984565621321654987
TGACAG
GC
>yal3 t3 gfs1235468798798456562132165498789879875468798652135469798987987987985465798798
ATG
TGAG
wanted form:
yal1 t1 GAT
yal1 t1 AAC
yal1 t1 C
yal2 t2 TGA
yal2 t2 CAG
yal2 t2 GC
yal3 t3 ATG
yal3 t3 TGA
yal3 t3 G
data_null_的回答如下:
filename FT15F001 temp;
data dna;
infile FT15F001 n=2 eof=eof;
input @'>' id :$10. name :$10. / x $1. @;
if x eq '>' then lostcard;
length dna $3;
do while(x ne '>');
dna = catt(dna,x);
do i = 2 to 3;
input x $1. @;
if x eq '>' then do;
output;
goto nextid;
end;
dna = catt(dna,x);
end;
output;
dna = ' ';
input x $1. @;
end;
nextid: input @1 @@;
return;
eof: output;
stop;
drop i x;
parmcards;
>yal1 t1 awd123456789
GATA
ACC
>yal4 t4 gfs12354687987984565621321654987
TGACAG
GCG
>yal2 t2 gfs12354687987984565621321654987
TGACAG
GC
>yal3 t3 gfs1235468798798456562132165498789879875468798652135469798987987987985465798798
ATG
TGAG
;;;;
run;