@@ -165,11 +165,21 @@ public STDataAssembly readData() throws IOException {
165165 AffineTransform2D transform = new AffineTransform2D ();
166166 readAndSetTransformation (reader , transform , transformFieldName );
167167
168- for (final String annotationLabel : detectAnnotations (reader ))
169- stData .getAnnotations ().put (annotationLabel , readAnnotations (reader , annotationLabel ));
168+ for (final String annotationLabel : detectAnnotations (reader )) {
169+ try {
170+ stData .getAnnotations ().put (annotationLabel , readAnnotations (reader , annotationLabel ));
171+ } catch (Exception e ) {
172+ logger .warn ("Could not read annotation '{}'. Skipping" , annotationLabel );
173+ }
174+ }
170175
171- for (final String geneAnnotationLabel : detectGeneAnnotations (reader ))
172- stData .getGeneAnnotations ().put (geneAnnotationLabel , readGeneAnnotations (reader , geneAnnotationLabel ));
176+ for (final String geneAnnotationLabel : detectGeneAnnotations (reader )) {
177+ try {
178+ stData .getGeneAnnotations ().put (geneAnnotationLabel , readGeneAnnotations (reader , geneAnnotationLabel ));
179+ } catch (Exception e ) {
180+ logger .warn ("Could not read annotation '{}'. Skipping" , geneAnnotationLabel );
181+ }
182+ }
173183
174184 logger .debug ("Loading took {} ms." , System .currentTimeMillis () - time );
175185 logger .debug ("Metadata: dims={}, numLocations={}, numGenes={}, size(locations)={}, size(exprValues)={}" ,
0 commit comments