Changes between Version 9 and Version 10 of CreatingAnnotion


Ignore:
Timestamp:
01/11/2017 09:22:38 PM (6 years ago)
Author:
dbrentw
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CreatingAnnotion

    v9 v10  
    211211                        if( ! glycanScanAnnotation.getScanAnnotations().isEmpty() ) {
    212212                                try {
    213                                         writer.writeAnnotationsPerGlycan(glycanScanAnnotation, getTempOutputPath());
     213                                        writer.writeAnnotationsPerGlycan(glycanScanAnnotation, getTempOutputPath());  // creates temp files that will be used to populate the archive in the next step
    214214                                } catch (IOException e) {
    215215                                        // TODO Auto-generated catch block
     
    222222        }
    223223}}}
     224
     2259) Create the archive that will be read by GRITS
     226  a) Populate the Scan Feature object
     227{{{
     228        protected void populateScanFeatureData(String glycanFilesPath) {
     229                //define objects to gather the MS1 annotation while processing MS2
     230                AnnotationReader reader = new AnnotationReader(); // instantiate the reader, which will read the temp files created in Step 8
     231                GlycanScansAnnotation glycanAnnotation = new GlycanScansAnnotation();
     232                ScanFeatures scanFeatures = new ScanFeatures(); 
     233                for(Integer scanId : getTestData().getScans().keySet()){       
     234                        if( isCanceled() )
     235                                return;
     236                        scanFeatures = new ScanFeatures(); // Create new ScanFeatures object to add features to the scan if it was annotated
     237                        scanFeatures.setScanId(scanId);
     238                        scanFeatures.setScanPeaks(new HashSet<Peak>(getTestData().getScans().get(scanId).getPeaklist()));
     239                        getTestData().getScanFeatures().put(scanId, scanFeatures);
     240                        if(getTestData().getAnnotatedScan().get(scanId) != null) { // this scan was annotated
     241                                for(String glycanId : getTestData().getAnnotatedScan().get(scanId)){
     242                                        glycanAnnotation = reader.readglycanAnnotation(glycanFilesPath, glycanId); // read the temp file for this particular glycan
     243                                        if(glycanAnnotation != null && glycanAnnotation.getScanAnnotations().get(scanId) != null) {
     244                                                for( GlycanFeature f : glycanAnnotation.getScanAnnotations().get(scanId) ) {
     245                                                        if( ! scanFeatures.getFeatures().contains(f) ) {
     246                                                                scanFeatures.getFeatures().add(f); // add each unique GlycanFeature (from ScanAnnotations) to the ScanFeatures list of features
     247                                                        }
     248                                                }
     249                                        }
     250                                }
     251                        }
     252                }
     253        }
     254}}}