Write a script which allows the user to insert strings within another string.
Mutations
Mutations are changes which occur in a DNA sequence. They can be changes to a single nucleotide in the form of an insertion, a deletion, or a substitution of just one nucleotide. Insertions, deletions, and substitutions of more than one nucleotide can also occur. Sequences can sometimes get copied from one point in the genome to another or sometimes sequences from a virus, for instance, can get spliced into the nucleotide sequence in a cell. These sequences can, if they are inserted in the middle of a gene sequence, disrupt the gene and render it non-functional. Most often a cell containing a mutation will die or be unable to replicate, but sometimes it will survive to generate daughter cells. If a mutation occurs in germline cells, it is possible that the mutation could be copied to the offspring of an organism.
Single nucleotide insertions or deletions will result in what is known as a frameshift if they occur within an exon of a gene. This will mess up the codon sequence so that the amino acid sequence is totally different and the resulting protein most likely will no longer work.
Splicing
The splice function allows you to insert items into an array.
Slicing
Not to be confused with splicing is slicing:
ASSIGNMENT:
Write a script which allows the user to insert a sequence within another
sequence. This script must use the splice function to do the actual
insertion, which means that source and destination must be arrays as opposed
to strings. (Don't forget that it's pretty easy to convert from array to
string and vice versa.) Allow the user to do the following things: