Minor bio error here:  The transcribed RNA is in the same frame as the DNA (template DNA strand is read 3' to 5' direction, thus resulting RNA is 5' to 3', same as template).  Thus this should be: A -> A, T -> U, G -> G, C -> C.  But your code is otherwise consistent.