Changeset 22711
Legend:
- Unmodified
- Added
- Removed
-
trunk/bio/sources/chado-db/main/src/org/intermine/bio/dataconversion/ModEncodeMetaDataProcessor.java
r22593 r22711 42 42 import org.intermine.xml.full.ReferenceList; 43 43 44 44 45 /** 45 46 * Create items from the modENCODE metadata extensions to the chado schema. … … 103 104 private Map<String, List<Integer>> expSubMap = new HashMap<String, List<Integer>>(); 104 105 106 105 107 // ...we need a further map to link to submission 106 108 private Map<Integer, String> submissionProjectMap = new HashMap<Integer, String>(); 107 109 private Map<Integer, String> submissionLabMap = new HashMap<Integer, String>(); 108 110 111 // to store the category in experiment 112 private Map<Integer, String> submissionExpCatMap = new HashMap<Integer, String>(); 113 // to check if experiment type is set 114 private Set<Integer> submissionWithExpTypeSet = new HashSet<Integer>(); 109 115 110 116 // submission/applied_protocol/protocol maps … … 901 907 exp.setAttribute("name", name); 902 908 909 // find experiment category from map (take first available) 910 String category = null; 911 for (Integer ii : expSubMap.get(name)) { 912 category = submissionExpCatMap.get(ii); 913 if (category != null) { 914 exp.setAttribute("category", category); 915 break; 916 } 917 } 918 903 919 String project = expProMap.get(name); 904 920 exp.setReference("project", projectIdRefMap.get(project)); … … 1071 1087 } 1072 1088 1089 if (fieldName.equals("category")) { // Data Type 1090 submissionExpCatMap.put(submissionId, value); 1091 continue; 1092 } 1093 1094 if (fieldName.equals("experimentType")) { // Assay Type 1095 submissionWithExpTypeSet.add(submissionId); 1096 } 1097 1073 1098 if (fieldName.equals("pubMedId")) { 1074 1099 // sometime in the form PMID:16938558 … … 1091 1116 LOG.info("created " + count + " submission properties"); 1092 1117 res.close(); 1093 LOG.info("PROCESS TIME submission properties: " + (System.currentTimeMillis() - bT) + " ms"); 1118 LOG.info("PROCESS TIME submission properties: " 1119 + (System.currentTimeMillis() - bT) + " ms"); 1094 1120 } 1095 1121 … … 1846 1872 } 1847 1873 } 1848 LOG.info("PROCESS TIME submission properties: " + (System.currentTimeMillis() - bT) + " ms"); 1874 LOG.info("PROCESS TIME submission properties: " 1875 + (System.currentTimeMillis() - bT) + " ms"); 1849 1876 } 1850 1877 … … 2722 2749 } 2723 2750 } 2724 LOG.info("TIME setting submission-data references: " + (System.currentTimeMillis() - bT) + " ms"); 2751 LOG.info("TIME setting submission-data references: " 2752 + (System.currentTimeMillis() - bT) + " ms"); 2725 2753 } 2726 2754 … … 2751 2779 } 2752 2780 } 2753 LOG.info("TIME creating DatabaseRecord objects: " + (System.currentTimeMillis() - bT) + " ms"); 2781 LOG.info("TIME creating DatabaseRecord objects: " 2782 + (System.currentTimeMillis() - bT) + " ms"); 2754 2783 } 2755 2784 … … 2928 2957 getChadoDBConverter().store(collection, storedSubmissionId); 2929 2958 2930 // may need protocols from referenced submissions to work out experiment type 2931 protocolChadoIds.addAll(findProtocolIdsFromReferencedSubmissions(thisSubmissionId)); 2932 2933 String piName = submissionProjectMap.get(thisSubmissionId); 2934 setSubmissionExperimentType(storedSubmissionId, protocolChadoIds, piName); 2959 // TODO use Item? 2960 if (!submissionWithExpTypeSet.contains(thisSubmissionId)) { 2961 // may need protocols from referenced submissions to work out experiment type 2962 protocolChadoIds.addAll(findProtocolIdsFromReferencedSubmissions(thisSubmissionId)); 2963 2964 String piName = submissionProjectMap.get(thisSubmissionId); 2965 setSubmissionExperimentType(storedSubmissionId, protocolChadoIds, piName); 2966 } 2935 2967 } 2936 2968 LOG.info("TIME setting submission-protocol references: " … … 2974 3006 /** 2975 3007 * Work out an experiment type give the combination of protocols used for the 2976 * subm ussion. e.g. *immunoprecipitation + hybridization = chIP-chip2977 * @param protocolTypes the protoc al types3008 * submission. e.g. *immunoprecipitation + hybridization = chIP-chip 3009 * @param protocolTypes the protocol types 2978 3010 * @param piName name of PI 2979 3011 * @return a short experiment type … … 3196 3228 FIELD_NAME_MAP.put("Person Roles", NOT_TO_BE_LOADED); 3197 3229 3230 FIELD_NAME_MAP.put("Data Type", "category"); 3231 FIELD_NAME_MAP.put("Assay Type", "experimentType"); 3232 3198 3233 // data: parameter values 3199 3234 FIELD_NAME_MAP.put("Array Data File", "arrayDataFile"); -
trunk/modmine/dbmodel/resources/modencode-metadata_additions.xml
r22539 r22711 166 166 <class name="Experiment" is-interface="true"> 167 167 <attribute name="name" type="java.lang.String" /> 168 <attribute name="category" type="java.lang.String" /> 168 169 <reference name="project" referenced-type="Project" reverse-reference="experiments" /> 169 170 <collection name="submissions" referenced-type="Submission" reverse-reference="experiment" />
Note: See TracChangeset
for help on using the changeset viewer.
