Changeset 870

Show
Ignore:
Timestamp:
03-08-12 20:35:37 (21 months ago)
Author:
hailiang.mei@…
Message:

fixed the inconsistency between SP release file and its species list.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/code/conceptwiki/imports/imports-swissprot/src/main/java/nl/nbic/conceptwiki/imports/swissprot/SwissProtReader.java

    r869 r870  
    422422            if (proteinRecommendedName.isEmpty()) { 
    423423                logger.error("proteinRecommendedName is empty: " + entry.getAccession().get(0)); 
    424             }                                 
     424            }    
     425             
     426            logger.info("primary AC: " + entry.getAccession().get(0)); 
     427            logger.info("proteinRecommendedName: " +proteinRecommendedName); 
     428             
    425429            if (!bootstrapGenericProteinTags.containsKey(proteinRecommendedName)) { 
    426430                bootstrapGenericProteinTags.put(proteinRecommendedName, new BootstrapConceptEnvelopImpl(genericProteinConcept, CONCEPTWIKI_BRANCH)); 
     
    524528     */ 
    525529    private LinkedHashMultiset<Concept> getSpeciesConcepts() throws IOException { 
     530         
     531        allSpeciesConcepts.clear(); 
    526532         
    527533        logger.info("enter SwissProtReader.getSpeciesConcepts()"); 
     
    582588        // name = Aedes albopictus densovirus (isolate Boublik/1994) 
    583589        final String code = line.substring(0, line.indexOf(' ')); 
    584         final String scientificName = line.substring(line.indexOf(SPECIES_NAME_PREFIX) + SPECIES_NAME_PREFIX.length()).trim(); 
     590        String scientificName = line.substring(line.indexOf(SPECIES_NAME_PREFIX) + SPECIES_NAME_PREFIX.length()).trim();         
     591         
     592        // Some species name is ended with a ".". This is not consistent with the SwissProt release XML file. Thus the "." should be skipped. 
     593        if (scientificName.endsWith(".")) { 
     594                scientificName = scientificName.substring(0, scientificName.length()-1); 
     595        } 
    585596         
    586597        labels.add(new LabelImpl(LabelType.PREFERRED, scientificName, LANG_EN)); 
     
    630641        while (xsr.nextTag() == XMLStreamConstants.START_ELEMENT) { 
    631642            final Entry entry = (Entry)unmarshaller.unmarshal(xsr); 
    632             updatedTriples.addAll(getTriplesFromEntry(entry));             
     643            final LinkedHashMultiset<Triple> triples = getTriplesFromEntry(entry); 
     644             
     645            if (triples != null) { 
     646                updatedTriples.addAll(getTriplesFromEntry(entry)); 
     647            }            
    633648            if (counter % CHUNK_SIZE == 0) { 
    634649                logger.info(Integer.toString(counter));