Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatching Logic #1

Open
gmkarl opened this issue Apr 9, 2019 · 1 comment
Open

Mismatching Logic #1

gmkarl opened this issue Apr 9, 2019 · 1 comment

Comments

@gmkarl
Copy link

gmkarl commented Apr 9, 2019

Hey,

I'm confused by a line of logic in the code.

On line 49, the code waits until it picks a set of codons that are found within the last sequence:

if(RandomCodonSet %>% grep(sequences[x], fixed = TRUE) %>% length > 0){

Then once this check passes, it randomly samples all generated sequences to pick one to replace the sequence in:

Newseed <- str_replace(sequences[sample(1:x, 1)], RandomCodonSet, ReplacementCodonSet)

This seems to mean that it may not replace anything at all, because it will usually randomly pick a sequence different from the one that matched.

Is this the intended behavior?

@AABoyles
Copy link
Member

I tried re-writing this passage once before, and it broke the sequence generation in a way I didn't anticipate or understand. (I didn't write the original logic--I just packaged what was an internal R script in our department.) If you can tweak it such that it continues to generate sequences with the same statistical properties, be my guest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants