	private DSMicroarraySet parseFile(File file)
		throws InputFileFormatException, InterruptedIOException {
		if (!checkFormat(file)) {
			log
					.info("SOFTFileFormat::getMArraySet - "
							+ "Attempting to open a file that does not comply with the "
							+ "GEO SOFT file format.");
			throw new InputFileFormatException(errorMessage);
		}
		CSMicroarraySet maSet = new CSMicroarraySet();
		List<String> arrayNames = new ArrayList<String>();
		int possibleMarkers = 0;
		BufferedReader in = null;
		final int extSeperater = '.';
		String fileName = file.getName();
		int dotIndex = fileName.lastIndexOf(extSeperater);
		if (dotIndex != -1) {
			fileName = fileName.substring(0, dotIndex);
		}
		maSet.setLabel(fileName);
		List<String> markers = new ArrayList<String>();
		try {
			in = new BufferedReader(new FileReader(file));
			if(in != null){
				try {
					int m = 0;
					String header = in.readLine();
					while (header != null) {
						if (header.startsWith(commentSign1) || header.startsWith(commentSign2)) {
							if(!header.equalsIgnoreCase("!dataset_table_begin") && !header.equalsIgnoreCase("!dataset_table_end")) {
							}
						}	
						String[] tokens = null;
						if(!header.startsWith(commentSign1) && !header.startsWith(commentSign2) && !header.startsWith(commentSign3)){
							if(header.subSequence(0, 6).equals("ID_REF")){
								tokens = header.split("\t");
								for(int n = 2; n<tokens.length; n++){
									if(tokens[n].contains("GSM")) {
										arrayNames.add(tokens[n]);
									}
								}
							}
							if(!header.subSequence(0, 6).equals("ID_REF")){
								String[] mark = header.split("\t");
								markers.add(mark[0]);
								String markerName = new String(mark[0].trim());
								CSExpressionMarker marker = new CSExpressionMarker(m);
								marker.setLabel(markerName);
								maSet.getMarkers().add(m, marker);
								m++;
							}
						}
						header = in.readLine();
					}
					in.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		String result = null;
		for (int i = 0; i < possibleMarkers; i++) {
			result = AffyAnnotationUtil.matchAffyAnnotationFile(maSet);
			if (result != null) {
				break;
			}
		}
		if (result == null) {
			AffyAnnotationUtil.matchAffyAnnotationFile(maSet);
		} else {
			maSet.setCompatibilityLabel(result);
		}
		for (DSGeneMarker marker : maSet.getMarkers()) {
			String token = marker.getLabel();
			String[] locusResult = AnnotationParser.getInfo(token,
					AnnotationParser.LOCUSLINK);
			String locus = "";
			if ((locusResult != null)
					&& (!locusResult[0].trim().equals(""))) {
				locus = locusResult[0].trim();
			}
			if (locus.compareTo("") != 0) {
				try {
					marker.setGeneId(Integer.parseInt(locus));
				} catch (NumberFormatException e) {
				}
			}
			String[] geneNames = AnnotationParser.getInfo(token,
					AnnotationParser.ABREV);
			if (geneNames != null) {
				marker.setGeneName(geneNames[0]);
			}
			marker.getUnigene().set(token);
		}
		possibleMarkers = markers.size();
		for (int i = 0; i < arrayNames.size(); i++) {
			String arrayName = arrayNames.get(i);
			CSMicroarray array = new CSMicroarray(i, possibleMarkers,
					arrayName,
					DSMicroarraySet.affyTxtType);
			maSet.add(array);	
		}
        maSet.sortMarkers(possibleMarkers);
		BufferedReader out = null;
		int j = 0;
		try {
			out = new BufferedReader(new FileReader(file));
			try {
				String line = out.readLine();
				while (line != null) {	
					if(!line.startsWith(commentSign1) && !line.startsWith(commentSign2) && !line.startsWith(commentSign3)){
						if(!line.subSequence(0, 6).equals("ID_REF")){
							String[] values = line.split("\t");
							String valString = null; 
							for(int k = 0; k < arrayNames.size(); k++){
								valString = values[k+2].trim();
								if(valString == null){
									Float v = Float.NaN;
									CSExpressionMarkerValue markerValue = new CSExpressionMarkerValue(v);
									DSMicroarray microarray = (DSMicroarray)maSet.get(k);
									microarray.setMarkerValue(maSet.getNewMarkerOrder()[j], markerValue);
									if (v.isNaN()) {
										markerValue.setMissing(true);
									} else {
										markerValue.setPresent();
									}
								}else { 
									float value = Float.NaN;
									try {
										value = Float.parseFloat(valString);
									} catch (NumberFormatException nfe) {
									}
									Float v = value;
									CSExpressionMarkerValue markerValue = new CSExpressionMarkerValue(
											v);
									DSMicroarray microarray = (DSMicroarray)maSet.get(k);
									microarray.setMarkerValue(maSet.getNewMarkerOrder()[j], markerValue);
									if (v.isNaN()) {
										markerValue.setMissing(true);
									} else {
										markerValue.setPresent();
									}
								}		
							}
							j++;
						}
					}
					line = out.readLine();
				}
				out.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		labelDisp(file, maSet, arrayNames);
		return maSet;
	}

	private DSMicroarraySet parseFile(File file)
		throws InputFileFormatException, InterruptedIOException {
		if (!checkFormat(file)) {
			log
					.info("SOFTFileFormat::getMArraySet - "
							+ "Attempting to open a file that does not comply with the "
							+ "GEO SOFT file format.");
			throw new InputFileFormatException(errorMessage);
		}
		CSMicroarraySet maSet = new CSMicroarraySet();
		List<String> arrayNames = new ArrayList<String>();
		int possibleMarkers = 0;
		BufferedReader in = null;
		String fileName = file.getName();
		maSet.setLabel(fileName);
		List<String> markers = new ArrayList<String>();
		try {
			in = new BufferedReader(new FileReader(file));
			if(in != null){
				try {
					int m = 0;
					String header = in.readLine();
					while (header != null) {
						if (header.startsWith(commentSign1) || header.startsWith(commentSign2)) {
							if(!header.equalsIgnoreCase("!dataset_table_begin") && !header.equalsIgnoreCase("!dataset_table_end")) {
							}
						}	
						String[] tokens = null;
						if(!header.startsWith(commentSign1) && !header.startsWith(commentSign2) && !header.startsWith(commentSign3)){
							if(header.subSequence(0, 6).equals("ID_REF")){
								tokens = header.split("\t");
								for(int n = 2; n<tokens.length; n++){
									if(tokens[n].contains("GSM")) {
										arrayNames.add(tokens[n]);
									}
								}
							}
							if(!header.subSequence(0, 6).equals("ID_REF")){
								String[] mark = header.split("\t");
								markers.add(mark[0]);
								String markerName = new String(mark[0].trim());
								CSExpressionMarker marker = new CSExpressionMarker(m);
								marker.setLabel(markerName);
								maSet.getMarkers().add(m, marker);
								m++;
							}
						}
						header = in.readLine();
					}
					in.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		String result = null;
		for (int i = 0; i < possibleMarkers; i++) {
			result = AffyAnnotationUtil.matchAffyAnnotationFile(maSet);
			if (result != null) {
				break;
			}
		}
		if (result == null) {
			AffyAnnotationUtil.matchAffyAnnotationFile(maSet);
		} else {
			maSet.setCompatibilityLabel(result);
		}
		for (DSGeneMarker marker : maSet.getMarkers()) {
			String token = marker.getLabel();
			String[] locusResult = AnnotationParser.getInfo(token,
					AnnotationParser.LOCUSLINK);
			String locus = "";
			if ((locusResult != null)
					&& (!locusResult[0].trim().equals(""))) {
				locus = locusResult[0].trim();
			}
			if (locus.compareTo("") != 0) {
				try {
					marker.setGeneId(Integer.parseInt(locus));
				} catch (NumberFormatException e) {
				}
			}
			String[] geneNames = AnnotationParser.getInfo(token,
					AnnotationParser.ABREV);
			if (geneNames != null) {
				marker.setGeneName(geneNames[0]);
			}
			marker.getUnigene().set(token);
		}
		possibleMarkers = markers.size();
		for (int i = 0; i < arrayNames.size(); i++) {
			String arrayName = arrayNames.get(i);
			CSMicroarray array = new CSMicroarray(i, possibleMarkers,
					arrayName,
					DSMicroarraySet.affyTxtType);
			maSet.add(array);	
		}
        maSet.sortMarkers(possibleMarkers);
		BufferedReader out = null;
		int j = 0;
		try {
			out = new BufferedReader(new FileReader(file));
			try {
				String line = out.readLine();
				while (line != null) {	
					if(!line.startsWith(commentSign1) && !line.startsWith(commentSign2) && !line.startsWith(commentSign3)){
						if(!line.subSequence(0, 6).equals("ID_REF")){
							String[] values = line.split("\t");
							String valString = null; 
							for(int k = 0; k < arrayNames.size(); k++){
								valString = values[k+2].trim();
								if(valString == null){
									Float v = Float.NaN;
									CSExpressionMarkerValue markerValue = new CSExpressionMarkerValue(v);
									DSMicroarray microarray = (DSMicroarray)maSet.get(k);
									microarray.setMarkerValue(maSet.getNewMarkerOrder()[j], markerValue);
									if (v.isNaN()) {
										markerValue.setMissing(true);
									} else {
										markerValue.setPresent();
									}
								}else { 
									float value = Float.NaN;
									try {
										value = Float.parseFloat(valString);
									} catch (NumberFormatException nfe) {
									}
									Float v = value;
									CSExpressionMarkerValue markerValue = new CSExpressionMarkerValue(
											v);
									DSMicroarray microarray = (DSMicroarray)maSet.get(k);
									microarray.setMarkerValue(maSet.getNewMarkerOrder()[j], markerValue);
									if (v.isNaN()) {
										markerValue.setMissing(true);
									} else {
										markerValue.setPresent();
									}
								}		
							}
							j++;
						}
					}
					line = out.readLine();
				}
				out.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		labelDisp(file, maSet, arrayNames);
		return maSet;
	}
