Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: all permutations of given lenght

by Anonymous Monk
on Aug 11, 2020 at 07:55 UTC ( [id://11120596]=note: print w/replies, xml ) Need Help??


in reply to all permutations of given lenght

O=C(O)C(N)CCC/N=C(\N)N, O=C(N)C[C@H](N)C(=O)O, O=C(O)[C@@H](N)Cc1cncn1
That's SMILES! What are you actually trying to do?

Replies are listed 'Best First'.
Re^2: all permutations of given lenght
by cataclismic_user (Novice) on Aug 11, 2020 at 08:08 UTC
    Indeed! I am trying to generate an exhaustive list of SMILES codes, including their repetitions. I have tried
    use strict; use warnings; use Algorithm::Combinatorics qw(permutations); my $strings = [qw(A B C)]; my $iter = permutations($strings, 3); while (my $c = $iter->next) { print "@$c\n"; }

    The problem is that it does not generate things like AAA, BBB, CCC [A, B, C would be the corresponding SMILEs).

      I am trying to generate an exhaustive list of SMILES codes, including their repetitions.
      permutations are reorderings, i.e. samples without replacement. You seem to want all possible samples with replacement, i.e. variations_with_repetition.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120596]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-20 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found