Changeset 16245

Show
Ignore:
Timestamp:
17/07/08 10:21:17 (1 month ago)
Author:
julie
Message:

revert [16240], protein structures can't have synonyms

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bio/sources/pdb/main/src/org/intermine/bio/dataconversion/PdbConverter.java

    r16231 r16245  
    2020import java.util.Map; 
    2121 
    22 import org.apache.commons.lang.StringUtils; 
    2322import org.apache.log4j.Logger; 
    2423import org.biojava.bio.structure.Structure; 
     
    3837    private static final Logger LOG = Logger.getLogger(PdbConverter.class); 
    3938    protected static final String ENDL = System.getProperty("line.separator"); 
    40     private Map<String, String> synonyms = new HashMap(); 
    4139 
    4240    /** 
     
    6563            String idCode = (String) structure.getHeader().get("idCode"); 
    6664            proteinStructure.setAttribute("identifier", idCode); 
    67  
    68             createSynonym(proteinStructure.getIdentifier(), "identifier", idCode); 
    6965 
    7066            List<String> proteins = new ArrayList<String>(); 
     
    10298        } 
    10399    } 
    104  
    105     private Item createSynonym(String subjectId, String type, String value) throws Exception { 
    106         String key = subjectId + type + value; 
    107         if (StringUtils.isEmpty(value)) { 
    108             return null; 
    109         } 
    110         if (!synonyms.containsKey(key)) { 
    111             Item syn = createItem("Synonym"); 
    112             syn.setReference("subject", subjectId); 
    113             syn.setAttribute("type", type); 
    114             syn.setAttribute("value", value); 
    115             store(syn); 
    116             synonyms.put(key, syn.getIdentifier()); 
    117             return syn; 
    118         } 
    119         return null; 
    120     } 
    121  
    122100 
    123101    /** 
  • trunk/bio/sources/pdb/test/resources/PdbConverterTest_tgt.xml

    r16231 r16245  
    44<reference name="dataSource" ref_id="0_1"/> 
    55</item> 
    6   <item id="4_2" class="http://www.flymine.org/model/genomic#Protein"> 
     6  <item id="3_2" class="http://www.flymine.org/model/genomic#Protein"> 
    77    <attribute name="primaryAccession" value="P26675"/> 
    88    <collection name="dataSets"><reference ref_id="1_1"/></collection> 
     
    1616    <attribute name="title" value="NMR STRUCTURE OF THE COMPLEX BETWEEN THE C32S-Y7V MUTANT OF THE NSH3 DOMAIN OF GRB2 WITH A PEPTIDE FROM SOS, 10 STRUCTURES "/> 
    1717    <collection name="dataSets"><reference ref_id="1_1"/></collection> 
    18     <collection name="proteins"><reference ref_id="4_1"/><reference ref_id="4_2"/></collection> 
     18    <collection name="proteins"><reference ref_id="3_1"/><reference ref_id="3_2"/></collection> 
    1919  </item> 
    20   <item id="4_1" class="http://www.flymine.org/model/genomic#Protein"> 
     20  <item id="3_1" class="http://www.flymine.org/model/genomic#Protein"> 
    2121    <attribute name="primaryAccession" value="P29354"/> 
    2222    <collection name="dataSets"><reference ref_id="1_1"/></collection> 
     
    2525<attribute name="name" value="PDB"/> 
    2626</item> 
    27 <item id="3_1" class="http://www.flymine.org/model/genomic#Synonym"> 
    28 <attribute name="type" value="identifier"/> 
    29 <attribute name="value" value="1AZE"/> 
    30 <reference name="source" ref_id="0_1"/> 
    31 <reference name="subject" ref_id="2_1"/> 
    32 <collection name="dataSets"><reference ref_id="1_1"/></collection> 
    33 </item> 
    3427</items>