I have two gene sequences (1)GAGCAAGCGCCATACTCCTGTGGAGAAGTCTGCCGTTACTGCCCTGTGGGGCAAGGTGAACGTGGA (2)GAGCAAGCGCCATAGTCCTGTGGAGAAGTCTGCCGTTACTGCCCTGTGGGGCAAGGTGAACGTGGA I want to mark their differences. Now I marked the differences with lowcase(char) (see my code below). My question is how I can mark the difference with Red color. By the way, I appreciate if someone can optimize my code. Thanks. ***Code Start******************************************* data a; length f1 $ 200; input f1; datalines; GAGCAAGCGCCATACTCCTGTGGAGAAGTCTGCCGTTACTGCCCTGTGGGGCAAGGTGAACGTGGA GAGCAAGCGCCATAGTCCTGTGGAGAAGTCTGCCGTTACTGCCCTGTGGGGCAAGGTGAACGTGGA ; data b; set a; retain base len_1; if _n_=1 then do; base=f1; len_1=length(base); end; f2=f1; len_2=length(f2); x=min(len_1, len_2); do i=1 to x; substr_1=substr(base,i,1); substr_2=substr(f2,i,1); if substr_1 ^=substr_2 then substr(f2,i,1)=lowcase(substr_2); else; end; run; proc print data=b ; var f1 f2; run; ***Code end***********************************
... View more