public void saveToFile(File file) {
		String suffix = file.getAbsolutePath().substring( file.getAbsolutePath().lastIndexOf(".")+1);
		boolean saved = false;
		if (suffix.equalsIgnoreCase("fasta") || suffix.equalsIgnoreCase("fas") ) {
			FastaParser parser = new FastaParser(sunfishParent);
			parser.writeData(file, currentSG);
			setHasUnsavedChanges(false);
			saved = true;
		}
		
		if (suffix.equalsIgnoreCase("phy") || suffix.equalsIgnoreCase("ph") || suffix.equalsIgnoreCase("phylip")) {
			PhyParser parser = new PhyParser(sunfishParent);
			parser.writeData(file, currentSG);
			setHasUnsavedChanges(false);
			saved = true;
		}
		
//		if (suffix.equalsIgnoreCase("nex") || suffix.equalsIgnoreCase("nexus")) {
//			NexusParser parser = new NexusParser(sunfishParent);
//			parser.writeData(file, currentSG);	
//			setHasUnsavedChanges(false);
//			saved = true;
//		}
		
		if (suffix.equalsIgnoreCase("im") || suffix.equalsIgnoreCase("ima")) {
			IMAParser parser = new IMAParser(sunfishParent);
			parser.writeData(file, currentSG);	
			setHasUnsavedChanges(false);
			saved = true;
		}
		
		if (saved) {
			sunfishParent.getLogger().info("Saved SG file to : " + file.getAbsolutePath());
			sourceFile = file;
			SunFishFrame.getSunFishFrame().getDisplayPane().setTitleForDisplay(this, file.getName());
			SunFishFrame.getSunFishFrame().setInfoLabelText("Saved file " + file.getName());
		}
		else 
			sunfishParent.getLogger().warning("Error, did not save SG file to : " + file.getAbsolutePath());

	}