Changeset 22711


Ignore:
Timestamp:
03/09/10 16:20:02 (17 months ago)
Author:
contrino
Message:

modmine meta: added experiment category and now experiment type is set by experiment prop if present.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bio/sources/chado-db/main/src/org/intermine/bio/dataconversion/ModEncodeMetaDataProcessor.java

    r22593 r22711  
    4242import org.intermine.xml.full.ReferenceList; 
    4343 
     44 
    4445/** 
    4546 * Create items from the modENCODE metadata extensions to the chado schema. 
     
    103104    private Map<String, List<Integer>> expSubMap = new HashMap<String, List<Integer>>(); 
    104105 
     106 
    105107    // ...we need a further map to link to submission 
    106108    private Map<Integer, String> submissionProjectMap = new HashMap<Integer, String>(); 
    107109    private Map<Integer, String> submissionLabMap = new HashMap<Integer, String>(); 
    108110 
     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>(); 
    109115 
    110116    // submission/applied_protocol/protocol maps 
     
    901907            exp.setAttribute("name", name); 
    902908 
     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 
    903919            String project = expProMap.get(name); 
    904920            exp.setReference("project", projectIdRefMap.get(project)); 
     
    10711087            } 
    10721088 
     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 
    10731098            if (fieldName.equals("pubMedId")) { 
    10741099                // sometime in the form PMID:16938558 
     
    10911116        LOG.info("created " + count + " submission properties"); 
    10921117        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"); 
    10941120    } 
    10951121 
     
    18461872            } 
    18471873        } 
    1848         LOG.info("PROCESS TIME submission properties: " + (System.currentTimeMillis() - bT) + " ms"); 
     1874        LOG.info("PROCESS TIME submission properties: " 
     1875                + (System.currentTimeMillis() - bT) + " ms"); 
    18491876    } 
    18501877 
     
    27222749            } 
    27232750        } 
    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"); 
    27252753    } 
    27262754 
     
    27512779            } 
    27522780        } 
    2753         LOG.info("TIME creating DatabaseRecord objects: " + (System.currentTimeMillis() - bT) + " ms"); 
     2781        LOG.info("TIME creating DatabaseRecord objects: " 
     2782                + (System.currentTimeMillis() - bT) + " ms"); 
    27542783    } 
    27552784 
     
    29282957            getChadoDBConverter().store(collection, storedSubmissionId); 
    29292958 
    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            } 
    29352967        } 
    29362968        LOG.info("TIME setting submission-protocol references: " 
     
    29743006    /** 
    29753007     * Work out an experiment type give the combination of protocols used for the 
    2976      * submussion.  e.g. *immunoprecipitation + hybridization = chIP-chip 
    2977      * @param protocolTypes the protocal types 
     3008     * submission.  e.g. *immunoprecipitation + hybridization = chIP-chip 
     3009     * @param protocolTypes the protocol types 
    29783010     * @param piName name of PI 
    29793011     * @return a short experiment type 
     
    31963228        FIELD_NAME_MAP.put("Person Roles", NOT_TO_BE_LOADED); 
    31973229 
     3230        FIELD_NAME_MAP.put("Data Type", "category"); 
     3231        FIELD_NAME_MAP.put("Assay Type", "experimentType"); 
     3232 
    31983233        // data: parameter values 
    31993234        FIELD_NAME_MAP.put("Array Data File", "arrayDataFile"); 
  • trunk/modmine/dbmodel/resources/modencode-metadata_additions.xml

    r22539 r22711  
    166166<class name="Experiment" is-interface="true"> 
    167167  <attribute name="name" type="java.lang.String" /> 
     168  <attribute name="category" type="java.lang.String" /> 
    168169  <reference name="project" referenced-type="Project" reverse-reference="experiments" /> 
    169170  <collection name="submissions" referenced-type="Submission" reverse-reference="experiment" /> 
Note: See TracChangeset for help on using the changeset viewer.