// いいいいいいいいいいいいいい Defining the List-object いいいいいいいいいいいいいい // In this object function several strings can be created. The virtual strings list atom-ID // for all atoms which fits in their respective category. string.Display() shows the "string" // Variables in this function are: // Integers: n, qm, mem, sz, as // Integer number matrix: connections, atom_sorts // Logical matrix this.l // Mixed variable def function List(def, connections, atom_sorts, rings) { this.l = new Array(atom_sorts.length); this.Display=Display; this.Add=Add; this.Check=Check; this.Span=Span; this.First=First; var n=0; var sz=0; var as=0; if(def!="empty"){ for(n=0;n3 && atom_sorts[connections[n][3]]>1) this.Add(n); break; case 3: // Remember that the connections are sorted wih respect to atom sort if(sz==3 && atom_sorts[connections[n][2]]>1) this.Add(n); if(sz==4 && atom_sorts[connections[n][2]]>1 && atom_sorts[connections[n][3]]==1) this.Add(n); break; case "branch": // ie case 4 OR case 3 if(sz>2 && atom_sorts[connections[n][2]]>1) this.Add(n); break; case "carbon4": // like the central all carbon binding carbon in morphine (can be chiral) var mem=0; var q=0; if(sz==4 && as==6){ // well for(q=0;q1) mem++; } if(mem>1) this.Add(n); break; case "branch3": // Like case = 2, but for branches which does not end instantly -> mem>2 // This is necessary to make the judgements when a conjugated area is scrutinized. var mem=0; var q=0; var asa=0; var bsa=0; for(q=0;q2) this.Add(n); break; case "fat": // Carbons that can build a fatty complex. They do not link to other molecules then H & C, // for simplicity. Ring atoms are excluded if(as==6 && rings.indexOf(" "+n+" ")==-1){ var mem=0; var q=0; for(q=0;q0) q=q.substring(0,q.length-1); return (q); } // ------------------------Add---------------------------- // Adds a atom to the virtual list function Add(jr) { this.l[jr]=true; } // ------------------------Check-------------------------- // Returns true if the atom is on the virtual list, else false function Check(jr) { if(this.l[jr]){ return true; } else{ return false; // Which covers also "undefined" } } // いいいいいいいいいいいいいい End definition List-object いいいいいいいいいいいいいい