Character Offset to Randomize Specific Pairs of Letters

Community Beginner ,
Mar 14, 2022 Mar 14, 2022

Copy link to clipboard

Copied

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

Views

65

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Mar 14, 2022 Mar 14, 2022

Copy link to clipboard

Copied

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

 

 

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Mar 17, 2022 Mar 17, 2022

Copy link to clipboard

Copied

LATEST

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

Likes

Translate

Translate

Report

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