Get the desicion-tree result for the Halogen family given a series of values.
It is based in 6 qsar descriptors.

@param resultsH      Array which contains the results of each descriptor
@return              The result
172399
private static double getDTBondF(double[] resultsH) {
        double result = 0.0;
        double SE = resultsH[0];
        double PE = resultsH[1];
        double PSC = resultsH[2];
        double PIC = resultsH[3];
        double ETP = resultsH[4];
        double COUNTR = resultsH[6];

        //		System.out.println("SE : "+SE+", PE : "+PE+", PSC : "+PSC+", PIC : "+PIC+", ETP : "+ETP+", SPC : "+SPC+", COUNTR : "+COUNTR);
        result = 0.1691 * SE + 1.1536 * PE + -6.3049 * PSC + -15.2638 * PIC + -0.2456 * ETP + -0.0139 * COUNTR + 2.114;

        return result;
    }
957521
private static double getRmsd(Atom[] catmp1, Atom[] catmp2) throws StructureException{

		Matrix4d trans = SuperPositions.superpose(Calc.atomsToPoints(catmp1),
				Calc.atomsToPoints(catmp2));

		Calc.transform(catmp2, trans);

		//   if ( showAlig) {
		//      StructureAlignmentJmol jmol = new StructureAlignmentJmol();
		//      jmol.setTitle("AFPCHainer: getRmsd" + rmsd);
		//
		//      Chain c1 = new ChainImpl();
		//      c1.setName("A");
		//      for ( Atom a : catmp1){
		//         c1.addGroup(a.getParent());
		//      }
		//
		//      Chain c2 = new ChainImpl();
		//      c2.setName("B");
		//      for ( Atom a : catmp2){
		//         c2.addGroup(a.getParent());
		//      }
		//
		//      Structure fake = new StructureImpl();
		//      fake.setPDBCode("AFPCHainer: getRmsd" + rmsd);
		//      List<Chain> model1 = new ArrayList<Chain>();
		//      model1.add(c1);
		//      List<Chain> model2 = new ArrayList<Chain>();
		//      model2.add(c2);
		//      fake.addModel(model1);
		//      fake.addModel(model2);
		//      fake.setNmr(true);
		//
		//      jmol.setStructure(fake);
		//      jmol.evalString("select *; backbone 0.4; wireframe off; spacefill off; " +
		//      "select not protein and not solvent; spacefill on;");
		//      jmol.evalString("select */1 ; color red; model 1; ");
		//
		//      // now show both models again.
		//      jmol.evalString("model 0;");
		//   }

		return Calc.rmsd(catmp1,catmp2);
	}
733001
public Chemical getChemicalList(int i) {
    if (ManualDescriptor_Type.featOkTst && ((ManualDescriptor_Type)jcasType).casFeat_chemicalList == null)
      jcasType.jcas.throwFeatMissing("chemicalList", "de.julielab.jules.types.pubmed.ManualDescriptor");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((ManualDescriptor_Type)jcasType).casFeatCode_chemicalList), i);
    return (Chemical)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((ManualDescriptor_Type)jcasType).casFeatCode_chemicalList), i)));}
673988
public static <T> HashSet<T> getLeaves(T root, Deps<T> deps) {
        return dfs(root, new HashSet<T>(), deps);
    }
903636
public static Predicate<Map.Entry<Long, Boolean>> amongDeadHsids(final Set<Long> hsids) {
        return new Predicate<Map.Entry<Long,Boolean>>() {
            @Override
            public boolean apply(Entry<Long, Boolean> e) {
                return hsids.contains(e.getKey()) && e.getValue();
            }
        };
    }
159062
public static ResultDescriptor ofResult(final AnalyzerResult result) {
        if (result == null) {
            throw new IllegalArgumentException("AnalyzerResult cannot be null");
        }
        return ofResult(result.getClass());
    }
848423
def get_siblings(self):
        
        if self.parent:
            return get_result_class(self.__class__).objects.filter(
                parent=self.parent)
        return self.__class__.get_root_nodes()
224486
def find_hal(self, atoms):
        """"""
        data = namedtuple('hal_donor', 'x orig_x x_orig_idx c c_orig_idx')
        a_set = []
        for a in atoms:
            if self.is_functional_group(a, 'halocarbon'):
                n_atoms = [na for na in pybel.ob.OBAtomAtomIter(a.OBAtom) if na.GetAtomicNum() == 6]
                x_orig_idx = self.Mapper.mapid(a.idx, mtype=self.mtype, bsid=self.bsid)
                orig_x = self.Mapper.id_to_atom(x_orig_idx)
                c_orig_idx = [self.Mapper.mapid(na.GetIdx(), mtype=self.mtype, bsid=self.bsid) for na in n_atoms]
                a_set.append(data(x=a, orig_x=orig_x, x_orig_idx=x_orig_idx,
                                  c=pybel.Atom(n_atoms[0]), c_orig_idx=c_orig_idx))
        if len(a_set) != 0:
            write_message('Ligand contains %i halogen atom(s).\n' % len(a_set), indent=True)
        return a_set
878421
@Override
    public DescriptorValue calculate(IAtomContainer container) {
        if (order.equals("")) {
            int bondCount = 0;
            for (IBond bond : container.bonds()) {
                boolean hasHydrogen = false;
                for (int i = 0; i < bond.getAtomCount(); i++) {
                    if (bond.getAtom(i).getSymbol().equals("H")) {
                        hasHydrogen = true;
                        break;
                    }
                }
                if (!hasHydrogen) bondCount++;

            }
            return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                    bondCount), getDescriptorNames(), null);
        }

        int bondCount = 0;
        for (IBond bond : container.bonds()) {
            if (bondMatch(bond.getOrder(), order)) {
                bondCount += 1;
            }
        }

        return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                bondCount), getDescriptorNames());
    }
1077389
public List<Double> getRDBEValue(IMolecularFormula formula) {
        List<Double> RDBEList = new ArrayList<Double>();
        // The number of combinations with repetition
        // (v+n-1)!/[n!(v-1)!]
        int nE = 0; // number of elements to change
        List<Integer> nV = new ArrayList<Integer>(); // number of valence changing
        for (Iterator<IIsotope> it = formula.isotopes().iterator(); it.hasNext();) {
            IIsotope isotope = it.next();
            int[] valence = getOxidationState(formula.getBuilder().newInstance(IAtom.class, isotope.getSymbol()));
            if (valence.length != 1) {
                for (int i = 0; i < valence.length; i++) {
                    nV.add(valence[i]);
                }
                nE += MolecularFormulaManipulator.getElementCount(formula,
                        formula.getBuilder().newInstance(IElement.class, isotope.getSymbol()));
            }
        }

        double RDBE = 0;
        if (nE == 0) {
            for (Iterator<IIsotope> it = formula.isotopes().iterator(); it.hasNext();) {
                IIsotope isotope = it.next();
                int[] valence = getOxidationState(formula.getBuilder().newInstance(IAtom.class, isotope.getSymbol()));
                double value = (valence[0] - 2) * formula.getIsotopeCount(isotope) / 2.0;
                RDBE += value;
            }
            RDBE += 1;
            RDBEList.add(RDBE);
        } else {
            double RDBE_1 = 0;
            for (Iterator<IIsotope> it = formula.isotopes().iterator(); it.hasNext();) {
                IIsotope isotope = it.next();
                int[] valence = getOxidationState(formula.getBuilder().newInstance(IAtom.class, isotope.getSymbol()));
                double value = (valence[0] - 2) * formula.getIsotopeCount(isotope) * 0.5;
                RDBE_1 += value;
            }
            String[] valences = new String[nV.size()];
            for (int i = 0; i < valences.length; i++)
                valences[i] = Integer.toString(nV.get(i));

            Combinations c = new Combinations(valences, nE);
            while (c.hasMoreElements()) {
                double RDBE_int = 0.0;
                Object[] combo = (Object[]) c.nextElement();
                for (int i = 0; i < combo.length; i++) {
                    int value = (Integer.parseInt((String) combo[i]) - 2) / 2;
                    RDBE_int += value;
                }
                RDBE = 1 + RDBE_1 + RDBE_int;
                RDBEList.add(RDBE);
            }
        }
        return RDBEList;
    }
990254
public static MmtfSummaryDataBean getStructureInfo(Structure structure) {
		MmtfSummaryDataBean mmtfSummaryDataBean = new MmtfSummaryDataBean();
		// Get all the atoms
		List<Atom> theseAtoms = new ArrayList<>();
		List<Chain> allChains = new ArrayList<>();
		Map<String, Integer> chainIdToIndexMap = new LinkedHashMap<>();
		int chainCounter = 0;
		int bondCount = 0;
		mmtfSummaryDataBean.setAllAtoms(theseAtoms);
		mmtfSummaryDataBean.setAllChains(allChains);
		mmtfSummaryDataBean.setChainIdToIndexMap(chainIdToIndexMap);
		for (int i=0; i<structure.nrModels(); i++){
			List<Chain> chains = structure.getModel(i);
			allChains.addAll(chains);
			for (Chain chain : chains) {
				String idOne = chain.getId();
				if (!chainIdToIndexMap.containsKey(idOne)) {
					chainIdToIndexMap.put(idOne, chainCounter);
				}
				chainCounter++;
				for (Group g : chain.getAtomGroups()) {
					for(Atom atom: getAtomsForGroup(g)){
						theseAtoms.add(atom);
						// If both atoms are in the group
						if (atom.getBonds()!=null){
							bondCount+=atom.getBonds().size();
						}
					}
				}
			}
		}
		// Assumes all bonds are referenced twice
		mmtfSummaryDataBean.setNumBonds(bondCount/2);
		return mmtfSummaryDataBean;

	}
