cancel
Showing results for 
Search instead for 
Did you mean: 

New bioinformatic coding problem (very simple) for scripting folks

former_member181923
Active Participant
0 Kudos

In Post 2 on this wiki page:

https://wiki.sdn.sap.com/wiki/display/EmTech/Bio-InformaticBasicsInRelationtoScriptingLanguages

I've stated the following very simple bioinformatic coding problem:

*************************************************************

Given a string containing just the letters a, c, g, and t:

a) reverse the order of the string;

b) move along the reversed string replacing a with t, c with g, g with c, and t with a.

(Assume that the input string can be lower or upper case and provide your output in lower as well as upper case.)

*****************************************************************

Any code snippets posted here will be posted on the wiki page given above.

Thanks for any and all contributions - I'd like to get a solution from each scripting language, if possible.

Best regards to all

djh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

$instring = "acttgGGTcaAAttAg";
echo strtr(strrev($instring),  "acgtACGT", "tgcaTGCA");
former_member181923
Active Participant
0 Kudos

Anton -

Thanks very much! It may seem trivial to you, but it's "huge" to me.

Because "from little acorns, big oak trees grow". (In other words, if you weren't willing to give answers to the simple ones, there's no chance of getting answers from you for the interesting ones!)

Speaking of "interesting" ones, please keep an eye out in this Forum for the first "interesting" one that should be posted no later than 16 June (Monday). Before posting it, I have to finish defining "protein secondary structure" in the wiki - once I do that, I can state the first "interesting" problem, or at least, "reasonably interesting" problem.

Regarding your solution above:

1) please forgive my ignorance, but what language? Is it shell of some kind?

2) can you give a version that takes an input "txt" or "dat" file? (Don't want to "push" you but that would be helpful.

Thank you very very much again.

As I said, I hope to be able to challenge you with some things that are more fun to think about.

And again, not to push you, but if you want to work on the other problem here (codons to amino acids), that would be super!

Best regards

djh