Changeset 16245
- Timestamp:
- 17/07/08 10:21:17 (1 month ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bio/sources/pdb/main/src/org/intermine/bio/dataconversion/PdbConverter.java
r16231 r16245 20 20 import java.util.Map; 21 21 22 import org.apache.commons.lang.StringUtils;23 22 import org.apache.log4j.Logger; 24 23 import org.biojava.bio.structure.Structure; … … 38 37 private static final Logger LOG = Logger.getLogger(PdbConverter.class); 39 38 protected static final String ENDL = System.getProperty("line.separator"); 40 private Map<String, String> synonyms = new HashMap();41 39 42 40 /** … … 65 63 String idCode = (String) structure.getHeader().get("idCode"); 66 64 proteinStructure.setAttribute("identifier", idCode); 67 68 createSynonym(proteinStructure.getIdentifier(), "identifier", idCode);69 65 70 66 List<String> proteins = new ArrayList<String>(); … … 102 98 } 103 99 } 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 122 100 123 101 /** trunk/bio/sources/pdb/test/resources/PdbConverterTest_tgt.xml
r16231 r16245 4 4 <reference name="dataSource" ref_id="0_1"/> 5 5 </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"> 7 7 <attribute name="primaryAccession" value="P26675"/> 8 8 <collection name="dataSets"><reference ref_id="1_1"/></collection> … … 16 16 <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 "/> 17 17 <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> 19 19 </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"> 21 21 <attribute name="primaryAccession" value="P29354"/> 22 22 <collection name="dataSets"><reference ref_id="1_1"/></collection> … … 25 25 <attribute name="name" value="PDB"/> 26 26 </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>34 27 </items>
