"); //throw in some buttons win_doc.write("

"); win_doc.write(""); win_doc.write(""); win_doc.write("


"); //start the portion the copy button will copy win_doc.write(""); //print the corresponding flags selected by the user in the options section print_flags(OpenWindow, form_dna); //select the courier font since it aligns the characters each the same win_doc.write(""); //print the sequences to fit the window: screen_width in width... for( index=1; (index*width) <= form_dna.length; index++ ) { //if the user wishes to display the nucleic acid... if( options.display_NA.checked == true ){ //if the user wishes to see the leading base position... if( options.display_width.checked == true ) { win_doc.write( format_number_dna((index-1)*width) ); } win_doc.write( form_dna.substring((index-1)*width,(index*width)),"
" ); } //if the user wishes to display the protein sequence... if( options.display_protein.checked == true ) { //print appropriate spaces for the protein, get protein sequence, //clean it, and print it to the screen... //if the user wishes to see the leading base position, need to include extra spaces... if( options.display_width.checked == true ) { win_doc.write( format_number_protein() ); } //get appropriate protein sequence and print it... protein_slice = clean_protein_seq(form_protein.substring((index-1)*width,(index*width)) ); win_doc.write( protein_slice,"
" ); } //print an extra line to make it look nice on the screen win_doc.write("
"); } //if the dna sequence is not an exact multiple of screen_width, print the remaining sequence... if( form_dna.length%width != 0 ) { //if the user wishes to display the nucleic acid... if( options.display_NA.checked == true ){ //if the user wishes to see the leading base position... if( options.display_width.checked == true ) { win_doc.write( format_number_dna((index-1)*width) ); } //print the nucleic acid sequence win_doc.write( form_dna.substring((index-1)*width,form_dna.length),"
" ); } //if the user wishes to display the protein sequence... if( options.display_protein.checked == true ) { //if the user wishes to see the leading base position, add in appropriate spaces... if( options.display_width.checked == true ) { win_doc.write( format_number_protein() ); } //print protein sequence protein_slice = clean_protein_seq( form_protein.substring((index-1)*width,form_protein.length) ); win_doc.write( protein_slice,"
" ); } //add in an extra line break win_doc.write( "
"); } //write remaining HTML form... win_doc.write("
"); win_doc.write("
"); win_doc.write(""); win_doc.write("
"); //throw in a couple more buttons at the bottom... win_doc.write("

"); win_doc.write(""); win_doc.write(""); win_doc.write("

"); win_doc.write("
Hosted by www.Geocities.ws

"); } //////////////////////////////////////////////////////// // END OF PRINTING FUNCTIONS //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// // MAIN FUNCTION WHICH CALLS FUNCTIONS ABOVE //////////////////////////////////////////////////////// //main function which obtains the dna sequence, translates it, and prints out both sequences function trans_and_format(form_ID_DNA) { //obtain the offset value to be used throughout translation // offset_value=conversion.offset_num.value; //first check to make sure a dna sequence exists if( verify_input_size(form_ID_DNA, 1, Number.MAX_VALUE) && (options.display_NA.checked || options.display_protein.checked) ) { //obtain, capitalize, and clean the dna sequence var clean_dna=clean( form_ID_DNA.value.toUpperCase() ); //check conversion setting: reverse-complement if( conversion.display_reverseComplement.checked == true ) { //reverse... clean_dna=reverse(clean_dna); //complement... clean_dna=complement(clean_dna); } //get the protein sequence var protein=translate(clean_dna, offset_value); //check to make sure an extra ORF wasn't added on checkLastOrf(protein); //check conversion setting: RNA conversion //must be done after translation, since the translation function only recognized DNA, not RNA if( conversion.display_RNA.checked == true ) { clean_dna=clean_dna.replace(/T/g, "U"); } //print the two sequences print_dna_protein(clean_dna, protein) } //if no DNA is present... else{ alert("No DNA or protein sequence can be displayed."); } } //////////////////////////////////////////////////////// // END OF MAIN FUNCTION AREA //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// // OPTIONS FUNCTIONS //////////////////////////////////////////////////////// // - COUNT_LETTERS(STRING_SEARCH, ARRAY_CHARACTERS_TO_FIND) //this function determines the total percent a set of letters appears in a string //both strings are passed in, first is the string to check, second is the characters to find/enumerate //for this 'program' it is used to calculate GC content function count_letters(string_to_count, chars_to_find) { //variables to hold value of count var content=0 //search the entire string looking at each member of the to_search_for list for( var i=0; i

DNA Translator and formating webpage



Name of DNA sequence: 

Reading frame offset:  0,  1, or  2

Conversion Settings:  Convert to RNA,  Show reverse-complement 

DNA sequence:
  -  must be between 1 and 1.79E+308 characters long
  -  annotation at top must be manually removed
  -  numbers and non-DNA characters will be removed automatically. List of DNA characters.

                                                                                

                                                                                


Display options: (To be included in the output file)

Name of DNA,  Length of DNA,  GC content,  Number of ORFs,  Reading frame offset value. 

Nucleic acid sequence  and/or   Protein sequence.  (You must choose at least one, or nothing will display.)
Number of DNA bases (or amino acids) per line (between 10 and 999):     Show leading position numbers.
Character for unknown amino acid:


Hosted by www.Geocities.ws

1