Sponsored links: Algebra eBooks
 

Related

sdowncase

sdowncase("SpaSS");

Calculate

sdowncase

? sdowncase;

Calculate

sdowncase

sdowncase("{SpaSS}");

Calculate

sdowncase

sdowncase("SpaSS");

Calculate

sdowncase

? sdowncase;

Calculate

sdowncase

sdowncase("{SpaSS}");

Calculate

sdowncase

Run Example
(%i1)sdowncase("{SpaSS}");
(%o1)                               {spass}
(%i2) 
Run Example
? sdowncase;

 -- Function: sdowncase (<string>)
 -- Function: sdowncase (<string>, <start>)
 -- Function: sdowncase (<string>, <start>, <end>)
     Like `supcase', but uppercase characters are converted to
     lowercase.


(%o1)                                true
(%i2) 
Run Example
cut(l,m,k,h,[p]):=block( cut_segment(l, m, k, [p]):=block( elimn(l,index):=block([ans, indi:map("=", index, makelist(0, n, 1, length(index)))], ans:subst([0="_"], l*subst(indi, makelist(n, n, 1, length(l)))/makelist(n, n, 1, length(l))), if(not(emptyp(p))) then return(delete("_", ans)) else return(ans)), elimn(l, makelist(n, n, m, k))), cut_flanks(l, m, k, [p]):=block( elimn(l,index):=block([ans, indi:map("=", index, makelist(0, n, 1, length(index)))], ans:subst([0="_"], l*map(lambda([x], if(x=1) then 0 else 1), subst(indi, makelist(n, n, 1, length(l)))/makelist(n, n, 1, length(l)))), if(not(emptyp(p))) then return(delete("_", ans)) else return(ans)), elimn(l, makelist(n, n, m, k))), if(h=s and emptyp(p)) then return(cut_flanks(l,m,k)) else if(h=s and not(emptyp(p))) then return(cut_flanks(l,m,k,t)) else if(h=f and emptyp(p)) then return(cut_segment(l,m,k)) else if(h=f and not(emptyp(p))) then return(cut_segment(l,m,k,t)));
(%o1) cut(l, m, k, h, [p]) := block(cut_segment(l, m, k, [p]) := 
block(elimn(l, index) := block([ans, indi : 
map("=", index, makelist(0, n, 1, length(index)))], 
                       l subst(indi, makelist(n, n, 1, length(l)))
ans : subst([0 = "_"], -------------------------------------------), 
                              makelist(n, n, 1, length(l))
if not emptyp(p) then return(delete("_", ans)) else return(ans)), 
elimn(l, makelist(n, n, m, k))), cut_flanks(l, m, k, [p]) := 
block(elimn(l, index) := block([ans, indi : 
map("=", index, makelist(0, n, 1, length(index)))], 
ans : subst([0 = "_"], l map(lambda([x], if x = 1 then 0 else 1), 
subst(indi, makelist(n, n, 1, length(l)))
-----------------------------------------)), 
      makelist(n, n, 1, length(l))
if not emptyp(p) then return(delete("_", ans)) else return(ans)), 
elimn(l, makelist(n, n, m, k))), if (h = s) and emptyp(p)
 then return(cut_flanks(l, m, k)) else (if (h = s) and (not emptyp(p))
 then return(cut_flanks(l, m, k, t)) else (if (h = f) and emptyp(p)
 then return(cut_segment(l, m, k)) else (if (h = f) and (not emptyp(p))
 then return(cut_segment(l, m, k, t))))))
(%i2) find(s,l,h,[p]):=block([ans:[], rep:[], final:[], parts:makelist(part(l, makelist(n, n, 1+m, length(s)+m)), m, 0, length(l)-length(s)), res, count:0, pos:[]], for n:1 thru length(parts) do  (ans:append(ans, [map(lambda([x], if(is(x)) then lhs(x)), map("=", part(parts, n), s))])), for i in ans do (if(freeof(false, i)) then (res:i)), count:length(delete([], map(lambda([x], if(freeof(false, x)) then x else []), ans))), for i:1 thru length(ans) do (if(freeof(false, ans[i])) then pos:append(pos, [[i, i+length(ans[i])-1]])), if(h=f) then (if(not(emptyp(p))) then print(ans) else (print(res, ":", count), [pos])) else (for i in pos do (rep:append(rep, makelist(n, n, lmin(i), lmax(i)))), final:map(lambda([x], if(member(x, rep)) then l[x] else "_"), sublist_indices(l, atom)), return(final)));
(%o2) find(s, l, h, [p]) := block([ans : [], rep : [], final : [], 
parts : makelist(part(l, makelist(n, n, 1 + m, length(s) + m)), m, 0, 
length(l) - length(s)), res, count : 0, pos : []], 
for n thru length(parts) do ans : append(ans, 
[map(lambda([x], if is(x) then lhs(x)), map("=", part(parts, n), s))]), 
for i in ans do if freeof(false, i) then res : i, 
count : length(delete([], map(lambda([x], if freeof(false, x) then x else []), 
ans))), for i thru length(ans) do if freeof(false, ans )
                                                      i
 then pos : append(pos, [[i, i + length(ans ) - 1]]), 
                                           i
if h = f then (if not emptyp(p) then print(ans)
 else (print(res, ":", count), [pos])) else (for i in pos do rep : 
append(rep, makelist(n, n, lmin(i), lmax(i))), 
final : map(lambda([x], if member(x, rep) then l  else "_"), 
                                                x
sublist_indices(l, atom)), return(final)))
(%i3) M:[C,A,T,G,C,A,T,C,A,T,C];
(%o3)                  [C, A, T, G, C, A, T, C, A, T, C]
(%i4) M;
(%o4)                  [C, A, T, G, C, A, T, C, A, T, C]
(%i5) "";
(%o5) 
(%i6) find([C,A,T], M, f);
[C, A, T] : 3 
(%o6)                     [[[1, 3], [5, 7], [8, 10]]]
(%i7) "";
(%o7) 
(%i8) find([C,A,T], M, t);
(%o8)                  [C, A, T, _, C, A, T, C, A, T, _]
(%i9) cut(M, 1, 3, s);
(%o9)                  [C, A, T, _, _, _, _, _, _, _, _]
(%i10) cut(M, 5, 7, s);
(%o10)                 [_, _, _, _, C, A, T, _, _, _, _]
(%i11) cut(M, 8, 10, s);
(%o11)                 [_, _, _, _, _, _, _, C, A, T, _]
(%i12) find([C, A, T], M, f);
[C, A, T] : 3 
(%o12)                    [[[1, 3], [5, 7], [8, 10]]]
(%i13) find([C, A, T], M, t);
(%o13)                 [C, A, T, _, C, A, T, C, A, T, _]
(%i14) find([C,A,T], find([C,A,T], M, t), f);
[C, A, T] : 3 
(%o14)                    [[[1, 3], [5, 7], [8, 10]]]
(%i15) find([c,a,t], map(lambda([x], parse_string(sdowncase(string(x)))), M), t);
(%o15)                 [c, a, t, _, c, a, t, c, a, t, _]
(%i16) ssearch("CAT", simplode(M));
(%o16)                                 1
(%i17) ssearch("CAT", simplode(M), 2);
(%o17)                                 5
(%i18) ssearch("CAT", simplode(M), 6);
(%o18)                                 8
(%i19) 

Related Help

Help for Sdowncase