Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Character Offset to Randomize Specific Pairs of Letters

Community Beginner ,
Mar 14, 2022 Mar 14, 2022

I'd like the bottom left text to do the same as the top right, but the randomized text should be limited to "ATCG" in pairs (e.g. "AATTCCGG), instead of numbers. Is there a way to do this with expressions? Preserve Case &  Digits seems to keep the random text to pairs, but I'm not sure how to make an expression so that the pairs are limited to As, Ts, Cs, and Gs. Thansk!

 

TOPICS
Expressions , How to , Scripting
428
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 14, 2022 Mar 14, 2022

You have to create a source text expression that's pulling these characters e.g. from an array. Not sure why you would want double letters, though. DNA base pairs are always specific and the same base type can't pair. Your second callout would merely be a random arrangement of ATs and GCs. anyway, here's something you might use:

 

mPairs=[AC,GT,AC,AC,GT];

mChange=3;

mSeed=Math.floor(time/framesToTime(mChange));

 

seedRandom(index+mSeed)

mIndex=Math.round(random(0,mPairs.length);

 

mPairs[mIndex]

 

Modify as you need like tying it to a slider or such...

 

Mylenium

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 17, 2022 Mar 17, 2022
LATEST

If you own iExpressions, you can use the Random Letter Wipe iExpression, which contains a customizable alphabet.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines