Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Text Pattern and Calculation

Featured Replies

Hi,

As a disclaimer, I'm a Geneticist by training and my FM skills are not skills at all.

I'm setting up a database in my lab for oligonucleotides (small stretches of DNA that contain A, G, T or C in random sequence). The length of the oligo is usually between 12 and 80 bases (characters) long.

One of the key calculations in an oligo database is the melting temperature, which is directly affected by the number of G and C as opposed to A and T.

In my database, I have an input text field that hold the sequence of the oligo.

From this how do I calculate the number of A, T, G and C in the text string.

For eg. a typical sequence is the following

AATGGCGCGCTGGATCGATGCTTTAATTAG

What functions can I call that will break this string and give the requires number of each base (character) ? I can subsequently use that amount with a standard mathematical calculation to arrive at the melting temperature.

I checked around in the forums, and saw some examples of using the Substitute function, but that was way beyond me.

Thanks for all the help

Indy

[color:"red"] [color:"#666666"]

Hmmm, how about this:

Make a field that holds the base you want to count - I'll call it Base

Make a field to hold the nucleotide string - I'll call it Oligo

Make a calc field that counts the amount of character type specified in the Base field. Call it BaseCount.

The calc is: PatternCount(Oligo, Base). Result should be number, do not store.

This is a very interesting project it seems!

Ken

  • Author

Thanks Ken,

That was all it took. Worked perfectly. I'm surprised as to how straightforward these functions are. Extremely helpful for a newbie like me.

Thanks again

Be aware that FMP has limits on its indexing, and this may affect your results. IIRC, the limits are 20 characters per word, where a word is a string of characters ending in a space or end-of-line or paragraph mark.

The is also a limit to the number of words indexed, but the number escapes me at the moment. I know LiveOak is on-the-ball with this stuff! hopefully he'll take it from here...

That's true, I didn't even think about that. I just have indexing on the field Off. Might make it slower.

How would lack of indexing create a problem here?

Does "PatternCount()" require indexing?

I dunno whether PatternCount requires indexing... I'm just flagging it as a potential problem.

Jason:

Indexing is required on foreign keys. From my understanding, the limit is 60 characters including spaces. If the field BaseCount is going to be this key, it needs to be kept within these limitations. Indexing has its advantages, as it is referenced quicker but takes up file size.

So since the field is counting the amount of times a certain letter comes up in a string of text, this would make the limit to this number 6 x 10 to the 59th, right? that should meet the initial request.

Sound right Vaughan?

Ken

Ohhhkay I think I understand now! I've never really understood much about indexing and storage, even though it doesn't seem very complicated! smile.gif

BTW: I checked in FileMaker help and it says it will index the first (up to) 20 characters of any word (without spaces), up to a max of 60 characters in a field (with spaces).

Nop, 60 chars per line.

Also PatternCount doesn't depend on string length (unless you've superated the 64k limit)

Dj

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.