
Below is the code we used to transform DNA to time series.



The most upto date Human DNA is here: 

http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=9606&lvl=3&lin=f&keep=1&srchmode=1&unlock



Here is a sample contig from Homo sapiens chromosome 2 

http://www.ncbi.nlm.nih.gov/nuccore/NT_005334.15?report=fasta&from=1&to=11088087





In this folder we have attached some sample DNA files...


1) The Contig NT_005334.15 of human chromosome 2
2) A snippet of mDNA from a Hippo  Hippopotamusamphibius.txt
3) A snippet of mDNA from a Polar bear Ursus maritimus.txt








%********** Paste the Below into a Matlab Function ****************



function time_series = DNA2TimeSeries

time_series = 0;

fileName = input ( 'File name?  ','s');

fid = fopen(fileName,'rt');
DNA_STRING = fgets(fid);
fclose(fid);

   for i = 1 : length(DNA_STRING)

        if  DNA_STRING(i) =='a'   | DNA_STRING(i)== 'A'
            index = 2;
        elseif DNA_STRING(i)=='g' | DNA_STRING(i)=='G'
            index = 1;
        elseif DNA_STRING(i)=='c' | DNA_STRING(i)=='C'
            index = -1;
        elseif DNA_STRING(i)=='t' | DNA_STRING(i)=='T'
            index = -2;
        else
            disp('Found a non A,T,C,G!!!')
            index = 0;
        end
              
        time_series(i+1) =  time_series(i) + index;
        
   end  
    
    figure;
    hold on
    title(fileName)
    plot(time_series)