// ############################## START FUNC ############################################ // Here is the main function that loopes through all molecules and gathers the information. // Missing information pieces are calculated in routines and put in. So if there is no // bit string in frame1, frame2 is checked. If feature information is availible in frame2 // it is converted to a bit string by calling the function over_all2. If there is no information // in frame2 either, frame3 is checked for information about cartesian coordinates of the atoms. // This information is (by calling the function over_all1) converted to input information for // the function over_all2 and so on. The objective is to get a final bitstring for each molecule // placed in bitstrings[n] where n is the row for the molecule in the file list. function mega2(bitstrings,f_ligands,f_ex,angle_intervals,dist_intervals,groups,files, g_commands, saved) { // Please note that f_ex is the table for features vs feature numbers according to // the feature_list in the main map. var bit_string=""; var save=document.form1.save.checked; var convert=document.form1.cb.checked; var texx=document.form1.tex.checked; var tupp=new Array(0); var temp=""; // First, the frame 1 is checked for content. If there is content it will be a bitstring // which can then just be read into the memory. if(verify_frame_content(1)){ transfer(2); bit_string=read(1,1000000,1,1); } // If frame 1 has no content, it means that no bitstring information are availible. It // must then be calculated, either from a feature file, or from the base file for the // cartesian coordinates for the atoms whithin the molecule. else{ //--------------------- // If frame 2 has content there are a feature file stored for the molecule if(verify_frame_content(2)){ transfer_and_mod(2, f_ex); over_all2(f_ex,angle_intervals,dist_intervals,groups, g_commands); bit_string=read(1,1000000,1,1); } else{ // If not, there are no direct bitstring information and no direct information availible. // All this information must be calculated from scratch, first by calculating features, // then by calculating a bitstring. //******************* if(verify_frame_content(3)){ transfer(3); over_all1(); // calculating features transfer_and_mod(100, f_ex); if(save) saved=saved+"\n\n"+files[g_commands[3]]+"\n"+document.form1.text1.value; over_all2(f_ex,angle_intervals,dist_intervals,groups, g_commands); // calculating bitstring bit_string=read(1,1000000,1,1); } else{ alert("No files on: "+files[g_commands[3]]); // In this case no file is availible at all. } //******************* } //--------------------- } // The bitstring is now hopefully stored in the singular variable bit_string. For comparation // of different bitstrings, it must be transferred to a 1 dim vector as bitstrings[N] where // -1 < N < number of molecules. bitstrings[g_commands[3]]=bit_string; g_commands[3]++; // This is the molecule counter. Prepare for next loop and next molecule. // ^^^^^^^^^^^^^^^^^marker^^^^^^^^^^^^^^^^^^ if(g_commands[3]"; parent.right.document.write(saved); saved=""; } mega3(bitstrings,files, f_ex); // in this case the counter = the number of mulecules. // Then it is time to compare all bitstrings. } } // ############################### end func ############################################