Hello Perl Monks,
I am very new to Perl and I have a question. I have two input files.
In the fist file I have ID with sequence.
File1:
string1 (C)C(T)A string2 T(A)GG(A)GGG(G)
In File2, the second column gives the position where the bracket is located in File1. And the 3rd Column has the same character as located in File1 at that position. And the 4th Column gives the character that it can be replaced with the one in the 3rd Coulmn.
File2:
string1 1 C A string1 3 T C string2 2 A C string2 5 A T string2 9 G A
I looking for an output, which has all the possible combinations (provided in file2).
For example, For string1 Position1, the two characters that this position can have is C and A. Again, string1 Position8, the two characters that this position can gave is T and C. Therefore, I am looking for all the possible combinations possible between C/A and T/C. Similarly, for string2, I am looking for all the possible combinations between A/T , C/A and T/G.
Expected Output:
string1 (C)C(T)A string1 (C)C(C)A string1 (A)C(T)A string1 (A)C(C)A string2 T(A)GG(A)GGG(G) string2 T(A)GG(A)GGG(A) string2 T(A)GG(T)GGG(A) string2 T(A)GG(T)GGG(G) string2 T(C)GG(A)GGG(G) string2 T(C)GG(A)GGG(G) string2 T(C)GG(T)GGG(A) string2 T(C)GG(T)GGG(A)
I am very new to PERL would highly appreciate if somebody can help me with this.
Thank you.
In reply to Looking for Printing all possible combinations by sarkar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |