@@ -0,0 +1,2735 @@
+/*%0A * Copyright (C) 2003 EBI, GRL%0A * %0A * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by%0A * the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.%0A * %0A * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or%0A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.%0A * %0A * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation,%0A * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA%0A */%0Apackage org.ensembl.healthcheck.testcase.variation;%0A%0Aimport java.sql.Connection;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.ensembl.healthcheck.DatabaseRegistryEntry;%0Aimport org.ensembl.healthcheck.ReportManager;%0Aimport org.ensembl.healthcheck.Team;%0Aimport org.ensembl.healthcheck.testcase.generic.ComparePreviousVersionBase;%0A%0A/**%0A * Compare the number of phenotype features between the current database and the database on the secondary server.%0A */%0A%0Apublic class ComparePreviousVersionPhenotypeFeatures extends ComparePreviousVersionBase %7B%0A%0A%09/**%0A%09 * Create a new testcase.%0A%09 */%0A%09public ComparePreviousVersionPhenotypeFeatures() %7B%0A%0A%09%09addToGroup(%22variation%22);%0A%09%09addToGroup(%22variation-release%22);%0A%0A%09%09setDescription(%22Compare the number of phenotype features in the current database with those from the equivalent database on the secondary server%22);%0A%09%09setTeamResponsible(Team.VARIATION);%0A%0A%09%7D%0A%0A%09protected Map getCounts(DatabaseRegistryEntry dbre) %7B%0A%0A%09%09Map%3CString, Integer%3E counts = new HashMap%3CString, Integer%3E();%0A%09%09Connection con = dbre.getConnection();%0A%0A%09%09try %7B%0A%09%09%09// Count phenotype features by source%0A%09%09%09counts.putAll(getCountsBySQL(dbre, %22SELECT s.name, COUNT(*) FROM phenotype_feature pf JOIN source s ON (s.source_id = pf.source_id) GROUP BY s.name%22));%0A%09%09%09// Count total number of variations%0A%09%09%09counts.putAll(getCountsBySQL(dbre, %22SELECT 'all sources', COUNT(*) FROM phenotype_feature%22));%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09ReportManager.problem(this, con, %22HealthCheck caused an exception: %22 + e.getMessage());%0A%09%09%7D%0A%09%09%0A%09%09return counts;%0A%09%7D%0A%0A%09// ------------------------------------------------------------------------%0A%0A%09protected String entityDescription() %7B%0A%0A%09%09return %22number of phenotype features from%22;%0A%0A%09%7D%0A%0A%09// ------------------------------------------------------------------------%0A%0A%09protected double threshold() %7B%0A%0A%09%09return 1;%0A%0A%09%7D%0A%0A%09// ------------------------------------------------------------------------%0A%0A%7D // ComparePreviousVersionPhenotypeFeatures%0A

Replace the HC "ComparePreviousVersionVariationAnnotations"