G
George George
Hello,
Given a string,
"gcgggcgggccgcggaaattacta" it may so happen that the gcgg substring is
very important and it is repeated in strings of this nature.
I would like to replace all occurrences of "gcgg" with a new symbol call
it B such that I can reduce the initial text to BggcgggccBaaattacta.
While i know it is possible to accomplish that using regular expressions
and substitution,my wider aim is to develop a grammar for such a
string,using a finite alphabet for example {A,G,C,T} in this case. Where
A,G,C,T are terminal symbols and B is a nonterminal symbol. Ideally I
would like to have a set of Production rules for generating such
strings.
How easy or relevant is it to use ruby for deriving stochastic grammars
and linguistics? Are there existing libraries for doing such things in
ruby?
I am new to the world of grammar and stuff so please bear with me
Thank you.
George
Given a string,
"gcgggcgggccgcggaaattacta" it may so happen that the gcgg substring is
very important and it is repeated in strings of this nature.
I would like to replace all occurrences of "gcgg" with a new symbol call
it B such that I can reduce the initial text to BggcgggccBaaattacta.
While i know it is possible to accomplish that using regular expressions
and substitution,my wider aim is to develop a grammar for such a
string,using a finite alphabet for example {A,G,C,T} in this case. Where
A,G,C,T are terminal symbols and B is a nonterminal symbol. Ideally I
would like to have a set of Production rules for generating such
strings.
How easy or relevant is it to use ruby for deriving stochastic grammars
and linguistics? Are there existing libraries for doing such things in
ruby?
I am new to the world of grammar and stuff so please bear with me
Thank you.
George