String taxonName = rec.get("nameString");
if (taxonName == null && ncbiTaxID == null)
die("Taxon " + oldID + " has neither name nor NCBI id");
Taxon t = knownTaxon.get(oldID);
if (t == null) {
warn("File calls for missing taxon with TB1id=" + oldID);
continue;
}
// TODO: reduce duplication in the next three blocks of code
if (uBioId == null && t.getUBioNamebankId() != null)
warn("TB1id=" + oldID + " should have no uBio id, but T" + t.getId() + " has " + t.getUBioNamebankId());
else if (uBioId != null && t.getUBioNamebankId() == null)
warn("TB1id=" + oldID + " should have uBio id " + uBioId + " but T" + t.getId() + " has none");
else if (uBioId != null && t.getUBioNamebankId() != null)
if (! uBioId.equals(t.getUBioNamebankId()))
warn("File says TB1id=" + oldID + " T" + t.getId() + " should have ubio id " + uBioId + " but it has " + t.getUBioNamebankId());
if (ncbiTaxID == null && t.getNcbiTaxId() != null)
warn("TB1id=" + oldID + " should have no NCBI id, but T" + t.getId() + " has " + t.getNcbiTaxId());
else if (ncbiTaxID != null && t.getNcbiTaxId() == null)
warn("TB1id=" + oldID + " should have NCBI id " + ncbiTaxID + " but T" + t.getId() + " has none");
else if (ncbiTaxID != null && t.getNcbiTaxId() != null)
if (! ncbiTaxID.equals(t.getNcbiTaxId()))
warn("File says TB1id=" + oldID + " T" + t.getId() + " should have NCBI id " + ncbiTaxID + " but it has " + t.getNcbiTaxId());
if (taxonName == null && t.getName() != null)
warn("TB1id=" + oldID + " should have no name, but T" + t.getId() + " has " + t.getName());
else if (taxonName != null && t.getName() == null)
warn("TB1id=" + oldID + " should have name " + taxonName + " but T" + t.getId() + " has none");
else if (taxonName != null && t.getName() != null)
if (! taxonName.equals(t.getName()))
warn("File says TB1id=" + oldID + " T" + t.getId() + " should have name " + taxonName + " but it has " + t.getName());
taxon.put(oldID, t);
knownTaxon.remove(oldID);
// if (fh.recNumber % 100 == 0) {