void countSamFile(String fileName) {
		// Open file
		int readNum = 1;
		SAMFileReader sam = new SAMFileReader(new File(fileName));
		sam.setValidationStringency(ValidationStringency.SILENT);

		for (SAMRecord samRecord : sam) {
			try {
				if (!samRecord.getReadUnmappedFlag()) { // Mapped?
					Chromosome chr = genome.getOrCreateChromosome(samRecord.getReferenceName());
					if (chr != null) {
						// Create a marker from read
						Marker read = new Marker(chr, samRecord.getAlignmentStart(), samRecord.getAlignmentEnd(), 1, "");
						readLengthCount++;
						readLengthSum += read.size();

						countMarker(fileName, read);
					}
				}

				if (verbose) Gpr.showMark(readNum, SHOW_EVERY);
				readNum++;
			} catch (Exception e) {
				countExceptions++;
				if (countExceptions < 10) e.printStackTrace();
				else if (countExceptions == 10) System.err.println("Not showing more exceptions!");
			}

		}
		sam.close();
	}