// ############################## START FUNC ############################################ function over_all1() { // ######################################### var covalent_radii = new Array(0); // N*4 matrix covalent_radii = set_radii_matrix(1.3); var atom_sorts = new Array(0); var x = new Array(0); var y = new Array(0); var z = new Array(0); var atom_sorts=read(1,1000000,1,1); x=read(1,1000000,2,2); y=read(1,1000000,3,3); z=read(1,1000000,4,4); var sumstring = mass_point(atom_sorts,x,y,z); var helpv=new Array(0); helpv=sumstring.split("&&"); sumstring=helpv[0]; var MW=parseInt(helpv[1]); var dist_table = new Array(0); dist_table= intra_molecular_distances(atom_sorts, x,y,z); var con_table = new Array(0); con_table=intra_molecular_connections(atom_sorts, dist_table, covalent_radii); var connections = neighbours(con_table); connections=sort_connections(connections, atom_sorts); var branch4 = new List(4, connections, atom_sorts); var branch3 = new List(3, connections, atom_sorts); var allcarbon = new List("carbon4", connections, atom_sorts); var branchlist = new List("branch", connections, atom_sorts); var pot_ring_atom = new List(2, connections, atom_sorts); var poschir = new List("chir", connections, atom_sorts); var double_bond_atoms = new List("double", connections, atom_sorts); var triple_bond_atoms = new List("triple", connections, atom_sorts); var carbonyle_atoms = new List("carbonyle", connections, atom_sorts); var fattyends = new List("ends", connections, atom_sorts); var conj_end = new List("cunjugate_end", connections, atom_sorts); var branchstop= new List("branch3", connections, atom_sorts); var n_two_bond_atoms = pot_ring_atom.Span(); // If there are no branches in the molecule one pot_ring_atom is added as start // atom for ring calculations if(branchlist.Span()==0) branchlist.l[pot_ring_atom.First()]=true; // ... branchlist.Add(pot_ring_atom.First()); does not work - unbelivible // multibonds is a vector. Note that branch eyes MAY (unlikely) create duplicates on som atoms. var multibonds = d_t_bonds(conj_end, connections, atom_sorts, double_bond_atoms, triple_bond_atoms, branchstop); multibonds = determine_muliple_bonds(multibonds, atom_sorts, double_bond_atoms, triple_bond_atoms); var ringcollection = rings(x.length, branchlist, connections); var a_list=""; var red_list=""; var ringatoms=""; if(ringcollection!=""){ ringcollection=clear_rings(ringcollection); ringatoms=ringcollection; helpv=ringatoms.split("#"); ringatoms=" "+helpv.join(" ")+" "; ringcollection = calculate_ring_centra(ringcollection, x, y, z, atom_sorts, double_bond_atoms, triple_bond_atoms, multibonds); helpv=ringcollection.split("?"); if(helpv.length>1) a_list=helpv[1]; if(helpv.length>1) red_list=ar_red(a_list); sumstring=sumstring+helpv[0]+"#"; // Suddenly it does not work to retrieve 2 values from one function and the ugly // split above is necessary } var chirmax=prepare_chir(atom_sorts, connections, poschir); chirmax=chirmax+2; // Necessary because // 1) function "chirality" starts from the chiral atom, not its neighbour. // 2) Because double bonds are marked after the development out to another neighbour. // The +"#" undo the final action in the subroutines, but creates clean output. var chirstring= chirality(poschir, branch3, branch4, double_bond_atoms, triple_bond_atoms, connections, n_two_bond_atoms, atom_sorts, multibonds, chirmax); if(chirstring!=""){ chirstring=substitute(chirstring, atom_sorts); // Here cis- trans- paths can be extracted multibonds,c_t_string = cis_trans(multibonds, chirstring, atom_sorts, connections, x, y, z,a_list); // multibonds must be first. JavaScript seems to fail with an vector last if(c_t_string!="") sumstring=sumstring+c_t_string+"#"; chirstring = dim3mak(chirstring, poschir, atom_sorts, connections, x, y, z, allcarbon); if(chirstring!="") sumstring=sumstring+chirstring+"#"; // (new chirstring) } // ******************** New List Object ************************ var fatty = new List("fat", connections, atom_sorts, ringatoms); // ************************************************************* var features = groups(atom_sorts, carbonyle_atoms, connections, double_bond_atoms, fattyends, fatty, x,y,z, a_list, ringatoms, red_list); if(features!=""){ features = recognize_features(features,MW); sumstring=sumstring+features+"#"; } // Does finally remove duplets and put some simple functional groups in sumstring=complete(sumstring, atom_sorts, multibonds, x, y, z, a_list); var temparray=sumstring.split("#"); sumstring=temparray.join("\n"); document.form1.text1.value=sumstring; return; // ######################################### } // ############################### end func ############################################