Counting a character in MS-Excel (Mac)

Andy Law Big Nose Andy.Law at bbsrc.ac.uk
Thu Aug 24 12:16:01 EST 1995


In article <v01510100ac62011a3143@[143.48.11.21]>, lodhi at CSHL.ORG
(Muhammad Lodhi) wrote:

  > Does anyone know how to count a particular character ,e.g., 'A' or 'C' from
  > an oligo sequence in an Excel cell?  I am trying to develop a sheet to
  > calculate Tm, concentration , etc. of oligos that we use in our primer
  > walking.  If someone already has anything like that for Mac, I 'll
  > appreciate for the pointers.  Thanks in advance
  > Muhammad A. Lodhi
  > Cold Spring Harbor Lab.

There are several ways you could do this, depending on the way that you
calculate the Tm etc of your oligo. For example, if your calculation is
the standard 2 x (A+T) + 4 x (C+G) [or whatever it is, I forget for now],
you could define a macro that takes the oligo sequence as its argument and
steps through the sequence one by one, adding the requisite temperature
step as it goes. You could either do that as a series of IF statements, or
use a lookup array. The lookup array would be the most flexible as you
could then handle non ACGT bases in whatever way you chose.

Alternatively, you could design a macro that had two arguments, one the
sequence and the other the character that you wanted the count of. That
has the disadvantage that you would be stepping right through the sequence
for every base that you were looking for.

Details on writing macros are in the Excel User's Guide 2.
-- 
Andy Law

( Andy.Law @ bbsrc.ac.uk )
( Big Nose in Edinburgh )




More information about the Bio-soft mailing list