LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

count specified letters

Hello LabView-Community,
i have a question which is very easy for you i think.
i have a sequence in a string, for example "ACGTAA". Now i want just to now how many A´s, C´s, G´s and T´s are in it. In this case A=3, C=1, G=1, T=1. Yes, you have right, i´m really a beginner 😉
Do you know a VI for it or have a info for me?

Thanks, Bye
Flo
0 Kudos
Message 1 of 9
(3,170 Views)
try using the match pattern function under the string palette. If you place this in a loop and search until the offset past match is -1 you will see how many iterations of the loop have executed and that will tell you how many letters you have. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 9
(3,170 Views)
Thank you very much for your fast answer,
i´ll try this.

Best regards,
Flo
0 Kudos
Message 3 of 9
(3,170 Views)
There's a simpler way to do it. Convert the string to a character array. Sort the array. Step through the array looking for changes (from one character to the next) and count the number of characters between the breaks. See the attached VI. Cheers.

- Jim Cavera
0 Kudos
Message 4 of 9
(3,170 Views)
Thanks, you are great!
I just have a little problem - don´t have LV 7...
But i will try it.

Thank you very much,
Cheers,
Flo
0 Kudos
Message 5 of 9
(3,170 Views)
Hello Flo and all,

This is a great little example program! Good documentation.

I saved it for LabVIEW 6.0 and later for your use.

Hope this helps!

Liz F
National Instruments
0 Kudos
Message 6 of 9
(3,170 Views)
Hello Flo and all,

This is a great little example program! Good documentation.

I saved it for LabVIEW 6.0 and later for your use.

Hope this helps!

Liz F
National Instruments
0 Kudos
Message 7 of 9
(3,170 Views)
Hi and thanks, i had just a problem with opening the file. But it doesn´t metter, i´ll try it myself.
Thanks again.
Bye,
Flo
0 Kudos
Message 8 of 9
(3,170 Views)
Hi Liz F,
now it worked. Great!
Thank you very much!

Cheers,
Flo
0 Kudos
Message 9 of 9
(3,170 Views)