r/LabVIEW • • Sep 15 '15

Help with a Labview program?

So I have a project in my engineering class where I have to create a program that reads rna sequences in a text file, identify the palindromes of length X or greater (X determined by user input), and either (a) strip the palindromes from the original text file by writing a new, "clean" text file, or (b) writing the list of found palindromes to a new text file, each separated by a comma.

My progress is the ability to test for a palindrome based on user input, but I don't know how to find it by reading a text file and for different lengths

can anybody give a tip or advice? Thanks!

0 Upvotes

5 comments sorted by

View all comments

1

u/[deleted] Sep 15 '15

Is the RNA data in the text file comma-delimited? What's the formatting? Is it one long string? Rows of length N? Posting an example of the data you have to work with would be helpful.

1

u/[deleted] Sep 15 '15

It's one long string. My professor didn't give any example but he expects the program to be able to work for any given sequence

1

u/[deleted] Sep 15 '15

Well, I suppose that makes things a bit easier in that you don't have to worry about formatting.
Just be aware that GAATTC != gaattc, so when you read the string from the file, you'll want to use the 'To Upper Case' or 'To Lower Case' string functions to ensure that you're making an apples-to-apples comparison.
Dealing with strings can be somewhat annoying, but look at the functions available on the String palette and you'll find a lot of options for searching and matching. as /u/fuckingpewpew pointed out, the Example Finder (Help -> Find Examples...) has loads of good stuff to use as a starting point.