211940
function(result) {
    var oResult = {},
        schema = this.responseSchema;
        
    try {
        // Loop through each data field in each result using the schema
        for(var m = schema.fields.length-1; m >= 0 ; m--) {
            var field = schema.fields[m];
            var key = (lang.isValue(field.key)) ? field.key : field;
            var data = null;

            if(this.useXPath) {
                data = YAHOO.util.DataSource._getLocationValue(field, result);
            }
            else {
                // Values may be held in an attribute...
                var xmlAttr = result.attributes.getNamedItem(key);
                if(xmlAttr) {
                    data = xmlAttr.value;
                }
                // ...or in a node
                else {
                    var xmlNode = result.getElementsByTagName(key);
                    if(xmlNode && xmlNode.item(0)) {
                        var item = xmlNode.item(0);
                        // For IE, then DOM...
                        data = (item) ? ((item.text) ? item.text : (item.textContent) ? item.textContent : null) : null;
                        // ...then fallback, but check for multiple child nodes
                        if(!data) {
                            var datapieces = [];
                            for(var j=0, len=item.childNodes.length; j<len; j++) {
                                if(item.childNodes[j].nodeValue) {
                                    datapieces[datapieces.length] = item.childNodes[j].nodeValue;
                                }
                            }
                            if(datapieces.length > 0) {
                                data = datapieces.join("");
                            }
                        }
                    }
                }
            }
            
            
            // Safety net
            if(data === null) {
                   data = "";
            }
            // Backward compatibility
            if(!field.parser && field.converter) {
                field.parser = field.converter;
                YAHOO.log("The field property converter has been deprecated" +
                        " in favor of parser", "warn", this.toString());
            }
            var parser = (typeof field.parser === 'function') ?
                field.parser :
                DS.Parser[field.parser+''];
            if(parser) {
                data = parser.call(this, data);
            }
            // Safety measure
            if(data === undefined) {
                data = null;
            }
            oResult[key] = data;
        }
    }
    catch(e) {
        YAHOO.log("Error while parsing XML result: " + e.message);
    }

    return oResult;
}
1033529
public PCAResult processQueryResult(DoubleDBIDList results, Relation<? extends NumberVector> database) {
    return processCovarMatrix(covarianceMatrixBuilder.processQueryResults(results, database));
  }
1033319
public Map<String, Result> makeResultMap(ResponseCtx resCtx) {
        @SuppressWarnings("unchecked")
        Iterator<Result> i = resCtx.getResults().iterator();

        Map<String, Result> resultMap = new HashMap<String, Result>();

        while (i.hasNext()) {
            Result r = i.next();
            resultMap.put(r.getResource(), r);
        }

        return resultMap;
    }
659816
private List<String> getColumnResults(int columnIndex,
			UserCoreResult<?, ?, ?> results) {

		List<String> values = new ArrayList<>();
		while (results.moveToNext()) {
			values.add(results.getString(columnIndex));
		}

		return values;
	}
485569
HashMap<AbstractExpression, Set<AbstractExpression>> analyzeValueEquivalence() {
        // collect individual where/join expressions
        m_joinTree.analyzeJoinExpressions(m_noTableSelectionList);
        return m_joinTree.getAllEquivalenceFilters();
    }
1324841
static boolean[] terminalHydrogens(final IAtomContainer ac, final int[][] g) {

        final boolean[] hydrogens = new boolean[ac.getAtomCount()];

        // we specifically don't check for null atomic number, this must be set.
        // if not, something major is wrong
        for (int i = 0; i < ac.getAtomCount(); i++) {
            IAtom atom = ac.getAtom(i);
            hydrogens[i] = atom.getAtomicNumber() == 1 &&
                           atom.getMassNumber() == null &&
                           g[i].length == 1;
        }

        return hydrogens;
    }