// ############################## START FUNC ############################################ // This function follows all traces from possible chirality centra. // There can be an seldomly occuring priority error concerning branches vs double bonds, // which makes a simple fix in marker thjalp1 necessary for appropriate behaveor. The time // lacks for me right now. function chirality(poschir, threebranches, fourbranches, doubl_b, tripl_b, mconn, n_two_bond_atoms, atom_sorts, multibonds, chirmax) { var number_of_atoms=atom_sorts.length; var string_vector_1 = new Array(number_of_atoms); var string_vector_2 = new Array(number_of_atoms); for(n=0;n0 && string_vector_1.join("")=="") break; for(n=0;n-1))){ for(m=0;m"+mconn[n][q]+" "; back_direction=" "+mconn[n][q]+"->"+n+" "; // The string is never builded in a returning track, like "3->2 2->3" // The last parenthesis below is for cis- trans-. Such atoms must not be tracked over the base C=C bond if(single_trace[m].indexOf(back_direction)==-1 && atom_sorts[mconn[n][q]]>1 && (p>0 || parseInt(multibonds[n].substring(2,multibonds[n].length))!=mconn[n][q])){ if(single_trace[m].indexOf(actual_direction)==-1){ // In order to recognize cis- trans paths for extraction if(p==0 && multibonds[n]!="") single_trace[m]="x"; // To not fallow new rings when old are completed (the if-condition). if(single_trace[m].indexOf(" "+n+"-")==-1) string_vector_2[mconn[n][q]]=string_vector_2[mconn[n][q]]+single_trace[m]+actual_direction+"&"+thjalp1+" #"; } else{ // The fallowed path in the ring complex a proper number of times cleantemp=single_trace[m]; prefix=""; if(cleantemp.charAt(0)=="x"){ cleantemp=cleantemp.substring(1,cleantemp.length); // cis- trans- prefix="x"; } collect_variable=collect_variable+prefix+string_mult(cleantemp,Math.abs(n_two_bond_atoms/5))+"#"; } thjalp++; } } // If the string was not built on and sent to any neighbour atom, it is deposited here instead. // This is the case for end atoms like -CH3 or -Cl with their respective string history if(thjalp==0) collect_variable=collect_variable+single_trace[m]+"#"; } } } for(n=0;n