[med-svn] [fastqc] 02/06: Imported Upstream version 0.11.5+dfsg

Andreas Tille tille at debian.org
Sun Mar 20 13:45:58 UTC 2016


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository fastqc.

commit c00d2b491fc74bcbf899e710ed918da7e02b674d
Author: Andreas Tille <tille at debian.org>
Date:   Sun Mar 20 14:08:18 2016 +0100

    Imported Upstream version 0.11.5+dfsg
---
 Configuration/adapter_list.txt                     |   49 +-
 Configuration/contaminant_list.txt                 |  364 ++---
 Configuration/limits.txt                           |  166 +-
 Help/3 Analysis Modules/8 Duplicate Sequences.html |    4 +-
 INSTALL.txt                                        |  278 ++--
 LICENSE.txt                                        | 1348 ++++++++--------
 README.txt                                         |   88 +-
 RELEASE_NOTES.txt                                  | 1688 ++++++++++----------
 Templates/header_template.html                     |  372 ++---
 run_fastqc.bat                                     |    2 +-
 .../babraham/FastQC/Analysis/AnalysisListener.java |   62 +-
 uk/ac/babraham/FastQC/Analysis/AnalysisRunner.java |  230 +--
 uk/ac/babraham/FastQC/Analysis/OfflineRunner.java  |  382 ++---
 uk/ac/babraham/FastQC/Dialogs/AboutDialog.java     |  142 +-
 .../babraham/FastQC/Dialogs/FastQCTitlePanel.java  |  294 ++--
 uk/ac/babraham/FastQC/Dialogs/WelcomePanel.java    |  122 +-
 uk/ac/babraham/FastQC/FastQCApplication.java       |  676 ++++----
 uk/ac/babraham/FastQC/FastQCMenuBar.java           |  298 ++--
 .../babraham/FastQC/FileFilters/BAMFileFilter.java |   72 +-
 .../FastQC/FileFilters/CasavaFastQFileFilter.java  |   78 +-
 .../FastQC/FileFilters/FastQFileFilter.java        |   72 +-
 .../FastQC/FileFilters/GobyFileFilter.java         |   72 +-
 .../FastQC/FileFilters/MappedBAMFileFilter.java    |   72 +-
 .../FastQC/FileFilters/SequenceFileFilter.java     |  110 +-
 uk/ac/babraham/FastQC/Graphs/BaseGroup.java        |  442 ++---
 uk/ac/babraham/FastQC/Graphs/LineGraph.java        |  470 +++---
 uk/ac/babraham/FastQC/Graphs/QualityBoxPlot.java   |  420 ++---
 uk/ac/babraham/FastQC/Graphs/TileGraph.java        |  300 ++--
 uk/ac/babraham/FastQC/Help/HelpSearchPanel.java    |  320 ++--
 uk/ac/babraham/FastQC/Modules/AdapterContent.java  |  772 ++++-----
 .../babraham/FastQC/Modules/DuplicationLevel.java  |  528 +++---
 uk/ac/babraham/FastQC/Modules/GCModel/GCModel.java |  164 +-
 .../FastQC/Modules/GCModel/GCModelValue.java       |   80 +-
 uk/ac/babraham/FastQC/Modules/KmerContent.java     | 1160 +++++++-------
 uk/ac/babraham/FastQC/Modules/ModuleConfig.java    |  308 ++--
 uk/ac/babraham/FastQC/Modules/ModuleFactory.java   |   92 +-
 uk/ac/babraham/FastQC/Modules/NContent.java        |  330 ++--
 .../FastQC/Modules/PerBaseQualityScores.java       |  528 +++---
 .../FastQC/Modules/PerBaseSequenceContent.java     |  446 +++---
 .../FastQC/Modules/PerSequenceGCContent.java       |  532 +++---
 .../FastQC/Modules/PerSequenceQualityScores.java   |  332 ++--
 .../FastQC/Modules/PerTileQualityScores.java       |  718 ++++-----
 uk/ac/babraham/FastQC/Modules/QCModule.java        |  118 +-
 .../FastQC/Modules/SequenceLengthDistribution.java |  480 +++---
 uk/ac/babraham/FastQC/Report/stylesheet.txt        |  110 +-
 uk/ac/babraham/FastQC/Results/ResultsPanel.java    |  324 ++--
 uk/ac/babraham/FastQC/Sequence/BAMFile.java        |  440 ++---
 .../FastQC/Sequence/Contaminant/Contaminant.java   |  308 ++--
 .../Sequence/Contaminant/ContaminantHit.java       |  128 +-
 .../Sequence/Contaminant/ContaminentFinder.java    |  226 +--
 uk/ac/babraham/FastQC/Sequence/Fast5File.java      |  178 +--
 uk/ac/babraham/FastQC/Sequence/FastQFile.java      |  700 ++++----
 .../Sequence/QualityEncoding/PhredEncoding.java    |  188 +--
 uk/ac/babraham/FastQC/Sequence/Sequence.java       |  152 +-
 .../babraham/FastQC/Sequence/SequenceFactory.java  |  226 +--
 uk/ac/babraham/FastQC/Sequence/SequenceFile.java   |   66 +-
 .../FastQC/Sequence/SequenceFileGroup.java         |  186 +--
 .../FastQC/Sequence/SequenceFormatException.java   |   56 +-
 .../FastQC/Statistics/NormalDistribution.java      |   98 +-
 .../FastQC/Statistics/PearsonCorrelation.java      |  210 +--
 .../babraham/FastQC/Utilities/CasavaBasename.java  |  270 ++--
 .../FastQC/Utilities/HotColdColourGradient.java    |  310 ++--
 .../Utilities/MultiMemberGZIPInputStream.java      |  222 +--
 .../FastQC/Utilities/NameFormatException.java      |   52 +-
 .../FastQC/Utilities/NanoporeBasename.java         |  198 +--
 uk/ac/babraham/FastQC/Utilities/QualityCount.java  |  190 +--
 uk/ac/babraham/FastQC/Utilities/RGB.java           |   88 +-
 67 files changed, 10263 insertions(+), 10244 deletions(-)

diff --git a/Configuration/adapter_list.txt b/Configuration/adapter_list.txt
index 9709c97..df2c15a 100644
--- a/Configuration/adapter_list.txt
+++ b/Configuration/adapter_list.txt
@@ -1,25 +1,26 @@
-# This file contains a set of sequence fragments which will be explicitly
-# searched against your library.  The reporting will be similar to the 
-# Kmer plot, except that every sequence in this list will be shown so 
-# you can use this to judge the level of adapter read-through even if those
-# adapter sequences aren't picked out by the Kmer module.
-#
-# Since every sequence here will be analysed and the results plotted it 
-# doesn't make any sense to include duplicate sequences, or to add too
-# many sequences since your plot will end up a mess.
-#
-# You can add more sequences to the file by putting one line per entry
-# and specifying a name[tab]sequence.  If the contaminant you add is 
-# likely to be of use to others please consider sending it to the FastQ
-# authors, either via a bug report at www.bioinformatics.babraham.ac.uk/bugzilla/
-# or by directly emailing simon.andrews at babraham.ac.uk so other users of
-# the program can benefit.
-#
-# For the time being it's going to be easier to interpret this plot if all
-# of the sequences provided are the same length, so we've gone with 12bp
-# fragments for now.
-
-Illumina Universal Adapter					AGATCGGAAGAG
-Illumina Small RNA Adapter					ATGGAATTCTCG
-Nextera Transposase Sequence				CTGTCTCTTATA
+# This file contains a set of sequence fragments which will be explicitly
+# searched against your library.  The reporting will be similar to the 
+# Kmer plot, except that every sequence in this list will be shown so 
+# you can use this to judge the level of adapter read-through even if those
+# adapter sequences aren't picked out by the Kmer module.
+#
+# Since every sequence here will be analysed and the results plotted it 
+# doesn't make any sense to include duplicate sequences, or to add too
+# many sequences since your plot will end up a mess.
+#
+# You can add more sequences to the file by putting one line per entry
+# and specifying a name[tab]sequence.  If the contaminant you add is 
+# likely to be of use to others please consider sending it to the FastQ
+# authors, either via a bug report at www.bioinformatics.babraham.ac.uk/bugzilla/
+# or by directly emailing simon.andrews at babraham.ac.uk so other users of
+# the program can benefit.
+#
+# For the time being it's going to be easier to interpret this plot if all
+# of the sequences provided are the same length, so we've gone with 12bp
+# fragments for now.
+
+Illumina Universal Adapter					AGATCGGAAGAG
+Illumina Small RNA 3' Adapter				TGGAATTCTCGG
+Illumina Small RNA 5' Adapter				GATCGTCGGACT
+Nextera Transposase Sequence				CTGTCTCTTATA
 SOLID Small RNA Adapter						CGCCTTGGCCGT
\ No newline at end of file
diff --git a/Configuration/contaminant_list.txt b/Configuration/contaminant_list.txt
index d2c29be..69bc2b7 100644
--- a/Configuration/contaminant_list.txt
+++ b/Configuration/contaminant_list.txt
@@ -1,182 +1,182 @@
-# This file contains a list of potential contaminants which are
-# frequently found in high throughput sequencing reactions.  These
-# are mostly sequences of adapters / primers used in the various
-# sequencing chemistries.
-# 
-# Please DO NOT rely on these sequences to design your own oligos, some
-# of them are truncated at ambiguous positions, and none of them are
-# definitive sequences from the manufacturers so don't blame us if you
-# try to use them and they don't work.
-#
-# You can add more sequences to the file by putting one line per entry
-# and specifying a name[tab]sequence.  If the contaminant you add is 
-# likely to be of use to others please consider sending it to the FastQ
-# authors, either via a bug report at www.bioinformatics.babraham.ac.uk/bugzilla/
-# or by directly emailing simon.andrews at babraham.ac.uk so other users of
-# the program can benefit.
-
-Illumina Single End Adapter 1					GATCGGAAGAGCTCGTATGCCGTCTTCTGCTTG
-Illumina Single End Adapter 2					CAAGCAGAAGACGGCATACGAGCTCTTCCGATCT
-Illumina Single End PCR Primer 1				AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT
-Illumina Single End PCR Primer 2				CAAGCAGAAGACGGCATACGAGCTCTTCCGATCT
-Illumina Single End Sequencing Primer			ACACTCTTTCCCTACACGACGCTCTTCCGATCT
-
-Illumina Paired End Adapter 1					ACACTCTTTCCCTACACGACGCTCTTCCGATCT
-Illumina Paired End Adapter 2					GATCGGAAGAGCGGTTCAGCAGGAATGCCGAG
-Illumina Paried End PCR Primer 1				AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT
-Illumina Paired End PCR Primer 2				CAAGCAGAAGACGGCATACGAGATCGGTCTCGGCATTCCTGCTGAACCGCTCTTCCGATCT
-Illumina Paried End Sequencing Primer 1			ACACTCTTTCCCTACACGACGCTCTTCCGATCT
-Illumina Paired End Sequencing Primer 2			CGGTCTCGGCATTCCTGCTGAACCGCTCTTCCGATCT
-
-Illumina DpnII expression Adapter 1				ACAGGTTCAGAGTTCTACAGTCCGAC
-Illumina DpnII expression Adapter 2				CAAGCAGAAGACGGCATACGA
-Illumina DpnII expression PCR Primer 1			CAAGCAGAAGACGGCATACGA
-Illumina DpnII expression PCR Primer 2			AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
-Illumina DpnII expression Sequencing Primer		CGACAGGTTCAGAGTTCTACAGTCCGACGATC
-
-Illumina NlaIII expression Adapter 1			ACAGGTTCAGAGTTCTACAGTCCGACATG
-Illumina NlaIII expression Adapter 2			CAAGCAGAAGACGGCATACGA
-Illumina NlaIII expression PCR Primer 1			CAAGCAGAAGACGGCATACGA
-Illumina NlaIII expression PCR Primer 2			AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
-Illumina NlaIII expression Sequencing Primer	CCGACAGGTTCAGAGTTCTACAGTCCGACATG
-
-Illumina Small RNA Adapter 1					GTTCAGAGTTCTACAGTCCGACGATC
-Illumina Small RNA Adapter 2					TGGAATTCTCGGGTGCCAAGG
-Illumina Small RNA RT Primer					CAAGCAGAAGACGGCATACGA
-Illumina Small RNA PCR Primer 1					CAAGCAGAAGACGGCATACGA
-Illumina Small RNA PCR Primer 2					AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
-Illumina Small RNA Sequencing Primer			CGACAGGTTCAGAGTTCTACAGTCCGACGATC
-
-Illumina Multiplexing Adapter 1					GATCGGAAGAGCACACGTCT
-Illumina Multiplexing Adapter 2					ACACTCTTTCCCTACACGACGCTCTTCCGATCT
-Illumina Multiplexing PCR Primer 1.01			AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT
-Illumina Multiplexing PCR Primer 2.01			GTGACTGGAGTTCAGACGTGTGCTCTTCCGATCT
-Illumina Multiplexing Read1 Sequencing Primer	ACACTCTTTCCCTACACGACGCTCTTCCGATCT
-Illumina Multiplexing Index Sequencing Primer	GATCGGAAGAGCACACGTCTGAACTCCAGTCAC
-Illumina Multiplexing Read2 Sequencing Primer	GTGACTGGAGTTCAGACGTGTGCTCTTCCGATCT
-
-Illumina PCR Primer Index 1						CAAGCAGAAGACGGCATACGAGATCGTGATGTGACTGGAGTTC
-Illumina PCR Primer Index 2						CAAGCAGAAGACGGCATACGAGATACATCGGTGACTGGAGTTC
-Illumina PCR Primer Index 3						CAAGCAGAAGACGGCATACGAGATGCCTAAGTGACTGGAGTTC
-Illumina PCR Primer Index 4						CAAGCAGAAGACGGCATACGAGATTGGTCAGTGACTGGAGTTC
-Illumina PCR Primer Index 5						CAAGCAGAAGACGGCATACGAGATCACTGTGTGACTGGAGTTC
-Illumina PCR Primer Index 6						CAAGCAGAAGACGGCATACGAGATATTGGCGTGACTGGAGTTC
-Illumina PCR Primer Index 7						CAAGCAGAAGACGGCATACGAGATGATCTGGTGACTGGAGTTC
-Illumina PCR Primer Index 8						CAAGCAGAAGACGGCATACGAGATTCAAGTGTGACTGGAGTTC
-Illumina PCR Primer Index 9						CAAGCAGAAGACGGCATACGAGATCTGATCGTGACTGGAGTTC
-Illumina PCR Primer Index 10					CAAGCAGAAGACGGCATACGAGATAAGCTAGTGACTGGAGTTC
-Illumina PCR Primer Index 11					CAAGCAGAAGACGGCATACGAGATGTAGCCGTGACTGGAGTTC
-Illumina PCR Primer Index 12					CAAGCAGAAGACGGCATACGAGATTACAAGGTGACTGGAGTTC
-
-Illumina DpnII Gex Adapter 1					GATCGTCGGACTGTAGAACTCTGAAC
-Illumina DpnII Gex Adapter 1.01					ACAGGTTCAGAGTTCTACAGTCCGAC
-Illumina DpnII Gex Adapter 2					CAAGCAGAAGACGGCATACGA
-Illumina DpnII Gex Adapter 2.01					TCGTATGCCGTCTTCTGCTTG
-Illumina DpnII Gex PCR Primer 1					CAAGCAGAAGACGGCATACGA
-Illumina DpnII Gex PCR Primer 2					AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
-Illumina DpnII Gex Sequencing Primer			CGACAGGTTCAGAGTTCTACAGTCCGACGATC
-
-Illumina NlaIII Gex Adapter 1.01				TCGGACTGTAGAACTCTGAAC
-Illumina NlaIII Gex Adapter 1.02				ACAGGTTCAGAGTTCTACAGTCCGACATG
-Illumina NlaIII Gex Adapter 2.01				CAAGCAGAAGACGGCATACGA
-Illumina NlaIII Gex Adapter 2.02				TCGTATGCCGTCTTCTGCTTG
-Illumina NlaIII Gex PCR Primer 1				CAAGCAGAAGACGGCATACGA
-Illumina NlaIII Gex PCR Primer 2				AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
-Illumina NlaIII Gex Sequencing Primer			CCGACAGGTTCAGAGTTCTACAGTCCGACATG
-
-Illumina Small RNA RT Primer					CAAGCAGAAGACGGCATACGA
-Illumina 5p RNA Adapter							GTTCAGAGTTCTACAGTCCGACGATC
-Illumina RNA Adapter1							TGGAATTCTCGGGTGCCAAGG
-
-Illumina Small RNA 3p Adapter 1					ATCTCGTATGCCGTCTTCTGCTTG
-Illumina Small RNA PCR Primer 1					CAAGCAGAAGACGGCATACGA
-Illumina Small RNA PCR Primer 2					AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
-Illumina Small RNA Sequencing Primer			CGACAGGTTCAGAGTTCTACAGTCCGACGATC
-
-TruSeq Universal Adapter						AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT
-TruSeq Adapter, Index 1							GATCGGAAGAGCACACGTCTGAACTCCAGTCACATCACGATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 2							GATCGGAAGAGCACACGTCTGAACTCCAGTCACCGATGTATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 3							GATCGGAAGAGCACACGTCTGAACTCCAGTCACTTAGGCATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 4							GATCGGAAGAGCACACGTCTGAACTCCAGTCACTGACCAATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 5							GATCGGAAGAGCACACGTCTGAACTCCAGTCACACAGTGATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 6							GATCGGAAGAGCACACGTCTGAACTCCAGTCACGCCAATATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 7							GATCGGAAGAGCACACGTCTGAACTCCAGTCACCAGATCATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 8							GATCGGAAGAGCACACGTCTGAACTCCAGTCACACTTGAATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 9							GATCGGAAGAGCACACGTCTGAACTCCAGTCACGATCAGATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 10						GATCGGAAGAGCACACGTCTGAACTCCAGTCACTAGCTTATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 11						GATCGGAAGAGCACACGTCTGAACTCCAGTCACGGCTACATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 12						GATCGGAAGAGCACACGTCTGAACTCCAGTCACCTTGTAATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 13						GATCGGAAGAGCACACGTCTGAACTCCAGTCACAGTCAACTCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 14						GATCGGAAGAGCACACGTCTGAACTCCAGTCACAGTTCCGTCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 15						GATCGGAAGAGCACACGTCTGAACTCCAGTCACATGTCAGTCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 16						GATCGGAAGAGCACACGTCTGAACTCCAGTCACCCGTCCCTCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 18						GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTCCGCATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 19						GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTGAAACTCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 20						GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTGGCCTTCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 21						GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTTTCGGTCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 22						GATCGGAAGAGCACACGTCTGAACTCCAGTCACCGTACGTTCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 23						GATCGGAAGAGCACACGTCTGAACTCCAGTCACCCACTCTTCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 25						GATCGGAAGAGCACACGTCTGAACTCCAGTCACACTGATATCTCGTATGCCGTCTTCTGCTTG
-TruSeq Adapter, Index 27						GATCGGAAGAGCACACGTCTGAACTCCAGTCACATTCCTTTCTCGTATGCCGTCTTCTGCTTG
-
-Illumina RNA RT Primer							GCCTTGGCACCCGAGAATTCCA
-Illumina RNA PCR Primer							AATGATACGGCGACCACCGAGATCTACACGTTCAGAGTTCTACAGTCCGA
-
-RNA PCR Primer, Index 1							CAAGCAGAAGACGGCATACGAGATCGTGATGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 2							CAAGCAGAAGACGGCATACGAGATACATCGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 3							CAAGCAGAAGACGGCATACGAGATGCCTAAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 4							CAAGCAGAAGACGGCATACGAGATTGGTCAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 5							CAAGCAGAAGACGGCATACGAGATCACTGTGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 6							CAAGCAGAAGACGGCATACGAGATATTGGCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 7							CAAGCAGAAGACGGCATACGAGATGATCTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 8							CAAGCAGAAGACGGCATACGAGATTCAAGTGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 9							CAAGCAGAAGACGGCATACGAGATCTGATCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 10						CAAGCAGAAGACGGCATACGAGATAAGCTAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 11						CAAGCAGAAGACGGCATACGAGATGTAGCCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 12						CAAGCAGAAGACGGCATACGAGATTACAAGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 13						CAAGCAGAAGACGGCATACGAGATTTGACTGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 14						CAAGCAGAAGACGGCATACGAGATGGAACTGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 15						CAAGCAGAAGACGGCATACGAGATTGACATGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 16						CAAGCAGAAGACGGCATACGAGATGGACGGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 17						CAAGCAGAAGACGGCATACGAGATCTCTACGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 18						CAAGCAGAAGACGGCATACGAGATGCGGACGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 19						CAAGCAGAAGACGGCATACGAGATTTTCACGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 20						CAAGCAGAAGACGGCATACGAGATGGCCACGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 21						CAAGCAGAAGACGGCATACGAGATCGAAACGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 22						CAAGCAGAAGACGGCATACGAGATCGTACGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 23						CAAGCAGAAGACGGCATACGAGATCCACTCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 24						CAAGCAGAAGACGGCATACGAGATGCTACCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 25						CAAGCAGAAGACGGCATACGAGATATCAGTGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 26						CAAGCAGAAGACGGCATACGAGATGCTCATGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 27						CAAGCAGAAGACGGCATACGAGATAGGAATGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 28						CAAGCAGAAGACGGCATACGAGATCTTTTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 29						CAAGCAGAAGACGGCATACGAGATTAGTTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 30						CAAGCAGAAGACGGCATACGAGATCCGGTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 31						CAAGCAGAAGACGGCATACGAGATATCGTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 32						CAAGCAGAAGACGGCATACGAGATTGAGTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 33						CAAGCAGAAGACGGCATACGAGATCGCCTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 34						CAAGCAGAAGACGGCATACGAGATGCCATGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 35						CAAGCAGAAGACGGCATACGAGATAAAATGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 36						CAAGCAGAAGACGGCATACGAGATTGTTGGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 37						CAAGCAGAAGACGGCATACGAGATATTCCGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 38						CAAGCAGAAGACGGCATACGAGATAGCTAGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 39						CAAGCAGAAGACGGCATACGAGATGTATAGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 40						CAAGCAGAAGACGGCATACGAGATTCTGAGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 41						CAAGCAGAAGACGGCATACGAGATGTCGTCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 42						CAAGCAGAAGACGGCATACGAGATCGATTAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 43						CAAGCAGAAGACGGCATACGAGATGCTGTAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 44						CAAGCAGAAGACGGCATACGAGATATTATAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 45						CAAGCAGAAGACGGCATACGAGATGAATGAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 46						CAAGCAGAAGACGGCATACGAGATTCGGGAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 47						CAAGCAGAAGACGGCATACGAGATCTTCGAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-RNA PCR Primer, Index 48						CAAGCAGAAGACGGCATACGAGATTGCCGAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
-
-ABI Dynabead EcoP Oligo							CTGATCTAGAGGTACCGGATCCCAGCAGT
-ABI Solid3 Adapter A							CTGCCCCGGGTTCCTCATTCTCTCAGCAGCATG
-ABI Solid3 Adapter B							CCACTACGCCTCCGCTTTCCTCTCTATGGGCAGTCGGTGAT
-ABI Solid3 5' AMP Primer						CCACTACGCCTCCGCTTTCCTCTCTATG
-ABI Solid3 3' AMP Primer						CTGCCCCGGGTTCCTCATTCT
-ABI Solid3 EF1 alpha Sense Primer				CATGTGTGTTGAGAGCTTC
-ABI Solid3 EF1 alpha Antisense Primer			GAAAACCAAAGTGGTCCAC
-ABI Solid3 GAPDH Forward Primer					TTAGCACCCCTGGCCAAGG
-ABI Solid3 GAPDH Reverse Primer					CTTACTCCTTGGAGGCCATG
+# This file contains a list of potential contaminants which are
+# frequently found in high throughput sequencing reactions.  These
+# are mostly sequences of adapters / primers used in the various
+# sequencing chemistries.
+# 
+# Please DO NOT rely on these sequences to design your own oligos, some
+# of them are truncated at ambiguous positions, and none of them are
+# definitive sequences from the manufacturers so don't blame us if you
+# try to use them and they don't work.
+#
+# You can add more sequences to the file by putting one line per entry
+# and specifying a name[tab]sequence.  If the contaminant you add is 
+# likely to be of use to others please consider sending it to the FastQ
+# authors, either via a bug report at www.bioinformatics.babraham.ac.uk/bugzilla/
+# or by directly emailing simon.andrews at babraham.ac.uk so other users of
+# the program can benefit.
+
+Illumina Single End Adapter 1					GATCGGAAGAGCTCGTATGCCGTCTTCTGCTTG
+Illumina Single End Adapter 2					CAAGCAGAAGACGGCATACGAGCTCTTCCGATCT
+Illumina Single End PCR Primer 1				AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT
+Illumina Single End PCR Primer 2				CAAGCAGAAGACGGCATACGAGCTCTTCCGATCT
+Illumina Single End Sequencing Primer			ACACTCTTTCCCTACACGACGCTCTTCCGATCT
+
+Illumina Paired End Adapter 1					ACACTCTTTCCCTACACGACGCTCTTCCGATCT
+Illumina Paired End Adapter 2					GATCGGAAGAGCGGTTCAGCAGGAATGCCGAG
+Illumina Paried End PCR Primer 1				AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT
+Illumina Paired End PCR Primer 2				CAAGCAGAAGACGGCATACGAGATCGGTCTCGGCATTCCTGCTGAACCGCTCTTCCGATCT
+Illumina Paried End Sequencing Primer 1			ACACTCTTTCCCTACACGACGCTCTTCCGATCT
+Illumina Paired End Sequencing Primer 2			CGGTCTCGGCATTCCTGCTGAACCGCTCTTCCGATCT
+
+Illumina DpnII expression Adapter 1				ACAGGTTCAGAGTTCTACAGTCCGAC
+Illumina DpnII expression Adapter 2				CAAGCAGAAGACGGCATACGA
+Illumina DpnII expression PCR Primer 1			CAAGCAGAAGACGGCATACGA
+Illumina DpnII expression PCR Primer 2			AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
+Illumina DpnII expression Sequencing Primer		CGACAGGTTCAGAGTTCTACAGTCCGACGATC
+
+Illumina NlaIII expression Adapter 1			ACAGGTTCAGAGTTCTACAGTCCGACATG
+Illumina NlaIII expression Adapter 2			CAAGCAGAAGACGGCATACGA
+Illumina NlaIII expression PCR Primer 1			CAAGCAGAAGACGGCATACGA
+Illumina NlaIII expression PCR Primer 2			AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
+Illumina NlaIII expression Sequencing Primer	CCGACAGGTTCAGAGTTCTACAGTCCGACATG
+
+Illumina Small RNA Adapter 1					GTTCAGAGTTCTACAGTCCGACGATC
+Illumina Small RNA Adapter 2					TGGAATTCTCGGGTGCCAAGG
+Illumina Small RNA RT Primer					CAAGCAGAAGACGGCATACGA
+Illumina Small RNA PCR Primer 1					CAAGCAGAAGACGGCATACGA
+Illumina Small RNA PCR Primer 2					AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
+Illumina Small RNA Sequencing Primer			CGACAGGTTCAGAGTTCTACAGTCCGACGATC
+
+Illumina Multiplexing Adapter 1					GATCGGAAGAGCACACGTCT
+Illumina Multiplexing Adapter 2					ACACTCTTTCCCTACACGACGCTCTTCCGATCT
+Illumina Multiplexing PCR Primer 1.01			AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT
+Illumina Multiplexing PCR Primer 2.01			GTGACTGGAGTTCAGACGTGTGCTCTTCCGATCT
+Illumina Multiplexing Read1 Sequencing Primer	ACACTCTTTCCCTACACGACGCTCTTCCGATCT
+Illumina Multiplexing Index Sequencing Primer	GATCGGAAGAGCACACGTCTGAACTCCAGTCAC
+Illumina Multiplexing Read2 Sequencing Primer	GTGACTGGAGTTCAGACGTGTGCTCTTCCGATCT
+
+Illumina PCR Primer Index 1						CAAGCAGAAGACGGCATACGAGATCGTGATGTGACTGGAGTTC
+Illumina PCR Primer Index 2						CAAGCAGAAGACGGCATACGAGATACATCGGTGACTGGAGTTC
+Illumina PCR Primer Index 3						CAAGCAGAAGACGGCATACGAGATGCCTAAGTGACTGGAGTTC
+Illumina PCR Primer Index 4						CAAGCAGAAGACGGCATACGAGATTGGTCAGTGACTGGAGTTC
+Illumina PCR Primer Index 5						CAAGCAGAAGACGGCATACGAGATCACTGTGTGACTGGAGTTC
+Illumina PCR Primer Index 6						CAAGCAGAAGACGGCATACGAGATATTGGCGTGACTGGAGTTC
+Illumina PCR Primer Index 7						CAAGCAGAAGACGGCATACGAGATGATCTGGTGACTGGAGTTC
+Illumina PCR Primer Index 8						CAAGCAGAAGACGGCATACGAGATTCAAGTGTGACTGGAGTTC
+Illumina PCR Primer Index 9						CAAGCAGAAGACGGCATACGAGATCTGATCGTGACTGGAGTTC
+Illumina PCR Primer Index 10					CAAGCAGAAGACGGCATACGAGATAAGCTAGTGACTGGAGTTC
+Illumina PCR Primer Index 11					CAAGCAGAAGACGGCATACGAGATGTAGCCGTGACTGGAGTTC
+Illumina PCR Primer Index 12					CAAGCAGAAGACGGCATACGAGATTACAAGGTGACTGGAGTTC
+
+Illumina DpnII Gex Adapter 1					GATCGTCGGACTGTAGAACTCTGAAC
+Illumina DpnII Gex Adapter 1.01					ACAGGTTCAGAGTTCTACAGTCCGAC
+Illumina DpnII Gex Adapter 2					CAAGCAGAAGACGGCATACGA
+Illumina DpnII Gex Adapter 2.01					TCGTATGCCGTCTTCTGCTTG
+Illumina DpnII Gex PCR Primer 1					CAAGCAGAAGACGGCATACGA
+Illumina DpnII Gex PCR Primer 2					AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
+Illumina DpnII Gex Sequencing Primer			CGACAGGTTCAGAGTTCTACAGTCCGACGATC
+
+Illumina NlaIII Gex Adapter 1.01				TCGGACTGTAGAACTCTGAAC
+Illumina NlaIII Gex Adapter 1.02				ACAGGTTCAGAGTTCTACAGTCCGACATG
+Illumina NlaIII Gex Adapter 2.01				CAAGCAGAAGACGGCATACGA
+Illumina NlaIII Gex Adapter 2.02				TCGTATGCCGTCTTCTGCTTG
+Illumina NlaIII Gex PCR Primer 1				CAAGCAGAAGACGGCATACGA
+Illumina NlaIII Gex PCR Primer 2				AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
+Illumina NlaIII Gex Sequencing Primer			CCGACAGGTTCAGAGTTCTACAGTCCGACATG
+
+Illumina Small RNA RT Primer					CAAGCAGAAGACGGCATACGA
+Illumina 5p RNA Adapter							GTTCAGAGTTCTACAGTCCGACGATC
+Illumina RNA Adapter1							TGGAATTCTCGGGTGCCAAGG
+
+Illumina Small RNA 3p Adapter 1					ATCTCGTATGCCGTCTTCTGCTTG
+Illumina Small RNA PCR Primer 1					CAAGCAGAAGACGGCATACGA
+Illumina Small RNA PCR Primer 2					AATGATACGGCGACCACCGACAGGTTCAGAGTTCTACAGTCCGA
+Illumina Small RNA Sequencing Primer			CGACAGGTTCAGAGTTCTACAGTCCGACGATC
+
+TruSeq Universal Adapter						AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT
+TruSeq Adapter, Index 1							GATCGGAAGAGCACACGTCTGAACTCCAGTCACATCACGATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 2							GATCGGAAGAGCACACGTCTGAACTCCAGTCACCGATGTATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 3							GATCGGAAGAGCACACGTCTGAACTCCAGTCACTTAGGCATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 4							GATCGGAAGAGCACACGTCTGAACTCCAGTCACTGACCAATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 5							GATCGGAAGAGCACACGTCTGAACTCCAGTCACACAGTGATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 6							GATCGGAAGAGCACACGTCTGAACTCCAGTCACGCCAATATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 7							GATCGGAAGAGCACACGTCTGAACTCCAGTCACCAGATCATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 8							GATCGGAAGAGCACACGTCTGAACTCCAGTCACACTTGAATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 9							GATCGGAAGAGCACACGTCTGAACTCCAGTCACGATCAGATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 10						GATCGGAAGAGCACACGTCTGAACTCCAGTCACTAGCTTATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 11						GATCGGAAGAGCACACGTCTGAACTCCAGTCACGGCTACATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 12						GATCGGAAGAGCACACGTCTGAACTCCAGTCACCTTGTAATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 13						GATCGGAAGAGCACACGTCTGAACTCCAGTCACAGTCAACTCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 14						GATCGGAAGAGCACACGTCTGAACTCCAGTCACAGTTCCGTCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 15						GATCGGAAGAGCACACGTCTGAACTCCAGTCACATGTCAGTCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 16						GATCGGAAGAGCACACGTCTGAACTCCAGTCACCCGTCCCTCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 18						GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTCCGCATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 19						GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTGAAACTCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 20						GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTGGCCTTCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 21						GATCGGAAGAGCACACGTCTGAACTCCAGTCACGTTTCGGTCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 22						GATCGGAAGAGCACACGTCTGAACTCCAGTCACCGTACGTTCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 23						GATCGGAAGAGCACACGTCTGAACTCCAGTCACCCACTCTTCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 25						GATCGGAAGAGCACACGTCTGAACTCCAGTCACACTGATATCTCGTATGCCGTCTTCTGCTTG
+TruSeq Adapter, Index 27						GATCGGAAGAGCACACGTCTGAACTCCAGTCACATTCCTTTCTCGTATGCCGTCTTCTGCTTG
+
+Illumina RNA RT Primer							GCCTTGGCACCCGAGAATTCCA
+Illumina RNA PCR Primer							AATGATACGGCGACCACCGAGATCTACACGTTCAGAGTTCTACAGTCCGA
+
+RNA PCR Primer, Index 1							CAAGCAGAAGACGGCATACGAGATCGTGATGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 2							CAAGCAGAAGACGGCATACGAGATACATCGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 3							CAAGCAGAAGACGGCATACGAGATGCCTAAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 4							CAAGCAGAAGACGGCATACGAGATTGGTCAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 5							CAAGCAGAAGACGGCATACGAGATCACTGTGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 6							CAAGCAGAAGACGGCATACGAGATATTGGCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 7							CAAGCAGAAGACGGCATACGAGATGATCTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 8							CAAGCAGAAGACGGCATACGAGATTCAAGTGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 9							CAAGCAGAAGACGGCATACGAGATCTGATCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 10						CAAGCAGAAGACGGCATACGAGATAAGCTAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 11						CAAGCAGAAGACGGCATACGAGATGTAGCCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 12						CAAGCAGAAGACGGCATACGAGATTACAAGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 13						CAAGCAGAAGACGGCATACGAGATTTGACTGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 14						CAAGCAGAAGACGGCATACGAGATGGAACTGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 15						CAAGCAGAAGACGGCATACGAGATTGACATGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 16						CAAGCAGAAGACGGCATACGAGATGGACGGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 17						CAAGCAGAAGACGGCATACGAGATCTCTACGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 18						CAAGCAGAAGACGGCATACGAGATGCGGACGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 19						CAAGCAGAAGACGGCATACGAGATTTTCACGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 20						CAAGCAGAAGACGGCATACGAGATGGCCACGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 21						CAAGCAGAAGACGGCATACGAGATCGAAACGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 22						CAAGCAGAAGACGGCATACGAGATCGTACGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 23						CAAGCAGAAGACGGCATACGAGATCCACTCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 24						CAAGCAGAAGACGGCATACGAGATGCTACCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 25						CAAGCAGAAGACGGCATACGAGATATCAGTGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 26						CAAGCAGAAGACGGCATACGAGATGCTCATGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 27						CAAGCAGAAGACGGCATACGAGATAGGAATGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 28						CAAGCAGAAGACGGCATACGAGATCTTTTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 29						CAAGCAGAAGACGGCATACGAGATTAGTTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 30						CAAGCAGAAGACGGCATACGAGATCCGGTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 31						CAAGCAGAAGACGGCATACGAGATATCGTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 32						CAAGCAGAAGACGGCATACGAGATTGAGTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 33						CAAGCAGAAGACGGCATACGAGATCGCCTGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 34						CAAGCAGAAGACGGCATACGAGATGCCATGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 35						CAAGCAGAAGACGGCATACGAGATAAAATGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 36						CAAGCAGAAGACGGCATACGAGATTGTTGGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 37						CAAGCAGAAGACGGCATACGAGATATTCCGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 38						CAAGCAGAAGACGGCATACGAGATAGCTAGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 39						CAAGCAGAAGACGGCATACGAGATGTATAGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 40						CAAGCAGAAGACGGCATACGAGATTCTGAGGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 41						CAAGCAGAAGACGGCATACGAGATGTCGTCGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 42						CAAGCAGAAGACGGCATACGAGATCGATTAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 43						CAAGCAGAAGACGGCATACGAGATGCTGTAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 44						CAAGCAGAAGACGGCATACGAGATATTATAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 45						CAAGCAGAAGACGGCATACGAGATGAATGAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 46						CAAGCAGAAGACGGCATACGAGATTCGGGAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 47						CAAGCAGAAGACGGCATACGAGATCTTCGAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+RNA PCR Primer, Index 48						CAAGCAGAAGACGGCATACGAGATTGCCGAGTGACTGGAGTTCCTTGGCACCCGAGAATTCCA
+
+ABI Dynabead EcoP Oligo							CTGATCTAGAGGTACCGGATCCCAGCAGT
+ABI Solid3 Adapter A							CTGCCCCGGGTTCCTCATTCTCTCAGCAGCATG
+ABI Solid3 Adapter B							CCACTACGCCTCCGCTTTCCTCTCTATGGGCAGTCGGTGAT
+ABI Solid3 5' AMP Primer						CCACTACGCCTCCGCTTTCCTCTCTATG
+ABI Solid3 3' AMP Primer						CTGCCCCGGGTTCCTCATTCT
+ABI Solid3 EF1 alpha Sense Primer				CATGTGTGTTGAGAGCTTC
+ABI Solid3 EF1 alpha Antisense Primer			GAAAACCAAAGTGGTCCAC
+ABI Solid3 GAPDH Forward Primer					TTAGCACCCCTGGCCAAGG
+ABI Solid3 GAPDH Reverse Primer					CTTACTCCTTGGAGGCCATG
diff --git a/Configuration/limits.txt b/Configuration/limits.txt
index 742d172..1b8415a 100644
--- a/Configuration/limits.txt
+++ b/Configuration/limits.txt
@@ -1,84 +1,84 @@
-# For each of the modules you can choose to not run that
-# module at all by setting the value below to 1 for the
-# modules you want to remove.
-duplication 		ignore 		0
-kmer 				ignore 		0
-n_content 			ignore 		0
-overrepresented 	ignore 		0
-quality_base 		ignore 		0
-sequence 			ignore 		0
-gc_sequence			ignore 		0
-quality_sequence	ignore		0
-tile				ignore		0
-sequence_length		ignore		0
-adapter				ignore		0
-
-# For the duplication module the value is the percentage
-# remaining after deduplication.  Measured levels below
-# these limits trigger the warning / error.
-duplication	warn	70
-duplication error	50
-
-# For the kmer module the filter is on the -log10 binomial
-# pvalue for the most significant Kmer, so 5 would be 
-# 10^-5 = p<0.00001
-kmer	warn	2
-kmer	error	5
-
-# For the N module the filter is on the percentage of Ns
-# at any position in the library
-n_content	warn	5
-n_content	error	20
-
-# For the overrepresented seqs the warn value sets the
-# threshold for the overrepresented sequences to be reported
-# at all as the proportion of the library which must be seen
-# as a single sequence
-overrepresented	warn	0.1
-overrepresented	error	1
-
-# The per base quality filter uses two values, one for the value
-# of the lower quartile, and the other for the value of the
-# median quality.  Failing either of these will trigger the alert
-quality_base_lower	warn	10
-quality_base_lower	error	5
-quality_base_median	warn	25
-quality_base_median	error	20
-
-# The per base sequence content module tests the maximum deviation
-# between A and T or C and G
-sequence	warn	10
-sequence	error	20
-
-# The per sequence GC content tests the maximum deviation between
-# the theoretical distribution and the real distribution
-gc_sequence	warn	15
-gc_sequence	error	30
-
-# The per sequence quality module tests the phred score which is
-# most frequently observed
-quality_sequence	warn	27
-quality_sequence	error	20
-
-# The per tile module tests the maximum phred score loss between 
-# and individual tile and the average for that base across all tiles
-tile	warn	5
-tile	error	10
-
-# The sequence length module tests are binary, so the values here
-# simply turn them on or off.  The actual tests warn if you have
-# sequences of different length, and error if you have sequences
-# of zero length.
-
-sequence_length	warn	1
-sequence_length	error	1
-
-# The adapter module's warnings and errors are based on the 
-# percentage of reads in the library which have been observed
-# to contain an adapter associated Kmer at any point
-
-adapter	warn	5
-adapter	error	10
-
-
+# For each of the modules you can choose to not run that
+# module at all by setting the value below to 1 for the
+# modules you want to remove.
+duplication 		ignore 		0
+kmer 				ignore 		0
+n_content 			ignore 		0
+overrepresented 	ignore 		0
+quality_base 		ignore 		0
+sequence 			ignore 		0
+gc_sequence			ignore 		0
+quality_sequence	ignore		0
+tile				ignore		0
+sequence_length		ignore		0
+adapter				ignore		0
+
+# For the duplication module the value is the percentage
+# remaining after deduplication.  Measured levels below
+# these limits trigger the warning / error.
+duplication	warn	70
+duplication error	50
+
+# For the kmer module the filter is on the -log10 binomial
+# pvalue for the most significant Kmer, so 5 would be 
+# 10^-5 = p<0.00001
+kmer	warn	2
+kmer	error	5
+
+# For the N module the filter is on the percentage of Ns
+# at any position in the library
+n_content	warn	5
+n_content	error	20
+
+# For the overrepresented seqs the warn value sets the
+# threshold for the overrepresented sequences to be reported
+# at all as the proportion of the library which must be seen
+# as a single sequence
+overrepresented	warn	0.1
+overrepresented	error	1
+
+# The per base quality filter uses two values, one for the value
+# of the lower quartile, and the other for the value of the
+# median quality.  Failing either of these will trigger the alert
+quality_base_lower	warn	10
+quality_base_lower	error	5
+quality_base_median	warn	25
+quality_base_median	error	20
+
+# The per base sequence content module tests the maximum deviation
+# between A and T or C and G
+sequence	warn	10
+sequence	error	20
+
+# The per sequence GC content tests the maximum deviation between
+# the theoretical distribution and the real distribution
+gc_sequence	warn	15
+gc_sequence	error	30
+
+# The per sequence quality module tests the phred score which is
+# most frequently observed
+quality_sequence	warn	27
+quality_sequence	error	20
+
+# The per tile module tests the maximum phred score loss between 
+# and individual tile and the average for that base across all tiles
+tile	warn	5
+tile	error	10
+
+# The sequence length module tests are binary, so the values here
+# simply turn them on or off.  The actual tests warn if you have
+# sequences of different length, and error if you have sequences
+# of zero length.
+
+sequence_length	warn	1
+sequence_length	error	1
+
+# The adapter module's warnings and errors are based on the 
+# percentage of reads in the library which have been observed
+# to contain an adapter associated Kmer at any point
+
+adapter	warn	5
+adapter	error	10
+
+
 	
\ No newline at end of file
diff --git a/Help/3 Analysis Modules/8 Duplicate Sequences.html b/Help/3 Analysis Modules/8 Duplicate Sequences.html
index 72e630c..ac54f23 100644
--- a/Help/3 Analysis Modules/8 Duplicate Sequences.html	
+++ b/Help/3 Analysis Modules/8 Duplicate Sequences.html	
@@ -59,9 +59,9 @@ plot in both the red and blue lines.  A general level of enrichment, indicating
 oversequencing in the library will tend to flatten the lines, lowering the low end and 
 generally raising other categories.  More specific enrichments of subsets, or the 
 presence of low complexity contaminants will tend to produce spikes towards the right
-of the plot.  These high duplication peaks will most often appear in the red trace as
+of the plot.  These high duplication peaks will most often appear in the blue trace as
 they make up a high proportion of the original library, but usually disappear in the
-blue trace as they make up an insignificant proportion of the deduplicated set.  If peaks
+red trace as they make up an insignificant proportion of the deduplicated set.  If peaks
 persist in the blue trace then this suggests that there are a large number of different
 highly duplicated sequences which might indicate either a contaminant set or a very
 severe technical duplication.
diff --git a/INSTALL.txt b/INSTALL.txt
index c4d578a..f311e0c 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -1,139 +1,139 @@
-Installing FastQC
--------------------
-FastQC is a java application.  In order to run it needs your system to have a suitable
-Java Runtime Environment (JRE) installed.  Before you try to run FastQC you should therefore
-ensure that you have a suitable JRE.  There are a number of different JREs available
-however the ones we have tested are the v1.6-v1.8 JREs from Oracle.  These are available
-for a number of different platforms.
-
-Windows/Linux: Go to java.com - click on Free Java Download - DON'T click the large red button
-but choose the smaller link to "See all java downloads".  Find your operating system and select
-the appropriate offline installer.  If you are using a 64bit operating system (and nearly 
-everyone is these days), then make sure you select the 64bit version of the the installer.
-
-OSX: On newer versions of OSX you need to install the Java Development Kit.  The normal Java
-runtime environment IS NOT enough.  To get this go to java.com, click "Free java download",
-then IGNORE the big red button, and select "See all java downloads", on the next screen select
-"Looking for the JDK?" from the left hand menu and select the link to "JDK downloads" in the
-first paragraph.  You can then click the "Download" button underneath JDK in the page you are
-taken to.  Sorry this is such a pain!
-
-
-If you're not sure whether you have java installed then you can test this from a command
-prompt.  To get a command prompt try:
-
-Windows: Select Start > Run, and type 'cmd' (no quotes) in the box which appears, press OK
-
-MaxOSX: Run Applications > Utilities > Terminal
-
-Linux: From your applications menu look for an application called 'Terminal' or 'Konsole'.
-Either of these will give you a usable shell.
-
-At the command prompt type 'java -version' and press enter.  You should see something like:
-
-java version "1.8.0_60"
-Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
-Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
-
-If you get an error then you don't have java installed.  If the version listed on the first
-line is less than 1.6 then you might have problems running FastQC.
-
-Actually installing FastQC is as simple as unzipping the zip file it comes in into a
-suitable location.  That's it.  Once unzipped it's ready to go.
-
-Running FastQC
---------------
-
-You can run FastQC in one of two modes, either as an interactive graphical application
-in which you can dynamically load FastQ files and view their results.
-
-Alternatively you can run FastQC in a non-interactive mode where you specify the files
-you want to process on the command line and FastQC will generate an HTML report for
-each file without launching a user interface.  This would allow FastQC to be run as
-part of an analysis pipeline.
-
-
-Running FastQC Interactively
-----------------------------
-Windows: Simply double click on the run_fastqc bat file.  If you want to make a pretty 
-shortcut then we've included an icon file in the top level directory so you don't have
-to use the generic bat file icon.
-
-MacOSX: There is an application bundle for MacOSX which you can use to install and run
-FastQC.  Just drag the application from the disk image to your Applications folder (or
-wherever you want to install the program).
-
-Linux:  We have included a wrapper script, called 'fastqc' which is the easiest way to 
-start the program.  The wrapper is in the top level of the FastQC installation.  You 
-may need to make this file executable:
-
-chmod 755 fastqc
-
-..but once you have done that you can run it directly
-
-./fastqc
-
-..or place a link in /usr/local/bin to be able to run the program from any location:
-
-sudo ln -s /path/to/FastQC/fastqc /usr/local/bin/fastqc
-
-
-Running FastQC as part of a pipeline
-------------------------------------
-To run FastQC non-interactively you should use the fastqc wrapper script to launch
-the program.  You will probably want to use the zipped install file on every platform
-(even OSX).
-
-To run non-interactively you simply have to specify a list of files to process
-on the commandline
-
-fastqc somefile.txt someotherfile.txt
-
-You can specify as many files to process in a single run as you like.  If you don't
-specify any files to process the program will try to open the interactive application
-which may result in an error if you're running in a non-graphical environment.
-
-There are a few extra options you can specify when running non-interactively.  Full
-details of these can be found by running 
-
-fastqc --help
-
-By default, in non-interactive mode FastQC will create an HTML report with embedded
-graphs, but also a zip file containing individual graph files and additional data files
-containing the raw data from which plots were drawn.  The zip file will not be extracted
-by default but you can enable this by adding:
-
---extract
-
-To the launch command.
-
-If you want to save your reports in a folder other than the folder which contained
-your original FastQ files then you can specify an alternative location by setting a
---outdir value:
-
---outdir=/some/other/dir/
-
-If you want to run fastqc on a stream of data to be read from standard input then you
-can do this by specifing 'stdin' as the name of the file to be processed and then 
-streaming uncompressed fastq format data to the program.  For example:
-
-zcat *fastq.gz | fastqc stdin
-
-Customising the report output
------------------------------
-
-If you want to run FastQC as part of a sequencing pipeline you may wish to change the
-formatting of the report to add in your own branding or to include extra information.
-
-In the Templates directory you will find a file called 'header_template.html' which
-you can edit to change the look of the report.  This file contains all of the header for
-the report file, including the CSS section and you can alter this however you see fit.
-
-Whilst you can make whatever changes you like you should probably leave in place the
-<div> structure of the html template since later code will expect to close the main div
-which is left open at the end of the header.  There is no facility to change the code in
-the main body of the report or the footer (although you can of course change the styling).
-
-The text tags @@FILENAME@@ and @@DATE@@ are placeholders which are filled in when the
-report it created.  You can use these placeholders in other parts of the header if you
-wish.
+Installing FastQC
+-------------------
+FastQC is a java application.  In order to run it needs your system to have a suitable
+Java Runtime Environment (JRE) installed.  Before you try to run FastQC you should therefore
+ensure that you have a suitable JRE.  There are a number of different JREs available
+however the ones we have tested are the v1.6-v1.8 JREs from Oracle.  These are available
+for a number of different platforms.
+
+Windows/Linux: Go to java.com - click on Free Java Download - DON'T click the large red button
+but choose the smaller link to "See all java downloads".  Find your operating system and select
+the appropriate offline installer.  If you are using a 64bit operating system (and nearly 
+everyone is these days), then make sure you select the 64bit version of the the installer.
+
+OSX: On newer versions of OSX you need to install the Java Development Kit.  The normal Java
+runtime environment IS NOT enough.  To get this go to java.com, click "Free java download",
+then IGNORE the big red button, and select "See all java downloads", on the next screen select
+"Looking for the JDK?" from the left hand menu and select the link to "JDK downloads" in the
+first paragraph.  You can then click the "Download" button underneath JDK in the page you are
+taken to.  Sorry this is such a pain!
+
+
+If you're not sure whether you have java installed then you can test this from a command
+prompt.  To get a command prompt try:
+
+Windows: Select Start > Run, and type 'cmd' (no quotes) in the box which appears, press OK
+
+MaxOSX: Run Applications > Utilities > Terminal
+
+Linux: From your applications menu look for an application called 'Terminal' or 'Konsole'.
+Either of these will give you a usable shell.
+
+At the command prompt type 'java -version' and press enter.  You should see something like:
+
+java version "1.8.0_60"
+Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
+Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
+
+If you get an error then you don't have java installed.  If the version listed on the first
+line is less than 1.6 then you might have problems running FastQC.
+
+Actually installing FastQC is as simple as unzipping the zip file it comes in into a
+suitable location.  That's it.  Once unzipped it's ready to go.
+
+Running FastQC
+--------------
+
+You can run FastQC in one of two modes, either as an interactive graphical application
+in which you can dynamically load FastQ files and view their results.
+
+Alternatively you can run FastQC in a non-interactive mode where you specify the files
+you want to process on the command line and FastQC will generate an HTML report for
+each file without launching a user interface.  This would allow FastQC to be run as
+part of an analysis pipeline.
+
+
+Running FastQC Interactively
+----------------------------
+Windows: Simply double click on the run_fastqc bat file.  If you want to make a pretty 
+shortcut then we've included an icon file in the top level directory so you don't have
+to use the generic bat file icon.
+
+MacOSX: There is an application bundle for MacOSX which you can use to install and run
+FastQC.  Just drag the application from the disk image to your Applications folder (or
+wherever you want to install the program).
+
+Linux:  We have included a wrapper script, called 'fastqc' which is the easiest way to 
+start the program.  The wrapper is in the top level of the FastQC installation.  You 
+may need to make this file executable:
+
+chmod 755 fastqc
+
+..but once you have done that you can run it directly
+
+./fastqc
+
+..or place a link in /usr/local/bin to be able to run the program from any location:
+
+sudo ln -s /path/to/FastQC/fastqc /usr/local/bin/fastqc
+
+
+Running FastQC as part of a pipeline
+------------------------------------
+To run FastQC non-interactively you should use the fastqc wrapper script to launch
+the program.  You will probably want to use the zipped install file on every platform
+(even OSX).
+
+To run non-interactively you simply have to specify a list of files to process
+on the commandline
+
+fastqc somefile.txt someotherfile.txt
+
+You can specify as many files to process in a single run as you like.  If you don't
+specify any files to process the program will try to open the interactive application
+which may result in an error if you're running in a non-graphical environment.
+
+There are a few extra options you can specify when running non-interactively.  Full
+details of these can be found by running 
+
+fastqc --help
+
+By default, in non-interactive mode FastQC will create an HTML report with embedded
+graphs, but also a zip file containing individual graph files and additional data files
+containing the raw data from which plots were drawn.  The zip file will not be extracted
+by default but you can enable this by adding:
+
+--extract
+
+To the launch command.
+
+If you want to save your reports in a folder other than the folder which contained
+your original FastQ files then you can specify an alternative location by setting a
+--outdir value:
+
+--outdir=/some/other/dir/
+
+If you want to run fastqc on a stream of data to be read from standard input then you
+can do this by specifing 'stdin' as the name of the file to be processed and then 
+streaming uncompressed fastq format data to the program.  For example:
+
+zcat *fastq.gz | fastqc stdin
+
+Customising the report output
+-----------------------------
+
+If you want to run FastQC as part of a sequencing pipeline you may wish to change the
+formatting of the report to add in your own branding or to include extra information.
+
+In the Templates directory you will find a file called 'header_template.html' which
+you can edit to change the look of the report.  This file contains all of the header for
+the report file, including the CSS section and you can alter this however you see fit.
+
+Whilst you can make whatever changes you like you should probably leave in place the
+<div> structure of the html template since later code will expect to close the main div
+which is left open at the end of the header.  There is no facility to change the code in
+the main body of the report or the footer (although you can of course change the styling).
+
+The text tags @@FILENAME@@ and @@DATE@@ are placeholders which are filled in when the
+report it created.  You can use these placeholders in other parts of the header if you
+wish.
diff --git a/LICENSE.txt b/LICENSE.txt
index 94a9ed0..818433e 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,674 +1,674 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/README.txt b/README.txt
index 3e0db5c..06d6391 100644
--- a/README.txt
+++ b/README.txt
@@ -1,44 +1,44 @@
-FastQC - A Quality Control application for FastQ files
-------------------------------------------------------
-
-Most high throughput sequencers generate output in FastQ format.  This
-format combines the base calls for the sequence which was generated with
-an encoded quality value for each base which says how confident the
-sequencer was that the base call generated was correct.
-
-Before proceeding with the analysis of a sequence data set it is
-a good idea to do some basic quality control checks on the raw data
-to ensure that there are no hidden problems which might be more
-difficult to detect at a later stage.
-
-FastQC is an application which takes a FastQ file and runs a series
-of tests on it to generate a comprehensive QC report.  This will
-tell you if there is anything unusual about your sequence.  Each
-test is flagged as a pass, warning or fail depending on how far it
-departs from what you'd expect from a normal large dataset with no
-significant biases.  It's important to stress that warnings or even
-failures do not necessarily mean that there is a problem with your
-data, only that it is unusual.  It is possible that the biological
-nature of your sample means that you would expect this particular
-bias in your results.
-
-FastQC can be run either as an interactive graphical application 
-which allows you to view results for multiple files in a single
-application.  Alternatively you can run the program in a non
-interactive way (say as part of a pipeline) which will generate
-an HTML report for each file you process.
-
-FastQC is a cross-platform application, written in java.  In theory it
-should run on any platform which has a suitable java runtime environment.
-Having said that we've only tested in on Windows, MacOSX and Linux
-running the Oracle v1.6 to 1.8 JREs.  Please let us know what happened if
-you try running it on other platforms / JREs.  Please see the detailed
-instructions in the INSTALL.txt document to tell you how to get a 
-suitable java version to run FastQC on your system.
-
-If you have any comments about FastQC we would like to hear them.  You
-can either enter them in our bug tracking system at:
-
-http://www.bioinformatics.babraham.ac.uk/bugzilla/
-
-..or send them directly to simon.andrews at babraham.ac.uk.
+FastQC - A Quality Control application for FastQ files
+------------------------------------------------------
+
+Most high throughput sequencers generate output in FastQ format.  This
+format combines the base calls for the sequence which was generated with
+an encoded quality value for each base which says how confident the
+sequencer was that the base call generated was correct.
+
+Before proceeding with the analysis of a sequence data set it is
+a good idea to do some basic quality control checks on the raw data
+to ensure that there are no hidden problems which might be more
+difficult to detect at a later stage.
+
+FastQC is an application which takes a FastQ file and runs a series
+of tests on it to generate a comprehensive QC report.  This will
+tell you if there is anything unusual about your sequence.  Each
+test is flagged as a pass, warning or fail depending on how far it
+departs from what you'd expect from a normal large dataset with no
+significant biases.  It's important to stress that warnings or even
+failures do not necessarily mean that there is a problem with your
+data, only that it is unusual.  It is possible that the biological
+nature of your sample means that you would expect this particular
+bias in your results.
+
+FastQC can be run either as an interactive graphical application 
+which allows you to view results for multiple files in a single
+application.  Alternatively you can run the program in a non
+interactive way (say as part of a pipeline) which will generate
+an HTML report for each file you process.
+
+FastQC is a cross-platform application, written in java.  In theory it
+should run on any platform which has a suitable java runtime environment.
+Having said that we've only tested in on Windows, MacOSX and Linux
+running the Oracle v1.6 to 1.8 JREs.  Please let us know what happened if
+you try running it on other platforms / JREs.  Please see the detailed
+instructions in the INSTALL.txt document to tell you how to get a 
+suitable java version to run FastQC on your system.
+
+If you have any comments about FastQC we would like to hear them.  You
+can either enter them in our bug tracking system at:
+
+http://www.bioinformatics.babraham.ac.uk/bugzilla/
+
+..or send them directly to simon.andrews at babraham.ac.uk.
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 8399a22..35eb52d 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,835 +1,853 @@
-RELEASE NOTES FOR FastQC v0.11.4
---------------------------------
-
-This is a minor bug-fix release which addresses issues found in
-the previous release.
-
-1) 	Changed the OSX launcher to not rely on the Mac specific JVM
-	framework, but to use any command line java which is found.  This
-	will require the user to install the JDK on newer OSX releases
-	rather than just the JVM.  See the updated version of the INSTALL.txt
-	document if you have problems with this on OSX.
-
-2)	Fixed a typo in one of the included adapter sequences in the search
-	set.
-	
-3) 	Fixed a bug which failed to remove an fq.gz extension from the 
-	name used in the report when running in offline mode.
-	
-4)	Made the per-tile quality module not collect any stats if it's
-	been disabled in limits.txt, rather than just not being included
-	in the output.
-	
-5)	Fixed a bug in the calculation of duplication levels which only 
-	affected highly duplicated ordered libraries where the count limit
-	was not reached.
-	
-6)  Fixed a bug which triggered an error flag on the per-base quality
-	plot for positions with fewer than 100 observations, where we can't
-	calculate a sensible percentile value.  Changed the text report to
-	assign NaN to these positions rather than 0.
-
-
-
-RELEASE NOTES FOR FastQC v0.11.3
---------------------------------
-
-This is a minor bug-fix release which addresses some issues 
-reported with the v0.11.2 release.
-
-1) Fixed a bug when using the limits.txt file to disable the per
-   tile analysis module.
-   
-2) Fixed a documentation error in the duplicated sequences plot.
-
-3) Fixed a thread safety bug when processing multiple files in a 
-   single session which caused the program not to exit when all
-   processing had in fact completed.
-   
-4) Fixed a bug which meant that forced formats in the interactive
-   application weren't being honoured.
-   
-5) Fixed a bug in the way soft clipping was applied when we were
-   analysing only mapped data.
-   
-6) Fix a memory issue when trying to parse tile names in cases where
-   we mistakenly think we're identify tile numbers, but we aren't
-   
-7) Fix a bug in the text reporting of per-tile quality scores
-
-8) Add the SOLID smallRNA adapter to the default adapter search set
-
-9) Fix a bug in casava mode when using uncompressed fastq files
-
-10) Increase the number of sampled sequences in the duplicate and 
-   overrepresented module to 100,000.
-   
-11) Add a clean up of data structures for the Kmer module so that
-    the interactive mode can process more files without dying.
-
-
-RELEASE NOTES FOR FastQC v0.11.2
---------------------------------
-
-This is a minor bug-fix release which addresses some issues 
-reported with the v0.11.1 release.
-
-1) Added a proper implementation of a --limits command line
-option to allow users to specify a custom limits file for an 
-individual run.  This also fixed a bug seen if the user used the
---adapter option.
-
-2) Fixed an error in the naming of the folder inside the zip file
-such that it couldn't be extracted into the same folder as the
-main HTML file.
-
-3) Fixed an overly large data structure which was causing some
-runs to terminate due to a lack of memory.
-
-4) Fixed a poor implementation in the Kmer module which was 
-causing unusually high memory usage.
-
-5) Fixed incorrect defaults for the warn/fail values in the per
-sequence quality module.
-
-RELEASE NOTES FOR FastQC V0.11.1
---------------------------------
-
-FastQC v0.11.1 is the first release for a long time and is a 
-major update to the package.  This release adds some significant
-new features to the program which will hopefully make it more 
-useful.
-
-The major new features in this release are:
-
-1) Configurable thresholds for modules.  For all modules you can
-now alter a configuration file to set the thresholds used by the 
-program for warnings and errors so that you can flag up only the
-types of problem which you are concerned by.
-
-2) Optional modules.  The same configuration file used to set 
-the warn / error thresholds can also be used to selectively 
-disable modules you don't want to see at all.
-
-3) New per-tile quality analysis.  If you are running Illumina
-libraries through FastQC it will now analyse the quality calls
-on a per-tile basis and will flag up points in the run where the
-quality in individual tiles fell below the average quality for 
-that cycle.  This can help to spot technical problems during the
-run.
-
-4) New adapter content module.  A new module has been added to
-specifically search for the presence of adapters in your library.
-This operates in a similar way to the existing Kmer analysis but 
-allows you to specify individual adapter sequences to screen and
-will always show the results for each adapter so you can easily
-see what you might gain if you chose to adapter trim your library.
-
-5) Improved duplication plot.  The duplication plot has been given
-an overhaul so that it now reports values which are real read 
-numbers rather than always giving relative values.  This is thanks
-to work done by Brian Howard of sciome.com who worked out the right
-way to extrapolate from the data we sample to the full library.  It 
-also shows how the level of duplication would affect the library 
-both before and after deduplication, and the headline figure is now 
-much more  useful as it shows the percentage of the library which 
-would remain if you chose to deduplicate.
-
-6) Improved Kmer module.  The Kmer module has been changed so that
-instead of trying to search for individual Kmers which are present
-at higher than expected frequency (which actually happens all the 
-time in real libraries), it now looks for Kmers which are present 
-in significantly different amounts at different starting positions
-within the library.  This has allowed the use of longer Kmer 
-sequences to give a more useful result.
-
-7) Since file reports.  The default output format for the program 
-is now a single HTML file with all of the various graphs embedded 
-into it.  The .zip file output with the individual graphs is still 
-produced as are the associated data files, but you can just 
-distribute the one HTML file alone - the other data is no longer 
-required.
-
-8) Ability to read from stdin.  If you want to pipe a stream of
-data into fastqc rather than using a real file then you can just
-use  'stdin' as the filename to process and then stream uncompressed
-fastq data on stdin.
-
-9) Changed base groupings.  For long reads we used to use an 
-exponential series to group bases together to summarise the sequence
-content and qualities.  We've now switched the default to be that
-for grouped plots the first 9 individual bases will always be shown
-(since this often roots out problems in the libraries), after that
-there will be a series of evenly sized windows so that the same number
-of bases fall into each window.  You can bring back the old behaviour
-with the new --expgroup option, and you can remove grouping all together
-with the --nogroup option (although this will do bad things to your
-plots if you have really long reads).
-
-10) Dropped support for the Solaxa64 (but NOT Phred64) encoding.  We
-have removed the ability of the program to reliably detect the original
-Solexa64 encoding which was used in the GA pipeline prior to v1.3.
-This was a 64 offset encoding but which allowed scores which ranged
-down to -5.  Supporting this encoding meant that we would incorrectly 
-guess the encoding on Phred33 files which had no bases with quality 
-scores below 26, which could happen if you aggressively trimmed your
-data.  Supporting just Phred33 and Phred64 now means that we wouldn't
-mis-detect unless there were no bases with qualities below 31, which 
-is much less likely, even in trimmed data.  Since no Solexa64 data
-will have been produced since early 2009 it is unlikely that removing
-support for this format will adversely affect users of the program.
-
-
-RELEASE NOTES FOR FastQC V0.10.1
---------------------------------
-
-FastQC v0.10.1 is a bugfix release which works around two problems
-people have encountered with previous releases:
-
-1) A work-round has been put into place for a limitation in the
-java gzip decompressor, where it would read only the first
-compressed block in a file created by concatenating multiple 
-gzipped files directly, rather than decompressing and recompressing
-them.
-
-2) Users who had installed the program in directories containing
-characters required to be encoded in URLs (= & ? etc) were finding
-that the report generation generated an error.  This encoding has
-now been fixed and the program should now have no limits in the 
-name of the directory in which it can be installed.
-
-One additional feature is that in the fastqc wrapper you can now
-specify the location of the java interpreter on the command line
-using the --java parameter, rather than having to have it included
-in the path.
-
-One other change in this release is that the package names for all
-of the java classes have been changed to reflect a change in the
-official project URL.  This means that the launchers for the 
-program have had to be updated to use these new names.  If you have
-created your own launcher, or had copied any of the old ones you'll
-need to update this to use the launchers included in this version
-of the program.
-
-The new URL for the project is:
-
-www.bioinformatics.babraham.ac.uk/projects/fastqc/
-
-..and if you want to report bugs the bugzilla URL is now:
-
-www.bioinformatics.babraham.ac.uk/bugzilla/
-
-
-RELEASE NOTES FOR FastQC V0.10.0
---------------------------------
-
-The major feature of FastQC v0.10.0 is the addition of support
-for fastq files generated directly by the latest version of the
-illumina pipeline (Casava v1.8).  In this version the pipeline
-generates gzipped fastq files by default rather than using qseq
-files which can then be converted to fastq.  However the fastq
-files generated by casava are unusual in two ways:
-
-1) A single sample produces a set of fastq files with a common
-   name, but an incrementing number at the end.
-   
-2) Casava FastQ files contain sequences from clusters which have
-   failed the internal QC, and been flagged to be filtered.
-
-FastQC v0.10.0 introduces a Casava mode which will merge together
-fastq files from the same sample group and produce a single report.
-It will also exclude any flagged entries from the analysis.  You
-would therefore run FastQC as normal but selecting all of the
-fastq files from Casava and using casava mode for your analysis.
-
-Casava mode is activated from the command line by adding the 
---casava option to the launch command. From the interactive 
-application you need to select 'Casava FastQ Files' from the drop 
-down file selector filter options.
-
-If you want to analyse casava fastq files without these extra
-options then you can use treat them as normal fastq files with 
-no problems.
-
-In addition to this change there have also been changes to allow 
-the wrapper script to work properly under windows, and a bug was
-fixed which missed of the last possible Kmer from every sequence
-in a library.
-
-
-RELEASE NOTES FOR FastQC V0.9.6
--------------------------------
-
-FastQC v0.9.6 fixes a couple of bugs which aren't likely to have
-affected the majority of fastqc users:
-
-- Fixed a crash in the Kmer module when analysing a sequence where
-  every sequence in a library contained a poly-N stretch at its
-  3' end.
-  
-- Fixed the wrapper script so that OSX users launching fastqc
-  through the script rather than the Mac application bundle get
-  their classpath set correctly, and can therefore analyse bam/sam
-  files.
-
-
-RELEASE NOTES FOR FastQC V0.9.5
--------------------------------
-
-FastQC v0.9.5 fixes some bugs in the programs text output and
-improves a few things in the graphical interface.  Main changes
-are:
-
-- Progress calculations are now exact and not approximate
-
-- The UI now has a welcome screen so you're not just presented
-  with a blank screen when the program starts
-
-- The wrapper script now sets the classpath correctly in windows
-  as well as linux.
-
-- The text report for per-base sequence content now reports
-  correct values for grouped bases
-
-- The HTML report uses a custom stylesheet for print output so
-  graphs aren't cut off when reports are printed.
-
-- Fixed a bug in testing for a warning in the per-base sequence
-  content module.
-  
-- Alt text in HTML reports now matches the graphic it describes
-
-
-RELEASE NOTES FOR FastQC V0.9.4
--------------------------------
-
-FastQC v0.9.4 is a minor bugfix release which changes the offline
-version of the program so that if a file fails to be processed a
-full backtrace of the error is produced, rather than just a
-simple generic error message.
-
-RELEASE NOTES FOR FastQC V0.9.3
--------------------------------
-
-FastQC v0.9.3 adds support for fastq files compressed with
-bzip2 in addition to its existing support for gzip compressed
-files.  It's worth noting that although bzip2 offers a reduction
-in the file size of the compressed files (about a 5-fold size
-reduction compared to raw fastq.  Gzip is a 4-fold decrease),
-there is a significant penalty in terms of the speed of
-decompression of these files.  In our tests gzipped files were
-actually processed slightly faster than raw FastQ files, presumably
-due to the lower amount of data transfer from disk required, 
-however bzip2 compressed files took around 6X as long to 
-process as gzipped files.
-
-The other big change in this release is an update to the default
-CSS layout such that viewing the HTML reports doesn't require
-lots of scrolling up and down the page. As before the CSS can
-be edited and customised by editing the templates shipped with
-the program.  Many thanks to Phil Ewels who did much of the 
-work on the new layout.
-
-
-
-RELEASE NOTES FOR FastQC V0.9.2
--------------------------------
-
-FastQC v0.9.2 fixes two bugs which were identified in the
-previous release.
-
-1) In the text output for the per-base quality module the 
-correct base numbers weren't being included for files which
-used grouped base ranges.
-
-2) The Kmer analysis module could crash when analysing very
-small files, such that no position in the file had more than
-1000 instances of an enriched Kmer.
-
-Both of these issues should now be resolved.
-
-
-RELEASE NOTES FOR FastQC V0.9.1
--------------------------------
-
-FastQC v0.9.1 adds some new command line options and fixes a
-couple of usability issues.
-
-The new command line options are:
-
---quiet Will suppress all progress messages and ensure that only
-warnings or errors are written to stderr.  This might be useful
-for people running fastqc as part of a pipeline.
-
---nogroup Will turn off the dynamic grouping of bases in the 
-various per-base plots.  This would allow you to see a result
-for each base of a 100bp run for example.  This option should
-not be used for really long reads (454, PacBio etc) since it
-has the potential to crash the program or generate very wide
-output plots
-
-In addition to these the following changes have been made:
-
-The basic stats module now includes a line to say which type
-of quality encoding was found so this information isn't just
-present in the header of the per-base quality plot, and will
-appear in the text based output.
-
-We now distinguish between Illumina <1.3, 1.3 and 1.5 encodings
-rather than just <1.3 and >=1.3.  The Sanger encoding is now
-labelled as Sanger / Illumina 1.9+ to allow for the change in
-encoding in the latest illumina pipeline.
-
-A bug was fixed which caused the program to crash when encountering
-a zero length colorspace file (which shouldn't happen anyway, but
-crashing wasn't the correct response).
-
-The interactive over-represented sequence table now allows you
-to copy out each cell individually which makes it easy to copy
-any unknown sequences into other programs.
-
-
-RELEASE NOTES FOR FastQC V0.9.0
--------------------------------
-
-FastQC v0.9.0 makes a number of changes primarily targetted at
-datasets containing longer reads.  It allows all of the analyses
-within FastQC to be completed sensibly and without excessive
-resource usage on runs containing reads up to tens of kilobases
-in length.
-
-For long reads the program now converts many of its plots to
-variably sized bins so that, for example you see every base for
-the first 10 bases, then every 5 bases for the next 40 bases,
-then every 50, then 100 then 1kb per bin, until the end of the
-sequence is reached.  For sequences below 75bp the reports will
-look exactly the same as before.  For groups running slightly
-longer Illumina or ABI runs you'll see some compression at the
-end of your reads, and people using 454 or PacBio will get 
-sensible results for all analyses for the first time.
-
-One additional change which will impact anyone using reads over
-75bp is that the duplicate sequence and overrepresented sequence
-plots now only use the first 50bp of each read if the total read
-length is over 75bp.  This is because these plots work on the 
-basis of an exact sequence match, and longer reads tend to show
-more errors at the end which makes them look like different
-sequences when they're actually the same.  50bp should be enough
-that you won't see exact matches by chance.
-
-
-
-RELEASE NOTES FOR FastQC V0.8.0
--------------------------------
-
-FastQC v0.8.0 adds some new options for parsing BAM/SAM files and
-makes the graphs in the report easier to interpret.
-
-All graphs in v0.8.0 now have marker lines going across them to make
-it easier to relate the data in the graph to the y-axis.  The per
-base quality boxplots have shading behind the graph to indicate ranges
-of good, medium and bad quality sequence.
-
-For BAM/SAM files you can now specify that you wish to analyse only
-the mapped sequences in the file.  This is particularly of use to
-people working on colorspace data where the mapped data should
-produce reliable sequence, whereas the current raw conversion to
-base space may overrepresent any errors which are present.  The 
-option to use only mapped data is set by using the
-
--f bam_mapped or -f sam_mapped
-
-option on the command line, or by specifying Mapped BAM/SAM files
-from the drop down file filter in the file chooser in the interactive
-version of the program.
-
-For FastQ files the parser has been updated to not treat blank lines
-between entries or at the end of the file as a format violation since
-many sequences in the public repositories can have this problem.
-
-From the command line we now offer the option to process multiple
-files in parallel by setting the -t/--threads option.  Please note that
-using more than 1 thread will increase the amount of allocated memory
-(250MB per thread), so you need to be sure you have enough memory (and
-disk bandwidth) to be able to process more than one file.  The
-interactive application still defaults to a single processing thread
-but you could theoretically change this by passing the correct java
-properties in the startup command.
-
-
-RELEASE NOTES FOR FastQC V0.7.2
--------------------------------
-
-FastQC v0.7.2 fixes a bug in libraries where no unique sequences
-were observed.  It also improves the collection of duplicate 
-statistics on libraries with very low diversity.
-
-A new command line option has been added to allow the user to
-manually specify a contaminant's file rather than using the sitewide
-default.  This would be useful if you have different sets of
-contaminants to screen against for different libraries, or if you
-wanted to make a custom set of contaminants, but didn't have 
-sufficient privileges to modify the sitewide contaminants file.
-
-
-RELEASE NOTES FOR FastQC V0.7.1
--------------------------------
-
-FastQC v0.7.1 makes some significant enhancements to the fastqc
-wrapper script which make it easier to use as part of a pipeline.
-
-You can now use normal unix options to create your fastqc
-command rather than having to pass java system properties.  The
-old options will continue to work though, so the updated 
-wrapper is still compatible with any previous commands you may
-have in place.  Full details of the new options can be found
-by running 
-
-fastqc --help
-
-One new option is the --format option which allows you to manually
-specify the input format of a file, rather than having FastQC
-guess the format from the file name.  This would allow you to have
-a BAM file called test.dat and process it using:
-
-fastqc --format bam test.dat
-
-
-
-
-RELEASE NOTES FOR FastQC V0.7.0
--------------------------------
-
-FastQC v0.7.0 introduces a new analysis module which looks at the 
-enrichment of short sequences within the library.  It is possible
-to get enrichment of unaligned subsequences to quite a high degree
-without this being apparent in any of the existing modules.  This
-new module should find problems such as read through into the 
-adapters at the other end of libraries, which other analyses would
-miss.
-
-Other changes in this release include:
-
-* Altering the fastqc wrapper script so it can identify when it's
-  being used on the source distribution of the software so it can
-  issue an appropriate warning.
-
-* Tidied up all of the y-axes on the graphs so that scaling should
-  now always be perfect in all graphs.
-
-
-RELEASE NOTES FOR FastQC V0.6.1
--------------------------------
-
-FastQC v0.6.1 is a bugfix release which fixes a problem with sequences
-from BAM/SAM files which map to the reverse strand of the reference.
-
-In these cases the sequence contained in the BAM/SAM file is reverse
-complemented and the qualities are reversed relative to the original
-sequence which came off the sequencer.  In the previous release this
-meant that the plots were incorrectly showing a mix of forward and 
-reversed sequences.
-
-In v0.6.1 any sequences mapping to the reverse strand of the reference
-are converted back to their original state before being analysed which
-should give a clearer view of the overall qualities and sequence biases
-within the run.
-
-
-RELEASE NOTES FOR FastQC V0.6.0
--------------------------------
-
-FastQC v0.6 adds support for reading SAM/BAM files as well as still
-supporting fastq files.  File type detection is based on the filename
-so SAM/BAM files need to be named .sam or .bam.  Any other form of
-filename is assumed to be a fastq file.
-
-SAM/BAM reading was added through the use of the picard libraries, which
-means that the launcher for FastQC has had to be modified to include
-the picard libraries into the classpath.  If you use the bat file launcher,
-the wrapper script or the Mac application bundle then you won't need to
-do anything to get the new version to work, but if you've created your
-own launcher then you will need to modify your classpath statement to
-include the sam-1.32.jar file into the classpath.
-
-The only other change in this release is that the line graphs have been
-improved to use smoother lines for the graphs.
-
-
-
-RELEASE NOTES FOR FastQC V0.5.1
--------------------------------
-
-Release 0.5.1 fixes a couple of bugs and makes some improvements to 
-existing functions.
-
-* A bug was fixed which caused the headers of the overrepresented
-  sequences results to not be separated in the text output.
-  
-* A bug was fixed which caused spikes to appear in the %GC profile
-  when using read lengths >100bp
-
-* The fitting of the theoretical distribution to the %GC profile
-  was improved
-  
-* Some new entries were added to the contaminants file to cover
-  Illumina oligos for multiplexing, tag expression and small RNA
-  protocols (thanks to Aaron Statham for providing these)
-
-
-RELEASE NOTES FOR FastQC V0.5.0
--------------------------------
-
-FastQC v0.4.4 makes a number of changes to the previous
-release which hopefully improve the relevance of the output.
-
-* The fitting of the normal curve to the %GC distribution has
-  been improved for shorter sequences
-  
-* Each section of the HTML report output now has a pass/warn/fail
-  icon next to it, rather than just having them at the top
-
-* The duplicate level analysis now estimates the total percentage
-  of sequences which are not unique, reports this on the graph and
-  uses this as the basis for the pass/warn/fail filtering
-  
-* The structure of the HTML output folder has been changed so that
-  icons and images are put into subfolders so the only files at
-  the top level are ones which the user is intended to open directly.
-
-
-RELEASE NOTES FOR FastQC V0.4.3
--------------------------------
-
-FastQC v0.4.3 is a bugfix release which fixes a bug and adds
-an extra check to the interactive program.
-
-In versions of the program since v0.2 the total sequence count
-in the Basic Stats module may have been incorrect by a few percent
-(either high or low).  This is because instead of using the real
-sequence count the module was using an estimated count which should
-only be used for updating the progress indicators.  The module
-has now been fixed to report the actual sequence count.
-
-In the interactive application there was no warning given if you 
-chose to save a report and opted to overwrite an existing report.  You
-will now be warned in this case an offered the chance to use a
-different filename.  This change won't affect the non-interactive
-mode of the program where report files will be overwritten if the
-program is run more than once on the same set of data.
-
-RELEASE NOTES FOR FastQC V0.4.2
--------------------------------
-
-FastQC v0.4.2 is a minor release which fixes some bugs and improves
-the warnings on some of the analysis modules.
-
-Bugs which were fixed were:
-
-* The per-base quality plot showed an incorrect scale on the
-  y-axis.  This was usually off by about 2, but could be more
-  depending on the data.  The relative relationships shown
-  were correct, it was just the scale bar which was wrong.
-  
-* The sequence parser incorrectly identified some base called
-  files as colorspace files where they contained dots in place
-  of N base calls.  This has now been improved but will still
-  fail for the base where a base called file starts with an 
-  entry which is a single called base followed by all dots
-  since this is indistinguishable from a colorspace fastq file.
-  
-* Some JREs (notably OpenJDK) can't cope with a headless environment
-  being set from within the program.  I've therefore added code
-  to the fastqc wrapper script to externally set the headless 
-  environment up to bypass this problem.
-  
-Other improvements which have been made are:
-
-* When writing out graphs for the HTML report we now scale some
-  graphs by the length of the sequences analysed so we don't get
-  really squashed graphs.  The interactive application will still
-  scale the graphs to the size of the window
-  
-* More checks have been added to the parsing of FastQ files to
-  ensure we're looking at the correct file format.  A better reporting
-  mechanism has been added to allow the program to cope better with
-  problems during parsing.
-  
-* The per-sequence GC plot has been modified to add in a modelled
-  normal distribtion over the observed distribution so you can see
-  how well the two fit.
-  
-* All modules (apart from the general stats) now have valid checks
-  in place, and all can now produce warnings and failures.  Some of
-  the checks in the existing modules have been changed to better cope
-  with libraries with very low or high GC content.
-
-
-RELEASE NOTES FOR FastQC V0.4.1
--------------------------------
-
-FastQC v0.4.1 is a bugfix release which changes the operation
-of the duplicate sequence and overrepresented sequence modules.
-
-Both of these modules now only track sequences which appear in
-the first 200,000 sequences of a file.  This change was made
-because people using longer read lengths found that tracking
-the first million sequences led to the program exhausting its
-allocated memory.
-
-The other change is that the duplicate sequence module now
-tracks sequence counts to the end of the file rather than
-stopping after a million sequences.  This means the final
-duplication counts seen are much more realistic and should
-match with what you would see in a genome browser.  Because
-of this change the cutoffs to flag a file with a warning or
-an error have been increased.  You now get a warning when 
-the sum of duplicated sequences is more than 20% of the
-unique sequences.  You get an error when there are more
-duplicated sequences than unique sequences.
-
-
-RELEASE NOTES FOR FastQC V0.4
------------------------------
-
-FastQC v0.4 introduces a new analysis module, and easier way
-to launch the program from the command line and a new output 
-file, as well as fixing a few minor bugs.
-
-The new analysis module is the sequence duplication level
-module.  This is a complement to the existing overrepresented
-sequences module in that it looks at sequences which occur
-more than once in your data.  The new module takes a more
-global view and says what proportion of all of your sequences
-occur once, twice, three times etc. In a diverse library most
-sequences should occur only once.  A highly enriched library
-may have some duplication, but higher levels of duplication
-may indicate a problem, such as a PCR overamplification.
-
-In response to several requests we've also now introduced a
-new output file into the report.  This is a text based, tab
-delimited file which includes all of the data show in the
-graphs in the graphical report.  This would allow people
-running pipelines to store the data generated by fastQC and
-analyse it systematically rather than just taking the 
-pass/fail/warn summary, or reviewing the reports manually.
-
-Finally, if you're running fastqc from the command line we've
-now included a 'fastqc' wrapper script which you can launch
-directly rather than having to construct a java launch
-command.  You can still pass -Dxxx options through to the 
-program, but for simple analyses you can now simply run:
-
-fastqc [some files]
-
-..once you have included the FastQC install directory into your
-path.  More details are in the install document.
-
-Other minor changes:
-
-- The over-represented sequences module now scans the first
-million sequences to decide which sequences to track to the
-end of the file.
-
-- The labeling on the per-base N content graph is now correct
-
-
-
-RELEASE NOTES FOR FastQC V0.3.1
--------------------------------
-
-V0.3.1 is a bugfix release which fixes a few minor problems.
-
-1) The template system now correctly checks that it only imports
-graphics files from the templates directory into the report
-files and doesn't break when it encounters unexpected files.
-
-2) The offline mode now correctly reports the progress of all
-processed files rather than just the first one.
-
-3) The documentation has been updated to include information on
-the blue mean line in the per base quality plot.
-
-
-RELEASE NOTES FOR FastQC V0.3
------------------------------
-
-Major new additions to v0.3 are listed below:
-
-1) Support for gzip compressed fastq files.  You can now
-load gzip compressed fastq files into FastQC in the same
-way as uncompressed files.  The files will be decompressed
-interactively and can be viewed in the same way as for
-uncompressed files.
-
-2) Contaminant identification.  If your library is found to
-have overrepresented sequences in it these are now scanned 
-against a database of common contaminants (primers, adapters etc)
-to see if the source of the contamination can be identified.
-The database is stored in a new Contaminants folder in the
-main installation directory, and can be updated with your
-own protocol specific sequences.
-
-3) When in non-interactive mode you can now pass a 
-preference -Dfastqc.output_dir to provide an alternative location
-to save reports to, rather than having them in the same
-directory as the source fastq files.
-
-Some improvements have also been made to the colorspace support
-so this version should support a wider range of colorspace
-fastq files.
-
-
-RELEASE NOTES FOR FastQC V0.2
------------------------------
-
-There are a few new additions in v0.2 of FastQC
-
-1) Colorspace support: We now have rudimentary support for the
-analysis of fastq files in colorspace.  The analysis is done by
-converting the colorspace calls to basecalls, which isn't ideal
-but is hopefully more useful than nothing.
-
-2) Option to unzip reports.  The default action in non-interactive
-mode is now to both create a zip file containing the FastQC report
-and to unzip this into a folder of the same name.  If you just want
-to generate the zip files you can add -Dfastqc.unzip=false to the
-command line to suppress this new behaviour
-
-3) It is now possible to customise the HTML report for your site.
-There is an HTML template which can be edited to add your own 
-branding to the reports you generate.
-
-4) In addition to the human readable HTML report we now also
-generate a tab delimited summary file which should make it 
-easier to integrate FastQC into an automated reporting system
-which spots any potential problems with the data.
-
-
-RELEASE NOTES FOR FastQC V0.1.1
--------------------------------
-
-This point release fixes a problem when running FastQC in a
-non-interactive mode on a system without a graphical display.
-The program should now operate correctly on headless systems
-as long as the filename(s) to process are specified on the
-command line.
-
-
-RELEASE NOTES FOR FastQC V0.1
--------------------------------
-
-FastQC v0.1 is a beta release it should work in its present state but
-we are keen to get feedback on the program.  In particular we are
-interested to hear if anyone has:
-
-1) Suggestions for other checks we could be performing.
-
-2) Comments about the criteria we set for issuing warnings or errors and
-suggestions for how these could be improved.
-
-You can report feedback either though our bug reporting tool at:
-
-www.bioinformatics.bbsrc.ac.uk/bugzilla/
-
-...or directly to simon.andrews at bbsrc.ac.uk
+RELEASE NOTES FOR FastQC v0.11.5
+--------------------------------
+
+This is a minor bug-fix release which addresses issues found in
+the previous release.
+
+1)  Fixed a bug in the per-base sequence content module where the warn
+    error flags were incorrectly being calculated on G-A and C-T instead
+    of G-C and T-A. 
+
+2)  Fixed the small-RNA adapter molecule sequence so that all possible
+    adapter variants would be found - the previous version would 
+    under-estimate the amount of small RNA adapter which was present in
+    a sample.
+
+3)  Fixed a typo in the documentation for the duplication plot.
+
+RELEASE NOTES FOR FastQC v0.11.4
+--------------------------------
+
+This is a minor bug-fix release which addresses issues found in
+the previous release.
+
+1) 	Changed the OSX launcher to not rely on the Mac specific JVM
+	framework, but to use any command line java which is found.  This
+	will require the user to install the JDK on newer OSX releases
+	rather than just the JVM.  See the updated version of the INSTALL.txt
+	document if you have problems with this on OSX.
+
+2)	Fixed a typo in one of the included adapter sequences in the search
+	set.
+	
+3) 	Fixed a bug which failed to remove an fq.gz extension from the 
+	name used in the report when running in offline mode.
+	
+4)	Made the per-tile quality module not collect any stats if it's
+	been disabled in limits.txt, rather than just not being included
+	in the output.
+	
+5)	Fixed a bug in the calculation of duplication levels which only 
+	affected highly duplicated ordered libraries where the count limit
+	was not reached.
+	
+6)  Fixed a bug which triggered an error flag on the per-base quality
+	plot for positions with fewer than 100 observations, where we can't
+	calculate a sensible percentile value.  Changed the text report to
+	assign NaN to these positions rather than 0.
+	
+
+
+
+RELEASE NOTES FOR FastQC v0.11.3
+--------------------------------
+
+This is a minor bug-fix release which addresses some issues 
+reported with the v0.11.2 release.
+
+1) Fixed a bug when using the limits.txt file to disable the per
+   tile analysis module.
+   
+2) Fixed a documentation error in the duplicated sequences plot.
+
+3) Fixed a thread safety bug when processing multiple files in a 
+   single session which caused the program not to exit when all
+   processing had in fact completed.
+   
+4) Fixed a bug which meant that forced formats in the interactive
+   application weren't being honoured.
+   
+5) Fixed a bug in the way soft clipping was applied when we were
+   analysing only mapped data.
+   
+6) Fix a memory issue when trying to parse tile names in cases where
+   we mistakenly think we're identify tile numbers, but we aren't
+   
+7) Fix a bug in the text reporting of per-tile quality scores
+
+8) Add the SOLID smallRNA adapter to the default adapter search set
+
+9) Fix a bug in casava mode when using uncompressed fastq files
+
+10) Increase the number of sampled sequences in the duplicate and 
+   overrepresented module to 100,000.
+   
+11) Add a clean up of data structures for the Kmer module so that
+    the interactive mode can process more files without dying.
+
+
+RELEASE NOTES FOR FastQC v0.11.2
+--------------------------------
+
+This is a minor bug-fix release which addresses some issues 
+reported with the v0.11.1 release.
+
+1) Added a proper implementation of a --limits command line
+option to allow users to specify a custom limits file for an 
+individual run.  This also fixed a bug seen if the user used the
+--adapter option.
+
+2) Fixed an error in the naming of the folder inside the zip file
+such that it couldn't be extracted into the same folder as the
+main HTML file.
+
+3) Fixed an overly large data structure which was causing some
+runs to terminate due to a lack of memory.
+
+4) Fixed a poor implementation in the Kmer module which was 
+causing unusually high memory usage.
+
+5) Fixed incorrect defaults for the warn/fail values in the per
+sequence quality module.
+
+RELEASE NOTES FOR FastQC V0.11.1
+--------------------------------
+
+FastQC v0.11.1 is the first release for a long time and is a 
+major update to the package.  This release adds some significant
+new features to the program which will hopefully make it more 
+useful.
+
+The major new features in this release are:
+
+1) Configurable thresholds for modules.  For all modules you can
+now alter a configuration file to set the thresholds used by the 
+program for warnings and errors so that you can flag up only the
+types of problem which you are concerned by.
+
+2) Optional modules.  The same configuration file used to set 
+the warn / error thresholds can also be used to selectively 
+disable modules you don't want to see at all.
+
+3) New per-tile quality analysis.  If you are running Illumina
+libraries through FastQC it will now analyse the quality calls
+on a per-tile basis and will flag up points in the run where the
+quality in individual tiles fell below the average quality for 
+that cycle.  This can help to spot technical problems during the
+run.
+
+4) New adapter content module.  A new module has been added to
+specifically search for the presence of adapters in your library.
+This operates in a similar way to the existing Kmer analysis but 
+allows you to specify individual adapter sequences to screen and
+will always show the results for each adapter so you can easily
+see what you might gain if you chose to adapter trim your library.
+
+5) Improved duplication plot.  The duplication plot has been given
+an overhaul so that it now reports values which are real read 
+numbers rather than always giving relative values.  This is thanks
+to work done by Brian Howard of sciome.com who worked out the right
+way to extrapolate from the data we sample to the full library.  It 
+also shows how the level of duplication would affect the library 
+both before and after deduplication, and the headline figure is now 
+much more  useful as it shows the percentage of the library which 
+would remain if you chose to deduplicate.
+
+6) Improved Kmer module.  The Kmer module has been changed so that
+instead of trying to search for individual Kmers which are present
+at higher than expected frequency (which actually happens all the 
+time in real libraries), it now looks for Kmers which are present 
+in significantly different amounts at different starting positions
+within the library.  This has allowed the use of longer Kmer 
+sequences to give a more useful result.
+
+7) Since file reports.  The default output format for the program 
+is now a single HTML file with all of the various graphs embedded 
+into it.  The .zip file output with the individual graphs is still 
+produced as are the associated data files, but you can just 
+distribute the one HTML file alone - the other data is no longer 
+required.
+
+8) Ability to read from stdin.  If you want to pipe a stream of
+data into fastqc rather than using a real file then you can just
+use  'stdin' as the filename to process and then stream uncompressed
+fastq data on stdin.
+
+9) Changed base groupings.  For long reads we used to use an 
+exponential series to group bases together to summarise the sequence
+content and qualities.  We've now switched the default to be that
+for grouped plots the first 9 individual bases will always be shown
+(since this often roots out problems in the libraries), after that
+there will be a series of evenly sized windows so that the same number
+of bases fall into each window.  You can bring back the old behaviour
+with the new --expgroup option, and you can remove grouping all together
+with the --nogroup option (although this will do bad things to your
+plots if you have really long reads).
+
+10) Dropped support for the Solaxa64 (but NOT Phred64) encoding.  We
+have removed the ability of the program to reliably detect the original
+Solexa64 encoding which was used in the GA pipeline prior to v1.3.
+This was a 64 offset encoding but which allowed scores which ranged
+down to -5.  Supporting this encoding meant that we would incorrectly 
+guess the encoding on Phred33 files which had no bases with quality 
+scores below 26, which could happen if you aggressively trimmed your
+data.  Supporting just Phred33 and Phred64 now means that we wouldn't
+mis-detect unless there were no bases with qualities below 31, which 
+is much less likely, even in trimmed data.  Since no Solexa64 data
+will have been produced since early 2009 it is unlikely that removing
+support for this format will adversely affect users of the program.
+
+
+RELEASE NOTES FOR FastQC V0.10.1
+--------------------------------
+
+FastQC v0.10.1 is a bugfix release which works around two problems
+people have encountered with previous releases:
+
+1) A work-round has been put into place for a limitation in the
+java gzip decompressor, where it would read only the first
+compressed block in a file created by concatenating multiple 
+gzipped files directly, rather than decompressing and recompressing
+them.
+
+2) Users who had installed the program in directories containing
+characters required to be encoded in URLs (= & ? etc) were finding
+that the report generation generated an error.  This encoding has
+now been fixed and the program should now have no limits in the 
+name of the directory in which it can be installed.
+
+One additional feature is that in the fastqc wrapper you can now
+specify the location of the java interpreter on the command line
+using the --java parameter, rather than having to have it included
+in the path.
+
+One other change in this release is that the package names for all
+of the java classes have been changed to reflect a change in the
+official project URL.  This means that the launchers for the 
+program have had to be updated to use these new names.  If you have
+created your own launcher, or had copied any of the old ones you'll
+need to update this to use the launchers included in this version
+of the program.
+
+The new URL for the project is:
+
+www.bioinformatics.babraham.ac.uk/projects/fastqc/
+
+..and if you want to report bugs the bugzilla URL is now:
+
+www.bioinformatics.babraham.ac.uk/bugzilla/
+
+
+RELEASE NOTES FOR FastQC V0.10.0
+--------------------------------
+
+The major feature of FastQC v0.10.0 is the addition of support
+for fastq files generated directly by the latest version of the
+illumina pipeline (Casava v1.8).  In this version the pipeline
+generates gzipped fastq files by default rather than using qseq
+files which can then be converted to fastq.  However the fastq
+files generated by casava are unusual in two ways:
+
+1) A single sample produces a set of fastq files with a common
+   name, but an incrementing number at the end.
+   
+2) Casava FastQ files contain sequences from clusters which have
+   failed the internal QC, and been flagged to be filtered.
+
+FastQC v0.10.0 introduces a Casava mode which will merge together
+fastq files from the same sample group and produce a single report.
+It will also exclude any flagged entries from the analysis.  You
+would therefore run FastQC as normal but selecting all of the
+fastq files from Casava and using casava mode for your analysis.
+
+Casava mode is activated from the command line by adding the 
+--casava option to the launch command. From the interactive 
+application you need to select 'Casava FastQ Files' from the drop 
+down file selector filter options.
+
+If you want to analyse casava fastq files without these extra
+options then you can use treat them as normal fastq files with 
+no problems.
+
+In addition to this change there have also been changes to allow 
+the wrapper script to work properly under windows, and a bug was
+fixed which missed of the last possible Kmer from every sequence
+in a library.
+
+
+RELEASE NOTES FOR FastQC V0.9.6
+-------------------------------
+
+FastQC v0.9.6 fixes a couple of bugs which aren't likely to have
+affected the majority of fastqc users:
+
+- Fixed a crash in the Kmer module when analysing a sequence where
+  every sequence in a library contained a poly-N stretch at its
+  3' end.
+  
+- Fixed the wrapper script so that OSX users launching fastqc
+  through the script rather than the Mac application bundle get
+  their classpath set correctly, and can therefore analyse bam/sam
+  files.
+
+
+RELEASE NOTES FOR FastQC V0.9.5
+-------------------------------
+
+FastQC v0.9.5 fixes some bugs in the programs text output and
+improves a few things in the graphical interface.  Main changes
+are:
+
+- Progress calculations are now exact and not approximate
+
+- The UI now has a welcome screen so you're not just presented
+  with a blank screen when the program starts
+
+- The wrapper script now sets the classpath correctly in windows
+  as well as linux.
+
+- The text report for per-base sequence content now reports
+  correct values for grouped bases
+
+- The HTML report uses a custom stylesheet for print output so
+  graphs aren't cut off when reports are printed.
+
+- Fixed a bug in testing for a warning in the per-base sequence
+  content module.
+  
+- Alt text in HTML reports now matches the graphic it describes
+
+
+RELEASE NOTES FOR FastQC V0.9.4
+-------------------------------
+
+FastQC v0.9.4 is a minor bugfix release which changes the offline
+version of the program so that if a file fails to be processed a
+full backtrace of the error is produced, rather than just a
+simple generic error message.
+
+RELEASE NOTES FOR FastQC V0.9.3
+-------------------------------
+
+FastQC v0.9.3 adds support for fastq files compressed with
+bzip2 in addition to its existing support for gzip compressed
+files.  It's worth noting that although bzip2 offers a reduction
+in the file size of the compressed files (about a 5-fold size
+reduction compared to raw fastq.  Gzip is a 4-fold decrease),
+there is a significant penalty in terms of the speed of
+decompression of these files.  In our tests gzipped files were
+actually processed slightly faster than raw FastQ files, presumably
+due to the lower amount of data transfer from disk required, 
+however bzip2 compressed files took around 6X as long to 
+process as gzipped files.
+
+The other big change in this release is an update to the default
+CSS layout such that viewing the HTML reports doesn't require
+lots of scrolling up and down the page. As before the CSS can
+be edited and customised by editing the templates shipped with
+the program.  Many thanks to Phil Ewels who did much of the 
+work on the new layout.
+
+
+
+RELEASE NOTES FOR FastQC V0.9.2
+-------------------------------
+
+FastQC v0.9.2 fixes two bugs which were identified in the
+previous release.
+
+1) In the text output for the per-base quality module the 
+correct base numbers weren't being included for files which
+used grouped base ranges.
+
+2) The Kmer analysis module could crash when analysing very
+small files, such that no position in the file had more than
+1000 instances of an enriched Kmer.
+
+Both of these issues should now be resolved.
+
+
+RELEASE NOTES FOR FastQC V0.9.1
+-------------------------------
+
+FastQC v0.9.1 adds some new command line options and fixes a
+couple of usability issues.
+
+The new command line options are:
+
+--quiet Will suppress all progress messages and ensure that only
+warnings or errors are written to stderr.  This might be useful
+for people running fastqc as part of a pipeline.
+
+--nogroup Will turn off the dynamic grouping of bases in the 
+various per-base plots.  This would allow you to see a result
+for each base of a 100bp run for example.  This option should
+not be used for really long reads (454, PacBio etc) since it
+has the potential to crash the program or generate very wide
+output plots
+
+In addition to these the following changes have been made:
+
+The basic stats module now includes a line to say which type
+of quality encoding was found so this information isn't just
+present in the header of the per-base quality plot, and will
+appear in the text based output.
+
+We now distinguish between Illumina <1.3, 1.3 and 1.5 encodings
+rather than just <1.3 and >=1.3.  The Sanger encoding is now
+labelled as Sanger / Illumina 1.9+ to allow for the change in
+encoding in the latest illumina pipeline.
+
+A bug was fixed which caused the program to crash when encountering
+a zero length colorspace file (which shouldn't happen anyway, but
+crashing wasn't the correct response).
+
+The interactive over-represented sequence table now allows you
+to copy out each cell individually which makes it easy to copy
+any unknown sequences into other programs.
+
+
+RELEASE NOTES FOR FastQC V0.9.0
+-------------------------------
+
+FastQC v0.9.0 makes a number of changes primarily targetted at
+datasets containing longer reads.  It allows all of the analyses
+within FastQC to be completed sensibly and without excessive
+resource usage on runs containing reads up to tens of kilobases
+in length.
+
+For long reads the program now converts many of its plots to
+variably sized bins so that, for example you see every base for
+the first 10 bases, then every 5 bases for the next 40 bases,
+then every 50, then 100 then 1kb per bin, until the end of the
+sequence is reached.  For sequences below 75bp the reports will
+look exactly the same as before.  For groups running slightly
+longer Illumina or ABI runs you'll see some compression at the
+end of your reads, and people using 454 or PacBio will get 
+sensible results for all analyses for the first time.
+
+One additional change which will impact anyone using reads over
+75bp is that the duplicate sequence and overrepresented sequence
+plots now only use the first 50bp of each read if the total read
+length is over 75bp.  This is because these plots work on the 
+basis of an exact sequence match, and longer reads tend to show
+more errors at the end which makes them look like different
+sequences when they're actually the same.  50bp should be enough
+that you won't see exact matches by chance.
+
+
+
+RELEASE NOTES FOR FastQC V0.8.0
+-------------------------------
+
+FastQC v0.8.0 adds some new options for parsing BAM/SAM files and
+makes the graphs in the report easier to interpret.
+
+All graphs in v0.8.0 now have marker lines going across them to make
+it easier to relate the data in the graph to the y-axis.  The per
+base quality boxplots have shading behind the graph to indicate ranges
+of good, medium and bad quality sequence.
+
+For BAM/SAM files you can now specify that you wish to analyse only
+the mapped sequences in the file.  This is particularly of use to
+people working on colorspace data where the mapped data should
+produce reliable sequence, whereas the current raw conversion to
+base space may overrepresent any errors which are present.  The 
+option to use only mapped data is set by using the
+
+-f bam_mapped or -f sam_mapped
+
+option on the command line, or by specifying Mapped BAM/SAM files
+from the drop down file filter in the file chooser in the interactive
+version of the program.
+
+For FastQ files the parser has been updated to not treat blank lines
+between entries or at the end of the file as a format violation since
+many sequences in the public repositories can have this problem.
+
+From the command line we now offer the option to process multiple
+files in parallel by setting the -t/--threads option.  Please note that
+using more than 1 thread will increase the amount of allocated memory
+(250MB per thread), so you need to be sure you have enough memory (and
+disk bandwidth) to be able to process more than one file.  The
+interactive application still defaults to a single processing thread
+but you could theoretically change this by passing the correct java
+properties in the startup command.
+
+
+RELEASE NOTES FOR FastQC V0.7.2
+-------------------------------
+
+FastQC v0.7.2 fixes a bug in libraries where no unique sequences
+were observed.  It also improves the collection of duplicate 
+statistics on libraries with very low diversity.
+
+A new command line option has been added to allow the user to
+manually specify a contaminant's file rather than using the sitewide
+default.  This would be useful if you have different sets of
+contaminants to screen against for different libraries, or if you
+wanted to make a custom set of contaminants, but didn't have 
+sufficient privileges to modify the sitewide contaminants file.
+
+
+RELEASE NOTES FOR FastQC V0.7.1
+-------------------------------
+
+FastQC v0.7.1 makes some significant enhancements to the fastqc
+wrapper script which make it easier to use as part of a pipeline.
+
+You can now use normal unix options to create your fastqc
+command rather than having to pass java system properties.  The
+old options will continue to work though, so the updated 
+wrapper is still compatible with any previous commands you may
+have in place.  Full details of the new options can be found
+by running 
+
+fastqc --help
+
+One new option is the --format option which allows you to manually
+specify the input format of a file, rather than having FastQC
+guess the format from the file name.  This would allow you to have
+a BAM file called test.dat and process it using:
+
+fastqc --format bam test.dat
+
+
+
+
+RELEASE NOTES FOR FastQC V0.7.0
+-------------------------------
+
+FastQC v0.7.0 introduces a new analysis module which looks at the 
+enrichment of short sequences within the library.  It is possible
+to get enrichment of unaligned subsequences to quite a high degree
+without this being apparent in any of the existing modules.  This
+new module should find problems such as read through into the 
+adapters at the other end of libraries, which other analyses would
+miss.
+
+Other changes in this release include:
+
+* Altering the fastqc wrapper script so it can identify when it's
+  being used on the source distribution of the software so it can
+  issue an appropriate warning.
+
+* Tidied up all of the y-axes on the graphs so that scaling should
+  now always be perfect in all graphs.
+
+
+RELEASE NOTES FOR FastQC V0.6.1
+-------------------------------
+
+FastQC v0.6.1 is a bugfix release which fixes a problem with sequences
+from BAM/SAM files which map to the reverse strand of the reference.
+
+In these cases the sequence contained in the BAM/SAM file is reverse
+complemented and the qualities are reversed relative to the original
+sequence which came off the sequencer.  In the previous release this
+meant that the plots were incorrectly showing a mix of forward and 
+reversed sequences.
+
+In v0.6.1 any sequences mapping to the reverse strand of the reference
+are converted back to their original state before being analysed which
+should give a clearer view of the overall qualities and sequence biases
+within the run.
+
+
+RELEASE NOTES FOR FastQC V0.6.0
+-------------------------------
+
+FastQC v0.6 adds support for reading SAM/BAM files as well as still
+supporting fastq files.  File type detection is based on the filename
+so SAM/BAM files need to be named .sam or .bam.  Any other form of
+filename is assumed to be a fastq file.
+
+SAM/BAM reading was added through the use of the picard libraries, which
+means that the launcher for FastQC has had to be modified to include
+the picard libraries into the classpath.  If you use the bat file launcher,
+the wrapper script or the Mac application bundle then you won't need to
+do anything to get the new version to work, but if you've created your
+own launcher then you will need to modify your classpath statement to
+include the sam-1.32.jar file into the classpath.
+
+The only other change in this release is that the line graphs have been
+improved to use smoother lines for the graphs.
+
+
+
+RELEASE NOTES FOR FastQC V0.5.1
+-------------------------------
+
+Release 0.5.1 fixes a couple of bugs and makes some improvements to 
+existing functions.
+
+* A bug was fixed which caused the headers of the overrepresented
+  sequences results to not be separated in the text output.
+  
+* A bug was fixed which caused spikes to appear in the %GC profile
+  when using read lengths >100bp
+
+* The fitting of the theoretical distribution to the %GC profile
+  was improved
+  
+* Some new entries were added to the contaminants file to cover
+  Illumina oligos for multiplexing, tag expression and small RNA
+  protocols (thanks to Aaron Statham for providing these)
+
+
+RELEASE NOTES FOR FastQC V0.5.0
+-------------------------------
+
+FastQC v0.4.4 makes a number of changes to the previous
+release which hopefully improve the relevance of the output.
+
+* The fitting of the normal curve to the %GC distribution has
+  been improved for shorter sequences
+  
+* Each section of the HTML report output now has a pass/warn/fail
+  icon next to it, rather than just having them at the top
+
+* The duplicate level analysis now estimates the total percentage
+  of sequences which are not unique, reports this on the graph and
+  uses this as the basis for the pass/warn/fail filtering
+  
+* The structure of the HTML output folder has been changed so that
+  icons and images are put into subfolders so the only files at
+  the top level are ones which the user is intended to open directly.
+
+
+RELEASE NOTES FOR FastQC V0.4.3
+-------------------------------
+
+FastQC v0.4.3 is a bugfix release which fixes a bug and adds
+an extra check to the interactive program.
+
+In versions of the program since v0.2 the total sequence count
+in the Basic Stats module may have been incorrect by a few percent
+(either high or low).  This is because instead of using the real
+sequence count the module was using an estimated count which should
+only be used for updating the progress indicators.  The module
+has now been fixed to report the actual sequence count.
+
+In the interactive application there was no warning given if you 
+chose to save a report and opted to overwrite an existing report.  You
+will now be warned in this case an offered the chance to use a
+different filename.  This change won't affect the non-interactive
+mode of the program where report files will be overwritten if the
+program is run more than once on the same set of data.
+
+RELEASE NOTES FOR FastQC V0.4.2
+-------------------------------
+
+FastQC v0.4.2 is a minor release which fixes some bugs and improves
+the warnings on some of the analysis modules.
+
+Bugs which were fixed were:
+
+* The per-base quality plot showed an incorrect scale on the
+  y-axis.  This was usually off by about 2, but could be more
+  depending on the data.  The relative relationships shown
+  were correct, it was just the scale bar which was wrong.
+  
+* The sequence parser incorrectly identified some base called
+  files as colorspace files where they contained dots in place
+  of N base calls.  This has now been improved but will still
+  fail for the base where a base called file starts with an 
+  entry which is a single called base followed by all dots
+  since this is indistinguishable from a colorspace fastq file.
+  
+* Some JREs (notably OpenJDK) can't cope with a headless environment
+  being set from within the program.  I've therefore added code
+  to the fastqc wrapper script to externally set the headless 
+  environment up to bypass this problem.
+  
+Other improvements which have been made are:
+
+* When writing out graphs for the HTML report we now scale some
+  graphs by the length of the sequences analysed so we don't get
+  really squashed graphs.  The interactive application will still
+  scale the graphs to the size of the window
+  
+* More checks have been added to the parsing of FastQ files to
+  ensure we're looking at the correct file format.  A better reporting
+  mechanism has been added to allow the program to cope better with
+  problems during parsing.
+  
+* The per-sequence GC plot has been modified to add in a modelled
+  normal distribtion over the observed distribution so you can see
+  how well the two fit.
+  
+* All modules (apart from the general stats) now have valid checks
+  in place, and all can now produce warnings and failures.  Some of
+  the checks in the existing modules have been changed to better cope
+  with libraries with very low or high GC content.
+
+
+RELEASE NOTES FOR FastQC V0.4.1
+-------------------------------
+
+FastQC v0.4.1 is a bugfix release which changes the operation
+of the duplicate sequence and overrepresented sequence modules.
+
+Both of these modules now only track sequences which appear in
+the first 200,000 sequences of a file.  This change was made
+because people using longer read lengths found that tracking
+the first million sequences led to the program exhausting its
+allocated memory.
+
+The other change is that the duplicate sequence module now
+tracks sequence counts to the end of the file rather than
+stopping after a million sequences.  This means the final
+duplication counts seen are much more realistic and should
+match with what you would see in a genome browser.  Because
+of this change the cutoffs to flag a file with a warning or
+an error have been increased.  You now get a warning when 
+the sum of duplicated sequences is more than 20% of the
+unique sequences.  You get an error when there are more
+duplicated sequences than unique sequences.
+
+
+RELEASE NOTES FOR FastQC V0.4
+-----------------------------
+
+FastQC v0.4 introduces a new analysis module, and easier way
+to launch the program from the command line and a new output 
+file, as well as fixing a few minor bugs.
+
+The new analysis module is the sequence duplication level
+module.  This is a complement to the existing overrepresented
+sequences module in that it looks at sequences which occur
+more than once in your data.  The new module takes a more
+global view and says what proportion of all of your sequences
+occur once, twice, three times etc. In a diverse library most
+sequences should occur only once.  A highly enriched library
+may have some duplication, but higher levels of duplication
+may indicate a problem, such as a PCR overamplification.
+
+In response to several requests we've also now introduced a
+new output file into the report.  This is a text based, tab
+delimited file which includes all of the data show in the
+graphs in the graphical report.  This would allow people
+running pipelines to store the data generated by fastQC and
+analyse it systematically rather than just taking the 
+pass/fail/warn summary, or reviewing the reports manually.
+
+Finally, if you're running fastqc from the command line we've
+now included a 'fastqc' wrapper script which you can launch
+directly rather than having to construct a java launch
+command.  You can still pass -Dxxx options through to the 
+program, but for simple analyses you can now simply run:
+
+fastqc [some files]
+
+..once you have included the FastQC install directory into your
+path.  More details are in the install document.
+
+Other minor changes:
+
+- The over-represented sequences module now scans the first
+million sequences to decide which sequences to track to the
+end of the file.
+
+- The labeling on the per-base N content graph is now correct
+
+
+
+RELEASE NOTES FOR FastQC V0.3.1
+-------------------------------
+
+V0.3.1 is a bugfix release which fixes a few minor problems.
+
+1) The template system now correctly checks that it only imports
+graphics files from the templates directory into the report
+files and doesn't break when it encounters unexpected files.
+
+2) The offline mode now correctly reports the progress of all
+processed files rather than just the first one.
+
+3) The documentation has been updated to include information on
+the blue mean line in the per base quality plot.
+
+
+RELEASE NOTES FOR FastQC V0.3
+-----------------------------
+
+Major new additions to v0.3 are listed below:
+
+1) Support for gzip compressed fastq files.  You can now
+load gzip compressed fastq files into FastQC in the same
+way as uncompressed files.  The files will be decompressed
+interactively and can be viewed in the same way as for
+uncompressed files.
+
+2) Contaminant identification.  If your library is found to
+have overrepresented sequences in it these are now scanned 
+against a database of common contaminants (primers, adapters etc)
+to see if the source of the contamination can be identified.
+The database is stored in a new Contaminants folder in the
+main installation directory, and can be updated with your
+own protocol specific sequences.
+
+3) When in non-interactive mode you can now pass a 
+preference -Dfastqc.output_dir to provide an alternative location
+to save reports to, rather than having them in the same
+directory as the source fastq files.
+
+Some improvements have also been made to the colorspace support
+so this version should support a wider range of colorspace
+fastq files.
+
+
+RELEASE NOTES FOR FastQC V0.2
+-----------------------------
+
+There are a few new additions in v0.2 of FastQC
+
+1) Colorspace support: We now have rudimentary support for the
+analysis of fastq files in colorspace.  The analysis is done by
+converting the colorspace calls to basecalls, which isn't ideal
+but is hopefully more useful than nothing.
+
+2) Option to unzip reports.  The default action in non-interactive
+mode is now to both create a zip file containing the FastQC report
+and to unzip this into a folder of the same name.  If you just want
+to generate the zip files you can add -Dfastqc.unzip=false to the
+command line to suppress this new behaviour
+
+3) It is now possible to customise the HTML report for your site.
+There is an HTML template which can be edited to add your own 
+branding to the reports you generate.
+
+4) In addition to the human readable HTML report we now also
+generate a tab delimited summary file which should make it 
+easier to integrate FastQC into an automated reporting system
+which spots any potential problems with the data.
+
+
+RELEASE NOTES FOR FastQC V0.1.1
+-------------------------------
+
+This point release fixes a problem when running FastQC in a
+non-interactive mode on a system without a graphical display.
+The program should now operate correctly on headless systems
+as long as the filename(s) to process are specified on the
+command line.
+
+
+RELEASE NOTES FOR FastQC V0.1
+-------------------------------
+
+FastQC v0.1 is a beta release it should work in its present state but
+we are keen to get feedback on the program.  In particular we are
+interested to hear if anyone has:
+
+1) Suggestions for other checks we could be performing.
+
+2) Comments about the criteria we set for issuing warnings or errors and
+suggestions for how these could be improved.
+
+You can report feedback either though our bug reporting tool at:
+
+www.bioinformatics.bbsrc.ac.uk/bugzilla/
+
+...or directly to simon.andrews at bbsrc.ac.uk
diff --git a/Templates/header_template.html b/Templates/header_template.html
index 7ffb43b..8344dd0 100644
--- a/Templates/header_template.html
+++ b/Templates/header_template.html
@@ -1,186 +1,186 @@
-
- @media screen {
-  div.summary {
-    width: 18em;
-    position:fixed;
-    top: 3em;
-    margin:1em 0 0 1em;
-  }
-  
-  div.main {
-    display:block;
-    position:absolute;
-    overflow:auto;
-    height:auto;
-    width:auto;
-    top:4.5em;
-    bottom:2.3em;
-    left:18em;
-    right:0;
-    border-left: 1px solid #CCC;
-    padding:0 0 0 1em;
-    background-color: white;
-    z-index:1;
-  }
-  
-  div.header {
-    background-color: #EEE;
-    border:0;
-    margin:0;
-    padding: 0.5em;
-    font-size: 200%;
-    font-weight: bold;
-    position:fixed;
-    width:100%;
-    top:0;
-    left:0;
-    z-index:2;
-  }
-
-  div.footer {
-    background-color: #EEE;
-    border:0;
-    margin:0;
-	padding:0.5em;
-    height: 1.3em;
-	overflow:hidden;
-    font-size: 100%;
-    font-weight: bold;
-    position:fixed;
-    bottom:0;
-    width:100%;
-    z-index:2;
-  }
-  
-  img.indented {
-    margin-left: 3em;
-  }
- }
- 
- @media print {
-	img {
-		max-width:100% !important;
-		page-break-inside: avoid;
-	}
-	h2, h3 {
-		page-break-after: avoid;
-	}
-	div.header {
-      background-color: #FFF;
-    }
-	
- }
- 
- body {    
-  font-family: sans-serif;   
-  color: #000;   
-  background-color: #FFF;
-  border: 0;
-  margin: 0;
-  padding: 0;
-  }
-  
-  div.header {
-  border:0;
-  margin:0;
-  padding: 0.5em;
-  font-size: 200%;
-  font-weight: bold;
-  width:100%;
-  }    
-  
-  #header_title {
-  display:inline-block;
-  float:left;
-  clear:left;
-  }
-  #header_filename {
-  display:inline-block;
-  float:right;
-  clear:right;
-  font-size: 50%;
-  margin-right:2em;
-  text-align: right;
-  }
-
-  div.header h3 {
-  font-size: 50%;
-  margin-bottom: 0;
-  }
-  
-  div.summary ul {
-  padding-left:0;
-  list-style-type:none;
-  }
-  
-  div.summary ul li img {
-  margin-bottom:-0.5em;
-  margin-top:0.5em;
-  }
-	  
-  div.main {
-  background-color: white;
-  }
-      
-  div.module {
-  padding-bottom:1.5em;
-  padding-top:1.5em;
-  }
-	  
-  div.footer {
-  background-color: #EEE;
-  border:0;
-  margin:0;
-  padding: 0.5em;
-  font-size: 100%;
-  font-weight: bold;
-  width:100%;
-  }
-
-
-  a {
-  color: #000080;
-  }
-
-  a:hover {
-  color: #800000;
-  }
-      
-  h2 {
-  color: #800000;
-  padding-bottom: 0;
-  margin-bottom: 0;
-  clear:left;
-  }
-
-  table { 
-  margin-left: 3em;
-  text-align: center;
-  }
-  
-  th { 
-  text-align: center;
-  background-color: #000080;
-  color: #FFF;
-  padding: 0.4em;
-  }      
-  
-  td { 
-  font-family: monospace; 
-  text-align: left;
-  background-color: #EEE;
-  color: #000;
-  padding: 0.4em;
-  }
-
-  img {
-  padding-top: 0;
-  margin-top: 0;
-  border-top: 0;
-  }
-
-  
-  p {
-  padding-top: 0;
-  margin-top: 0;
-  }
+
+ @media screen {
+  div.summary {
+    width: 18em;
+    position:fixed;
+    top: 3em;
+    margin:1em 0 0 1em;
+  }
+  
+  div.main {
+    display:block;
+    position:absolute;
+    overflow:auto;
+    height:auto;
+    width:auto;
+    top:4.5em;
+    bottom:2.3em;
+    left:18em;
+    right:0;
+    border-left: 1px solid #CCC;
+    padding:0 0 0 1em;
+    background-color: white;
+    z-index:1;
+  }
+  
+  div.header {
+    background-color: #EEE;
+    border:0;
+    margin:0;
+    padding: 0.5em;
+    font-size: 200%;
+    font-weight: bold;
+    position:fixed;
+    width:100%;
+    top:0;
+    left:0;
+    z-index:2;
+  }
+
+  div.footer {
+    background-color: #EEE;
+    border:0;
+    margin:0;
+	padding:0.5em;
+    height: 1.3em;
+	overflow:hidden;
+    font-size: 100%;
+    font-weight: bold;
+    position:fixed;
+    bottom:0;
+    width:100%;
+    z-index:2;
+  }
+  
+  img.indented {
+    margin-left: 3em;
+  }
+ }
+ 
+ @media print {
+	img {
+		max-width:100% !important;
+		page-break-inside: avoid;
+	}
+	h2, h3 {
+		page-break-after: avoid;
+	}
+	div.header {
+      background-color: #FFF;
+    }
+	
+ }
+ 
+ body {    
+  font-family: sans-serif;   
+  color: #000;   
+  background-color: #FFF;
+  border: 0;
+  margin: 0;
+  padding: 0;
+  }
+  
+  div.header {
+  border:0;
+  margin:0;
+  padding: 0.5em;
+  font-size: 200%;
+  font-weight: bold;
+  width:100%;
+  }    
+  
+  #header_title {
+  display:inline-block;
+  float:left;
+  clear:left;
+  }
+  #header_filename {
+  display:inline-block;
+  float:right;
+  clear:right;
+  font-size: 50%;
+  margin-right:2em;
+  text-align: right;
+  }
+
+  div.header h3 {
+  font-size: 50%;
+  margin-bottom: 0;
+  }
+  
+  div.summary ul {
+  padding-left:0;
+  list-style-type:none;
+  }
+  
+  div.summary ul li img {
+  margin-bottom:-0.5em;
+  margin-top:0.5em;
+  }
+	  
+  div.main {
+  background-color: white;
+  }
+      
+  div.module {
+  padding-bottom:1.5em;
+  padding-top:1.5em;
+  }
+	  
+  div.footer {
+  background-color: #EEE;
+  border:0;
+  margin:0;
+  padding: 0.5em;
+  font-size: 100%;
+  font-weight: bold;
+  width:100%;
+  }
+
+
+  a {
+  color: #000080;
+  }
+
+  a:hover {
+  color: #800000;
+  }
+      
+  h2 {
+  color: #800000;
+  padding-bottom: 0;
+  margin-bottom: 0;
+  clear:left;
+  }
+
+  table { 
+  margin-left: 3em;
+  text-align: center;
+  }
+  
+  th { 
+  text-align: center;
+  background-color: #000080;
+  color: #FFF;
+  padding: 0.4em;
+  }      
+  
+  td { 
+  font-family: monospace; 
+  text-align: left;
+  background-color: #EEE;
+  color: #000;
+  padding: 0.4em;
+  }
+
+  img {
+  padding-top: 0;
+  margin-top: 0;
+  border-top: 0;
+  }
+
+  
+  p {
+  padding-top: 0;
+  margin-top: 0;
+  }
diff --git a/run_fastqc.bat b/run_fastqc.bat
index eb8d603..9510dde 100644
--- a/run_fastqc.bat
+++ b/run_fastqc.bat
@@ -1 +1 @@
-java -Xmx250m -classpath .;./sam-1.103.jar;./jbzip2-0.9.jar uk.ac.babraham.FastQC.FastQCApplication
+java -Xmx250m -classpath .;./sam-1.103.jar;./jbzip2-0.9.jar uk.ac.babraham.FastQC.FastQCApplication
diff --git a/uk/ac/babraham/FastQC/Analysis/AnalysisListener.java b/uk/ac/babraham/FastQC/Analysis/AnalysisListener.java
index 899c7a8..a596ef9 100644
--- a/uk/ac/babraham/FastQC/Analysis/AnalysisListener.java
+++ b/uk/ac/babraham/FastQC/Analysis/AnalysisListener.java
@@ -1,31 +1,31 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Analysis;
-
-import uk.ac.babraham.FastQC.Modules.QCModule;
-import uk.ac.babraham.FastQC.Sequence.SequenceFile;
-
-public interface AnalysisListener {
-
-	public void analysisStarted(SequenceFile file);
-	public void analysisUpdated(SequenceFile file, int sequencesProcessed, int percentComplete);
-	public void analysisComplete(SequenceFile file, QCModule [] results);
-	public void analysisExceptionReceived(SequenceFile file, Exception e);
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Analysis;
+
+import uk.ac.babraham.FastQC.Modules.QCModule;
+import uk.ac.babraham.FastQC.Sequence.SequenceFile;
+
+public interface AnalysisListener {
+
+	public void analysisStarted(SequenceFile file);
+	public void analysisUpdated(SequenceFile file, int sequencesProcessed, int percentComplete);
+	public void analysisComplete(SequenceFile file, QCModule [] results);
+	public void analysisExceptionReceived(SequenceFile file, Exception e);
+}
diff --git a/uk/ac/babraham/FastQC/Analysis/AnalysisRunner.java b/uk/ac/babraham/FastQC/Analysis/AnalysisRunner.java
index eed3da8..32b108e 100644
--- a/uk/ac/babraham/FastQC/Analysis/AnalysisRunner.java
+++ b/uk/ac/babraham/FastQC/Analysis/AnalysisRunner.java
@@ -1,115 +1,115 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Analysis;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import uk.ac.babraham.FastQC.Modules.QCModule;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-import uk.ac.babraham.FastQC.Sequence.SequenceFile;
-import uk.ac.babraham.FastQC.Sequence.SequenceFormatException;
-
-public class AnalysisRunner implements Runnable {
-
-	private SequenceFile file;
-	private QCModule [] modules;
-	private List<AnalysisListener> listeners = new ArrayList<AnalysisListener>();
-	private int percentComplete = 0;
-	
-	public AnalysisRunner (SequenceFile file) {
-		this.file = file;
-	}
-	
-	public void addAnalysisListener (AnalysisListener l) {
-		if (l != null && !listeners.contains(l)) {
-			listeners.add(l);
-		}
-	}
-
-	public void removeAnalysisListener (AnalysisListener l) {
-		if (l != null && listeners.contains(l)) {
-			listeners.remove(l);
-		}
-	}
-
-	
-	public void startAnalysis (QCModule [] modules) {
-		this.modules = modules;
-		for (int i=0;i<modules.length;i++) {
-			modules[i].reset();
-		}
-		AnalysisQueue.getInstance().addToQueue(this);
-	}
-
-	public void run() {
-
-		Iterator<AnalysisListener> i = listeners.iterator();
-		while (i.hasNext()) {
-			i.next().analysisStarted(file);
-		}
-
-		
-		int seqCount = 0;
-		while (file.hasNext()) {
-			++seqCount;
-			Sequence seq;
-			try {
-				seq = file.next();
-			}
-			catch (SequenceFormatException e) {
-				i = listeners.iterator();
-				while (i.hasNext()) {
-					i.next().analysisExceptionReceived(file,e);
-				}
-				return;
-			}
-			
-			for (int m=0;m<modules.length;m++) {
-				if (seq.isFiltered() && modules[m].ignoreFilteredSequences()) continue;
-				modules[m].processSequence(seq);
-			}
-			
-			if (seqCount % 1000 == 0) {
-			if (file.getPercentComplete() >= percentComplete+5) {
-			
-				percentComplete = (((int)file.getPercentComplete())/5)*5;
-				
-				i = listeners.iterator();
-					while (i.hasNext()) {
-						i.next().analysisUpdated(file,seqCount,percentComplete);
-					}
-					try {
-						Thread.sleep(10);
-					} 
-					catch (InterruptedException e) {}
-			}
-			}
-		}
-		
-		i = listeners.iterator();
-		while (i.hasNext()) {
-			i.next().analysisComplete(file,modules);
-		}
-
-	}
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Analysis;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import uk.ac.babraham.FastQC.Modules.QCModule;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+import uk.ac.babraham.FastQC.Sequence.SequenceFile;
+import uk.ac.babraham.FastQC.Sequence.SequenceFormatException;
+
+public class AnalysisRunner implements Runnable {
+
+	private SequenceFile file;
+	private QCModule [] modules;
+	private List<AnalysisListener> listeners = new ArrayList<AnalysisListener>();
+	private int percentComplete = 0;
+	
+	public AnalysisRunner (SequenceFile file) {
+		this.file = file;
+	}
+	
+	public void addAnalysisListener (AnalysisListener l) {
+		if (l != null && !listeners.contains(l)) {
+			listeners.add(l);
+		}
+	}
+
+	public void removeAnalysisListener (AnalysisListener l) {
+		if (l != null && listeners.contains(l)) {
+			listeners.remove(l);
+		}
+	}
+
+	
+	public void startAnalysis (QCModule [] modules) {
+		this.modules = modules;
+		for (int i=0;i<modules.length;i++) {
+			modules[i].reset();
+		}
+		AnalysisQueue.getInstance().addToQueue(this);
+	}
+
+	public void run() {
+
+		Iterator<AnalysisListener> i = listeners.iterator();
+		while (i.hasNext()) {
+			i.next().analysisStarted(file);
+		}
+
+		
+		int seqCount = 0;
+		while (file.hasNext()) {
+			++seqCount;
+			Sequence seq;
+			try {
+				seq = file.next();
+			}
+			catch (SequenceFormatException e) {
+				i = listeners.iterator();
+				while (i.hasNext()) {
+					i.next().analysisExceptionReceived(file,e);
+				}
+				return;
+			}
+			
+			for (int m=0;m<modules.length;m++) {
+				if (seq.isFiltered() && modules[m].ignoreFilteredSequences()) continue;
+				modules[m].processSequence(seq);
+			}
+			
+			if (seqCount % 1000 == 0) {
+			if (file.getPercentComplete() >= percentComplete+5) {
+			
+				percentComplete = (((int)file.getPercentComplete())/5)*5;
+				
+				i = listeners.iterator();
+					while (i.hasNext()) {
+						i.next().analysisUpdated(file,seqCount,percentComplete);
+					}
+					try {
+						Thread.sleep(10);
+					} 
+					catch (InterruptedException e) {}
+			}
+			}
+		}
+		
+		i = listeners.iterator();
+		while (i.hasNext()) {
+			i.next().analysisComplete(file,modules);
+		}
+
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Analysis/OfflineRunner.java b/uk/ac/babraham/FastQC/Analysis/OfflineRunner.java
index 4570087..db404cf 100644
--- a/uk/ac/babraham/FastQC/Analysis/OfflineRunner.java
+++ b/uk/ac/babraham/FastQC/Analysis/OfflineRunner.java
@@ -1,191 +1,191 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Analysis;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Vector;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import uk.ac.babraham.FastQC.FastQCConfig;
-import uk.ac.babraham.FastQC.Modules.ModuleFactory;
-import uk.ac.babraham.FastQC.Modules.QCModule;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.SequenceFactory;
-import uk.ac.babraham.FastQC.Sequence.SequenceFile;
-import uk.ac.babraham.FastQC.Utilities.CasavaBasename;
-import uk.ac.babraham.FastQC.Utilities.NanoporeBasename;
-
-public class OfflineRunner implements AnalysisListener {
-	
-	private AtomicInteger filesRemaining;
-	private boolean showUpdates = true;
-	
-	public OfflineRunner (String [] filenames) {	
-		
-		// See if we need to show updates
-		showUpdates = !FastQCConfig.getInstance().quiet;
-		
-		Vector<File> files = new Vector<File>();
-		
-		// We make a special case if they supply a single filename
-		// which is stdin.  In this case we'll take data piped to us
-		// rather than trying to read the actual file.  We'll also
-		// skip the existence check.
-				
-		if (filenames.length == 1 && filenames[0].equals("stdin")) {
-			files.add(new File("stdin"));
-		}
-		else {
-			for (int f=0;f<filenames.length;f++) {
-				File file = new File(filenames[f]);
-
-				if (!file.exists() || ! file.canRead()) {
-					System.err.println("Skipping '"+filenames[f]+"' which didn't exist, or couldn't be read");
-					continue;
-				}
-
-				if (FastQCConfig.getInstance().nano && file.isDirectory()) {
-					File [] fast5files = file.listFiles();
-					for (int i=0;i<fast5files.length;i++) {
-						if (fast5files[i].getName().endsWith(".fast5")) {
-							files.add(fast5files[i]);
-						}
-					}
-				}
-				else {
-					files.add(file);
-				}
-			}
-		}
-		
-		
-		File [][] fileGroups;
-		
-		// See if we need to group together files from a casava group
-		if (FastQCConfig.getInstance().casava) {
-			fileGroups = CasavaBasename.getCasavaGroups(files.toArray(new File[0]));
-		}
-		else if (FastQCConfig.getInstance().nano) {
-			fileGroups = NanoporeBasename.getNanoporeGroups(files.toArray(new File[0]));
-		}
-		else {
-			fileGroups = new File [files.size()][1];
-			for (int f=0;f<files.size();f++) {
-				fileGroups[f][0] = files.elementAt(f);
-			}
-		}
-		
-		
-		filesRemaining = new AtomicInteger(fileGroups.length);
-		
-		for (int i=0;i<fileGroups.length;i++) {
-
-			try {
-				processFile(fileGroups[i]);
-			}
-			catch (Exception e) {
-				System.err.println("Failed to process "+fileGroups[i][0]);
-				e.printStackTrace();
-				filesRemaining.decrementAndGet();
-			}
-		}
-		
-		// We need to hold this class open as otherwise the main method
-		// exits when it's finished.
-		while (filesRemaining.intValue() > 0) {
-			try {
-				Thread.sleep(1000);
-			} 
-			catch (InterruptedException e) {}
-		}
-		System.exit(0);
-		
-	}
-	
-	public void processFile (File [] files) throws Exception {
-		for (int f=0;f<files.length;f++) {
-			if (!files[f].getName().equals("stdin") && !files[f].exists()) {
-				throw new IOException(files[f].getName()+" doesn't exist");
-			}
-		}
-		SequenceFile sequenceFile = SequenceFactory.getSequenceFile(files);			
-						
-		AnalysisRunner runner = new AnalysisRunner(sequenceFile);
-		runner.addAnalysisListener(this);
-			
-		QCModule [] module_list = ModuleFactory.getStandardModuleList();
-
-		runner.startAnalysis(module_list);
-
-	}	
-	
-	public void analysisComplete(SequenceFile file, QCModule[] results) {
-		File reportFile;
-		
-		if (showUpdates) System.out.println("Analysis complete for "+file.name());
-
-		
-		if (FastQCConfig.getInstance().output_dir != null) {
-			String fileName = file.getFile().getName().replaceAll("\\.gz$","").replaceAll("\\.bz2$","").replaceAll("\\.txt$","").replaceAll("\\.fastq$", "").replaceAll("\\.fq$", "").replaceAll("\\.csfastq$", "").replaceAll("\\.sam$", "").replaceAll("\\.bam$", "")+"_fastqc.html";
-			reportFile = new File(FastQCConfig.getInstance().output_dir+"/"+fileName);						
-		}
-		else {
-			reportFile = new File(file.getFile().getAbsolutePath().replaceAll("\\.gz$","").replaceAll("\\.bz2$","").replaceAll("\\.txt$","").replaceAll("\\.fastq$", "").replaceAll("\\.fq$", "").replaceAll("\\.csfastq$", "").replaceAll("\\.sam$", "").replaceAll("\\.bam$", "")+"_fastqc.html");			
-		}
-		
-		try {
-			new HTMLReportArchive(file, results, reportFile);
-		}
-		catch (Exception e) {
-			analysisExceptionReceived(file, e);
-			return;
-		}
-		filesRemaining.decrementAndGet();
-
-	}
-
-	public void analysisUpdated(SequenceFile file, int sequencesProcessed, int percentComplete) {
-		
-		if (percentComplete % 5 == 0) {
-			if (percentComplete == 105) {
-				if (showUpdates) System.err.println("It seems our guess for the total number of records wasn't very good.  Sorry about that.");
-			}
-			if (percentComplete > 100) {
-				if (showUpdates) System.err.println("Still going at "+percentComplete+"% complete for "+file.name());
-			}
-			else {
-				if (showUpdates) System.err.println("Approx "+percentComplete+"% complete for "+file.name());
-			}
-		}
-	}
-
-	public void analysisExceptionReceived(SequenceFile file, Exception e) {
-		System.err.println("Failed to process file "+file.name());
-		e.printStackTrace();
-		filesRemaining.decrementAndGet();
-	}
-
-	public void analysisStarted(SequenceFile file) {
-		if (showUpdates) System.err.println("Started analysis of "+file.name());
-		
-	}
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Analysis;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Vector;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import uk.ac.babraham.FastQC.FastQCConfig;
+import uk.ac.babraham.FastQC.Modules.ModuleFactory;
+import uk.ac.babraham.FastQC.Modules.QCModule;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.SequenceFactory;
+import uk.ac.babraham.FastQC.Sequence.SequenceFile;
+import uk.ac.babraham.FastQC.Utilities.CasavaBasename;
+import uk.ac.babraham.FastQC.Utilities.NanoporeBasename;
+
+public class OfflineRunner implements AnalysisListener {
+	
+	private AtomicInteger filesRemaining;
+	private boolean showUpdates = true;
+	
+	public OfflineRunner (String [] filenames) {	
+		
+		// See if we need to show updates
+		showUpdates = !FastQCConfig.getInstance().quiet;
+		
+		Vector<File> files = new Vector<File>();
+		
+		// We make a special case if they supply a single filename
+		// which is stdin.  In this case we'll take data piped to us
+		// rather than trying to read the actual file.  We'll also
+		// skip the existence check.
+				
+		if (filenames.length == 1 && filenames[0].equals("stdin")) {
+			files.add(new File("stdin"));
+		}
+		else {
+			for (int f=0;f<filenames.length;f++) {
+				File file = new File(filenames[f]);
+
+				if (!file.exists() || ! file.canRead()) {
+					System.err.println("Skipping '"+filenames[f]+"' which didn't exist, or couldn't be read");
+					continue;
+				}
+
+				if (FastQCConfig.getInstance().nano && file.isDirectory()) {
+					File [] fast5files = file.listFiles();
+					for (int i=0;i<fast5files.length;i++) {
+						if (fast5files[i].getName().endsWith(".fast5")) {
+							files.add(fast5files[i]);
+						}
+					}
+				}
+				else {
+					files.add(file);
+				}
+			}
+		}
+		
+		
+		File [][] fileGroups;
+		
+		// See if we need to group together files from a casava group
+		if (FastQCConfig.getInstance().casava) {
+			fileGroups = CasavaBasename.getCasavaGroups(files.toArray(new File[0]));
+		}
+		else if (FastQCConfig.getInstance().nano) {
+			fileGroups = NanoporeBasename.getNanoporeGroups(files.toArray(new File[0]));
+		}
+		else {
+			fileGroups = new File [files.size()][1];
+			for (int f=0;f<files.size();f++) {
+				fileGroups[f][0] = files.elementAt(f);
+			}
+		}
+		
+		
+		filesRemaining = new AtomicInteger(fileGroups.length);
+		
+		for (int i=0;i<fileGroups.length;i++) {
+
+			try {
+				processFile(fileGroups[i]);
+			}
+			catch (Exception e) {
+				System.err.println("Failed to process "+fileGroups[i][0]);
+				e.printStackTrace();
+				filesRemaining.decrementAndGet();
+			}
+		}
+		
+		// We need to hold this class open as otherwise the main method
+		// exits when it's finished.
+		while (filesRemaining.intValue() > 0) {
+			try {
+				Thread.sleep(1000);
+			} 
+			catch (InterruptedException e) {}
+		}
+		System.exit(0);
+		
+	}
+	
+	public void processFile (File [] files) throws Exception {
+		for (int f=0;f<files.length;f++) {
+			if (!files[f].getName().equals("stdin") && !files[f].exists()) {
+				throw new IOException(files[f].getName()+" doesn't exist");
+			}
+		}
+		SequenceFile sequenceFile = SequenceFactory.getSequenceFile(files);			
+						
+		AnalysisRunner runner = new AnalysisRunner(sequenceFile);
+		runner.addAnalysisListener(this);
+			
+		QCModule [] module_list = ModuleFactory.getStandardModuleList();
+
+		runner.startAnalysis(module_list);
+
+	}	
+	
+	public void analysisComplete(SequenceFile file, QCModule[] results) {
+		File reportFile;
+		
+		if (showUpdates) System.out.println("Analysis complete for "+file.name());
+
+		
+		if (FastQCConfig.getInstance().output_dir != null) {
+			String fileName = file.getFile().getName().replaceAll("\\.gz$","").replaceAll("\\.bz2$","").replaceAll("\\.txt$","").replaceAll("\\.fastq$", "").replaceAll("\\.fq$", "").replaceAll("\\.csfastq$", "").replaceAll("\\.sam$", "").replaceAll("\\.bam$", "")+"_fastqc.html";
+			reportFile = new File(FastQCConfig.getInstance().output_dir+"/"+fileName);						
+		}
+		else {
+			reportFile = new File(file.getFile().getAbsolutePath().replaceAll("\\.gz$","").replaceAll("\\.bz2$","").replaceAll("\\.txt$","").replaceAll("\\.fastq$", "").replaceAll("\\.fq$", "").replaceAll("\\.csfastq$", "").replaceAll("\\.sam$", "").replaceAll("\\.bam$", "")+"_fastqc.html");			
+		}
+		
+		try {
+			new HTMLReportArchive(file, results, reportFile);
+		}
+		catch (Exception e) {
+			analysisExceptionReceived(file, e);
+			return;
+		}
+		filesRemaining.decrementAndGet();
+
+	}
+
+	public void analysisUpdated(SequenceFile file, int sequencesProcessed, int percentComplete) {
+		
+		if (percentComplete % 5 == 0) {
+			if (percentComplete == 105) {
+				if (showUpdates) System.err.println("It seems our guess for the total number of records wasn't very good.  Sorry about that.");
+			}
+			if (percentComplete > 100) {
+				if (showUpdates) System.err.println("Still going at "+percentComplete+"% complete for "+file.name());
+			}
+			else {
+				if (showUpdates) System.err.println("Approx "+percentComplete+"% complete for "+file.name());
+			}
+		}
+	}
+
+	public void analysisExceptionReceived(SequenceFile file, Exception e) {
+		System.err.println("Failed to process file "+file.name());
+		e.printStackTrace();
+		filesRemaining.decrementAndGet();
+	}
+
+	public void analysisStarted(SequenceFile file) {
+		if (showUpdates) System.err.println("Started analysis of "+file.name());
+		
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Dialogs/AboutDialog.java b/uk/ac/babraham/FastQC/Dialogs/AboutDialog.java
index 5f76b6f..65baddf 100644
--- a/uk/ac/babraham/FastQC/Dialogs/AboutDialog.java
+++ b/uk/ac/babraham/FastQC/Dialogs/AboutDialog.java
@@ -1,71 +1,71 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Dialogs;
-
-import javax.swing.*;
-
-import uk.ac.babraham.FastQC.FastQCApplication;
-
-import java.awt.*;
-import java.awt.event.*;
-
-/**
- * Shows the generic about dialog giving details of the current version
- * and copyright assignments.  This is just a thin shell around the 
- * SeqMonkTitlePanel which actually holds the relevant information and
- * which is also used on the welcome screen.
- */
-public class AboutDialog extends JDialog {
-	private static final long serialVersionUID = 1L;
-
-    /**
-     * Instantiates a new about dialog.
-     * 
-     * @param a The SeqMonk application.
-     */
-    public AboutDialog(FastQCApplication a) {
-    	super(a);
-        setTitle("About FastQC...");  
-        Container cont = getContentPane();
-        cont.setLayout(new BorderLayout());
-        
-        add(new FastQCTitlePanel(),BorderLayout.CENTER);
-
-        JPanel buttonPanel = new JPanel();
-        
-        JButton closeButton = new JButton("Close");
-        getRootPane().setDefaultButton(closeButton);
-        closeButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent arg0) {
-                setVisible(false);
-                dispose();
-            }
-        });
-        buttonPanel.add(closeButton);
-        
-        cont.add(buttonPanel,BorderLayout.SOUTH);
-        
-        setSize(650,230);
-        setLocationRelativeTo(a);
-        setResizable(false);
-        setVisible(true);
-    }
-    
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Dialogs;
+
+import javax.swing.*;
+
+import uk.ac.babraham.FastQC.FastQCApplication;
+
+import java.awt.*;
+import java.awt.event.*;
+
+/**
+ * Shows the generic about dialog giving details of the current version
+ * and copyright assignments.  This is just a thin shell around the 
+ * SeqMonkTitlePanel which actually holds the relevant information and
+ * which is also used on the welcome screen.
+ */
+public class AboutDialog extends JDialog {
+	private static final long serialVersionUID = 1L;
+
+    /**
+     * Instantiates a new about dialog.
+     * 
+     * @param a The SeqMonk application.
+     */
+    public AboutDialog(FastQCApplication a) {
+    	super(a);
+        setTitle("About FastQC...");  
+        Container cont = getContentPane();
+        cont.setLayout(new BorderLayout());
+        
+        add(new FastQCTitlePanel(),BorderLayout.CENTER);
+
+        JPanel buttonPanel = new JPanel();
+        
+        JButton closeButton = new JButton("Close");
+        getRootPane().setDefaultButton(closeButton);
+        closeButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent arg0) {
+                setVisible(false);
+                dispose();
+            }
+        });
+        buttonPanel.add(closeButton);
+        
+        cont.add(buttonPanel,BorderLayout.SOUTH);
+        
+        setSize(650,230);
+        setLocationRelativeTo(a);
+        setResizable(false);
+        setVisible(true);
+    }
+    
+}
diff --git a/uk/ac/babraham/FastQC/Dialogs/FastQCTitlePanel.java b/uk/ac/babraham/FastQC/Dialogs/FastQCTitlePanel.java
index 610cbe4..e071474 100644
--- a/uk/ac/babraham/FastQC/Dialogs/FastQCTitlePanel.java
+++ b/uk/ac/babraham/FastQC/Dialogs/FastQCTitlePanel.java
@@ -1,147 +1,147 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Dialogs;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.RenderingHints;
-
-import javax.swing.BorderFactory;
-import javax.swing.ImageIcon;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-
-import uk.ac.babraham.FastQC.FastQCApplication;
-
-/**
- * The Class SeqMonkTitlePanel.
- */
-
-public class FastQCTitlePanel extends JPanel {
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Provides a small panel which gives details of the FastQC version
-	 * and copyright.  Used in both the welcome panel and the about dialog.
-	 */
-	public FastQCTitlePanel () {
-		setLayout(new BorderLayout(5,1));
-
-		ImageIcon logo = new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/fastqc_icon_100.png"));
-		JPanel logoPanel = new JPanel();
-		logoPanel.add(new JLabel("",logo,JLabel.CENTER));
-		logoPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
-		add(logoPanel,BorderLayout.WEST);
-		JPanel c = new JPanel();
-		c.setLayout(new GridBagLayout());
-
-		GridBagConstraints constraints = new GridBagConstraints();
-		constraints.gridx=1;
-		constraints.gridy=1;
-		constraints.weightx = 1;
-		constraints.weighty=1;
-		constraints.insets = new Insets(3, 3, 0, 0);
-		constraints.fill = GridBagConstraints.NONE;
-
-		JLabel program = new SmoothJLabel("FastQC High Throughput Sequence QC Report",JLabel.CENTER);
-		program.setFont(new Font("Dialog",Font.BOLD,18));
-		program.setForeground(new Color(200,0,0));
-		c.add(program,constraints);
-
-		constraints.gridy++;
-		JLabel version = new SmoothJLabel("Version: "+FastQCApplication.VERSION, JLabel.CENTER);
-		version.setFont(new Font("Dialog",Font.BOLD,15));
-		version.setForeground(new Color(0,0,200));
-		c.add(version,constraints);
-
-		constraints.gridy++;
-		// Use a text field so they can copy this
-		JTextField website = new JTextField(" www.bioinformatics.babraham.ac.uk/projects/ ");
-		website.setFont(new Font("Dialog",Font.PLAIN,14));
-		website.setEditable(false);
-		website.setBorder(null);
-		website.setOpaque(false);
-		website.setHorizontalAlignment(JTextField.CENTER);
-		c.add(website,constraints);
-		constraints.gridy++;
-
-		JLabel copyright = new JLabel("\u00a9 Simon Andrews, Pierre Lindenbaum, Brian Howard, Phil Ewels 2011-15,", JLabel.CENTER);
-		copyright.setFont(new Font("Dialog",Font.PLAIN,14));
-		c.add(copyright,constraints);
-		constraints.gridy++;
-		
-		JLabel copyright2 = new JLabel("Picard BAM/SAM reader \u00a9The Broad Institute, 2013", JLabel.CENTER);
-		copyright2.setFont(new Font("Dialog",Font.PLAIN,10));
-		c.add(copyright2,constraints);
-		constraints.gridy++;
-		
-		JLabel copyright3 = new JLabel("BZip decompression \u00a9Matthew J. Francis, 2011", JLabel.CENTER);
-		copyright3.setFont(new Font("Dialog",Font.PLAIN,10));
-		c.add(copyright3,constraints);
-		constraints.gridy++;
-		
-		JLabel copyright4 = new JLabel("Base64 encoding \u00a9Robert Harder, 2012", JLabel.CENTER);
-		copyright4.setFont(new Font("Dialog",Font.PLAIN,10));
-		c.add(copyright4,constraints);
-		constraints.gridy++;
-		
-		JLabel copyright5 = new JLabel("Java HDF5 reader \u00a9ETH, CISD and SIS, 2007-14", JLabel.CENTER);
-		copyright5.setFont(new Font("Dialog",Font.PLAIN,10));
-		c.add(copyright5,constraints);
-
-		add(c,BorderLayout.CENTER);
-	}
-	
-	/**
-	 * A JLabel with anti-aliasing enabled.  Takes the same constructor
-	 * arguments as JLabel
-	 */
-	private class SmoothJLabel extends JLabel {
-		
-		/**
-		 * Creates a new label
-		 * 
-		 * @param text The text
-		 * @param position The JLabel constant position for alignment
-		 */
-		public SmoothJLabel (String text, int position) {
-			super(text,position);
-		}
-		
-		/* (non-Javadoc)
-		 * @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
-		 */
-		public void paintComponent (Graphics g) {
-			if (g instanceof Graphics2D) {
-				((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-			}
-			super.paintComponent(g);
-		}
-
-	}
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Dialogs;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.RenderingHints;
+
+import javax.swing.BorderFactory;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import uk.ac.babraham.FastQC.FastQCApplication;
+
+/**
+ * The Class SeqMonkTitlePanel.
+ */
+
+public class FastQCTitlePanel extends JPanel {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Provides a small panel which gives details of the FastQC version
+	 * and copyright.  Used in both the welcome panel and the about dialog.
+	 */
+	public FastQCTitlePanel () {
+		setLayout(new BorderLayout(5,1));
+
+		ImageIcon logo = new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/fastqc_icon_100.png"));
+		JPanel logoPanel = new JPanel();
+		logoPanel.add(new JLabel("",logo,JLabel.CENTER));
+		logoPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
+		add(logoPanel,BorderLayout.WEST);
+		JPanel c = new JPanel();
+		c.setLayout(new GridBagLayout());
+
+		GridBagConstraints constraints = new GridBagConstraints();
+		constraints.gridx=1;
+		constraints.gridy=1;
+		constraints.weightx = 1;
+		constraints.weighty=1;
+		constraints.insets = new Insets(3, 3, 0, 0);
+		constraints.fill = GridBagConstraints.NONE;
+
+		JLabel program = new SmoothJLabel("FastQC High Throughput Sequence QC Report",JLabel.CENTER);
+		program.setFont(new Font("Dialog",Font.BOLD,18));
+		program.setForeground(new Color(200,0,0));
+		c.add(program,constraints);
+
+		constraints.gridy++;
+		JLabel version = new SmoothJLabel("Version: "+FastQCApplication.VERSION, JLabel.CENTER);
+		version.setFont(new Font("Dialog",Font.BOLD,15));
+		version.setForeground(new Color(0,0,200));
+		c.add(version,constraints);
+
+		constraints.gridy++;
+		// Use a text field so they can copy this
+		JTextField website = new JTextField(" www.bioinformatics.babraham.ac.uk/projects/ ");
+		website.setFont(new Font("Dialog",Font.PLAIN,14));
+		website.setEditable(false);
+		website.setBorder(null);
+		website.setOpaque(false);
+		website.setHorizontalAlignment(JTextField.CENTER);
+		c.add(website,constraints);
+		constraints.gridy++;
+
+		JLabel copyright = new JLabel("\u00a9 Simon Andrews, Pierre Lindenbaum, Brian Howard, Phil Ewels 2011-15,", JLabel.CENTER);
+		copyright.setFont(new Font("Dialog",Font.PLAIN,14));
+		c.add(copyright,constraints);
+		constraints.gridy++;
+		
+		JLabel copyright2 = new JLabel("Picard BAM/SAM reader \u00a9The Broad Institute, 2013", JLabel.CENTER);
+		copyright2.setFont(new Font("Dialog",Font.PLAIN,10));
+		c.add(copyright2,constraints);
+		constraints.gridy++;
+		
+		JLabel copyright3 = new JLabel("BZip decompression \u00a9Matthew J. Francis, 2011", JLabel.CENTER);
+		copyright3.setFont(new Font("Dialog",Font.PLAIN,10));
+		c.add(copyright3,constraints);
+		constraints.gridy++;
+		
+		JLabel copyright4 = new JLabel("Base64 encoding \u00a9Robert Harder, 2012", JLabel.CENTER);
+		copyright4.setFont(new Font("Dialog",Font.PLAIN,10));
+		c.add(copyright4,constraints);
+		constraints.gridy++;
+		
+		JLabel copyright5 = new JLabel("Java HDF5 reader \u00a9ETH, CISD and SIS, 2007-14", JLabel.CENTER);
+		copyright5.setFont(new Font("Dialog",Font.PLAIN,10));
+		c.add(copyright5,constraints);
+
+		add(c,BorderLayout.CENTER);
+	}
+	
+	/**
+	 * A JLabel with anti-aliasing enabled.  Takes the same constructor
+	 * arguments as JLabel
+	 */
+	private class SmoothJLabel extends JLabel {
+		
+		/**
+		 * Creates a new label
+		 * 
+		 * @param text The text
+		 * @param position The JLabel constant position for alignment
+		 */
+		public SmoothJLabel (String text, int position) {
+			super(text,position);
+		}
+		
+		/* (non-Javadoc)
+		 * @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
+		 */
+		public void paintComponent (Graphics g) {
+			if (g instanceof Graphics2D) {
+				((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+			}
+			super.paintComponent(g);
+		}
+
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Dialogs/WelcomePanel.java b/uk/ac/babraham/FastQC/Dialogs/WelcomePanel.java
index 1722e26..e6a9aa3 100644
--- a/uk/ac/babraham/FastQC/Dialogs/WelcomePanel.java
+++ b/uk/ac/babraham/FastQC/Dialogs/WelcomePanel.java
@@ -1,61 +1,61 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Dialogs;
-
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
- at SuppressWarnings("serial")
-public class WelcomePanel extends JPanel {
-	private static final long serialVersionUID = 1L;
-
-	public WelcomePanel () {
-		setLayout(new GridBagLayout());
-		GridBagConstraints gbc = new GridBagConstraints();
-		
-		gbc.gridx=1;
-		gbc.gridy=1;
-		gbc.weightx=0.5;
-		gbc.weighty=0.99;
-		
-		add(new JPanel(),gbc);
-		gbc.gridy++;
-		gbc.weighty=0.01;
-		
-		gbc.insets = new Insets(10, 10, 10, 10);
-		gbc.fill = GridBagConstraints.NONE;
-		
-		add(new FastQCTitlePanel(),gbc);
-		
-		gbc.gridy++;
-		gbc.weighty=0.5;
-		
-		add(new JLabel("Use File > Open to select the sequence file you want to check"),gbc);
-		
-		gbc.gridy++;
-		gbc.weighty=0.99;
-		add(new JPanel(),gbc);
-		
-	}
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Dialogs;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+ at SuppressWarnings("serial")
+public class WelcomePanel extends JPanel {
+	private static final long serialVersionUID = 1L;
+
+	public WelcomePanel () {
+		setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+		
+		gbc.gridx=1;
+		gbc.gridy=1;
+		gbc.weightx=0.5;
+		gbc.weighty=0.99;
+		
+		add(new JPanel(),gbc);
+		gbc.gridy++;
+		gbc.weighty=0.01;
+		
+		gbc.insets = new Insets(10, 10, 10, 10);
+		gbc.fill = GridBagConstraints.NONE;
+		
+		add(new FastQCTitlePanel(),gbc);
+		
+		gbc.gridy++;
+		gbc.weighty=0.5;
+		
+		add(new JLabel("Use File > Open to select the sequence file you want to check"),gbc);
+		
+		gbc.gridy++;
+		gbc.weighty=0.99;
+		add(new JPanel(),gbc);
+		
+	}
+}
diff --git a/uk/ac/babraham/FastQC/FastQCApplication.java b/uk/ac/babraham/FastQC/FastQCApplication.java
index ac94c6b..5c64485 100644
--- a/uk/ac/babraham/FastQC/FastQCApplication.java
+++ b/uk/ac/babraham/FastQC/FastQCApplication.java
@@ -1,338 +1,338 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC;
-
-import java.awt.BorderLayout;
-import java.io.File;
-import java.io.IOException;
-import java.util.Vector;
-
-import javax.swing.ImageIcon;
-import javax.swing.JFileChooser;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTabbedPane;
-import javax.swing.UIManager;
-import javax.swing.filechooser.FileFilter;
-
-import uk.ac.babraham.FastQC.Analysis.AnalysisRunner;
-import uk.ac.babraham.FastQC.Analysis.OfflineRunner;
-import uk.ac.babraham.FastQC.Dialogs.WelcomePanel;
-import uk.ac.babraham.FastQC.FileFilters.BAMFileFilter;
-import uk.ac.babraham.FastQC.FileFilters.CasavaFastQFileFilter;
-import uk.ac.babraham.FastQC.FileFilters.FastQFileFilter;
-import uk.ac.babraham.FastQC.FileFilters.MappedBAMFileFilter;
-import uk.ac.babraham.FastQC.FileFilters.SequenceFileFilter;
-import uk.ac.babraham.FastQC.Modules.ModuleFactory;
-import uk.ac.babraham.FastQC.Modules.QCModule;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Results.ResultsPanel;
-import uk.ac.babraham.FastQC.Sequence.SequenceFactory;
-import uk.ac.babraham.FastQC.Sequence.SequenceFile;
-import uk.ac.babraham.FastQC.Sequence.SequenceFormatException;
-import uk.ac.babraham.FastQC.Utilities.CasavaBasename;
-import uk.ac.babraham.FastQC.Utilities.NanoporeBasename;
-
-public class FastQCApplication extends JFrame {	
-	
-	public static final String VERSION = "0.11.4";
-	
-	private JTabbedPane fileTabs;
-	private WelcomePanel welcomePanel;
-	private File lastUsedDir = null;
-	
-	public FastQCApplication () {
-			setTitle("FastQC");
-			setIconImage(new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/fastqc_icon.png")).getImage());
-			setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-	//		setSize(1280, 720);
-			setSize(800,600);
-			setLocationRelativeTo(null);
-			
-			welcomePanel = new WelcomePanel();
-			
-			fileTabs = new JTabbedPane(JTabbedPane.TOP);
-			setContentPane(welcomePanel);
-			
-			setJMenuBar(new FastQCMenuBar(this));
-			
-		}
-
-	public void close () {
-		if (fileTabs.getSelectedIndex() >=0) {
-			fileTabs.remove(fileTabs.getSelectedIndex());
-		}
-		if (fileTabs.getTabCount() == 0) {
-			setContentPane(welcomePanel);
-			validate();
-			repaint();
-		}
-	}
-	
-	public void closeAll () {
-		fileTabs.removeAll();
-		setContentPane(welcomePanel);
-		validate();
-		repaint();
-	}
-	
-	public void openFile () {
-		JFileChooser chooser;
-		
-		if (lastUsedDir == null) {
-			chooser = new JFileChooser();
-		}
-		else {
-			chooser = new JFileChooser(lastUsedDir);
-		}
-		chooser.setMultiSelectionEnabled(true);
-		SequenceFileFilter sff = new SequenceFileFilter();
-		chooser.addChoosableFileFilter(sff);
-		chooser.addChoosableFileFilter(new FastQFileFilter());
-		chooser.addChoosableFileFilter(new CasavaFastQFileFilter());
-		chooser.addChoosableFileFilter(new BAMFileFilter());
-		chooser.addChoosableFileFilter(new MappedBAMFileFilter());
-		chooser.setFileFilter(sff);
-		int result = chooser.showOpenDialog(this);
-		if (result == JFileChooser.CANCEL_OPTION) return;
-	
-		// See if they forced a file format
-		FileFilter chosenFilter = chooser.getFileFilter();
-		if (chosenFilter instanceof FastQFileFilter) {
-			FastQCConfig.getInstance().setSequenceFormat("fastq");
-		}
-		if (chosenFilter instanceof CasavaFastQFileFilter) {
-			FastQCConfig.getInstance().setSequenceFormat("fastq");
-			FastQCConfig.getInstance().setCasavaMode(true);
-
-		}
-		else if (chosenFilter instanceof BAMFileFilter) {
-			FastQCConfig.getInstance().setSequenceFormat("bam");
-		}
-		else if (chosenFilter instanceof MappedBAMFileFilter) {
-			FastQCConfig.getInstance().setSequenceFormat("bam_mapped");
-			System.setProperty("fastqc.sequence_format", "bam_mapped");
-		}
-		
-		// If we're still showing the welcome panel switch this out for
-		// the file tabs panel
-		if (fileTabs.getTabCount() == 0) {
-			setContentPane(fileTabs);
-			validate();
-			repaint();
-		}
-		
-		File [] files = chooser.getSelectedFiles();
-		
-		if (FastQCConfig.getInstance().nano) {
-			// Some of the files we've been passed might be directories and we would need to
-			// list the fast5 files within those directories.
-			
-			Vector<File> keptFiles = new Vector<File>();
-			
-			for (int f=0;f<files.length;f++) {
-				if (files[f].isDirectory()) {
-					File [] fast5files = files[f].listFiles();
-					for (int i=0;i<fast5files.length;i++) {
-						if (fast5files[i].getName().endsWith(".fast5")) {
-							keptFiles.add(fast5files[i]);
-						}
-					}
-				}
-				else {
-					keptFiles.add(files[f]);
-				}
-			}
-			
-			files = keptFiles.toArray(new File[0]);
-			
-		}
-		
-		
-		File [][] fileGroups;
-		
-		// See if we need to group together files from a casava group
-		if (FastQCConfig.getInstance().casava) {
-			fileGroups = CasavaBasename.getCasavaGroups(files);
-		}
-		else if (FastQCConfig.getInstance().nano) {
-			fileGroups = NanoporeBasename.getNanoporeGroups(files);
-		}
-		else {
-			fileGroups = new File [files.length][1];
-			for (int f=0;f<files.length;f++) {
-				fileGroups[f][0] = files[f];
-			}
-		}
-
-	
-		for (int i=0;i<fileGroups.length;i++) {
-			File [] filesToProcess = fileGroups[i];
-			lastUsedDir = filesToProcess[0].getParentFile();
-			SequenceFile sequenceFile;
-			
-			
-			try {
-				sequenceFile = SequenceFactory.getSequenceFile(filesToProcess);
-			}
-			catch (SequenceFormatException e) {
-				JPanel errorPanel = new JPanel();
-				errorPanel.setLayout(new BorderLayout());
-				errorPanel.add(new JLabel("File format error: "+e.getLocalizedMessage(), JLabel.CENTER),BorderLayout.CENTER);
-				fileTabs.addTab(filesToProcess[0].getName(), errorPanel);
-				e.printStackTrace();
-				continue;
-			}
-			catch (IOException e) {
-				System.err.println("File broken");
-				e.printStackTrace();
-				JOptionPane.showMessageDialog(this, "Couldn't read file:"+e.getLocalizedMessage(), "Error reading file", JOptionPane.ERROR_MESSAGE);
-				continue;
-			}
-					
-			AnalysisRunner runner = new AnalysisRunner(sequenceFile);
-			ResultsPanel rp = new ResultsPanel(sequenceFile);
-			runner.addAnalysisListener(rp);
-			fileTabs.addTab(sequenceFile.name(), rp);
-			
-
-			QCModule [] module_list = ModuleFactory.getStandardModuleList();
-	
-			runner.startAnalysis(module_list);
-		}
-	}
-
-	public void saveReport () {
-		JFileChooser chooser;
-		
-		if (lastUsedDir == null) {
-			chooser = new JFileChooser();
-		}
-		else {
-			chooser = new JFileChooser(lastUsedDir);
-		}
-		
-		if (fileTabs.getSelectedComponent() == null) {
-			JOptionPane.showMessageDialog(this, "No FastQ files are open yet", "Can't save report", JOptionPane.ERROR_MESSAGE);
-			return;
-		}
-		chooser.setSelectedFile(new File(((ResultsPanel)fileTabs.getSelectedComponent()).sequenceFile().getFile().getName().replaceAll(".gz$","").replaceAll(".bz2$","").replaceAll(".txt$","").replaceAll(".fastq$", "").replaceAll(".fq$", "").replaceAll(".sam$", "").replaceAll(".bam$", "")+"_fastqc.html"));
-		chooser.setMultiSelectionEnabled(false);
-		chooser.setFileFilter(new FileFilter() {
-		
-			public String getDescription() {
-				return "HTML files";
-			}
-		
-			public boolean accept(File f) {
-				if (f.isDirectory() || f.getName().toLowerCase().endsWith(".html")) {
-					return true;
-				}
-				else {
-					return false;
-				}
-			}
-		
-		});
-	
-		File reportFile;
-		while (true) {
-			int result = chooser.showSaveDialog(this);
-			if (result == JFileChooser.CANCEL_OPTION) return;
-			
-			reportFile = chooser.getSelectedFile();
-			if (! reportFile.getName().toLowerCase().endsWith(".html")) {
-				reportFile = new File(reportFile.getAbsoluteFile()+".html");
-			}
-			
-			// Check if we're overwriting something
-			if (reportFile.exists()) {
-				int reply = JOptionPane.showConfirmDialog(this, reportFile.getName()+" already exists.  Overwrite?", "Overwrite existing file?", JOptionPane.YES_NO_OPTION);
-				if (reply == JOptionPane.NO_OPTION) {
-					continue;
-				}
-				else {
-					break;
-				}
-			}
-			else {
-				break;
-			}
-		}
-		
-		
-		ResultsPanel selectedPanel = (ResultsPanel)fileTabs.getSelectedComponent();
-		
-		try {
-			new HTMLReportArchive(selectedPanel.sequenceFile(), selectedPanel.modules(), reportFile);
-		} 
-		catch (Exception e) {
-			JOptionPane.showMessageDialog(this, "Failed to create archive: "+e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
-			e.printStackTrace();
-		}
-	}
-
-	public static void main(String[] args) {
-		
-		// See if we just have to print out the version
-		if (System.getProperty("fastqc.show_version") != null && System.getProperty("fastqc.show_version").equals("true")) {
-			System.out.println("FastQC v"+VERSION);
-			System.exit(0);
-		}
-		
-		if (args.length > 0) {
-			// Set headless to true so we don't get problems
-			// with people working without an X display.
-			System.setProperty("java.awt.headless", "true");
-			
-			// We used to default to unzipping the zip file in 
-			// non-interactive runs.  As we now save an HTML
-			// report at the top level we no longer do this
-			// so unzip is false unless explicitly set to be true.
-						
-			if (FastQCConfig.getInstance().do_unzip == null) {
-				FastQCConfig.getInstance().do_unzip = false;
-			}
-			
-			new OfflineRunner(args);
-			System.exit(0);
-		}
-		
-		else {
-			try {
-				UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-			} catch (Exception e) {}
-			
-	
-			// The interactive default is to not uncompress the
-			// reports after they have been generated
-			if (FastQCConfig.getInstance().do_unzip == null) {
-				FastQCConfig.getInstance().do_unzip = false;
-			}
-	
-			FastQCApplication app = new FastQCApplication();
-	
-			app.setVisible(true);
-		}
-	}	
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC;
+
+import java.awt.BorderLayout;
+import java.io.File;
+import java.io.IOException;
+import java.util.Vector;
+
+import javax.swing.ImageIcon;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+import javax.swing.UIManager;
+import javax.swing.filechooser.FileFilter;
+
+import uk.ac.babraham.FastQC.Analysis.AnalysisRunner;
+import uk.ac.babraham.FastQC.Analysis.OfflineRunner;
+import uk.ac.babraham.FastQC.Dialogs.WelcomePanel;
+import uk.ac.babraham.FastQC.FileFilters.BAMFileFilter;
+import uk.ac.babraham.FastQC.FileFilters.CasavaFastQFileFilter;
+import uk.ac.babraham.FastQC.FileFilters.FastQFileFilter;
+import uk.ac.babraham.FastQC.FileFilters.MappedBAMFileFilter;
+import uk.ac.babraham.FastQC.FileFilters.SequenceFileFilter;
+import uk.ac.babraham.FastQC.Modules.ModuleFactory;
+import uk.ac.babraham.FastQC.Modules.QCModule;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Results.ResultsPanel;
+import uk.ac.babraham.FastQC.Sequence.SequenceFactory;
+import uk.ac.babraham.FastQC.Sequence.SequenceFile;
+import uk.ac.babraham.FastQC.Sequence.SequenceFormatException;
+import uk.ac.babraham.FastQC.Utilities.CasavaBasename;
+import uk.ac.babraham.FastQC.Utilities.NanoporeBasename;
+
+public class FastQCApplication extends JFrame {	
+	
+	public static final String VERSION = "0.11.5";
+	
+	private JTabbedPane fileTabs;
+	private WelcomePanel welcomePanel;
+	private File lastUsedDir = null;
+	
+	public FastQCApplication () {
+			setTitle("FastQC");
+			setIconImage(new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/fastqc_icon.png")).getImage());
+			setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+	//		setSize(1280, 720);
+			setSize(800,600);
+			setLocationRelativeTo(null);
+			
+			welcomePanel = new WelcomePanel();
+			
+			fileTabs = new JTabbedPane(JTabbedPane.TOP);
+			setContentPane(welcomePanel);
+			
+			setJMenuBar(new FastQCMenuBar(this));
+			
+		}
+
+	public void close () {
+		if (fileTabs.getSelectedIndex() >=0) {
+			fileTabs.remove(fileTabs.getSelectedIndex());
+		}
+		if (fileTabs.getTabCount() == 0) {
+			setContentPane(welcomePanel);
+			validate();
+			repaint();
+		}
+	}
+	
+	public void closeAll () {
+		fileTabs.removeAll();
+		setContentPane(welcomePanel);
+		validate();
+		repaint();
+	}
+	
+	public void openFile () {
+		JFileChooser chooser;
+		
+		if (lastUsedDir == null) {
+			chooser = new JFileChooser();
+		}
+		else {
+			chooser = new JFileChooser(lastUsedDir);
+		}
+		chooser.setMultiSelectionEnabled(true);
+		SequenceFileFilter sff = new SequenceFileFilter();
+		chooser.addChoosableFileFilter(sff);
+		chooser.addChoosableFileFilter(new FastQFileFilter());
+		chooser.addChoosableFileFilter(new CasavaFastQFileFilter());
+		chooser.addChoosableFileFilter(new BAMFileFilter());
+		chooser.addChoosableFileFilter(new MappedBAMFileFilter());
+		chooser.setFileFilter(sff);
+		int result = chooser.showOpenDialog(this);
+		if (result == JFileChooser.CANCEL_OPTION) return;
+	
+		// See if they forced a file format
+		FileFilter chosenFilter = chooser.getFileFilter();
+		if (chosenFilter instanceof FastQFileFilter) {
+			FastQCConfig.getInstance().setSequenceFormat("fastq");
+		}
+		if (chosenFilter instanceof CasavaFastQFileFilter) {
+			FastQCConfig.getInstance().setSequenceFormat("fastq");
+			FastQCConfig.getInstance().setCasavaMode(true);
+
+		}
+		else if (chosenFilter instanceof BAMFileFilter) {
+			FastQCConfig.getInstance().setSequenceFormat("bam");
+		}
+		else if (chosenFilter instanceof MappedBAMFileFilter) {
+			FastQCConfig.getInstance().setSequenceFormat("bam_mapped");
+			System.setProperty("fastqc.sequence_format", "bam_mapped");
+		}
+		
+		// If we're still showing the welcome panel switch this out for
+		// the file tabs panel
+		if (fileTabs.getTabCount() == 0) {
+			setContentPane(fileTabs);
+			validate();
+			repaint();
+		}
+		
+		File [] files = chooser.getSelectedFiles();
+		
+		if (FastQCConfig.getInstance().nano) {
+			// Some of the files we've been passed might be directories and we would need to
+			// list the fast5 files within those directories.
+			
+			Vector<File> keptFiles = new Vector<File>();
+			
+			for (int f=0;f<files.length;f++) {
+				if (files[f].isDirectory()) {
+					File [] fast5files = files[f].listFiles();
+					for (int i=0;i<fast5files.length;i++) {
+						if (fast5files[i].getName().endsWith(".fast5")) {
+							keptFiles.add(fast5files[i]);
+						}
+					}
+				}
+				else {
+					keptFiles.add(files[f]);
+				}
+			}
+			
+			files = keptFiles.toArray(new File[0]);
+			
+		}
+		
+		
+		File [][] fileGroups;
+		
+		// See if we need to group together files from a casava group
+		if (FastQCConfig.getInstance().casava) {
+			fileGroups = CasavaBasename.getCasavaGroups(files);
+		}
+		else if (FastQCConfig.getInstance().nano) {
+			fileGroups = NanoporeBasename.getNanoporeGroups(files);
+		}
+		else {
+			fileGroups = new File [files.length][1];
+			for (int f=0;f<files.length;f++) {
+				fileGroups[f][0] = files[f];
+			}
+		}
+
+	
+		for (int i=0;i<fileGroups.length;i++) {
+			File [] filesToProcess = fileGroups[i];
+			lastUsedDir = filesToProcess[0].getParentFile();
+			SequenceFile sequenceFile;
+			
+			
+			try {
+				sequenceFile = SequenceFactory.getSequenceFile(filesToProcess);
+			}
+			catch (SequenceFormatException e) {
+				JPanel errorPanel = new JPanel();
+				errorPanel.setLayout(new BorderLayout());
+				errorPanel.add(new JLabel("File format error: "+e.getLocalizedMessage(), JLabel.CENTER),BorderLayout.CENTER);
+				fileTabs.addTab(filesToProcess[0].getName(), errorPanel);
+				e.printStackTrace();
+				continue;
+			}
+			catch (IOException e) {
+				System.err.println("File broken");
+				e.printStackTrace();
+				JOptionPane.showMessageDialog(this, "Couldn't read file:"+e.getLocalizedMessage(), "Error reading file", JOptionPane.ERROR_MESSAGE);
+				continue;
+			}
+					
+			AnalysisRunner runner = new AnalysisRunner(sequenceFile);
+			ResultsPanel rp = new ResultsPanel(sequenceFile);
+			runner.addAnalysisListener(rp);
+			fileTabs.addTab(sequenceFile.name(), rp);
+			
+
+			QCModule [] module_list = ModuleFactory.getStandardModuleList();
+	
+			runner.startAnalysis(module_list);
+		}
+	}
+
+	public void saveReport () {
+		JFileChooser chooser;
+		
+		if (lastUsedDir == null) {
+			chooser = new JFileChooser();
+		}
+		else {
+			chooser = new JFileChooser(lastUsedDir);
+		}
+		
+		if (fileTabs.getSelectedComponent() == null) {
+			JOptionPane.showMessageDialog(this, "No FastQ files are open yet", "Can't save report", JOptionPane.ERROR_MESSAGE);
+			return;
+		}
+		chooser.setSelectedFile(new File(((ResultsPanel)fileTabs.getSelectedComponent()).sequenceFile().getFile().getName().replaceAll(".gz$","").replaceAll(".bz2$","").replaceAll(".txt$","").replaceAll(".fastq$", "").replaceAll(".fq$", "").replaceAll(".sam$", "").replaceAll(".bam$", "")+"_fastqc.html"));
+		chooser.setMultiSelectionEnabled(false);
+		chooser.setFileFilter(new FileFilter() {
+		
+			public String getDescription() {
+				return "HTML files";
+			}
+		
+			public boolean accept(File f) {
+				if (f.isDirectory() || f.getName().toLowerCase().endsWith(".html")) {
+					return true;
+				}
+				else {
+					return false;
+				}
+			}
+		
+		});
+	
+		File reportFile;
+		while (true) {
+			int result = chooser.showSaveDialog(this);
+			if (result == JFileChooser.CANCEL_OPTION) return;
+			
+			reportFile = chooser.getSelectedFile();
+			if (! reportFile.getName().toLowerCase().endsWith(".html")) {
+				reportFile = new File(reportFile.getAbsoluteFile()+".html");
+			}
+			
+			// Check if we're overwriting something
+			if (reportFile.exists()) {
+				int reply = JOptionPane.showConfirmDialog(this, reportFile.getName()+" already exists.  Overwrite?", "Overwrite existing file?", JOptionPane.YES_NO_OPTION);
+				if (reply == JOptionPane.NO_OPTION) {
+					continue;
+				}
+				else {
+					break;
+				}
+			}
+			else {
+				break;
+			}
+		}
+		
+		
+		ResultsPanel selectedPanel = (ResultsPanel)fileTabs.getSelectedComponent();
+		
+		try {
+			new HTMLReportArchive(selectedPanel.sequenceFile(), selectedPanel.modules(), reportFile);
+		} 
+		catch (Exception e) {
+			JOptionPane.showMessageDialog(this, "Failed to create archive: "+e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
+			e.printStackTrace();
+		}
+	}
+
+	public static void main(String[] args) {
+		
+		// See if we just have to print out the version
+		if (System.getProperty("fastqc.show_version") != null && System.getProperty("fastqc.show_version").equals("true")) {
+			System.out.println("FastQC v"+VERSION);
+			System.exit(0);
+		}
+		
+		if (args.length > 0) {
+			// Set headless to true so we don't get problems
+			// with people working without an X display.
+			System.setProperty("java.awt.headless", "true");
+			
+			// We used to default to unzipping the zip file in 
+			// non-interactive runs.  As we now save an HTML
+			// report at the top level we no longer do this
+			// so unzip is false unless explicitly set to be true.
+						
+			if (FastQCConfig.getInstance().do_unzip == null) {
+				FastQCConfig.getInstance().do_unzip = false;
+			}
+			
+			new OfflineRunner(args);
+			System.exit(0);
+		}
+		
+		else {
+			try {
+				UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+			} catch (Exception e) {}
+			
+	
+			// The interactive default is to not uncompress the
+			// reports after they have been generated
+			if (FastQCConfig.getInstance().do_unzip == null) {
+				FastQCConfig.getInstance().do_unzip = false;
+			}
+	
+			FastQCApplication app = new FastQCApplication();
+	
+			app.setVisible(true);
+		}
+	}	
+
+}
diff --git a/uk/ac/babraham/FastQC/FastQCMenuBar.java b/uk/ac/babraham/FastQC/FastQCMenuBar.java
index e020f36..f02e485 100644
--- a/uk/ac/babraham/FastQC/FastQCMenuBar.java
+++ b/uk/ac/babraham/FastQC/FastQCMenuBar.java
@@ -1,149 +1,149 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC;
-
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyEvent;
-import java.io.File;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
-import javax.swing.KeyStroke;
-
-import uk.ac.babraham.FastQC.Dialogs.AboutDialog;
-import uk.ac.babraham.FastQC.Help.HelpDialog;
-
-public class FastQCMenuBar extends JMenuBar implements ActionListener {
-
-	private FastQCApplication application;
-	
-	public FastQCMenuBar (FastQCApplication application) {
-		this.application = application;
-		
-		JMenu fileMenu = new JMenu("File");
-		fileMenu.setMnemonic(KeyEvent.VK_F);
-		
-		JMenuItem fileOpen = new JMenuItem("Open...");
-		fileOpen.setMnemonic(KeyEvent.VK_O);
-		fileOpen.setAccelerator(KeyStroke.getKeyStroke('O', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
-		fileOpen.setActionCommand("open");
-		fileOpen.addActionListener(this);
-		fileMenu.add(fileOpen);
-		
-		fileMenu.addSeparator();
-		
-		JMenuItem fileSave = new JMenuItem("Save report...");
-		fileSave.setMnemonic(KeyEvent.VK_S);
-		fileSave.setAccelerator(KeyStroke.getKeyStroke('S', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
-		fileSave.setActionCommand("save");
-		fileSave.addActionListener(this);
-		fileMenu.add(fileSave);
-		
-		fileMenu.addSeparator();
-		
-		JMenuItem fileClose = new JMenuItem("Close");
-		fileClose.setMnemonic(KeyEvent.VK_C);
-		fileClose.setAccelerator(KeyStroke.getKeyStroke('W', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
-		fileClose.setActionCommand("close");
-		fileClose.addActionListener(this);
-		fileMenu.add(fileClose);
-		
-
-		JMenuItem fileCloseAll = new JMenuItem("Close All");
-		fileCloseAll.setMnemonic(KeyEvent.VK_A);
-		fileCloseAll.setActionCommand("close_all");
-		fileCloseAll.addActionListener(this);
-		fileMenu.add(fileCloseAll);
-
-		
-		fileMenu.addSeparator();
-		
-		JMenuItem fileExit = new JMenuItem("Exit");
-		fileExit.setMnemonic(KeyEvent.VK_X);
-		fileExit.setActionCommand("exit");
-		fileExit.addActionListener(this);
-		fileMenu.add(fileExit);
-		
-		add(fileMenu);
-		
-		JMenu helpMenu = new JMenu("Help");
-		helpMenu.setMnemonic(KeyEvent.VK_H);
-		
-		JMenuItem helpContents = new JMenuItem("Contents...");
-		helpContents.setMnemonic(KeyEvent.VK_C);
-		helpContents.setActionCommand("help_contents");
-		helpContents.addActionListener(this);
-		helpMenu.add(helpContents);
-		
-		helpMenu.addSeparator();
-		
-		JMenuItem helpAbout = new JMenuItem("About FastQC");
-		helpAbout.setMnemonic(KeyEvent.VK_A);
-		helpAbout.setActionCommand("about");
-		helpAbout.addActionListener(this);
-		
-		helpMenu.add(helpAbout);
-		
-		add(helpMenu);
-		
-	}
-
-	public void actionPerformed(ActionEvent e) {
-
-		String command = e.getActionCommand();
-		
-		if (command.equals("exit")) {
-			System.exit(0);
-		}
-		else if (command.equals("open")) {
-			application.openFile();
-		}
-		else if (command.equals("save")) {
-			application.saveReport();
-		}
-		else if (command.equals("close")) {
-			application.close();
-		}
-		else if (command.equals("close_all")) {
-			application.closeAll();
-		}
-		else if (command.equals("help_contents")) {
-			try {
-				new HelpDialog(application,new File(URLDecoder.decode(ClassLoader.getSystemResource("Help").getFile(),"UTF-8")));
-			} 
-			catch (UnsupportedEncodingException e1) {
-				e1.printStackTrace();
-			}
-		}
-		else if (command.equals("about")) {
-			new AboutDialog(application);
-		}
-		else {
-			JOptionPane.showMessageDialog(application, "Unknown menu command "+command, "Unknown command", JOptionPane.ERROR_MESSAGE);
-		}
-	}
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC;
+
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
+
+import uk.ac.babraham.FastQC.Dialogs.AboutDialog;
+import uk.ac.babraham.FastQC.Help.HelpDialog;
+
+public class FastQCMenuBar extends JMenuBar implements ActionListener {
+
+	private FastQCApplication application;
+	
+	public FastQCMenuBar (FastQCApplication application) {
+		this.application = application;
+		
+		JMenu fileMenu = new JMenu("File");
+		fileMenu.setMnemonic(KeyEvent.VK_F);
+		
+		JMenuItem fileOpen = new JMenuItem("Open...");
+		fileOpen.setMnemonic(KeyEvent.VK_O);
+		fileOpen.setAccelerator(KeyStroke.getKeyStroke('O', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
+		fileOpen.setActionCommand("open");
+		fileOpen.addActionListener(this);
+		fileMenu.add(fileOpen);
+		
+		fileMenu.addSeparator();
+		
+		JMenuItem fileSave = new JMenuItem("Save report...");
+		fileSave.setMnemonic(KeyEvent.VK_S);
+		fileSave.setAccelerator(KeyStroke.getKeyStroke('S', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
+		fileSave.setActionCommand("save");
+		fileSave.addActionListener(this);
+		fileMenu.add(fileSave);
+		
+		fileMenu.addSeparator();
+		
+		JMenuItem fileClose = new JMenuItem("Close");
+		fileClose.setMnemonic(KeyEvent.VK_C);
+		fileClose.setAccelerator(KeyStroke.getKeyStroke('W', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
+		fileClose.setActionCommand("close");
+		fileClose.addActionListener(this);
+		fileMenu.add(fileClose);
+		
+
+		JMenuItem fileCloseAll = new JMenuItem("Close All");
+		fileCloseAll.setMnemonic(KeyEvent.VK_A);
+		fileCloseAll.setActionCommand("close_all");
+		fileCloseAll.addActionListener(this);
+		fileMenu.add(fileCloseAll);
+
+		
+		fileMenu.addSeparator();
+		
+		JMenuItem fileExit = new JMenuItem("Exit");
+		fileExit.setMnemonic(KeyEvent.VK_X);
+		fileExit.setActionCommand("exit");
+		fileExit.addActionListener(this);
+		fileMenu.add(fileExit);
+		
+		add(fileMenu);
+		
+		JMenu helpMenu = new JMenu("Help");
+		helpMenu.setMnemonic(KeyEvent.VK_H);
+		
+		JMenuItem helpContents = new JMenuItem("Contents...");
+		helpContents.setMnemonic(KeyEvent.VK_C);
+		helpContents.setActionCommand("help_contents");
+		helpContents.addActionListener(this);
+		helpMenu.add(helpContents);
+		
+		helpMenu.addSeparator();
+		
+		JMenuItem helpAbout = new JMenuItem("About FastQC");
+		helpAbout.setMnemonic(KeyEvent.VK_A);
+		helpAbout.setActionCommand("about");
+		helpAbout.addActionListener(this);
+		
+		helpMenu.add(helpAbout);
+		
+		add(helpMenu);
+		
+	}
+
+	public void actionPerformed(ActionEvent e) {
+
+		String command = e.getActionCommand();
+		
+		if (command.equals("exit")) {
+			System.exit(0);
+		}
+		else if (command.equals("open")) {
+			application.openFile();
+		}
+		else if (command.equals("save")) {
+			application.saveReport();
+		}
+		else if (command.equals("close")) {
+			application.close();
+		}
+		else if (command.equals("close_all")) {
+			application.closeAll();
+		}
+		else if (command.equals("help_contents")) {
+			try {
+				new HelpDialog(application,new File(URLDecoder.decode(ClassLoader.getSystemResource("Help").getFile(),"UTF-8")));
+			} 
+			catch (UnsupportedEncodingException e1) {
+				e1.printStackTrace();
+			}
+		}
+		else if (command.equals("about")) {
+			new AboutDialog(application);
+		}
+		else {
+			JOptionPane.showMessageDialog(application, "Unknown menu command "+command, "Unknown command", JOptionPane.ERROR_MESSAGE);
+		}
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/FileFilters/BAMFileFilter.java b/uk/ac/babraham/FastQC/FileFilters/BAMFileFilter.java
index da18f48..67aee2b 100644
--- a/uk/ac/babraham/FastQC/FileFilters/BAMFileFilter.java
+++ b/uk/ac/babraham/FastQC/FileFilters/BAMFileFilter.java
@@ -1,36 +1,36 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.FileFilters;
-
-import java.io.File;
-
-import javax.swing.filechooser.FileFilter;
-
-public class BAMFileFilter extends FileFilter {
-
-	public boolean accept(File f) {
-		return true;
-	}
-
-	public String getDescription() {
-		return "BAM/SAM Files (all entries)";
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.FileFilters;
+
+import java.io.File;
+
+import javax.swing.filechooser.FileFilter;
+
+public class BAMFileFilter extends FileFilter {
+
+	public boolean accept(File f) {
+		return true;
+	}
+
+	public String getDescription() {
+		return "BAM/SAM Files (all entries)";
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/FileFilters/CasavaFastQFileFilter.java b/uk/ac/babraham/FastQC/FileFilters/CasavaFastQFileFilter.java
index 080cddd..72dd196 100644
--- a/uk/ac/babraham/FastQC/FileFilters/CasavaFastQFileFilter.java
+++ b/uk/ac/babraham/FastQC/FileFilters/CasavaFastQFileFilter.java
@@ -1,39 +1,39 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.FileFilters;
-
-import java.io.File;
-
-import javax.swing.filechooser.FileFilter;
-
-public class CasavaFastQFileFilter extends FileFilter {
-
-	public boolean accept(File f) {
-		if (f.isDirectory() || f.getName().endsWith(".fastq.gz")) {
-			return true;
-		}
-		return false;
-	}
-
-	public String getDescription() {
-		return "Casava FastQ Files";
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.FileFilters;
+
+import java.io.File;
+
+import javax.swing.filechooser.FileFilter;
+
+public class CasavaFastQFileFilter extends FileFilter {
+
+	public boolean accept(File f) {
+		if (f.isDirectory() || f.getName().endsWith(".fastq.gz")) {
+			return true;
+		}
+		return false;
+	}
+
+	public String getDescription() {
+		return "Casava FastQ Files";
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/FileFilters/FastQFileFilter.java b/uk/ac/babraham/FastQC/FileFilters/FastQFileFilter.java
index 5205857..41a2553 100644
--- a/uk/ac/babraham/FastQC/FileFilters/FastQFileFilter.java
+++ b/uk/ac/babraham/FastQC/FileFilters/FastQFileFilter.java
@@ -1,36 +1,36 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.FileFilters;
-
-import java.io.File;
-
-import javax.swing.filechooser.FileFilter;
-
-public class FastQFileFilter extends FileFilter {
-
-	public boolean accept(File f) {
-		return true;
-	}
-
-	public String getDescription() {
-		return "FastQ Files";
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.FileFilters;
+
+import java.io.File;
+
+import javax.swing.filechooser.FileFilter;
+
+public class FastQFileFilter extends FileFilter {
+
+	public boolean accept(File f) {
+		return true;
+	}
+
+	public String getDescription() {
+		return "FastQ Files";
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/FileFilters/GobyFileFilter.java b/uk/ac/babraham/FastQC/FileFilters/GobyFileFilter.java
index 681045c..2524b1c 100644
--- a/uk/ac/babraham/FastQC/FileFilters/GobyFileFilter.java
+++ b/uk/ac/babraham/FastQC/FileFilters/GobyFileFilter.java
@@ -1,36 +1,36 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.FileFilters;
-
-import java.io.File;
-
-import javax.swing.filechooser.FileFilter;
-
-public class GobyFileFilter extends FileFilter {
-
-	public boolean accept(File f) {
-		return true;
-	}
-
-	public String getDescription() {
-		return "Goby Files (all entries)";
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.FileFilters;
+
+import java.io.File;
+
+import javax.swing.filechooser.FileFilter;
+
+public class GobyFileFilter extends FileFilter {
+
+	public boolean accept(File f) {
+		return true;
+	}
+
+	public String getDescription() {
+		return "Goby Files (all entries)";
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/FileFilters/MappedBAMFileFilter.java b/uk/ac/babraham/FastQC/FileFilters/MappedBAMFileFilter.java
index 41972b9..39b078b 100644
--- a/uk/ac/babraham/FastQC/FileFilters/MappedBAMFileFilter.java
+++ b/uk/ac/babraham/FastQC/FileFilters/MappedBAMFileFilter.java
@@ -1,36 +1,36 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.FileFilters;
-
-import java.io.File;
-
-import javax.swing.filechooser.FileFilter;
-
-public class MappedBAMFileFilter extends FileFilter {
-
-	public boolean accept(File f) {
-		return true;
-	}
-
-	public String getDescription() {
-		return "BAM/SAM Files (only mapped entries)";
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.FileFilters;
+
+import java.io.File;
+
+import javax.swing.filechooser.FileFilter;
+
+public class MappedBAMFileFilter extends FileFilter {
+
+	public boolean accept(File f) {
+		return true;
+	}
+
+	public String getDescription() {
+		return "BAM/SAM Files (only mapped entries)";
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/FileFilters/SequenceFileFilter.java b/uk/ac/babraham/FastQC/FileFilters/SequenceFileFilter.java
index ddbe01c..22dbd81 100644
--- a/uk/ac/babraham/FastQC/FileFilters/SequenceFileFilter.java
+++ b/uk/ac/babraham/FastQC/FileFilters/SequenceFileFilter.java
@@ -1,55 +1,55 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.FileFilters;
-
-import java.io.File;
-
-import javax.swing.filechooser.FileFilter;
-
-public class SequenceFileFilter extends FileFilter {
-
-	public boolean accept(File f) {
-		if (f.isDirectory() 
-				|| f.getName().toLowerCase().endsWith(".txt.gz") 
-				|| f.getName().toLowerCase().endsWith(".fastq.gz") 
-				|| f.getName().toLowerCase().endsWith(".fq.gz") 
-				|| f.getName().toLowerCase().endsWith(".fq") 
-				|| f.getName().toLowerCase().endsWith(".txt.bz2") 
-				|| f.getName().toLowerCase().endsWith(".fastq.bz2")
-				|| f.getName().toLowerCase().endsWith(".txt") 
-				|| f.getName().toLowerCase().endsWith(".fastq") 
-				|| f.getName().toLowerCase().endsWith(".bam") 
-				|| f.getName().toLowerCase().endsWith(".sam")
-				|| f.getName().toLowerCase().endsWith(".compact-reads")
-				|| f.getName().toLowerCase().endsWith(".goby")
-				
-		) {
-			return true;
-		}
-		else {
-			return false;
-		}
-	}
-
-	public String getDescription() {
-		return "Sequence Files";
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.FileFilters;
+
+import java.io.File;
+
+import javax.swing.filechooser.FileFilter;
+
+public class SequenceFileFilter extends FileFilter {
+
+	public boolean accept(File f) {
+		if (f.isDirectory() 
+				|| f.getName().toLowerCase().endsWith(".txt.gz") 
+				|| f.getName().toLowerCase().endsWith(".fastq.gz") 
+				|| f.getName().toLowerCase().endsWith(".fq.gz") 
+				|| f.getName().toLowerCase().endsWith(".fq") 
+				|| f.getName().toLowerCase().endsWith(".txt.bz2") 
+				|| f.getName().toLowerCase().endsWith(".fastq.bz2")
+				|| f.getName().toLowerCase().endsWith(".txt") 
+				|| f.getName().toLowerCase().endsWith(".fastq") 
+				|| f.getName().toLowerCase().endsWith(".bam") 
+				|| f.getName().toLowerCase().endsWith(".sam")
+				|| f.getName().toLowerCase().endsWith(".compact-reads")
+				|| f.getName().toLowerCase().endsWith(".goby")
+				
+		) {
+			return true;
+		}
+		else {
+			return false;
+		}
+	}
+
+	public String getDescription() {
+		return "Sequence Files";
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Graphs/BaseGroup.java b/uk/ac/babraham/FastQC/Graphs/BaseGroup.java
index e9d505c..54dc61b 100644
--- a/uk/ac/babraham/FastQC/Graphs/BaseGroup.java
+++ b/uk/ac/babraham/FastQC/Graphs/BaseGroup.java
@@ -1,221 +1,221 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Graphs;
-
-import java.util.Vector;
-
-import uk.ac.babraham.FastQC.FastQCConfig;
-
-/**
- * The base group class is a simple way to create a set of bins into
- * which positions within a read can be put such that early positions
- * get a group to themselves and later positions get averaged so that
- * general trends can still be observed.
- *
- */
-public class BaseGroup {
-
-	private int lowerCount;
-	private int upperCount;
-
-	public static BaseGroup [] makeBaseGroups (int maxLength) {
-
-		if (FastQCConfig.getInstance().nogroup) {
-			return(makeUngroupedGroups(maxLength));
-		}
-		else if (FastQCConfig.getInstance().expgroup) {
-			return(makeExponentialBaseGroups(maxLength));
-		}
-		else {
-			return(makeLinearBaseGroups(maxLength));
-		}
-	}
-
-	public static BaseGroup [] makeUngroupedGroups (int maxLength) {
-
-		int startingBase = 1;
-		int interval = 1;
-
-		Vector<BaseGroup> groups = new Vector<BaseGroup>();
-
-		while (startingBase <= maxLength) {
-
-			int endBase = startingBase+(interval-1);
-			if (endBase > maxLength) endBase = maxLength;
-
-			BaseGroup bg = new BaseGroup(startingBase, endBase);
-			groups.add(bg);
-
-			startingBase += interval;
-		}
-
-		return groups.toArray(new BaseGroup[0]);
-
-	}
-
-	public static BaseGroup [] makeExponentialBaseGroups (int maxLength) {
-
-		int startingBase = 1;
-		int interval = 1;
-
-		Vector<BaseGroup> groups = new Vector<BaseGroup>();
-
-		while (startingBase <= maxLength) {
-
-			int endBase = startingBase+(interval-1);
-			if (endBase > maxLength) endBase = maxLength;
-
-			BaseGroup bg = new BaseGroup(startingBase, endBase);
-			groups.add(bg);
-
-			startingBase += interval;
-
-			// See if we need to increase the interval
-			if (startingBase == 10 && maxLength > 75) {
-				interval = 5;
-			}
-			if (startingBase == 50 && maxLength > 200) {
-				interval = 10;
-			}
-			if (startingBase == 100 && maxLength > 300) {
-				interval = 50;
-			}
-			if (startingBase == 500 && maxLength > 1000) {
-				interval = 100;
-			}
-			if (startingBase == 1000 && maxLength > 2000) {
-				interval = 500;
-			}
-
-
-		}
-
-		return groups.toArray(new BaseGroup[0]);
-
-	}
-
-	private static int getLinearInterval (int length) {
-		// The the first 9bp as individual residues since odd stuff 
-		// can happen there, then we find a grouping value which gives 
-		// us a total set of groups below 75.  We limit the intervals
-		// we try to sensible whole numbers.
-		
-		int [] baseValues = new int [] {2,5,10};
-		int multiplier = 1;
-		
-		while (true) {
-			for (int b=0;b<baseValues.length;b++) {
-				int interval = baseValues[b] * multiplier;
-				int groupCount = 9 + ((length-9)/interval);
-				if ((length-9) % interval != 0) {
-					groupCount += 1;
-				}
-				
-				if (groupCount < 75) return interval;
-			}
-			
-			multiplier *= 10;
-			
-			if (multiplier == 10000000) {
-				throw new IllegalStateException("Couldn't find a sensible interval grouping for length '"+length+"'");
-			}
-		}
-		
-	}
-	
-	public static BaseGroup [] makeLinearBaseGroups (int maxLength) {
-
-		// For lengths below 75bp we just return everything.
-		if (maxLength <= 75) return makeUngroupedGroups(maxLength);
-		
-		// We need to work out what interval we're going to use.
-		
-		int interval = getLinearInterval(maxLength);
-		
-		
-		int startingBase = 1;
-
-		Vector<BaseGroup> groups = new Vector<BaseGroup>();
-
-		while (startingBase <= maxLength) {
-
-			int endBase = startingBase+(interval-1);
-
-			if (startingBase < 10) endBase = startingBase;
-
-			if (startingBase == 10 && interval > 10) {
-				endBase = interval-1;
-			}
-			
-			if (endBase > maxLength) endBase = maxLength;
-
-			BaseGroup bg = new BaseGroup(startingBase, endBase);
-			groups.add(bg);
-
-			if (startingBase < 10) {
-				startingBase +=1;
-			}
-			else if (startingBase == 10 && interval > 10) {
-				startingBase = interval;
-			}
-			else {
-				startingBase += interval;
-			}
-
-		}
-
-		return groups.toArray(new BaseGroup[0]);
-
-	}
-
-
-	/**
-	 * 
-	 * @param lowerCount
-	 * @param upperCount
-	 */
-
-	private BaseGroup (int lowerCount, int upperCount) {
-		this.lowerCount = lowerCount;
-		this.upperCount = upperCount;
-	}
-
-	public int lowerCount () {
-		return lowerCount;
-	}
-
-	public int upperCount () {
-		return upperCount;
-	}
-
-	public boolean containsValue (int value) {
-		return value>=lowerCount && value<=upperCount;
-	}
-
-	public String toString () {
-		if (lowerCount == upperCount) {
-			return ""+lowerCount;
-		}
-		else {
-			return ""+lowerCount+"-"+upperCount;
-		}
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Graphs;
+
+import java.util.Vector;
+
+import uk.ac.babraham.FastQC.FastQCConfig;
+
+/**
+ * The base group class is a simple way to create a set of bins into
+ * which positions within a read can be put such that early positions
+ * get a group to themselves and later positions get averaged so that
+ * general trends can still be observed.
+ *
+ */
+public class BaseGroup {
+
+	private int lowerCount;
+	private int upperCount;
+
+	public static BaseGroup [] makeBaseGroups (int maxLength) {
+
+		if (FastQCConfig.getInstance().nogroup) {
+			return(makeUngroupedGroups(maxLength));
+		}
+		else if (FastQCConfig.getInstance().expgroup) {
+			return(makeExponentialBaseGroups(maxLength));
+		}
+		else {
+			return(makeLinearBaseGroups(maxLength));
+		}
+	}
+
+	public static BaseGroup [] makeUngroupedGroups (int maxLength) {
+
+		int startingBase = 1;
+		int interval = 1;
+
+		Vector<BaseGroup> groups = new Vector<BaseGroup>();
+
+		while (startingBase <= maxLength) {
+
+			int endBase = startingBase+(interval-1);
+			if (endBase > maxLength) endBase = maxLength;
+
+			BaseGroup bg = new BaseGroup(startingBase, endBase);
+			groups.add(bg);
+
+			startingBase += interval;
+		}
+
+		return groups.toArray(new BaseGroup[0]);
+
+	}
+
+	public static BaseGroup [] makeExponentialBaseGroups (int maxLength) {
+
+		int startingBase = 1;
+		int interval = 1;
+
+		Vector<BaseGroup> groups = new Vector<BaseGroup>();
+
+		while (startingBase <= maxLength) {
+
+			int endBase = startingBase+(interval-1);
+			if (endBase > maxLength) endBase = maxLength;
+
+			BaseGroup bg = new BaseGroup(startingBase, endBase);
+			groups.add(bg);
+
+			startingBase += interval;
+
+			// See if we need to increase the interval
+			if (startingBase == 10 && maxLength > 75) {
+				interval = 5;
+			}
+			if (startingBase == 50 && maxLength > 200) {
+				interval = 10;
+			}
+			if (startingBase == 100 && maxLength > 300) {
+				interval = 50;
+			}
+			if (startingBase == 500 && maxLength > 1000) {
+				interval = 100;
+			}
+			if (startingBase == 1000 && maxLength > 2000) {
+				interval = 500;
+			}
+
+
+		}
+
+		return groups.toArray(new BaseGroup[0]);
+
+	}
+
+	private static int getLinearInterval (int length) {
+		// The the first 9bp as individual residues since odd stuff 
+		// can happen there, then we find a grouping value which gives 
+		// us a total set of groups below 75.  We limit the intervals
+		// we try to sensible whole numbers.
+		
+		int [] baseValues = new int [] {2,5,10};
+		int multiplier = 1;
+		
+		while (true) {
+			for (int b=0;b<baseValues.length;b++) {
+				int interval = baseValues[b] * multiplier;
+				int groupCount = 9 + ((length-9)/interval);
+				if ((length-9) % interval != 0) {
+					groupCount += 1;
+				}
+				
+				if (groupCount < 75) return interval;
+			}
+			
+			multiplier *= 10;
+			
+			if (multiplier == 10000000) {
+				throw new IllegalStateException("Couldn't find a sensible interval grouping for length '"+length+"'");
+			}
+		}
+		
+	}
+	
+	public static BaseGroup [] makeLinearBaseGroups (int maxLength) {
+
+		// For lengths below 75bp we just return everything.
+		if (maxLength <= 75) return makeUngroupedGroups(maxLength);
+		
+		// We need to work out what interval we're going to use.
+		
+		int interval = getLinearInterval(maxLength);
+		
+		
+		int startingBase = 1;
+
+		Vector<BaseGroup> groups = new Vector<BaseGroup>();
+
+		while (startingBase <= maxLength) {
+
+			int endBase = startingBase+(interval-1);
+
+			if (startingBase < 10) endBase = startingBase;
+
+			if (startingBase == 10 && interval > 10) {
+				endBase = interval-1;
+			}
+			
+			if (endBase > maxLength) endBase = maxLength;
+
+			BaseGroup bg = new BaseGroup(startingBase, endBase);
+			groups.add(bg);
+
+			if (startingBase < 10) {
+				startingBase +=1;
+			}
+			else if (startingBase == 10 && interval > 10) {
+				startingBase = interval;
+			}
+			else {
+				startingBase += interval;
+			}
+
+		}
+
+		return groups.toArray(new BaseGroup[0]);
+
+	}
+
+
+	/**
+	 * 
+	 * @param lowerCount
+	 * @param upperCount
+	 */
+
+	private BaseGroup (int lowerCount, int upperCount) {
+		this.lowerCount = lowerCount;
+		this.upperCount = upperCount;
+	}
+
+	public int lowerCount () {
+		return lowerCount;
+	}
+
+	public int upperCount () {
+		return upperCount;
+	}
+
+	public boolean containsValue (int value) {
+		return value>=lowerCount && value<=upperCount;
+	}
+
+	public String toString () {
+		if (lowerCount == upperCount) {
+			return ""+lowerCount;
+		}
+		else {
+			return ""+lowerCount+"-"+upperCount;
+		}
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Graphs/LineGraph.java b/uk/ac/babraham/FastQC/Graphs/LineGraph.java
index 685f072..541c37d 100644
--- a/uk/ac/babraham/FastQC/Graphs/LineGraph.java
+++ b/uk/ac/babraham/FastQC/Graphs/LineGraph.java
@@ -1,235 +1,235 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Graphs;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-
-import javax.swing.JPanel;
-
-public class LineGraph extends JPanel {
-
-	private String [] xTitles;
-	private String xLabel;
-	private String [] xCategories;
-	private double [][] data;
-	private String graphTitle;
-	private double minY;
-	private double maxY;
-	private double yInterval;
-	
-	private static final Color [] COLOURS = new Color[] {new Color(220,0,0), new Color(0,0,220), new Color(0,220,0), Color.DARK_GRAY, Color.MAGENTA, Color.ORANGE,Color.YELLOW,Color.CYAN,Color.PINK,Color.LIGHT_GRAY};
-	
-	public LineGraph (double [] [] data, double minY, double maxY, String xLabel, String [] xTitles, int [] xCategories, String graphTitle) {
-		this(data,minY,maxY,xLabel,xTitles,new String[0],graphTitle);
-		this.xCategories = new String [xCategories.length];
-		for (int i=0;i<xCategories.length;i++) {
-			this.xCategories[i] = ""+xCategories[i];
-		}
-		
-	}
-	
-	public LineGraph (double [] [] data, double minY, double maxY, String xLabel, String [] xTitles, String [] xCategories, String graphTitle) {
-		this.data = data;
-		this.minY = minY;
-		this.maxY = maxY;
-		this.xTitles = xTitles;
-		this.xLabel = xLabel;
-		this.xCategories = xCategories;
-		this.graphTitle = graphTitle;
-		this.yInterval = findOptimalYInterval(maxY);
-	}
-	
-	private double findOptimalYInterval(double max) {
-		
-		int base = 1;
-		double [] divisions = new double [] {1,2,2.5,5};
-		
-		while (true) {
-			
-			for (int d=0;d<divisions.length;d++) {
-				double tester = base * divisions[d];
-				if (max / tester <= 10) {
-					return tester;
-				}
-			}
-		
-			base *=10;
-			
-		}
-		
-		
-		
-	}
-	
-	public Dimension getPreferredSize () {
-		return new Dimension(800,600);
-	}
-
-	public Dimension getMinimumSize () {
-		return new Dimension(100,200);
-	}
-	
-	public void paint (Graphics g) {
-		super.paint(g);
-		
-		g.setColor(Color.WHITE);
-		g.fillRect(0, 0, getWidth(), getHeight());
-		g.setColor(Color.BLACK);
-		
-		int lastY = 0;
-		
-		double yStart;
-		
-		if (minY % yInterval == 0) {
-			yStart = minY;
-		}
-		else {
-			yStart = yInterval * (((int)minY/yInterval)+1);
-		}
-		
-		int xOffset = 0;
-		
-		for (double i=yStart;i<=maxY;i+=yInterval) {
-			String label = ""+i;
-			label = label.replaceAll(".0$", ""); // Don't leave trailing .0s where we don't need them.
-			int width = g.getFontMetrics().stringWidth(label);
-			if (width > xOffset) {
-				xOffset = width;
-			}
-			
-			g.drawString(label, 2, getY(i)+(g.getFontMetrics().getAscent()/2));			
-		}
-	
-		// Give the x axis a bit of breathing space
-		xOffset += 5;
-		
-		// Draw the graph title
-		int titleWidth = g.getFontMetrics().stringWidth(graphTitle);
-		g.drawString(graphTitle, (xOffset + ((getWidth()-(xOffset+10))/2)) - (titleWidth/2), 30);
-		
-		
-		// Now draw the axes
-		g.drawLine(xOffset, getHeight()-40, getWidth()-10,getHeight()-40);
-		g.drawLine(xOffset, getHeight()-40, xOffset, 40);
-		
-		// Draw the xLabel under the xAxis
-		g.drawString(xLabel, (getWidth()/2) - (g.getFontMetrics().stringWidth(xLabel)/2), getHeight()-5);
-		
-		
-		// Now draw the data points
-		int baseWidth = (getWidth()-(xOffset+10))/data[0].length;
-		if (baseWidth<1) baseWidth=1;
-		
-//		System.out.println("Base Width is "+baseWidth);
-		
-		// First draw faint boxes over alternating bases so you can see which is which
-		
-		// Let's find the longest label, and then work out how often we can draw labels
-		
-		int lastXLabelEnd = 0;
-		
-		for (int i=0;i<data[0].length;i++) {
-			if (i%2 != 0) {
-				g.setColor(new Color(230, 230, 230));
-				g.fillRect(xOffset+(baseWidth*i), 40, baseWidth, getHeight()-80);
-			}
-			g.setColor(Color.BLACK);
-			String baseNumber = ""+xCategories[i];
-			int baseNumberWidth = g.getFontMetrics().stringWidth(baseNumber);
-			int baseNumberPosition =  (baseWidth/2)+xOffset+(baseWidth*i)-(baseNumberWidth/2);
-			
-			if (baseNumberPosition > lastXLabelEnd) {
-				g.drawString(baseNumber,baseNumberPosition, getHeight()-25);
-				lastXLabelEnd = baseNumberPosition+baseNumberWidth+5;
-			}
-		}
-		
-		// Now draw horizontal lines across from the y axis
-
-		g.setColor(new Color(180,180,180));
-		for (double i=yStart;i<=maxY;i+=yInterval) {
-			g.drawLine(xOffset, getY(i), getWidth()-10, getY(i));
-		}
-		g.setColor(Color.BLACK);
-		
-		// Now draw the datasets
-		
-		if (g instanceof Graphics2D) {
-			((Graphics2D)g).setStroke(new BasicStroke(2));
-			((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-		}
-		
-		for (int d=0;d<data.length;d++) {
-			g.setColor(COLOURS[d % COLOURS.length]);
-						
-			lastY = getY(data[d][0]);
-			for (int i=1;i<data[d].length;i++) {
-				int thisY = getY(data[d][i]);
-				g.drawLine((baseWidth/2)+xOffset+(baseWidth*(i-1)), lastY, (baseWidth/2)+xOffset+(baseWidth*i), thisY);
-				lastY = thisY;
-			}
-			
-		}
-		
-		// Now draw the data legend
-
-		if (g instanceof Graphics2D) {
-			((Graphics2D)g).setStroke(new BasicStroke(1));
-			((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
-		}
-
-		
-		// First we need to find the widest label
-		int widestLabel = 0;
-		for (int t=0;t<xTitles.length;t++) {
-			int width = g.getFontMetrics().stringWidth(xTitles[t]);
-			if (width > widestLabel) widestLabel = width;
-		}
-		
-		// Add 3px either side for a bit of space;
-		widestLabel += 6;
-		
-		// First draw a box to put the legend in
-		g.setColor(Color.WHITE);
-		g.fillRect((getWidth()-10)-widestLabel, 40, widestLabel, 3+(20*xTitles.length));
-		g.setColor(Color.LIGHT_GRAY);
-		g.drawRect((getWidth()-10)-widestLabel, 40, widestLabel, 3+(20*xTitles.length));
-
-		// Now draw the actual labels
-		for (int t=0;t<xTitles.length;t++) {
-			g.setColor(COLOURS[t]);
-			g.drawString(xTitles[t], ((getWidth()-10)-widestLabel)+3, 40+(20*(t+1)));
-		}
-		
-
-		
-		
-	}
-
-	private int getY(double y) {
-		return (getHeight()-40) - (int)(((getHeight()-80)/(maxY-minY))*y);
-	}
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Graphs;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+
+import javax.swing.JPanel;
+
+public class LineGraph extends JPanel {
+
+	private String [] xTitles;
+	private String xLabel;
+	private String [] xCategories;
+	private double [][] data;
+	private String graphTitle;
+	private double minY;
+	private double maxY;
+	private double yInterval;
+	
+	private static final Color [] COLOURS = new Color[] {new Color(220,0,0), new Color(0,0,220), new Color(0,220,0), Color.DARK_GRAY, Color.MAGENTA, Color.ORANGE,Color.YELLOW,Color.CYAN,Color.PINK,Color.LIGHT_GRAY};
+	
+	public LineGraph (double [] [] data, double minY, double maxY, String xLabel, String [] xTitles, int [] xCategories, String graphTitle) {
+		this(data,minY,maxY,xLabel,xTitles,new String[0],graphTitle);
+		this.xCategories = new String [xCategories.length];
+		for (int i=0;i<xCategories.length;i++) {
+			this.xCategories[i] = ""+xCategories[i];
+		}
+		
+	}
+	
+	public LineGraph (double [] [] data, double minY, double maxY, String xLabel, String [] xTitles, String [] xCategories, String graphTitle) {
+		this.data = data;
+		this.minY = minY;
+		this.maxY = maxY;
+		this.xTitles = xTitles;
+		this.xLabel = xLabel;
+		this.xCategories = xCategories;
+		this.graphTitle = graphTitle;
+		this.yInterval = findOptimalYInterval(maxY);
+	}
+	
+	private double findOptimalYInterval(double max) {
+		
+		int base = 1;
+		double [] divisions = new double [] {1,2,2.5,5};
+		
+		while (true) {
+			
+			for (int d=0;d<divisions.length;d++) {
+				double tester = base * divisions[d];
+				if (max / tester <= 10) {
+					return tester;
+				}
+			}
+		
+			base *=10;
+			
+		}
+		
+		
+		
+	}
+	
+	public Dimension getPreferredSize () {
+		return new Dimension(800,600);
+	}
+
+	public Dimension getMinimumSize () {
+		return new Dimension(100,200);
+	}
+	
+	public void paint (Graphics g) {
+		super.paint(g);
+		
+		g.setColor(Color.WHITE);
+		g.fillRect(0, 0, getWidth(), getHeight());
+		g.setColor(Color.BLACK);
+		
+		int lastY = 0;
+		
+		double yStart;
+		
+		if (minY % yInterval == 0) {
+			yStart = minY;
+		}
+		else {
+			yStart = yInterval * (((int)minY/yInterval)+1);
+		}
+		
+		int xOffset = 0;
+		
+		for (double i=yStart;i<=maxY;i+=yInterval) {
+			String label = ""+i;
+			label = label.replaceAll(".0$", ""); // Don't leave trailing .0s where we don't need them.
+			int width = g.getFontMetrics().stringWidth(label);
+			if (width > xOffset) {
+				xOffset = width;
+			}
+			
+			g.drawString(label, 2, getY(i)+(g.getFontMetrics().getAscent()/2));			
+		}
+	
+		// Give the x axis a bit of breathing space
+		xOffset += 5;
+		
+		// Draw the graph title
+		int titleWidth = g.getFontMetrics().stringWidth(graphTitle);
+		g.drawString(graphTitle, (xOffset + ((getWidth()-(xOffset+10))/2)) - (titleWidth/2), 30);
+		
+		
+		// Now draw the axes
+		g.drawLine(xOffset, getHeight()-40, getWidth()-10,getHeight()-40);
+		g.drawLine(xOffset, getHeight()-40, xOffset, 40);
+		
+		// Draw the xLabel under the xAxis
+		g.drawString(xLabel, (getWidth()/2) - (g.getFontMetrics().stringWidth(xLabel)/2), getHeight()-5);
+		
+		
+		// Now draw the data points
+		int baseWidth = (getWidth()-(xOffset+10))/data[0].length;
+		if (baseWidth<1) baseWidth=1;
+		
+//		System.out.println("Base Width is "+baseWidth);
+		
+		// First draw faint boxes over alternating bases so you can see which is which
+		
+		// Let's find the longest label, and then work out how often we can draw labels
+		
+		int lastXLabelEnd = 0;
+		
+		for (int i=0;i<data[0].length;i++) {
+			if (i%2 != 0) {
+				g.setColor(new Color(230, 230, 230));
+				g.fillRect(xOffset+(baseWidth*i), 40, baseWidth, getHeight()-80);
+			}
+			g.setColor(Color.BLACK);
+			String baseNumber = ""+xCategories[i];
+			int baseNumberWidth = g.getFontMetrics().stringWidth(baseNumber);
+			int baseNumberPosition =  (baseWidth/2)+xOffset+(baseWidth*i)-(baseNumberWidth/2);
+			
+			if (baseNumberPosition > lastXLabelEnd) {
+				g.drawString(baseNumber,baseNumberPosition, getHeight()-25);
+				lastXLabelEnd = baseNumberPosition+baseNumberWidth+5;
+			}
+		}
+		
+		// Now draw horizontal lines across from the y axis
+
+		g.setColor(new Color(180,180,180));
+		for (double i=yStart;i<=maxY;i+=yInterval) {
+			g.drawLine(xOffset, getY(i), getWidth()-10, getY(i));
+		}
+		g.setColor(Color.BLACK);
+		
+		// Now draw the datasets
+		
+		if (g instanceof Graphics2D) {
+			((Graphics2D)g).setStroke(new BasicStroke(2));
+			((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+		}
+		
+		for (int d=0;d<data.length;d++) {
+			g.setColor(COLOURS[d % COLOURS.length]);
+						
+			lastY = getY(data[d][0]);
+			for (int i=1;i<data[d].length;i++) {
+				int thisY = getY(data[d][i]);
+				g.drawLine((baseWidth/2)+xOffset+(baseWidth*(i-1)), lastY, (baseWidth/2)+xOffset+(baseWidth*i), thisY);
+				lastY = thisY;
+			}
+			
+		}
+		
+		// Now draw the data legend
+
+		if (g instanceof Graphics2D) {
+			((Graphics2D)g).setStroke(new BasicStroke(1));
+			((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
+		}
+
+		
+		// First we need to find the widest label
+		int widestLabel = 0;
+		for (int t=0;t<xTitles.length;t++) {
+			int width = g.getFontMetrics().stringWidth(xTitles[t]);
+			if (width > widestLabel) widestLabel = width;
+		}
+		
+		// Add 3px either side for a bit of space;
+		widestLabel += 6;
+		
+		// First draw a box to put the legend in
+		g.setColor(Color.WHITE);
+		g.fillRect((getWidth()-10)-widestLabel, 40, widestLabel, 3+(20*xTitles.length));
+		g.setColor(Color.LIGHT_GRAY);
+		g.drawRect((getWidth()-10)-widestLabel, 40, widestLabel, 3+(20*xTitles.length));
+
+		// Now draw the actual labels
+		for (int t=0;t<xTitles.length;t++) {
+			g.setColor(COLOURS[t]);
+			g.drawString(xTitles[t], ((getWidth()-10)-widestLabel)+3, 40+(20*(t+1)));
+		}
+		
+
+		
+		
+	}
+
+	private int getY(double y) {
+		return (getHeight()-40) - (int)(((getHeight()-80)/(maxY-minY))*y);
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Graphs/QualityBoxPlot.java b/uk/ac/babraham/FastQC/Graphs/QualityBoxPlot.java
index 4c0be5b..aa33fa9 100644
--- a/uk/ac/babraham/FastQC/Graphs/QualityBoxPlot.java
+++ b/uk/ac/babraham/FastQC/Graphs/QualityBoxPlot.java
@@ -1,210 +1,210 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Graphs;
-
-import java.awt.Color;
-import java.awt.Graphics;
-
-import javax.swing.JPanel;
-
-public class QualityBoxPlot extends JPanel {
-
-	private double [] means;
-	private double [] medians;
-	private double [] lowest;
-	private double [] highest;
-	private double [] lowerQuartile;
-	private double [] upperQuartile;
-	private String [] xLabels;
-	private String graphTitle;
-	private double minY;
-	private double maxY;
-	private double yInterval;
-	
-	private static final Color GOOD = new Color(195,230,195);
-	private static final Color BAD = new Color(230,220,195);
-	private static final Color UGLY = new Color(230,195,195);
-	
-	private static final Color GOOD_DARK = new Color(175,230,175);
-	private static final Color BAD_DARK = new Color(230,215,175);
-	private static final Color UGLY_DARK = new Color(230,175,175);
-		
-	public QualityBoxPlot (double [] means, double [] medians, double [] lowest, double [] highest, double [] lowerQuartile, double [] upperQuartile, double minY, double maxY, double yInterval, String [] xLabels, String graphTitle) {
-
-		this.means = means;
-		this.medians = medians;
-		this.lowest = lowest;
-		this.highest = highest;
-		this.lowerQuartile = lowerQuartile;
-		this.upperQuartile = upperQuartile;
-		this.minY = minY;
-		this.maxY = maxY;
-		this.yInterval = yInterval;
-		this.xLabels = xLabels;
-		this.graphTitle = graphTitle;
-		this.yInterval = yInterval;
-	}
-		
-	public void paint (Graphics g) {
-		super.paint(g);
-		
-		g.setColor(Color.WHITE);
-		g.fillRect(0, 0, getWidth(), getHeight());
-		g.setColor(Color.BLACK);
-		
-		int lastY = 0;
-		
-		double yStart;
-		
-		if (minY % yInterval == 0) {
-			yStart = minY;
-		}
-		else {
-			yStart = yInterval * (((int)minY/yInterval)+1);
-		}
-		
-		int xOffset = 0;
-		
-		for (double i=yStart;i<=maxY;i+=yInterval) {
-			String label = ""+i;
-			label = label.replaceAll(".0$", "");
-			int width = g.getFontMetrics().stringWidth(label);
-			if (width > xOffset) {
-				xOffset = width;
-			}
-			
-			g.drawString(label, 2, getY(i)+(g.getFontMetrics().getAscent()/2));
-		}
-
-		// Give the x axis a bit of breathing space
-		xOffset += 5;
-		
-
-	
-		g.setColor(Color.BLACK);
-		
-		
-		// Draw the graph title
-		int titleWidth = g.getFontMetrics().stringWidth(graphTitle);
-		g.drawString(graphTitle, (xOffset + ((getWidth()-(xOffset+10))/2)) - (titleWidth/2), 30);
-		
-		
-		
-		// Work out the width of the x axis bins
-		int baseWidth = (getWidth()-(xOffset+10))/means.length;
-		if (baseWidth<1) baseWidth = 1;
-				
-		// First draw faint boxes over alternating bases so you can see which is which
-		
-		int lastXLabelEnd = 0;
-		
-		for (int i=0;i<means.length;i++) {		// Now draw some background colours which show good / bad quality
-			if (i%2 != 0) {
-				g.setColor(UGLY);
-			}
-			else {
-				g.setColor(UGLY_DARK);
-			}
-
-			g.fillRect(xOffset+(baseWidth*i), getY(20), baseWidth, getY(yStart)-getY(20));
-
-			if (i%2 != 0) {
-				g.setColor(BAD);
-			}
-			else {
-				g.setColor(BAD_DARK);
-			}
-
-			g.fillRect(xOffset+(baseWidth*i), getY(28), baseWidth, getY(20)-getY(28));
-
-			if (i%2 != 0) {
-				g.setColor(GOOD);
-			}
-			else {
-				g.setColor(GOOD_DARK);
-			}
-
-			g.fillRect(xOffset+(baseWidth*i), getY(maxY), baseWidth, getY(28)-getY(maxY));
-
-			g.setColor(Color.BLACK);
-			int baseNumberWidth = g.getFontMetrics().stringWidth(xLabels[i]);
-			int labelStart = ((baseWidth/2)+xOffset+(baseWidth*i))-(baseNumberWidth/2);
-			
-			if (labelStart > lastXLabelEnd) {
-				g.drawString(xLabels[i], labelStart, getHeight()-25);
-				lastXLabelEnd = labelStart+g.getFontMetrics().stringWidth(xLabels[i])+5;
-			}
-		}
-		
-		// Now draw the axes
-		g.drawLine(xOffset, getHeight()-40, getWidth()-10,getHeight()-40);
-		g.drawLine(xOffset, getHeight()-40, xOffset, 40);
-		g.drawString("Position in read (bp)", (getWidth()/2) - (g.getFontMetrics().stringWidth("Position in read (bp)")/2), getHeight()-5);
-		
-		// Now draw the boxplots
-			
-		for (int i=0;i<medians.length;i++) {
-			
-			int boxBottomY = getY(lowerQuartile[i]);
-			int boxTopY = getY(upperQuartile[i]);
-			int lowerWhiskerY = getY(lowest[i]);
-			int upperWhiskerY = getY(highest[i]);
-			int medianY = getY(medians[i]);
-			
-//			System.out.println("For base "+i+" values are BoxBottom="+lowerQuartile[i]+" boxTop="+upperQuartile[i]+" whiskerBottom="+lowest[i]+" whiskerTop="+highest[i]+" median="+medians[i]);
-//			System.out.println("For base "+i+" Yvalues are BoxBottom="+boxBottomY+" boxTop="+boxTopY+" whiskerBottom="+lowerWhiskerY+" whiskerTop="+upperWhiskerY+" median="+medianY);
-			
-			// Draw the main box
-			g.setColor(new Color(240,240,0));
-			g.fillRect(xOffset+(baseWidth*i)+2, boxTopY, baseWidth-4, boxBottomY-boxTopY);
-			g.setColor(Color.BLACK);
-			g.drawRect(xOffset+(baseWidth*i)+2, boxTopY, baseWidth-4, boxBottomY-boxTopY);
-			
-			// Draw the upper whisker
-			g.drawLine(xOffset+(baseWidth*i)+(baseWidth/2), upperWhiskerY, xOffset+(baseWidth*i)+(baseWidth/2), boxTopY);
-			g.drawLine(xOffset+(baseWidth*i)+2, upperWhiskerY, xOffset+(baseWidth*(i+1))-2, upperWhiskerY);
-			
-			// Draw the lower whisker
-			g.drawLine(xOffset+(baseWidth*i)+(baseWidth/2), lowerWhiskerY, xOffset+(baseWidth*i)+(baseWidth/2), boxBottomY);
-			g.drawLine(xOffset+(baseWidth*i)+2, lowerWhiskerY, xOffset+(baseWidth*(i+1))-2, lowerWhiskerY);
-
-			// Draw the median line
-			g.setColor(new Color(200,0,0));
-			g.drawLine(xOffset+(baseWidth*i)+2, medianY, (xOffset+(baseWidth*(i+1)))-2,medianY);
-
-			
-		}
-
-		// Now overlay the means
-		g.setColor(new Color(0,0,200));
-		lastY = getY(means[0]);
-		for (int i=1;i<means.length;i++) {
-			int thisY = getY(means[i]);
-			g.drawLine((baseWidth/2)+xOffset+(baseWidth*(i-1)), lastY, (baseWidth/2)+xOffset+(baseWidth*i), thisY);
-			lastY = thisY;
-		}
-		
-	}
-
-	public int getY(double y) {
-		return (getHeight()-40) - (int)(((getHeight()-80)/(maxY-minY))*(y-minY));
-	}
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Graphs;
+
+import java.awt.Color;
+import java.awt.Graphics;
+
+import javax.swing.JPanel;
+
+public class QualityBoxPlot extends JPanel {
+
+	private double [] means;
+	private double [] medians;
+	private double [] lowest;
+	private double [] highest;
+	private double [] lowerQuartile;
+	private double [] upperQuartile;
+	private String [] xLabels;
+	private String graphTitle;
+	private double minY;
+	private double maxY;
+	private double yInterval;
+	
+	private static final Color GOOD = new Color(195,230,195);
+	private static final Color BAD = new Color(230,220,195);
+	private static final Color UGLY = new Color(230,195,195);
+	
+	private static final Color GOOD_DARK = new Color(175,230,175);
+	private static final Color BAD_DARK = new Color(230,215,175);
+	private static final Color UGLY_DARK = new Color(230,175,175);
+		
+	public QualityBoxPlot (double [] means, double [] medians, double [] lowest, double [] highest, double [] lowerQuartile, double [] upperQuartile, double minY, double maxY, double yInterval, String [] xLabels, String graphTitle) {
+
+		this.means = means;
+		this.medians = medians;
+		this.lowest = lowest;
+		this.highest = highest;
+		this.lowerQuartile = lowerQuartile;
+		this.upperQuartile = upperQuartile;
+		this.minY = minY;
+		this.maxY = maxY;
+		this.yInterval = yInterval;
+		this.xLabels = xLabels;
+		this.graphTitle = graphTitle;
+		this.yInterval = yInterval;
+	}
+		
+	public void paint (Graphics g) {
+		super.paint(g);
+		
+		g.setColor(Color.WHITE);
+		g.fillRect(0, 0, getWidth(), getHeight());
+		g.setColor(Color.BLACK);
+		
+		int lastY = 0;
+		
+		double yStart;
+		
+		if (minY % yInterval == 0) {
+			yStart = minY;
+		}
+		else {
+			yStart = yInterval * (((int)minY/yInterval)+1);
+		}
+		
+		int xOffset = 0;
+		
+		for (double i=yStart;i<=maxY;i+=yInterval) {
+			String label = ""+i;
+			label = label.replaceAll(".0$", "");
+			int width = g.getFontMetrics().stringWidth(label);
+			if (width > xOffset) {
+				xOffset = width;
+			}
+			
+			g.drawString(label, 2, getY(i)+(g.getFontMetrics().getAscent()/2));
+		}
+
+		// Give the x axis a bit of breathing space
+		xOffset += 5;
+		
+
+	
+		g.setColor(Color.BLACK);
+		
+		
+		// Draw the graph title
+		int titleWidth = g.getFontMetrics().stringWidth(graphTitle);
+		g.drawString(graphTitle, (xOffset + ((getWidth()-(xOffset+10))/2)) - (titleWidth/2), 30);
+		
+		
+		
+		// Work out the width of the x axis bins
+		int baseWidth = (getWidth()-(xOffset+10))/means.length;
+		if (baseWidth<1) baseWidth = 1;
+				
+		// First draw faint boxes over alternating bases so you can see which is which
+		
+		int lastXLabelEnd = 0;
+		
+		for (int i=0;i<means.length;i++) {		// Now draw some background colours which show good / bad quality
+			if (i%2 != 0) {
+				g.setColor(UGLY);
+			}
+			else {
+				g.setColor(UGLY_DARK);
+			}
+
+			g.fillRect(xOffset+(baseWidth*i), getY(20), baseWidth, getY(yStart)-getY(20));
+
+			if (i%2 != 0) {
+				g.setColor(BAD);
+			}
+			else {
+				g.setColor(BAD_DARK);
+			}
+
+			g.fillRect(xOffset+(baseWidth*i), getY(28), baseWidth, getY(20)-getY(28));
+
+			if (i%2 != 0) {
+				g.setColor(GOOD);
+			}
+			else {
+				g.setColor(GOOD_DARK);
+			}
+
+			g.fillRect(xOffset+(baseWidth*i), getY(maxY), baseWidth, getY(28)-getY(maxY));
+
+			g.setColor(Color.BLACK);
+			int baseNumberWidth = g.getFontMetrics().stringWidth(xLabels[i]);
+			int labelStart = ((baseWidth/2)+xOffset+(baseWidth*i))-(baseNumberWidth/2);
+			
+			if (labelStart > lastXLabelEnd) {
+				g.drawString(xLabels[i], labelStart, getHeight()-25);
+				lastXLabelEnd = labelStart+g.getFontMetrics().stringWidth(xLabels[i])+5;
+			}
+		}
+		
+		// Now draw the axes
+		g.drawLine(xOffset, getHeight()-40, getWidth()-10,getHeight()-40);
+		g.drawLine(xOffset, getHeight()-40, xOffset, 40);
+		g.drawString("Position in read (bp)", (getWidth()/2) - (g.getFontMetrics().stringWidth("Position in read (bp)")/2), getHeight()-5);
+		
+		// Now draw the boxplots
+			
+		for (int i=0;i<medians.length;i++) {
+			
+			int boxBottomY = getY(lowerQuartile[i]);
+			int boxTopY = getY(upperQuartile[i]);
+			int lowerWhiskerY = getY(lowest[i]);
+			int upperWhiskerY = getY(highest[i]);
+			int medianY = getY(medians[i]);
+			
+//			System.out.println("For base "+i+" values are BoxBottom="+lowerQuartile[i]+" boxTop="+upperQuartile[i]+" whiskerBottom="+lowest[i]+" whiskerTop="+highest[i]+" median="+medians[i]);
+//			System.out.println("For base "+i+" Yvalues are BoxBottom="+boxBottomY+" boxTop="+boxTopY+" whiskerBottom="+lowerWhiskerY+" whiskerTop="+upperWhiskerY+" median="+medianY);
+			
+			// Draw the main box
+			g.setColor(new Color(240,240,0));
+			g.fillRect(xOffset+(baseWidth*i)+2, boxTopY, baseWidth-4, boxBottomY-boxTopY);
+			g.setColor(Color.BLACK);
+			g.drawRect(xOffset+(baseWidth*i)+2, boxTopY, baseWidth-4, boxBottomY-boxTopY);
+			
+			// Draw the upper whisker
+			g.drawLine(xOffset+(baseWidth*i)+(baseWidth/2), upperWhiskerY, xOffset+(baseWidth*i)+(baseWidth/2), boxTopY);
+			g.drawLine(xOffset+(baseWidth*i)+2, upperWhiskerY, xOffset+(baseWidth*(i+1))-2, upperWhiskerY);
+			
+			// Draw the lower whisker
+			g.drawLine(xOffset+(baseWidth*i)+(baseWidth/2), lowerWhiskerY, xOffset+(baseWidth*i)+(baseWidth/2), boxBottomY);
+			g.drawLine(xOffset+(baseWidth*i)+2, lowerWhiskerY, xOffset+(baseWidth*(i+1))-2, lowerWhiskerY);
+
+			// Draw the median line
+			g.setColor(new Color(200,0,0));
+			g.drawLine(xOffset+(baseWidth*i)+2, medianY, (xOffset+(baseWidth*(i+1)))-2,medianY);
+
+			
+		}
+
+		// Now overlay the means
+		g.setColor(new Color(0,0,200));
+		lastY = getY(means[0]);
+		for (int i=1;i<means.length;i++) {
+			int thisY = getY(means[i]);
+			g.drawLine((baseWidth/2)+xOffset+(baseWidth*(i-1)), lastY, (baseWidth/2)+xOffset+(baseWidth*i), thisY);
+			lastY = thisY;
+		}
+		
+	}
+
+	public int getY(double y) {
+		return (getHeight()-40) - (int)(((getHeight()-80)/(maxY-minY))*(y-minY));
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Graphs/TileGraph.java b/uk/ac/babraham/FastQC/Graphs/TileGraph.java
index 2dead55..f98f97f 100644
--- a/uk/ac/babraham/FastQC/Graphs/TileGraph.java
+++ b/uk/ac/babraham/FastQC/Graphs/TileGraph.java
@@ -1,150 +1,150 @@
-/**
- * Copyright Copyright 2013-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-package uk.ac.babraham.FastQC.Graphs;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-
-import javax.swing.JPanel;
-
-import uk.ac.babraham.FastQC.Modules.ModuleConfig;
-import uk.ac.babraham.FastQC.Utilities.HotColdColourGradient;
-
-public class TileGraph extends JPanel {
-
-	private String [] xLabels;
-	private int [] tiles;
-	private double [][]tileBaseMeans;
-	private HotColdColourGradient gradient = new HotColdColourGradient();
-
-	public TileGraph (String [] xLabels, int [] tiles, double [][] tileBaseMeans) {
-		this.xLabels = xLabels;
-		this.tiles = tiles;
-		this.tileBaseMeans = tileBaseMeans;
-
-	}
-	
-
-	private int getY(double y) {
-		return (getHeight()-40) - (int)(((getHeight()-80)/(double)(tiles.length))*y);
-	}
-
-
-	public void paint (Graphics g) {
-		super.paint(g);
-
-		g.setColor(Color.WHITE);
-		g.fillRect(0, 0, getWidth(), getHeight());
-		g.setColor(Color.BLACK);
-
-		int lastY = 0;
-
-		int xOffset = 0;
-
-		for (int i=0;i<tiles.length;i++) {
-			String label = ""+tiles[i];
-			int width = g.getFontMetrics().stringWidth(label);
-			if (width > xOffset) {
-				xOffset = width;
-			}
-
-			int thisY = getY(i);
-			if (i>0 && thisY+g.getFontMetrics().getAscent() > lastY) continue;
-			
-			g.drawString(label, 2, getY(i));
-			lastY = thisY;
-		}
-
-		// Give the x axis a bit of breathing space
-		xOffset += 5;
-
-		// Draw the graph title
-		String graphTitle = "Quality per tile";
-		int titleWidth = g.getFontMetrics().stringWidth(graphTitle);
-		g.drawString(graphTitle, (xOffset + ((getWidth()-(xOffset+10))/2)) - (titleWidth/2), 30);
-
-
-		// Now draw the axes
-		g.drawLine(xOffset, getHeight()-40, getWidth()-10,getHeight()-40);
-		g.drawLine(xOffset, getHeight()-40, xOffset, 40);
-
-		// Draw the xLabel under the xAxis
-		String xLabel = "Position in read (bp)";
-		g.drawString(xLabel, (getWidth()/2) - (g.getFontMetrics().stringWidth(xLabel)/2), getHeight()-5);
-
-
-		// Now draw the data points
-		int baseWidth = (getWidth()-(xOffset+10))/xLabels.length;
-		if (baseWidth<1) baseWidth=1;
-
-		//		System.out.println("Base Width is "+baseWidth);
-
-		// First draw faint boxes over alternating bases so you can see which is which
-
-		// Let's find the longest label, and then work out how often we can draw labels
-
-		int lastXLabelEnd = 0;
-		g.setColor(Color.BLACK);
-
-		for (int base=0;base<xLabels.length;base++) {
-
-			String baseNumber = ""+xLabels[base];
-			int baseNumberWidth = g.getFontMetrics().stringWidth(baseNumber);
-			int baseNumberPosition =  (baseWidth/2)+xOffset+(baseWidth*base)-(baseNumberWidth/2);
-
-			if (baseNumberPosition > lastXLabelEnd) {
-				g.drawString(baseNumber,baseNumberPosition, getHeight()-25);
-				lastXLabelEnd = baseNumberPosition+baseNumberWidth+5;
-			}
-		}
-
-		// Now draw the datasets
-
-		if (g instanceof Graphics2D) {
-			((Graphics2D)g).setStroke(new BasicStroke(2));
-			((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-		}
-
-		for (int tile=0;tile<tiles.length;tile++) {
-			for (int base=0;base<xLabels.length;base++) {
-
-				g.setColor(getColour(tile,base));
-
-				int x=xOffset+(baseWidth*base);
-				int y=getY(tile+1);
-				g.fillRect(x, y, baseWidth, getY(tile)-getY(tile+1));
-
-			}
-
-		}
-
-
-	}
-	
-	private Color getColour(int tile, int base) {		
-		return gradient.getColor(0-tileBaseMeans[tile][base], 0, ModuleConfig.getParam("tile", "error"));
-	}
-
-
-}
+/**
+ * Copyright Copyright 2013-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+package uk.ac.babraham.FastQC.Graphs;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+
+import javax.swing.JPanel;
+
+import uk.ac.babraham.FastQC.Modules.ModuleConfig;
+import uk.ac.babraham.FastQC.Utilities.HotColdColourGradient;
+
+public class TileGraph extends JPanel {
+
+	private String [] xLabels;
+	private int [] tiles;
+	private double [][]tileBaseMeans;
+	private HotColdColourGradient gradient = new HotColdColourGradient();
+
+	public TileGraph (String [] xLabels, int [] tiles, double [][] tileBaseMeans) {
+		this.xLabels = xLabels;
+		this.tiles = tiles;
+		this.tileBaseMeans = tileBaseMeans;
+
+	}
+	
+
+	private int getY(double y) {
+		return (getHeight()-40) - (int)(((getHeight()-80)/(double)(tiles.length))*y);
+	}
+
+
+	public void paint (Graphics g) {
+		super.paint(g);
+
+		g.setColor(Color.WHITE);
+		g.fillRect(0, 0, getWidth(), getHeight());
+		g.setColor(Color.BLACK);
+
+		int lastY = 0;
+
+		int xOffset = 0;
+
+		for (int i=0;i<tiles.length;i++) {
+			String label = ""+tiles[i];
+			int width = g.getFontMetrics().stringWidth(label);
+			if (width > xOffset) {
+				xOffset = width;
+			}
+
+			int thisY = getY(i);
+			if (i>0 && thisY+g.getFontMetrics().getAscent() > lastY) continue;
+			
+			g.drawString(label, 2, getY(i));
+			lastY = thisY;
+		}
+
+		// Give the x axis a bit of breathing space
+		xOffset += 5;
+
+		// Draw the graph title
+		String graphTitle = "Quality per tile";
+		int titleWidth = g.getFontMetrics().stringWidth(graphTitle);
+		g.drawString(graphTitle, (xOffset + ((getWidth()-(xOffset+10))/2)) - (titleWidth/2), 30);
+
+
+		// Now draw the axes
+		g.drawLine(xOffset, getHeight()-40, getWidth()-10,getHeight()-40);
+		g.drawLine(xOffset, getHeight()-40, xOffset, 40);
+
+		// Draw the xLabel under the xAxis
+		String xLabel = "Position in read (bp)";
+		g.drawString(xLabel, (getWidth()/2) - (g.getFontMetrics().stringWidth(xLabel)/2), getHeight()-5);
+
+
+		// Now draw the data points
+		int baseWidth = (getWidth()-(xOffset+10))/xLabels.length;
+		if (baseWidth<1) baseWidth=1;
+
+		//		System.out.println("Base Width is "+baseWidth);
+
+		// First draw faint boxes over alternating bases so you can see which is which
+
+		// Let's find the longest label, and then work out how often we can draw labels
+
+		int lastXLabelEnd = 0;
+		g.setColor(Color.BLACK);
+
+		for (int base=0;base<xLabels.length;base++) {
+
+			String baseNumber = ""+xLabels[base];
+			int baseNumberWidth = g.getFontMetrics().stringWidth(baseNumber);
+			int baseNumberPosition =  (baseWidth/2)+xOffset+(baseWidth*base)-(baseNumberWidth/2);
+
+			if (baseNumberPosition > lastXLabelEnd) {
+				g.drawString(baseNumber,baseNumberPosition, getHeight()-25);
+				lastXLabelEnd = baseNumberPosition+baseNumberWidth+5;
+			}
+		}
+
+		// Now draw the datasets
+
+		if (g instanceof Graphics2D) {
+			((Graphics2D)g).setStroke(new BasicStroke(2));
+			((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+		}
+
+		for (int tile=0;tile<tiles.length;tile++) {
+			for (int base=0;base<xLabels.length;base++) {
+
+				g.setColor(getColour(tile,base));
+
+				int x=xOffset+(baseWidth*base);
+				int y=getY(tile+1);
+				g.fillRect(x, y, baseWidth, getY(tile)-getY(tile+1));
+
+			}
+
+		}
+
+
+	}
+	
+	private Color getColour(int tile, int base) {		
+		return gradient.getColor(0-tileBaseMeans[tile][base], 0, ModuleConfig.getParam("tile", "error"));
+	}
+
+
+}
diff --git a/uk/ac/babraham/FastQC/Help/HelpSearchPanel.java b/uk/ac/babraham/FastQC/Help/HelpSearchPanel.java
index 646e554..fbdaac6 100644
--- a/uk/ac/babraham/FastQC/Help/HelpSearchPanel.java
+++ b/uk/ac/babraham/FastQC/Help/HelpSearchPanel.java
@@ -1,160 +1,160 @@
-/**
- * Copyright 2009-15 Simon Andrews
- *
- *    This file is part of SeqMonk.
- *
- *    SeqMonk is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    SeqMonk is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with SeqMonk; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Help;
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.IOException;
-
-import javax.swing.BorderFactory;
-import javax.swing.DefaultListModel;
-import javax.swing.JButton;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-/**
- * The Class HelpSearchPanel.
- */
-public class HelpSearchPanel extends JPanel implements ActionListener, ListSelectionListener, Runnable {
-
-	/** The root. */
-	private HelpIndexRoot root;
-	
-	/** The query field. */
-	private JTextField queryField;
-	
-	/** The result list. */
-	private JList resultList;
-	
-	/** The list model. */
-	private DefaultListModel listModel;
-	
-	/** The search button. */
-	private JButton searchButton;
-	
-	/** The dialog. */
-	private HelpDialog dialog;
-	
-	/** The results scroll pane. */
-	private JScrollPane resultsScrollPane;
-	
-	/**
-	 * Instantiates a new help search panel.
-	 * 
-	 * @param root the root
-	 * @param dialog the dialog
-	 */
-	public HelpSearchPanel (HelpIndexRoot root,HelpDialog dialog) {
-		this.root = root;
-		this.dialog = dialog;
-		
-		setLayout(new BorderLayout());
-		
-		JPanel queryPanel = new JPanel();
-		queryPanel.setLayout(new BorderLayout());
-		queryPanel.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
-		queryField = new JTextField();
-		queryField.setActionCommand("search");
-		queryField.addActionListener(this);
-		queryPanel.add(queryField,BorderLayout.CENTER);
-		searchButton = new JButton("Search");
-		searchButton.setActionCommand("search");
-		searchButton.addActionListener(this);
-		queryPanel.add(searchButton,BorderLayout.EAST);
-		add(queryPanel,BorderLayout.NORTH);
-		
-		listModel = new DefaultListModel();
-		listModel.addElement("[No search results]");
-		resultList = new JList(listModel);
-		resultList.addListSelectionListener(this);
-		resultList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-		resultsScrollPane = new JScrollPane(resultList);
-		add(resultsScrollPane,BorderLayout.CENTER);
-		
-	}
-
-	/* (non-Javadoc)
-	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
-	 */
-	public void actionPerformed(ActionEvent e) {
-		Thread t = new Thread(this);
-		t.start();
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
-	 */
-	public void valueChanged(ListSelectionEvent lse) {
-		Object o = resultList.getSelectedValue();
-		if (o != null && o instanceof HelpPage) {
-			dialog.DisplayPage((HelpPage)o);
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see java.lang.Runnable#run()
-	 */
-	public void run() {
-		searchButton.setEnabled(false);
-		listModel.removeAllElements();
-		if (queryField.getText().trim().length() > 0) {
-			HelpPage[] results;
-			try {
-				results = root.findPagesForTerm(queryField.getText().trim());
-			} 
-			catch (IOException e) {
-				e.printStackTrace();
-				searchButton.setEnabled(true);
-				return;
-			}
-			if (results.length > 0) {
-				for (int r=0;r<results.length;r++) {
-					listModel.addElement(results[r]);
-				}
-			}
-			else {
-				listModel.addElement("[No search results]");
-			}
-		}
-
-		// This stupid rigmarole is because on OSX the updated list
-		// just won't show up for some reason.  Removing the list and
-		// re-adding it forces it to always show up.
-		//
-		// It's not even enough to remake the scroll pane.  You have
-		// to replace the entire JList.  Aaargh!
-		remove(resultsScrollPane);
-		revalidate();
-		resultList = new JList(listModel);
-		resultList.addListSelectionListener(this);
-		resultsScrollPane = new JScrollPane(resultList);
-		add(resultsScrollPane,BorderLayout.CENTER);
-		revalidate();
-		repaint();
-		
-		searchButton.setEnabled(true);
-	}
-}
+/**
+ * Copyright 2009-15 Simon Andrews
+ *
+ *    This file is part of SeqMonk.
+ *
+ *    SeqMonk is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    SeqMonk is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with SeqMonk; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Help;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.IOException;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultListModel;
+import javax.swing.JButton;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextField;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+/**
+ * The Class HelpSearchPanel.
+ */
+public class HelpSearchPanel extends JPanel implements ActionListener, ListSelectionListener, Runnable {
+
+	/** The root. */
+	private HelpIndexRoot root;
+	
+	/** The query field. */
+	private JTextField queryField;
+	
+	/** The result list. */
+	private JList resultList;
+	
+	/** The list model. */
+	private DefaultListModel listModel;
+	
+	/** The search button. */
+	private JButton searchButton;
+	
+	/** The dialog. */
+	private HelpDialog dialog;
+	
+	/** The results scroll pane. */
+	private JScrollPane resultsScrollPane;
+	
+	/**
+	 * Instantiates a new help search panel.
+	 * 
+	 * @param root the root
+	 * @param dialog the dialog
+	 */
+	public HelpSearchPanel (HelpIndexRoot root,HelpDialog dialog) {
+		this.root = root;
+		this.dialog = dialog;
+		
+		setLayout(new BorderLayout());
+		
+		JPanel queryPanel = new JPanel();
+		queryPanel.setLayout(new BorderLayout());
+		queryPanel.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
+		queryField = new JTextField();
+		queryField.setActionCommand("search");
+		queryField.addActionListener(this);
+		queryPanel.add(queryField,BorderLayout.CENTER);
+		searchButton = new JButton("Search");
+		searchButton.setActionCommand("search");
+		searchButton.addActionListener(this);
+		queryPanel.add(searchButton,BorderLayout.EAST);
+		add(queryPanel,BorderLayout.NORTH);
+		
+		listModel = new DefaultListModel();
+		listModel.addElement("[No search results]");
+		resultList = new JList(listModel);
+		resultList.addListSelectionListener(this);
+		resultList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+		resultsScrollPane = new JScrollPane(resultList);
+		add(resultsScrollPane,BorderLayout.CENTER);
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+	 */
+	public void actionPerformed(ActionEvent e) {
+		Thread t = new Thread(this);
+		t.start();
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
+	 */
+	public void valueChanged(ListSelectionEvent lse) {
+		Object o = resultList.getSelectedValue();
+		if (o != null && o instanceof HelpPage) {
+			dialog.DisplayPage((HelpPage)o);
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Runnable#run()
+	 */
+	public void run() {
+		searchButton.setEnabled(false);
+		listModel.removeAllElements();
+		if (queryField.getText().trim().length() > 0) {
+			HelpPage[] results;
+			try {
+				results = root.findPagesForTerm(queryField.getText().trim());
+			} 
+			catch (IOException e) {
+				e.printStackTrace();
+				searchButton.setEnabled(true);
+				return;
+			}
+			if (results.length > 0) {
+				for (int r=0;r<results.length;r++) {
+					listModel.addElement(results[r]);
+				}
+			}
+			else {
+				listModel.addElement("[No search results]");
+			}
+		}
+
+		// This stupid rigmarole is because on OSX the updated list
+		// just won't show up for some reason.  Removing the list and
+		// re-adding it forces it to always show up.
+		//
+		// It's not even enough to remake the scroll pane.  You have
+		// to replace the entire JList.  Aaargh!
+		remove(resultsScrollPane);
+		revalidate();
+		resultList = new JList(listModel);
+		resultList.addListSelectionListener(this);
+		resultsScrollPane = new JScrollPane(resultList);
+		add(resultsScrollPane,BorderLayout.CENTER);
+		revalidate();
+		repaint();
+		
+		searchButton.setEnabled(true);
+	}
+}
diff --git a/uk/ac/babraham/FastQC/Modules/AdapterContent.java b/uk/ac/babraham/FastQC/Modules/AdapterContent.java
index f551c6d..cd6eb04 100644
--- a/uk/ac/babraham/FastQC/Modules/AdapterContent.java
+++ b/uk/ac/babraham/FastQC/Modules/AdapterContent.java
@@ -1,386 +1,386 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-import java.awt.BorderLayout;
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Vector;
-
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.table.AbstractTableModel;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-
-import uk.ac.babraham.FastQC.FastQCConfig;
-import uk.ac.babraham.FastQC.Graphs.BaseGroup;
-import uk.ac.babraham.FastQC.Graphs.LineGraph;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-import uk.ac.babraham.FastQC.Sequence.Contaminant.ContaminentFinder;
-
-public class AdapterContent extends AbstractQCModule {
-
-	private int longestSequence = 0;
-	private int longestAdapter = 0;
-
-	private long totalCount = 0;
-
-	public boolean calculated = false;
-
-	// This is the full set of Kmers to be reported
-	private Adapter [] adapters;
-
-	// This is the data for the Kmers which are going to be placed on the graph
-	private double [][] enrichments = null;
-	private String [] labels;
-
-	private String [] xLabels = new String[0];
-
-	BaseGroup [] groups;
-	public AdapterContent () {
-
-		Vector<Adapter>c = new Vector<Adapter>();
-		Vector<String>l = new Vector<String>();
-
-		try {
-
-			BufferedReader br = null;
-			if (FastQCConfig.getInstance().adapter_file == null) {
-				InputStream rsrc=ContaminentFinder.class.getResourceAsStream("/Configuration/adapter_list.txt");
-				if (rsrc==null) throw new FileNotFoundException("cannot find Configuration/adapter_list.txt");
-				br =new BufferedReader(new InputStreamReader(rsrc));
-			}
-			else {
-				br=new BufferedReader(new FileReader(FastQCConfig.getInstance().adapter_file));
-			}
-
-
-			String line;
-			while ((line = br.readLine())!= null){
-
-				if (line.startsWith("#")) continue; // Skip comments
-				if (line.trim().length() == 0) continue; // Skip blank lines
-
-				String [] sections = line.split("\\t+");
-				if (sections.length != 2) {
-					System.err.println("Expected 2 sections for contaminant line but got "+sections.length+" from "+line);
-					continue;
-				}
-				Adapter adapter = new Adapter(sections[0], sections[1]);
-				c.add(adapter);	
-				l.add(adapter.name());
-				if (adapter.sequence().length() > longestAdapter) longestAdapter = adapter.sequence().length();
-			}
-			labels = l.toArray(new String[0]);
-
-			br.close();
-		}
-		catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		adapters = c.toArray(new Adapter[0]);
-
-	}
-
-	public boolean ignoreFilteredSequences() {
-		return true;
-	}
-
-	public boolean ignoreInReport () {
-		if (ModuleConfig.getParam("adapter", "ignore") > 0) {
-			return true;
-		}
-		return false;
-	}
-
-	public JPanel getResultsPanel() {
-
-		if (longestAdapter > longestSequence) {
-			// We can't display sensible results
-			JPanel failPanel = new JPanel();
-			failPanel.setLayout(new BorderLayout());
-			failPanel.add(new JLabel("Can't analyse adapters as read length is too short",JLabel.CENTER),BorderLayout.CENTER);
-			return failPanel;
-		}
-
-		if (!calculated) calculateEnrichment();
-
-		//		System.err.println("Xlabels="+xLabels.length+" labels="+labels.length+" enrichments="+enrichments.length+" enrichments[0]="+enrichments[0].length+" groups="+groups.length);	
-
-		return (new LineGraph(enrichments, 0, 100, "Position in read (bp)", labels, xLabels, "% Adapter"));
-
-	}
-
-
-
-	public void processSequence(Sequence sequence) {
-		calculated = false;
-		++totalCount;
-
-		if (sequence.getSequence().length()-longestAdapter > longestSequence) {
-			longestSequence = sequence.getSequence().length()-longestAdapter;
-			for (int a=0;a<adapters.length;a++) {
-				adapters[a].expandLengthTo(longestSequence);
-			}
-		}
-
-		// Now we go through all of the Adapters to see where they occur
-
-		for (int a=0;a<adapters.length;a++) {
-
-			int index = sequence.getSequence().indexOf(adapters[a].sequence());
-			if (index >=0) {
-				for (int i=index;i<longestSequence;i++) {
-					adapters[a].incrementCount(i);
-				}
-			}
-		}
-
-
-	}
-
-	public synchronized void calculateEnrichment () {
-		int maxLength = 0;
-		for (int a=0;a<adapters.length;a++) {
-			if (adapters[a].getPositions().length > maxLength) {
-				maxLength = adapters[a].getPositions().length;
-			}
-		}
-
-		// We'll be grouping together positions later so make up the groups now
-		groups = BaseGroup.makeBaseGroups(maxLength);
-
-		//		System.err.println("Made "+groups.length+" groups from "+maxLength);
-
-		xLabels = new String[groups.length];
-		for (int i=0;i<xLabels.length;i++) {
-			xLabels[i] = groups[i].toString();
-		}
-
-		enrichments = new double [adapters.length][groups.length];
-
-
-		for (int a=0;a<adapters.length;a++) {
-			long [] positions = adapters[a].positions;
-
-			for (int g=0;g<groups.length;g++) {
-
-//				System.err.println("Looking at group "+groups[g]);
-
-				for (int p=groups[g].lowerCount()-1;p<groups[g].upperCount() && p<positions.length;p++) {
-//					System.err.println("Count at position "+p+" is "+ positions[p]);
-					enrichments[a][g] += (positions[p]*100d)/totalCount;
-//					System.err.println("Percentage at position "+p+" is "+ ((positions[p]*100d)/totalCount)+" total count is "+totalCount);
-				}
-
-				enrichments[a][g] /= (groups[g].upperCount()-groups[g].lowerCount())+1;
-//				System.err.println("Averge Percetage for group "+groups[g]+" is "+ enrichments[a][g]);
-			}
-		}
-
-		calculated = true;
-
-	}
-
-	public void reset () {
-		calculated = false;
-		totalCount = 0;
-		longestSequence = 0;
-		for (int a=0;a<adapters.length;a++) {
-			adapters[a].reset();
-		}
-	}
-
-	public String description() {
-		return "Searches for specific adapter sequences in a library";
-	}
-
-	public String name() {
-		return "Adapter Content";
-	}
-
-	public boolean raisesError() {
-		if (!calculated) calculateEnrichment();
-
-		for (int i=0;i<enrichments.length;i++) {
-			for (int j=0;j<enrichments[i].length;j++) {
-				if (enrichments[i][j] > ModuleConfig.getParam("adapter", "error")) return true;
-			}
-		}
-		return false;
-	}
-
-	public boolean raisesWarning() {
-
-		// We warn if we just couldn't run the analysis
-		if (longestAdapter > longestSequence) return true;
-
-		if (!calculated) calculateEnrichment();
-
-		for (int i=0;i<enrichments.length;i++) {
-			for (int j=0;j<enrichments[i].length;j++) {
-				if (enrichments[i][j] > ModuleConfig.getParam("adapter", "warn")) return true;
-			}
-		}
-		return false;
-	}
-
-	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
-
-		if (longestAdapter > longestSequence) {
-			XMLStreamWriter xhtml = report.xhtmlStream();
-
-			xhtml.writeStartElement("p");
-			xhtml.writeCharacters("Can't analyse adapters as read length is too short");
-			xhtml.writeEndElement();
-		}
-
-		else {
-
-			if (!calculated) calculateEnrichment();
-
-			writeDefaultImage(report, "adapter_content.png", "Adapter graph", Math.max(800, groups.length*15), 600);
-
-			StringBuffer sb = report.dataDocument();
-
-			ResultsTable table = new ResultsTable();
-			// Header
-			sb.append("#");
-			for (int i=0;i<table.getColumnCount();i++) {
-				if (i>0) {
-					sb.append("\t");
-				}
-				sb.append(table.getColumnName(i));
-			}
-			sb.append("\n");
-			
-			for (int r=0;r<table.getRowCount();r++) {
-				for (int c=0;c<table.getColumnCount();c++) {
-					if (c>0) {
-						sb.append("\t");
-					}
-					sb.append(table.getValueAt(r, c));
-				}
-				sb.append("\n");
-			}
-			
-		}
-	}
-
-	private class Adapter {
-
-		private String name;
-		private String sequence;
-		private long [] positions = new long[0];
-
-		public Adapter (String name, String sequence) {
-
-			this.name = name;
-			this.sequence = sequence;
-			positions = new long[1];
-		}
-
-		public void incrementCount (int position) {
-
-			if (position >= positions.length) {
-				expandLengthTo(position+1);
-			}
-
-			++positions[position];			
-
-		}
-		
-		public void expandLengthTo (int newLength) {
-			long [] newPositions = new long[newLength];
-			for (int i=0;i<positions.length;i++) {
-				newPositions[i] = positions[i];
-				//					System.err.println("Copied value "+positions[i]+" at position "+i);
-			}
-			// Copy the current longest value to the newly added slots
-			if (positions.length > 0) {
-				for (int i=positions.length;i<newPositions.length;i++) {
-					newPositions[i] = positions[positions.length-1];
-				}
-			}
-			
-			positions = newPositions;
-			
-		}
-
-		public long [] getPositions () {
-			return positions;
-		}
-
-		public String sequence () {
-			return sequence;
-		}
-
-		public void reset () {
-			positions = new long[0];
-		}
-
-		public String name () {
-			return name;
-		}
-	}
-
-
-	private class ResultsTable extends AbstractTableModel {
-		private static final long serialVersionUID = 1L;
-
-		public ResultsTable () {}
-
-		// Sequence - Count - Obs/Exp
-		public int getColumnCount() {
-			return adapters.length+1;
-		}
-
-		public int getRowCount() {
-			return enrichments[0].length;
-		}
-
-		public Object getValueAt(int rowIndex, int columnIndex) {
-			if (columnIndex == 0) return xLabels[rowIndex];
-			return enrichments[columnIndex-1][rowIndex];
-		}
-
-		public String getColumnName (int columnIndex) {
-			if (columnIndex == 0) return "Position";
-			return (labels[columnIndex-1]);
-		}
-
-		public Class<?> getColumnClass (int columnIndex) {
-			switch (columnIndex) {
-			case 0: return String.class;
-			}
-			return Double.class;
-
-		}
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+import java.awt.BorderLayout;
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Vector;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.table.AbstractTableModel;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+
+import uk.ac.babraham.FastQC.FastQCConfig;
+import uk.ac.babraham.FastQC.Graphs.BaseGroup;
+import uk.ac.babraham.FastQC.Graphs.LineGraph;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+import uk.ac.babraham.FastQC.Sequence.Contaminant.ContaminentFinder;
+
+public class AdapterContent extends AbstractQCModule {
+
+	private int longestSequence = 0;
+	private int longestAdapter = 0;
+
+	private long totalCount = 0;
+
+	public boolean calculated = false;
+
+	// This is the full set of Kmers to be reported
+	private Adapter [] adapters;
+
+	// This is the data for the Kmers which are going to be placed on the graph
+	private double [][] enrichments = null;
+	private String [] labels;
+
+	private String [] xLabels = new String[0];
+
+	BaseGroup [] groups;
+	public AdapterContent () {
+
+		Vector<Adapter>c = new Vector<Adapter>();
+		Vector<String>l = new Vector<String>();
+
+		try {
+
+			BufferedReader br = null;
+			if (FastQCConfig.getInstance().adapter_file == null) {
+				InputStream rsrc=ContaminentFinder.class.getResourceAsStream("/Configuration/adapter_list.txt");
+				if (rsrc==null) throw new FileNotFoundException("cannot find Configuration/adapter_list.txt");
+				br =new BufferedReader(new InputStreamReader(rsrc));
+			}
+			else {
+				br=new BufferedReader(new FileReader(FastQCConfig.getInstance().adapter_file));
+			}
+
+
+			String line;
+			while ((line = br.readLine())!= null){
+
+				if (line.startsWith("#")) continue; // Skip comments
+				if (line.trim().length() == 0) continue; // Skip blank lines
+
+				String [] sections = line.split("\\t+");
+				if (sections.length != 2) {
+					System.err.println("Expected 2 sections for contaminant line but got "+sections.length+" from "+line);
+					continue;
+				}
+				Adapter adapter = new Adapter(sections[0], sections[1]);
+				c.add(adapter);	
+				l.add(adapter.name());
+				if (adapter.sequence().length() > longestAdapter) longestAdapter = adapter.sequence().length();
+			}
+			labels = l.toArray(new String[0]);
+
+			br.close();
+		}
+		catch (IOException e) {
+			e.printStackTrace();
+		}
+
+		adapters = c.toArray(new Adapter[0]);
+
+	}
+
+	public boolean ignoreFilteredSequences() {
+		return true;
+	}
+
+	public boolean ignoreInReport () {
+		if (ModuleConfig.getParam("adapter", "ignore") > 0) {
+			return true;
+		}
+		return false;
+	}
+
+	public JPanel getResultsPanel() {
+
+		if (longestAdapter > longestSequence) {
+			// We can't display sensible results
+			JPanel failPanel = new JPanel();
+			failPanel.setLayout(new BorderLayout());
+			failPanel.add(new JLabel("Can't analyse adapters as read length is too short",JLabel.CENTER),BorderLayout.CENTER);
+			return failPanel;
+		}
+
+		if (!calculated) calculateEnrichment();
+
+		//		System.err.println("Xlabels="+xLabels.length+" labels="+labels.length+" enrichments="+enrichments.length+" enrichments[0]="+enrichments[0].length+" groups="+groups.length);	
+
+		return (new LineGraph(enrichments, 0, 100, "Position in read (bp)", labels, xLabels, "% Adapter"));
+
+	}
+
+
+
+	public void processSequence(Sequence sequence) {
+		calculated = false;
+		++totalCount;
+
+		if (sequence.getSequence().length()-longestAdapter > longestSequence) {
+			longestSequence = sequence.getSequence().length()-longestAdapter;
+			for (int a=0;a<adapters.length;a++) {
+				adapters[a].expandLengthTo(longestSequence);
+			}
+		}
+
+		// Now we go through all of the Adapters to see where they occur
+
+		for (int a=0;a<adapters.length;a++) {
+
+			int index = sequence.getSequence().indexOf(adapters[a].sequence());
+			if (index >=0) {
+				for (int i=index;i<longestSequence;i++) {
+					adapters[a].incrementCount(i);
+				}
+			}
+		}
+
+
+	}
+
+	public synchronized void calculateEnrichment () {
+		int maxLength = 0;
+		for (int a=0;a<adapters.length;a++) {
+			if (adapters[a].getPositions().length > maxLength) {
+				maxLength = adapters[a].getPositions().length;
+			}
+		}
+
+		// We'll be grouping together positions later so make up the groups now
+		groups = BaseGroup.makeBaseGroups(maxLength);
+
+		//		System.err.println("Made "+groups.length+" groups from "+maxLength);
+
+		xLabels = new String[groups.length];
+		for (int i=0;i<xLabels.length;i++) {
+			xLabels[i] = groups[i].toString();
+		}
+
+		enrichments = new double [adapters.length][groups.length];
+
+
+		for (int a=0;a<adapters.length;a++) {
+			long [] positions = adapters[a].positions;
+
+			for (int g=0;g<groups.length;g++) {
+
+//				System.err.println("Looking at group "+groups[g]);
+
+				for (int p=groups[g].lowerCount()-1;p<groups[g].upperCount() && p<positions.length;p++) {
+//					System.err.println("Count at position "+p+" is "+ positions[p]);
+					enrichments[a][g] += (positions[p]*100d)/totalCount;
+//					System.err.println("Percentage at position "+p+" is "+ ((positions[p]*100d)/totalCount)+" total count is "+totalCount);
+				}
+
+				enrichments[a][g] /= (groups[g].upperCount()-groups[g].lowerCount())+1;
+//				System.err.println("Averge Percetage for group "+groups[g]+" is "+ enrichments[a][g]);
+			}
+		}
+
+		calculated = true;
+
+	}
+
+	public void reset () {
+		calculated = false;
+		totalCount = 0;
+		longestSequence = 0;
+		for (int a=0;a<adapters.length;a++) {
+			adapters[a].reset();
+		}
+	}
+
+	public String description() {
+		return "Searches for specific adapter sequences in a library";
+	}
+
+	public String name() {
+		return "Adapter Content";
+	}
+
+	public boolean raisesError() {
+		if (!calculated) calculateEnrichment();
+
+		for (int i=0;i<enrichments.length;i++) {
+			for (int j=0;j<enrichments[i].length;j++) {
+				if (enrichments[i][j] > ModuleConfig.getParam("adapter", "error")) return true;
+			}
+		}
+		return false;
+	}
+
+	public boolean raisesWarning() {
+
+		// We warn if we just couldn't run the analysis
+		if (longestAdapter > longestSequence) return true;
+
+		if (!calculated) calculateEnrichment();
+
+		for (int i=0;i<enrichments.length;i++) {
+			for (int j=0;j<enrichments[i].length;j++) {
+				if (enrichments[i][j] > ModuleConfig.getParam("adapter", "warn")) return true;
+			}
+		}
+		return false;
+	}
+
+	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
+
+		if (longestAdapter > longestSequence) {
+			XMLStreamWriter xhtml = report.xhtmlStream();
+
+			xhtml.writeStartElement("p");
+			xhtml.writeCharacters("Can't analyse adapters as read length is too short");
+			xhtml.writeEndElement();
+		}
+
+		else {
+
+			if (!calculated) calculateEnrichment();
+
+			writeDefaultImage(report, "adapter_content.png", "Adapter graph", Math.max(800, groups.length*15), 600);
+
+			StringBuffer sb = report.dataDocument();
+
+			ResultsTable table = new ResultsTable();
+			// Header
+			sb.append("#");
+			for (int i=0;i<table.getColumnCount();i++) {
+				if (i>0) {
+					sb.append("\t");
+				}
+				sb.append(table.getColumnName(i));
+			}
+			sb.append("\n");
+			
+			for (int r=0;r<table.getRowCount();r++) {
+				for (int c=0;c<table.getColumnCount();c++) {
+					if (c>0) {
+						sb.append("\t");
+					}
+					sb.append(table.getValueAt(r, c));
+				}
+				sb.append("\n");
+			}
+			
+		}
+	}
+
+	private class Adapter {
+
+		private String name;
+		private String sequence;
+		private long [] positions = new long[0];
+
+		public Adapter (String name, String sequence) {
+
+			this.name = name;
+			this.sequence = sequence;
+			positions = new long[1];
+		}
+
+		public void incrementCount (int position) {
+
+			if (position >= positions.length) {
+				expandLengthTo(position+1);
+			}
+
+			++positions[position];			
+
+		}
+		
+		public void expandLengthTo (int newLength) {
+			long [] newPositions = new long[newLength];
+			for (int i=0;i<positions.length;i++) {
+				newPositions[i] = positions[i];
+				//					System.err.println("Copied value "+positions[i]+" at position "+i);
+			}
+			// Copy the current longest value to the newly added slots
+			if (positions.length > 0) {
+				for (int i=positions.length;i<newPositions.length;i++) {
+					newPositions[i] = positions[positions.length-1];
+				}
+			}
+			
+			positions = newPositions;
+			
+		}
+
+		public long [] getPositions () {
+			return positions;
+		}
+
+		public String sequence () {
+			return sequence;
+		}
+
+		public void reset () {
+			positions = new long[0];
+		}
+
+		public String name () {
+			return name;
+		}
+	}
+
+
+	private class ResultsTable extends AbstractTableModel {
+		private static final long serialVersionUID = 1L;
+
+		public ResultsTable () {}
+
+		// Sequence - Count - Obs/Exp
+		public int getColumnCount() {
+			return adapters.length+1;
+		}
+
+		public int getRowCount() {
+			return enrichments[0].length;
+		}
+
+		public Object getValueAt(int rowIndex, int columnIndex) {
+			if (columnIndex == 0) return xLabels[rowIndex];
+			return enrichments[columnIndex-1][rowIndex];
+		}
+
+		public String getColumnName (int columnIndex) {
+			if (columnIndex == 0) return "Position";
+			return (labels[columnIndex-1]);
+		}
+
+		public Class<?> getColumnClass (int columnIndex) {
+			switch (columnIndex) {
+			case 0: return String.class;
+			}
+			return Double.class;
+
+		}
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Modules/DuplicationLevel.java b/uk/ac/babraham/FastQC/Modules/DuplicationLevel.java
index 6b35f20..6c17256 100644
--- a/uk/ac/babraham/FastQC/Modules/DuplicationLevel.java
+++ b/uk/ac/babraham/FastQC/Modules/DuplicationLevel.java
@@ -1,264 +1,264 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-import java.io.IOException;
-import java.text.DecimalFormat;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import javax.swing.JPanel;
-import javax.xml.stream.XMLStreamException;
-
-import uk.ac.babraham.FastQC.Graphs.LineGraph;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-
-public class DuplicationLevel extends AbstractQCModule {
-
-	private OverRepresentedSeqs overrepresentedModule;
-	private double [] deduplicatedPercentages = null;
-	private double [] totalPercentages = null;
-	private double maxCount = 100;
-	private double percentDifferentSeqs = 0;
-	private String [] labels;
-	private static final DecimalFormat df = new DecimalFormat("#.##");
-	
-	protected DuplicationLevel (OverRepresentedSeqs overrepresentedModule) {
-		this.overrepresentedModule = overrepresentedModule;
-	}
-	
-	public String description() {
-		return "Plots the number of sequences which are duplicated to different levels";
-	}
-
-	public boolean ignoreFilteredSequences() {
-		if (ModuleConfig.getParam("duplication", "ignore") > 0) {
-			return true;
-		}
-		return false;
-	}
-	
-	public boolean ignoreInReport () {
-		if (ModuleConfig.getParam("duplication", "ignore") > 0) {
-			return true;
-		}
-		return false;
-	}
-	
-	protected synchronized void calculateLevels () {
-		
-		if (deduplicatedPercentages != null) return;
-		
-		deduplicatedPercentages = new double[16];
-		totalPercentages = new double[16];
-		
-		HashMap<Integer, Integer> collatedCounts = new HashMap<Integer, Integer>();
-		
-		Iterator<String> it = overrepresentedModule.sequences.keySet().iterator();
-				
-		while (it.hasNext()) {
-			int thisCount = overrepresentedModule.sequences.get(it.next());
-		
-			if (collatedCounts.containsKey(thisCount)) {
-				collatedCounts.put(thisCount,collatedCounts.get(thisCount)+1);
-			}
-			else {
-				collatedCounts.put(thisCount,1);
-			}
-		}
-		
-		// Now we can correct each of these
-		
-		HashMap<Integer, Double> correctedCounts = new HashMap<Integer, Double>();
-		
-		Iterator<Integer> itr = collatedCounts.keySet().iterator();
-		
-		while (itr.hasNext()) {
-			int dupLevel = itr.next();
-			int count = collatedCounts.get(dupLevel);
-			
-			correctedCounts.put(dupLevel,getCorrectedCount(overrepresentedModule.countAtUniqueLimit, overrepresentedModule.count, dupLevel, count));
-			
-//			System.err.println("For dup level "+dupLevel+" raw count was "+count+" corrected count was "+correctedCounts.get(dupLevel));
-			
-		}
-		
-		// From the corrected counts we can now work out the raw and deduplicated proportions
-		
-		double dedupTotal = 0;
-		double rawTotal = 0;
-
-		Iterator<Integer> itc = correctedCounts.keySet().iterator();
-		
-		while (itc.hasNext()) {
-			int dupLevel = itc.next();
-			double count = correctedCounts.get(dupLevel);
-			
-			dedupTotal += count;
-			rawTotal += count * dupLevel;
-
-			int dupSlot = dupLevel - 1;
-			
-			if (dupSlot > 9999) dupSlot = 15;
-			else if (dupSlot > 4999) dupSlot = 14;
-			else if (dupSlot > 999) dupSlot = 13;
-			else if (dupSlot > 499) dupSlot = 12;
-			else if (dupSlot > 99) dupSlot = 11;
-			else if (dupSlot > 49) dupSlot = 10;
-			else if (dupSlot > 9) dupSlot = 9;
-
-			
-			deduplicatedPercentages[dupSlot] += count;
-			totalPercentages[dupSlot] += count * dupLevel;
-			
-		}
-		
-//		System.err.println("True total = "+overrepresentedModule.count+" inferred total is "+rawTotal+" dedup total is "+dedupTotal);
-		
-		
-		labels = new String [16];
-		for (int i=0;i<deduplicatedPercentages.length;i++) {
-			if (i<9) labels[i] = ""+(i+1);
-			else if (i==9) labels[i]=">10";
-			else if (i==10) labels[i]=">50";
-			else if (i==11) labels[i]=">100";
-			else if (i==12) labels[i]=">500";
-			else if (i==13) labels[i]=">1k";
-			else if (i==14) labels[i]=">5k";
-			else if (i==15) labels[i]=">10k";
-			
-			
-			deduplicatedPercentages[i] /= dedupTotal;
-			totalPercentages[i] /= rawTotal;
-			deduplicatedPercentages[i] *= 100;
-			totalPercentages[i] *= 100;
-		}
-		
-		
-		percentDifferentSeqs = (dedupTotal/rawTotal)*100;
-		
-	}
-	
-	private static double getCorrectedCount (long countAtLimit, long totalCount, int duplicationLevel, int numberOfObservations) {
-		
-//		System.err.println("Count at limit = "+countAtLimit+" total = "+totalCount+" Dup level = "+duplicationLevel+" no obs = "+numberOfObservations);
-		
-		// See if we can bail out early
-		if (countAtLimit == totalCount) return numberOfObservations;
-		
-		// If there aren't enough sequences left to hide another sequence with this count then
-		// we can also skip the calculation
-		if (totalCount - numberOfObservations < countAtLimit) return numberOfObservations;
-		
-		// If not then we need to see what the likelihood is that we had another sequence
-		// with this number of observations which we would have missed.
-
-		// We'll start by working out the probability of NOT seeing a sequence with this duplication level
-		// within the first countAtLimit sequences of numberOfObservations.  This is easier than calculating
-		// the probability of seeing it.
-		
-		double pNotSeeingAtLimit = 1;
-		
-		for (int i=0;i<countAtLimit;i++) {
-			pNotSeeingAtLimit *= ((totalCount-i)-duplicationLevel)/(double)(totalCount-i);
-//			System.err.println("At i="+i+" p is "+pNotSeeingAtLimit);
-		}
-		
-		// Now we can invert this to get the chance of seeing a sequence with this count
-		double pSeeingAtLimit = 1 - pNotSeeingAtLimit;
-		
-		// Now we can assume that the number we observed can be scaled up by this proportion
-		double trueCount = numberOfObservations/pSeeingAtLimit;
-		
-		return trueCount;
-		
-	}
-	
-
-	public JPanel getResultsPanel() {
-		if (deduplicatedPercentages == null) calculateLevels();
-
-		return new LineGraph(new double [][] {deduplicatedPercentages,totalPercentages}, 0d, maxCount, "Sequence Duplication Level",new String [] {"% Deduplicated sequences","% Total sequences"}, labels, "Percent of seqs remaining if deduplicated "+df.format(percentDifferentSeqs)+"%");
-	}
-	
-	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
-		if (deduplicatedPercentages == null) calculateLevels();
-
-		writeDefaultImage(report, "duplication_levels.png", "Duplication level graph", 800, 600);
-				
-		StringBuffer sb = report.dataDocument();
-		
-		sb.append("#Total Deduplicated Percentage\t");
-		sb.append(percentDifferentSeqs);
-		sb.append("\n");
-		
-		sb.append("#Duplication Level\tPercentage of deduplicated\tPercentage of total\n");
-		for (int i=0;i<labels.length;i++) {
-			sb.append(labels[i]);
-			if (i == labels.length-1) {
-				sb.append("+");
-			}
-			sb.append("\t");
-			sb.append(deduplicatedPercentages[i]);
-			sb.append("\t");
-			sb.append(totalPercentages[i]);
-			sb.append("\n");
-		}
-		
-	}
-
-	public String name() {
-		return "Sequence Duplication Levels";
-	}
-
-	public void processSequence(Sequence sequence) {
-		// We don't need to do anything since we use 
-		// the data structure from the overrepresented sequences
-		// module.
-	}
-
-	public boolean raisesError() {
-		if (deduplicatedPercentages == null) calculateLevels();
-		
-		// Anything over 50% duplicate gets us a error
-		if (percentDifferentSeqs < ModuleConfig.getParam("duplication", "error")) {
-			return true;
-		}
-		
-		return false;
-	}
-
-	public boolean raisesWarning() {
-		if (deduplicatedPercentages == null) calculateLevels();
-
-		// Anything over 20% duplicate gets us a warning
-		if (percentDifferentSeqs < ModuleConfig.getParam("duplication", "warn")) {
-			return true;
-		}
-		
-		return false;
-	}
-
-	public void reset() {
-		deduplicatedPercentages = null;
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+import java.io.IOException;
+import java.text.DecimalFormat;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import javax.swing.JPanel;
+import javax.xml.stream.XMLStreamException;
+
+import uk.ac.babraham.FastQC.Graphs.LineGraph;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+
+public class DuplicationLevel extends AbstractQCModule {
+
+	private OverRepresentedSeqs overrepresentedModule;
+	private double [] deduplicatedPercentages = null;
+	private double [] totalPercentages = null;
+	private double maxCount = 100;
+	private double percentDifferentSeqs = 0;
+	private String [] labels;
+	private static final DecimalFormat df = new DecimalFormat("#.##");
+	
+	protected DuplicationLevel (OverRepresentedSeqs overrepresentedModule) {
+		this.overrepresentedModule = overrepresentedModule;
+	}
+	
+	public String description() {
+		return "Plots the number of sequences which are duplicated to different levels";
+	}
+
+	public boolean ignoreFilteredSequences() {
+		if (ModuleConfig.getParam("duplication", "ignore") > 0) {
+			return true;
+		}
+		return false;
+	}
+	
+	public boolean ignoreInReport () {
+		if (ModuleConfig.getParam("duplication", "ignore") > 0) {
+			return true;
+		}
+		return false;
+	}
+	
+	protected synchronized void calculateLevels () {
+		
+		if (deduplicatedPercentages != null) return;
+		
+		deduplicatedPercentages = new double[16];
+		totalPercentages = new double[16];
+		
+		HashMap<Integer, Integer> collatedCounts = new HashMap<Integer, Integer>();
+		
+		Iterator<String> it = overrepresentedModule.sequences.keySet().iterator();
+				
+		while (it.hasNext()) {
+			int thisCount = overrepresentedModule.sequences.get(it.next());
+		
+			if (collatedCounts.containsKey(thisCount)) {
+				collatedCounts.put(thisCount,collatedCounts.get(thisCount)+1);
+			}
+			else {
+				collatedCounts.put(thisCount,1);
+			}
+		}
+		
+		// Now we can correct each of these
+		
+		HashMap<Integer, Double> correctedCounts = new HashMap<Integer, Double>();
+		
+		Iterator<Integer> itr = collatedCounts.keySet().iterator();
+		
+		while (itr.hasNext()) {
+			int dupLevel = itr.next();
+			int count = collatedCounts.get(dupLevel);
+			
+			correctedCounts.put(dupLevel,getCorrectedCount(overrepresentedModule.countAtUniqueLimit, overrepresentedModule.count, dupLevel, count));
+			
+//			System.err.println("For dup level "+dupLevel+" raw count was "+count+" corrected count was "+correctedCounts.get(dupLevel));
+			
+		}
+		
+		// From the corrected counts we can now work out the raw and deduplicated proportions
+		
+		double dedupTotal = 0;
+		double rawTotal = 0;
+
+		Iterator<Integer> itc = correctedCounts.keySet().iterator();
+		
+		while (itc.hasNext()) {
+			int dupLevel = itc.next();
+			double count = correctedCounts.get(dupLevel);
+			
+			dedupTotal += count;
+			rawTotal += count * dupLevel;
+
+			int dupSlot = dupLevel - 1;
+			
+			if (dupSlot > 9999) dupSlot = 15;
+			else if (dupSlot > 4999) dupSlot = 14;
+			else if (dupSlot > 999) dupSlot = 13;
+			else if (dupSlot > 499) dupSlot = 12;
+			else if (dupSlot > 99) dupSlot = 11;
+			else if (dupSlot > 49) dupSlot = 10;
+			else if (dupSlot > 9) dupSlot = 9;
+
+			
+			deduplicatedPercentages[dupSlot] += count;
+			totalPercentages[dupSlot] += count * dupLevel;
+			
+		}
+		
+//		System.err.println("True total = "+overrepresentedModule.count+" inferred total is "+rawTotal+" dedup total is "+dedupTotal);
+		
+		
+		labels = new String [16];
+		for (int i=0;i<deduplicatedPercentages.length;i++) {
+			if (i<9) labels[i] = ""+(i+1);
+			else if (i==9) labels[i]=">10";
+			else if (i==10) labels[i]=">50";
+			else if (i==11) labels[i]=">100";
+			else if (i==12) labels[i]=">500";
+			else if (i==13) labels[i]=">1k";
+			else if (i==14) labels[i]=">5k";
+			else if (i==15) labels[i]=">10k";
+			
+			
+			deduplicatedPercentages[i] /= dedupTotal;
+			totalPercentages[i] /= rawTotal;
+			deduplicatedPercentages[i] *= 100;
+			totalPercentages[i] *= 100;
+		}
+		
+		
+		percentDifferentSeqs = (dedupTotal/rawTotal)*100;
+		
+	}
+	
+	private static double getCorrectedCount (long countAtLimit, long totalCount, int duplicationLevel, int numberOfObservations) {
+		
+//		System.err.println("Count at limit = "+countAtLimit+" total = "+totalCount+" Dup level = "+duplicationLevel+" no obs = "+numberOfObservations);
+		
+		// See if we can bail out early
+		if (countAtLimit == totalCount) return numberOfObservations;
+		
+		// If there aren't enough sequences left to hide another sequence with this count then
+		// we can also skip the calculation
+		if (totalCount - numberOfObservations < countAtLimit) return numberOfObservations;
+		
+		// If not then we need to see what the likelihood is that we had another sequence
+		// with this number of observations which we would have missed.
+
+		// We'll start by working out the probability of NOT seeing a sequence with this duplication level
+		// within the first countAtLimit sequences of numberOfObservations.  This is easier than calculating
+		// the probability of seeing it.
+		
+		double pNotSeeingAtLimit = 1;
+		
+		for (int i=0;i<countAtLimit;i++) {
+			pNotSeeingAtLimit *= ((totalCount-i)-duplicationLevel)/(double)(totalCount-i);
+//			System.err.println("At i="+i+" p is "+pNotSeeingAtLimit);
+		}
+		
+		// Now we can invert this to get the chance of seeing a sequence with this count
+		double pSeeingAtLimit = 1 - pNotSeeingAtLimit;
+		
+		// Now we can assume that the number we observed can be scaled up by this proportion
+		double trueCount = numberOfObservations/pSeeingAtLimit;
+		
+		return trueCount;
+		
+	}
+	
+
+	public JPanel getResultsPanel() {
+		if (deduplicatedPercentages == null) calculateLevels();
+
+		return new LineGraph(new double [][] {deduplicatedPercentages,totalPercentages}, 0d, maxCount, "Sequence Duplication Level",new String [] {"% Deduplicated sequences","% Total sequences"}, labels, "Percent of seqs remaining if deduplicated "+df.format(percentDifferentSeqs)+"%");
+	}
+	
+	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
+		if (deduplicatedPercentages == null) calculateLevels();
+
+		writeDefaultImage(report, "duplication_levels.png", "Duplication level graph", 800, 600);
+				
+		StringBuffer sb = report.dataDocument();
+		
+		sb.append("#Total Deduplicated Percentage\t");
+		sb.append(percentDifferentSeqs);
+		sb.append("\n");
+		
+		sb.append("#Duplication Level\tPercentage of deduplicated\tPercentage of total\n");
+		for (int i=0;i<labels.length;i++) {
+			sb.append(labels[i]);
+			if (i == labels.length-1) {
+				sb.append("+");
+			}
+			sb.append("\t");
+			sb.append(deduplicatedPercentages[i]);
+			sb.append("\t");
+			sb.append(totalPercentages[i]);
+			sb.append("\n");
+		}
+		
+	}
+
+	public String name() {
+		return "Sequence Duplication Levels";
+	}
+
+	public void processSequence(Sequence sequence) {
+		// We don't need to do anything since we use 
+		// the data structure from the overrepresented sequences
+		// module.
+	}
+
+	public boolean raisesError() {
+		if (deduplicatedPercentages == null) calculateLevels();
+		
+		// Anything over 50% duplicate gets us a error
+		if (percentDifferentSeqs < ModuleConfig.getParam("duplication", "error")) {
+			return true;
+		}
+		
+		return false;
+	}
+
+	public boolean raisesWarning() {
+		if (deduplicatedPercentages == null) calculateLevels();
+
+		// Anything over 20% duplicate gets us a warning
+		if (percentDifferentSeqs < ModuleConfig.getParam("duplication", "warn")) {
+			return true;
+		}
+		
+		return false;
+	}
+
+	public void reset() {
+		deduplicatedPercentages = null;
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Modules/GCModel/GCModel.java b/uk/ac/babraham/FastQC/Modules/GCModel/GCModel.java
index a553986..5732b58 100644
--- a/uk/ac/babraham/FastQC/Modules/GCModel/GCModel.java
+++ b/uk/ac/babraham/FastQC/Modules/GCModel/GCModel.java
@@ -1,82 +1,82 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules.GCModel;
-
-public class GCModel {
-	
-	public int readLength;
-	public GCModelValue[][] models;
-	
-	public GCModel (int readLength) {
-		
-		int [] claimingCounts = new int [101];
-		this.readLength = readLength;
-		models = new GCModelValue[readLength+1][];
-		
-		for (int pos=0;pos<=readLength;pos++) {
-			double lowCount = pos-0.5;
-			double highCount = pos+0.5;
-			
-			if (lowCount < 0) lowCount = 0;
-			if (highCount < 0) highCount = 0;
-			if (highCount > readLength) highCount = readLength;
-			if (lowCount > readLength) lowCount = readLength;
-			
-			int lowPercentage = (int)Math.round((lowCount*100) / readLength);
-			int highPercentage = (int)Math.round((highCount*100) / readLength);
-			
-			for (int p=lowPercentage;p<=highPercentage;p++) {
-				claimingCounts[p]++;
-			}
-		}
-				
-		
-		// We now do a second pass to make up the model using the weightings
-		// we calculated previously.
-		
-		for (int pos=0;pos<=readLength;pos++) {
-			double lowCount = pos-0.5;
-			double highCount = pos+0.5;
-			
-			if (lowCount < 0) lowCount = 0;
-			if (highCount < 0) highCount = 0;
-			if (highCount > readLength) highCount = readLength;
-			if (lowCount > readLength) lowCount = readLength;
-			
-			int lowPercentage = (int)Math.round((lowCount*100) / readLength);
-			int highPercentage = (int)Math.round((highCount*100) / readLength);
-			
-			GCModelValue [] modelValues = new GCModelValue [(highPercentage-lowPercentage)+1];
-						
-			for (int p=lowPercentage;p<=highPercentage;p++) {
-				modelValues[p-lowPercentage] = new GCModelValue(p, 1d/claimingCounts[p]);
-			}
-			models[pos] = modelValues;
-		}
-		
-		
-		
-	}
-	
-	public GCModelValue [] getModelValues (int gcCount) {
-		return models[gcCount];
-	}
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules.GCModel;
+
+public class GCModel {
+	
+	public int readLength;
+	public GCModelValue[][] models;
+	
+	public GCModel (int readLength) {
+		
+		int [] claimingCounts = new int [101];
+		this.readLength = readLength;
+		models = new GCModelValue[readLength+1][];
+		
+		for (int pos=0;pos<=readLength;pos++) {
+			double lowCount = pos-0.5;
+			double highCount = pos+0.5;
+			
+			if (lowCount < 0) lowCount = 0;
+			if (highCount < 0) highCount = 0;
+			if (highCount > readLength) highCount = readLength;
+			if (lowCount > readLength) lowCount = readLength;
+			
+			int lowPercentage = (int)Math.round((lowCount*100) / readLength);
+			int highPercentage = (int)Math.round((highCount*100) / readLength);
+			
+			for (int p=lowPercentage;p<=highPercentage;p++) {
+				claimingCounts[p]++;
+			}
+		}
+				
+		
+		// We now do a second pass to make up the model using the weightings
+		// we calculated previously.
+		
+		for (int pos=0;pos<=readLength;pos++) {
+			double lowCount = pos-0.5;
+			double highCount = pos+0.5;
+			
+			if (lowCount < 0) lowCount = 0;
+			if (highCount < 0) highCount = 0;
+			if (highCount > readLength) highCount = readLength;
+			if (lowCount > readLength) lowCount = readLength;
+			
+			int lowPercentage = (int)Math.round((lowCount*100) / readLength);
+			int highPercentage = (int)Math.round((highCount*100) / readLength);
+			
+			GCModelValue [] modelValues = new GCModelValue [(highPercentage-lowPercentage)+1];
+						
+			for (int p=lowPercentage;p<=highPercentage;p++) {
+				modelValues[p-lowPercentage] = new GCModelValue(p, 1d/claimingCounts[p]);
+			}
+			models[pos] = modelValues;
+		}
+		
+		
+		
+	}
+	
+	public GCModelValue [] getModelValues (int gcCount) {
+		return models[gcCount];
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Modules/GCModel/GCModelValue.java b/uk/ac/babraham/FastQC/Modules/GCModel/GCModelValue.java
index 2c760c0..1b54516 100644
--- a/uk/ac/babraham/FastQC/Modules/GCModel/GCModelValue.java
+++ b/uk/ac/babraham/FastQC/Modules/GCModel/GCModelValue.java
@@ -1,40 +1,40 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules.GCModel;
-
-public class GCModelValue {
-
-	private int percentage;
-	private double increment;
-	
-	public GCModelValue (int percentage,double increment) {
-		this.percentage = percentage;
-		this.increment = increment;
-	}
-	
-	public int percentage () {
-		return percentage;
-	}
-	
-	public double increment () {
-		return increment;
-	}
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules.GCModel;
+
+public class GCModelValue {
+
+	private int percentage;
+	private double increment;
+	
+	public GCModelValue (int percentage,double increment) {
+		this.percentage = percentage;
+		this.increment = increment;
+	}
+	
+	public int percentage () {
+		return percentage;
+	}
+	
+	public double increment () {
+		return increment;
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Modules/KmerContent.java b/uk/ac/babraham/FastQC/Modules/KmerContent.java
index 5f2a083..8bed580 100644
--- a/uk/ac/babraham/FastQC/Modules/KmerContent.java
+++ b/uk/ac/babraham/FastQC/Modules/KmerContent.java
@@ -1,580 +1,580 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-import java.awt.BorderLayout;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JSplitPane;
-import javax.swing.JTable;
-import javax.swing.table.AbstractTableModel;
-import javax.swing.table.TableModel;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.commons.math3.distribution.BinomialDistribution;
-
-
-import uk.ac.babraham.FastQC.FastQCConfig;
-import uk.ac.babraham.FastQC.Graphs.BaseGroup;
-import uk.ac.babraham.FastQC.Graphs.LineGraph;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-
-public class KmerContent extends AbstractQCModule {
-
-	private Hashtable<String, Kmer> kmers = new Hashtable<String, Kmer>((int)Math.pow(4, MAX_KMER_SIZE));
-	
-	private int longestSequence = 0;
-	
-	/* 2D array, first dimension is the position in the sequence, second is Kmer length */
-	private long [][] totalKmerCounts = new long [0][0];
-	
-	private long skipCount = 0;
-	
-	private static int MIN_KMER_SIZE = 7;
-	private static int MAX_KMER_SIZE = 7;
-	
-	public boolean calculated = false;
-	
-	// This is the full set of Kmers to be reported
-	private Kmer [] enrichedKmers = null;
-	
-	// This is the data for the Kmers which are going to be placed on the graph
-	private double [][] enrichments = null;
-	
-	// For the graph we also need to know the scale we need to use on the axes.
-	private double minGraphValue = 0;
-	private double maxGraphValue = 0;
-	
-	
-	private String [] xCategories = new String[0];
-	private String [] xLabels = new String[0];
-	
-	BaseGroup [] groups;
-	public KmerContent () {
-		if (FastQCConfig.getInstance().kmer_size != null) {
-			int kmerSize = FastQCConfig.getInstance().kmer_size;
-			MIN_KMER_SIZE = kmerSize;
-			MAX_KMER_SIZE = kmerSize;
-		}
-	}
-	
-	public boolean ignoreFilteredSequences() {
-		return true;
-	}
-	
-	public boolean ignoreInReport () {
-		if (ModuleConfig.getParam("kmer", "ignore") > 0) {
-			return true;
-		}
-		return false;
-	}
-	
-	public JPanel getResultsPanel() {
-		
-		if (!calculated) calculateEnrichment();
-		JPanel returnPanel = new JPanel();
-		returnPanel.setLayout(new BorderLayout());
-		returnPanel.add(new JLabel("Overrepresented Kmers",JLabel.CENTER),BorderLayout.NORTH);
-		
-		JSplitPane splitPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
-		
-		if (enrichedKmers.length > 0) {
-			TableModel model = new ResultsTable(enrichedKmers);
-			splitPanel.setBottomComponent(new JScrollPane(new JTable(model)));
-			splitPanel.setTopComponent(new LineGraph(enrichments, minGraphValue, maxGraphValue, "Position in read (bp)", xLabels, xCategories, "Log2 Obs/Exp"));
-			returnPanel.add(splitPanel,BorderLayout.CENTER);
-		}
-		else {
-			returnPanel.add(new JLabel("There are no overrepresented Kmers",JLabel.CENTER),BorderLayout.CENTER);
-		}
-		
-		return returnPanel;
-	}
-	
-	/**
-	 * This method simply keeps a count of the number of Kmers of a given size
-	 * seen at each position within the run.  We can use this later on to calculate
-	 * the enrichment of the Kmers we actually count.
-	 * 
-	 * We take in the Kmer sequence even though this isn't used in the total counts
-	 * we do this because we don't want to count Kmers with Ns in them, but we do
-	 * need to ensure that the data structure is expanded to the right size, and if
-	 * we have libraries where later positions are Ns in all sequences then our
-	 * data structure ends up too short and we crash. 
-	 * 
-	 * @param position Position within the read.  0 indexed
-	 * @param kmerLength Actual length of the Kmer analysed
-	 */
-	private void addKmerCount (int position,int kmerLength, String kmer) {
-	
-		
-		if (position >= totalKmerCounts.length) {
-			// We need to expand the array
-			long [][] newCounts = new long[position+1][];
-			for (int i=0;i<totalKmerCounts.length;i++) {
-				newCounts[i] = totalKmerCounts[i];
-			}
-			for (int i=totalKmerCounts.length;i<newCounts.length;i++) {
-				newCounts[i] = new long[MAX_KMER_SIZE];
-			}
-			
-			totalKmerCounts = newCounts;
-		}
-		
-		if (kmer.indexOf("N") >=0) return;
-
-		++totalKmerCounts[position][kmerLength-1];
-		
-	}
-
-	private synchronized void calculateEnrichment () {
-		
-		/*
-		 * For each Kmer we work out whether there is a statistically
-		 * significant deviation in its coverage at any given position
-		 * compared to its average coverage over all positions.
-		 */
-		
-		
-		// We'll be grouping together positions later so make up the groups now
-		groups = BaseGroup.makeBaseGroups((longestSequence-MIN_KMER_SIZE)+1);
-
-		Vector<Kmer>unevenKmers = new Vector<Kmer>();
-				
-		Iterator<Kmer> rawKmers = kmers.values().iterator();
-		
-		while (rawKmers.hasNext()) {
-			Kmer k = rawKmers.next();
-			char [] chars = k.sequence().toCharArray();
-
-			
-			long totalKmerCount = 0;
-
-			
-			// This gets us the total number of Kmers of this type in the whole
-			// dataset.
-			for (int i=0;i<totalKmerCounts.length;i++) {
-				totalKmerCount += totalKmerCounts[i][k.sequence().length()-1];
-			}
-
-			// This is the expected proportion of all Kmers which have this
-			// specific Kmer sequence.  We no longer make any attempt to judge
-			// overall enrichment or depletion of this sequence since once you
-			// get to longer lengths the distribution isn't flat anyway
-			
-			float expectedProportion = k.count/(float)totalKmerCount;
-
-			// We now want to go through each of the positions looking for whether
-			// this Kmer was seen an unexpected number of times compared to what we
-			// expected from the global values
-							
-				
-			float [] obsExpPositions = new float[groups.length];
-			float [] binomialPValues = new float[groups.length];
-				
-			long [] positionCounts = k.getPositions();
-				
-			for (int g=0;g<groups.length;g++) {
-				// This is a summation of the number of Kmers of this length which
-				// fall into this base group
-				long totalGroupCount = 0;
-				
-				// This is a summation of the number of hit Kmers which fall within
-				// this base group.
-				long totalGroupHits = 0;
-				for (int p=groups[g].lowerCount()-1;p<groups[g].upperCount() && p < positionCounts.length ;p++) {
-					totalGroupCount += totalKmerCounts[p][chars.length-1];
-					totalGroupHits += positionCounts[p];
-				}
-							
-				float predicted = expectedProportion * totalGroupCount;
-//				obsExpPositions[g] = (float)(Math.log(totalGroupHits/predicted)/Math.log(2));
-				obsExpPositions[g] = (float)(totalGroupHits/predicted);
-				
-				// Now we can run a binomial test to see if there is a significant
-				// deviation from what we expect given the number of observations we've
-				// made
-				
-				BinomialDistribution bd = new BinomialDistribution((int)totalGroupCount, expectedProportion);
-				if (totalGroupHits > predicted) {
-					binomialPValues[g] = (float)((1 - bd.cumulativeProbability((int)totalGroupHits)) * Math.pow(4,chars.length));
-				}
-				else {
-					binomialPValues[g] = 1;
-				}
-				
-			}
-			
-			k.setObsExpPositions(obsExpPositions);
-			
-			
-			// To keep this we need a p-value below 0.01 and an obs/exp above 5 (actual values are log2 transformed)
-			float lowestPValue = 1;
-			for (int i=0;i<binomialPValues.length;i++) {
-//				if (binomialPValues[i] < 0.01 && obsExpPositions[i] > (Math.log(5)/Math.log(2))) {
-				if (binomialPValues[i] < 0.01 && obsExpPositions[i] > 5) {
-					if (binomialPValues[i]<lowestPValue) {
-						lowestPValue = binomialPValues[i];
-					}
-				}
-			}
-			
-			if (lowestPValue < 0.01) {
-				k.setLowestPValue(lowestPValue);
-				unevenKmers.add(k);
-			}
-			
-			
-		}
-		
-		Kmer [] finalKMers = unevenKmers.toArray(new Kmer[0]);
-		
-		// We sort by the highest degree of enrichment over the average		
-		Arrays.sort(finalKMers);
-		
-		// So we don't end up with stupidly long lists of Kmers in the
-		// report we'll only report the top 20
-		if (finalKMers.length > 20) {
-			Kmer [] shortenedKmers = new Kmer [20];
-			for (int i=0;i<shortenedKmers.length;i++) {
-				shortenedKmers[i] = finalKMers[i];
-			}
-			
-			finalKMers = shortenedKmers;
-		}
-		
-		// Now we take the enrichment positions for the top 6 hits and
-		// record these so we can plot them on a line graph
-		enrichments = new double [Math.min(6, finalKMers.length)][];
-		xLabels = new String[enrichments.length];
-		
-		xCategories = new String [groups.length];
-		
-		for (int i=0;i<xCategories.length;i++) {
-			xCategories[i] = groups[i].toString();
-		}
-		
-		for (int k=0;k<enrichments.length;k++) {
-			enrichments[k] = new double[groups.length];
-			
-			float [] obsExpPos = finalKMers[k].getObsExpPositions();
-						
-			for (int g=0;g<groups.length;g++) {				
-				enrichments[k][g] = obsExpPos[g];
-				if (obsExpPos[g] > maxGraphValue) maxGraphValue = obsExpPos[g];
-				if (obsExpPos[g] < minGraphValue) minGraphValue = obsExpPos[g];
-			}
-			
-			xLabels[k] = finalKMers[k].sequence();
-			
-		}
-		
-		minGraphValue = 0;
-		
-//		System.err.println("Max value="+maxGraphValue+" min value="+minGraphValue);
-		
-		this.enrichedKmers = finalKMers;		
-		
-		// Delete the initial data structure so we don't suck up more memory
-		// than we have to.
-		kmers.clear();
-		
-		calculated = true;
-	}
-
-	
-	public void processSequence(Sequence sequence) {
-		calculated = false;
-		
-		/*
-		 * The processing done by this module is quite intensive so to speed things
-		 * up we don't look at every sequence.  Instead we take only 2% of the 
-		 * submitted sequences and extrapolate from these to the full set in the file.
-		 */
-		++skipCount;
-		if (skipCount % 50 != 0) return;
-		
-		/*
-		 * This module uses horrible amounts of memory if allowed to store the full
-		 * Kmer content for all positions in really long reads (pacbio reads were the
-		 * ones which really broke this).  We'll therefore limit our read lengths to
-		 * 500bp since specific Kmer positions beyond that are not likely to be useful
-		 */
-
-		String seq;
-		
-		if (sequence.getSequence().length() > 500) {
-			seq = sequence.getSequence().substring(0, 500);		
-		}
-		else {
-			seq = sequence.getSequence();
-		}
-
-		if (seq.length() > longestSequence) {
-			longestSequence = seq.length();
-		}
-						
-		// Now we go through all of the Kmers to count these
-		for (int kmerSize=MIN_KMER_SIZE;kmerSize<=MAX_KMER_SIZE;kmerSize++) {
-			for (int i=0;i<=seq.length()-kmerSize;i++) {
-				
-				String kmer = seq.substring(i, i+kmerSize);
-				
-				if (kmer.length() != kmerSize) {
-					throw new IllegalStateException("String length "+kmer.length()+" wasn't the same as the kmer length "+kmerSize);
-				}
-				
-				// Add to the counts before skipping Kmers containing Ns (see
-				// explanation in addKmerCount for the reasoning).
-				addKmerCount(i, kmerSize, kmer);
-				
-				// Skip Kmers containing N
-				if (kmer.indexOf("N") >=0) continue;
-
-				if (kmers.containsKey(kmer)) {
-					kmers.get(kmer).incrementCount(i);
-				}
-				else {
-					kmers.put(new String(kmer), new Kmer(kmer,i,(seq.length()-kmerSize)+1));
-				}
-
-			}
-		}
-	}
-	
-	public void reset () {
-		calculated = false;
-		totalKmerCounts = new long[0][0];
-		longestSequence = 0;
-		skipCount = 0;
-		enrichedKmers = null;
-		kmers.clear();
-	}
-
-	public String description() {
-		return "Identifies short sequences which have uneven representation";
-	}
-
-	public String name() {
-		return "Kmer Content";
-	}
-
-	public boolean raisesError() {
-		if (!calculated) calculateEnrichment();
-		
-		// We raise an error if the most enriched kmer is seen more than 100 times
-		// more frequently than we expect.
-		
-		if (enrichedKmers.length > 0 && 0-Math.log10(enrichedKmers[0].pValue()) > ModuleConfig.getParam("kmer", "error")) return true;
-		return false;
-	}
-
-	public boolean raisesWarning() {
-		if (!calculated) calculateEnrichment();
-		
-		// We raise a warning if there are any enriched kmers
-		if (enrichedKmers.length > 0 && 0-Math.log10(enrichedKmers[0].pValue()) > ModuleConfig.getParam("kmer", "warn")) return true;
-		return false;
-	}
-
-	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
-		if (!calculated) calculateEnrichment();
-		
-		if (enrichedKmers.length > 0) {			
-			writeSpecificImage(report, new LineGraph(enrichments, minGraphValue, maxGraphValue, "Position in read (bp)", xLabels, xCategories, "Log2 Obs/Exp"),"kmer_profiles.png", "Kmer graph", Math.max(800, groups.length*15), 600);
-		}
-		
-		
-		ResultsTable table = new ResultsTable(enrichedKmers);
-		
-		XMLStreamWriter xhtml = report.xhtmlStream();
-		
-		if (enrichedKmers.length == 0)
-			{
-			xhtml.writeStartElement("p");
-			xhtml.writeCharacters("No overrepresented Kmers");
-			xhtml.writeEndElement();
-			}
-		
-		else
-			{
-			super.writeTable(report, table);
-			}
-	}
-	
-	private class Kmer implements Comparable<Kmer>{
-		
-		private String sequence;
-		private long count = 0;
-		private float lowestPValue = 0;
-		private float [] obsExpPositions = null;
-		private long [] positions = new long[0];
-		
-		public Kmer (String sequence, int position, int seqLength) {
-
-			// Do this slightly convoluted dance to try to avoid
-			// keeping the whole original sequence in memory
-			char [] chars = sequence.toCharArray();
-			this.sequence = new String(chars);
-			count = 1;
-			positions = new long[seqLength];
-			++positions[position];
-		}
-		
-		public void incrementCount (int position) {
-			++count;
-			
-			if (position >= positions.length) {
-				long [] newPositions = new long[position+1];
-				for (int i=0;i<positions.length;i++) {
-					newPositions[i] = positions[i];
-				}
-				positions = newPositions;
-			}
-			
-			++positions[position];
-			
-		}
-		
-		public long [] getPositions () {
-			return positions;
-		}
-		
-		public String sequence () {
-			return sequence;
-		}
-		
-		public long count () {
-			return count;
-		}
-		
-		public void setLowestPValue (float p) {
-			this.lowestPValue = p;
-		}
-		
-		public void setObsExpPositions (float [] oePositions) {
-			this.obsExpPositions = oePositions;
-		}
-		
-		public float [] getObsExpPositions () {
-			return obsExpPositions;
-		}
-		
-		public float pValue () {
-			return lowestPValue;
-		}
-				
-		public float maxObsExp () {
-			float max = 0;
-			for (int i=0;i<obsExpPositions.length;i++) {
-				if (obsExpPositions[i]>max) max = obsExpPositions[i];
-			}
-			return max;
-		}
-
-		public int maxPosition () {
-			float max = 0;
-			int position = 0;
-			for (int i=0;i<obsExpPositions.length;i++) {
-				if (obsExpPositions[i]>max) {
-					max = obsExpPositions[i];
-					position = i+1;
-				}
-			}
-			
-			if (position == 0) {
-				System.err.println("No value > 0 for "+sequence);
-				position = 1;
-			}
-			
-			return position;
-		}
-
-		public int compareTo(Kmer o) {
-			return Float.compare(o.maxObsExp(), maxObsExp());
-		}
-	}
-	
-	
-	private class ResultsTable extends AbstractTableModel
-		{
-		private static final long serialVersionUID = 1L;
-		private Kmer [] kmers;
-		
-		public ResultsTable (Kmer [] kmers) {
-			this.kmers = kmers;
-		}
-		
-		
-		// Sequence - Count - Obs/Exp
-		public int getColumnCount() {
-			return 5;
-		}
-
-		public int getRowCount() {
-			return kmers.length;
-		}
-
-		public Object getValueAt(int rowIndex, int columnIndex) {
-			switch (columnIndex) {
-				case 0: return kmers[rowIndex].sequence();
-				case 1: return kmers[rowIndex].count()*5;
-				case 2: return kmers[rowIndex].pValue();
-				case 3: return kmers[rowIndex].maxObsExp();
-				case 4: return groups[kmers[rowIndex].maxPosition()-1].toString();
-						
-			}
-			return null;
-		}
-		
-		public String getColumnName (int columnIndex) {
-			switch (columnIndex) {
-				case 0: return "Sequence";
-				case 1: return "Count";
-				case 2: return "PValue";
-				case 3: return "Obs/Exp Max";
-				case 4: return "Max Obs/Exp Position";
-			}
-			return null;
-		}
-		
-		public Class<?> getColumnClass (int columnIndex) {
-			switch (columnIndex) {
-			case 0: return String.class;
-			case 1: return Integer.class;
-			case 2: return Float.class;
-			case 3: return Float.class;
-			case 4: return String.class;
-		}
-		return null;
-			
-		}
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+import java.awt.BorderLayout;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Vector;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTable;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableModel;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.commons.math3.distribution.BinomialDistribution;
+
+
+import uk.ac.babraham.FastQC.FastQCConfig;
+import uk.ac.babraham.FastQC.Graphs.BaseGroup;
+import uk.ac.babraham.FastQC.Graphs.LineGraph;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+
+public class KmerContent extends AbstractQCModule {
+
+	private Hashtable<String, Kmer> kmers = new Hashtable<String, Kmer>((int)Math.pow(4, MAX_KMER_SIZE));
+	
+	private int longestSequence = 0;
+	
+	/* 2D array, first dimension is the position in the sequence, second is Kmer length */
+	private long [][] totalKmerCounts = new long [0][0];
+	
+	private long skipCount = 0;
+	
+	private static int MIN_KMER_SIZE = 7;
+	private static int MAX_KMER_SIZE = 7;
+	
+	public boolean calculated = false;
+	
+	// This is the full set of Kmers to be reported
+	private Kmer [] enrichedKmers = null;
+	
+	// This is the data for the Kmers which are going to be placed on the graph
+	private double [][] enrichments = null;
+	
+	// For the graph we also need to know the scale we need to use on the axes.
+	private double minGraphValue = 0;
+	private double maxGraphValue = 0;
+	
+	
+	private String [] xCategories = new String[0];
+	private String [] xLabels = new String[0];
+	
+	BaseGroup [] groups;
+	public KmerContent () {
+		if (FastQCConfig.getInstance().kmer_size != null) {
+			int kmerSize = FastQCConfig.getInstance().kmer_size;
+			MIN_KMER_SIZE = kmerSize;
+			MAX_KMER_SIZE = kmerSize;
+		}
+	}
+	
+	public boolean ignoreFilteredSequences() {
+		return true;
+	}
+	
+	public boolean ignoreInReport () {
+		if (ModuleConfig.getParam("kmer", "ignore") > 0) {
+			return true;
+		}
+		return false;
+	}
+	
+	public JPanel getResultsPanel() {
+		
+		if (!calculated) calculateEnrichment();
+		JPanel returnPanel = new JPanel();
+		returnPanel.setLayout(new BorderLayout());
+		returnPanel.add(new JLabel("Overrepresented Kmers",JLabel.CENTER),BorderLayout.NORTH);
+		
+		JSplitPane splitPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
+		
+		if (enrichedKmers.length > 0) {
+			TableModel model = new ResultsTable(enrichedKmers);
+			splitPanel.setBottomComponent(new JScrollPane(new JTable(model)));
+			splitPanel.setTopComponent(new LineGraph(enrichments, minGraphValue, maxGraphValue, "Position in read (bp)", xLabels, xCategories, "Log2 Obs/Exp"));
+			returnPanel.add(splitPanel,BorderLayout.CENTER);
+		}
+		else {
+			returnPanel.add(new JLabel("There are no overrepresented Kmers",JLabel.CENTER),BorderLayout.CENTER);
+		}
+		
+		return returnPanel;
+	}
+	
+	/**
+	 * This method simply keeps a count of the number of Kmers of a given size
+	 * seen at each position within the run.  We can use this later on to calculate
+	 * the enrichment of the Kmers we actually count.
+	 * 
+	 * We take in the Kmer sequence even though this isn't used in the total counts
+	 * we do this because we don't want to count Kmers with Ns in them, but we do
+	 * need to ensure that the data structure is expanded to the right size, and if
+	 * we have libraries where later positions are Ns in all sequences then our
+	 * data structure ends up too short and we crash. 
+	 * 
+	 * @param position Position within the read.  0 indexed
+	 * @param kmerLength Actual length of the Kmer analysed
+	 */
+	private void addKmerCount (int position,int kmerLength, String kmer) {
+	
+		
+		if (position >= totalKmerCounts.length) {
+			// We need to expand the array
+			long [][] newCounts = new long[position+1][];
+			for (int i=0;i<totalKmerCounts.length;i++) {
+				newCounts[i] = totalKmerCounts[i];
+			}
+			for (int i=totalKmerCounts.length;i<newCounts.length;i++) {
+				newCounts[i] = new long[MAX_KMER_SIZE];
+			}
+			
+			totalKmerCounts = newCounts;
+		}
+		
+		if (kmer.indexOf("N") >=0) return;
+
+		++totalKmerCounts[position][kmerLength-1];
+		
+	}
+
+	private synchronized void calculateEnrichment () {
+		
+		/*
+		 * For each Kmer we work out whether there is a statistically
+		 * significant deviation in its coverage at any given position
+		 * compared to its average coverage over all positions.
+		 */
+		
+		
+		// We'll be grouping together positions later so make up the groups now
+		groups = BaseGroup.makeBaseGroups((longestSequence-MIN_KMER_SIZE)+1);
+
+		Vector<Kmer>unevenKmers = new Vector<Kmer>();
+				
+		Iterator<Kmer> rawKmers = kmers.values().iterator();
+		
+		while (rawKmers.hasNext()) {
+			Kmer k = rawKmers.next();
+			char [] chars = k.sequence().toCharArray();
+
+			
+			long totalKmerCount = 0;
+
+			
+			// This gets us the total number of Kmers of this type in the whole
+			// dataset.
+			for (int i=0;i<totalKmerCounts.length;i++) {
+				totalKmerCount += totalKmerCounts[i][k.sequence().length()-1];
+			}
+
+			// This is the expected proportion of all Kmers which have this
+			// specific Kmer sequence.  We no longer make any attempt to judge
+			// overall enrichment or depletion of this sequence since once you
+			// get to longer lengths the distribution isn't flat anyway
+			
+			float expectedProportion = k.count/(float)totalKmerCount;
+
+			// We now want to go through each of the positions looking for whether
+			// this Kmer was seen an unexpected number of times compared to what we
+			// expected from the global values
+							
+				
+			float [] obsExpPositions = new float[groups.length];
+			float [] binomialPValues = new float[groups.length];
+				
+			long [] positionCounts = k.getPositions();
+				
+			for (int g=0;g<groups.length;g++) {
+				// This is a summation of the number of Kmers of this length which
+				// fall into this base group
+				long totalGroupCount = 0;
+				
+				// This is a summation of the number of hit Kmers which fall within
+				// this base group.
+				long totalGroupHits = 0;
+				for (int p=groups[g].lowerCount()-1;p<groups[g].upperCount() && p < positionCounts.length ;p++) {
+					totalGroupCount += totalKmerCounts[p][chars.length-1];
+					totalGroupHits += positionCounts[p];
+				}
+							
+				float predicted = expectedProportion * totalGroupCount;
+//				obsExpPositions[g] = (float)(Math.log(totalGroupHits/predicted)/Math.log(2));
+				obsExpPositions[g] = (float)(totalGroupHits/predicted);
+				
+				// Now we can run a binomial test to see if there is a significant
+				// deviation from what we expect given the number of observations we've
+				// made
+				
+				BinomialDistribution bd = new BinomialDistribution((int)totalGroupCount, expectedProportion);
+				if (totalGroupHits > predicted) {
+					binomialPValues[g] = (float)((1 - bd.cumulativeProbability((int)totalGroupHits)) * Math.pow(4,chars.length));
+				}
+				else {
+					binomialPValues[g] = 1;
+				}
+				
+			}
+			
+			k.setObsExpPositions(obsExpPositions);
+			
+			
+			// To keep this we need a p-value below 0.01 and an obs/exp above 5 (actual values are log2 transformed)
+			float lowestPValue = 1;
+			for (int i=0;i<binomialPValues.length;i++) {
+//				if (binomialPValues[i] < 0.01 && obsExpPositions[i] > (Math.log(5)/Math.log(2))) {
+				if (binomialPValues[i] < 0.01 && obsExpPositions[i] > 5) {
+					if (binomialPValues[i]<lowestPValue) {
+						lowestPValue = binomialPValues[i];
+					}
+				}
+			}
+			
+			if (lowestPValue < 0.01) {
+				k.setLowestPValue(lowestPValue);
+				unevenKmers.add(k);
+			}
+			
+			
+		}
+		
+		Kmer [] finalKMers = unevenKmers.toArray(new Kmer[0]);
+		
+		// We sort by the highest degree of enrichment over the average		
+		Arrays.sort(finalKMers);
+		
+		// So we don't end up with stupidly long lists of Kmers in the
+		// report we'll only report the top 20
+		if (finalKMers.length > 20) {
+			Kmer [] shortenedKmers = new Kmer [20];
+			for (int i=0;i<shortenedKmers.length;i++) {
+				shortenedKmers[i] = finalKMers[i];
+			}
+			
+			finalKMers = shortenedKmers;
+		}
+		
+		// Now we take the enrichment positions for the top 6 hits and
+		// record these so we can plot them on a line graph
+		enrichments = new double [Math.min(6, finalKMers.length)][];
+		xLabels = new String[enrichments.length];
+		
+		xCategories = new String [groups.length];
+		
+		for (int i=0;i<xCategories.length;i++) {
+			xCategories[i] = groups[i].toString();
+		}
+		
+		for (int k=0;k<enrichments.length;k++) {
+			enrichments[k] = new double[groups.length];
+			
+			float [] obsExpPos = finalKMers[k].getObsExpPositions();
+						
+			for (int g=0;g<groups.length;g++) {				
+				enrichments[k][g] = obsExpPos[g];
+				if (obsExpPos[g] > maxGraphValue) maxGraphValue = obsExpPos[g];
+				if (obsExpPos[g] < minGraphValue) minGraphValue = obsExpPos[g];
+			}
+			
+			xLabels[k] = finalKMers[k].sequence();
+			
+		}
+		
+		minGraphValue = 0;
+		
+//		System.err.println("Max value="+maxGraphValue+" min value="+minGraphValue);
+		
+		this.enrichedKmers = finalKMers;		
+		
+		// Delete the initial data structure so we don't suck up more memory
+		// than we have to.
+		kmers.clear();
+		
+		calculated = true;
+	}
+
+	
+	public void processSequence(Sequence sequence) {
+		calculated = false;
+		
+		/*
+		 * The processing done by this module is quite intensive so to speed things
+		 * up we don't look at every sequence.  Instead we take only 2% of the 
+		 * submitted sequences and extrapolate from these to the full set in the file.
+		 */
+		++skipCount;
+		if (skipCount % 50 != 0) return;
+		
+		/*
+		 * This module uses horrible amounts of memory if allowed to store the full
+		 * Kmer content for all positions in really long reads (pacbio reads were the
+		 * ones which really broke this).  We'll therefore limit our read lengths to
+		 * 500bp since specific Kmer positions beyond that are not likely to be useful
+		 */
+
+		String seq;
+		
+		if (sequence.getSequence().length() > 500) {
+			seq = sequence.getSequence().substring(0, 500);		
+		}
+		else {
+			seq = sequence.getSequence();
+		}
+
+		if (seq.length() > longestSequence) {
+			longestSequence = seq.length();
+		}
+						
+		// Now we go through all of the Kmers to count these
+		for (int kmerSize=MIN_KMER_SIZE;kmerSize<=MAX_KMER_SIZE;kmerSize++) {
+			for (int i=0;i<=seq.length()-kmerSize;i++) {
+				
+				String kmer = seq.substring(i, i+kmerSize);
+				
+				if (kmer.length() != kmerSize) {
+					throw new IllegalStateException("String length "+kmer.length()+" wasn't the same as the kmer length "+kmerSize);
+				}
+				
+				// Add to the counts before skipping Kmers containing Ns (see
+				// explanation in addKmerCount for the reasoning).
+				addKmerCount(i, kmerSize, kmer);
+				
+				// Skip Kmers containing N
+				if (kmer.indexOf("N") >=0) continue;
+
+				if (kmers.containsKey(kmer)) {
+					kmers.get(kmer).incrementCount(i);
+				}
+				else {
+					kmers.put(new String(kmer), new Kmer(kmer,i,(seq.length()-kmerSize)+1));
+				}
+
+			}
+		}
+	}
+	
+	public void reset () {
+		calculated = false;
+		totalKmerCounts = new long[0][0];
+		longestSequence = 0;
+		skipCount = 0;
+		enrichedKmers = null;
+		kmers.clear();
+	}
+
+	public String description() {
+		return "Identifies short sequences which have uneven representation";
+	}
+
+	public String name() {
+		return "Kmer Content";
+	}
+
+	public boolean raisesError() {
+		if (!calculated) calculateEnrichment();
+		
+		// We raise an error if the most enriched kmer is seen more than 100 times
+		// more frequently than we expect.
+		
+		if (enrichedKmers.length > 0 && 0-Math.log10(enrichedKmers[0].pValue()) > ModuleConfig.getParam("kmer", "error")) return true;
+		return false;
+	}
+
+	public boolean raisesWarning() {
+		if (!calculated) calculateEnrichment();
+		
+		// We raise a warning if there are any enriched kmers
+		if (enrichedKmers.length > 0 && 0-Math.log10(enrichedKmers[0].pValue()) > ModuleConfig.getParam("kmer", "warn")) return true;
+		return false;
+	}
+
+	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
+		if (!calculated) calculateEnrichment();
+		
+		if (enrichedKmers.length > 0) {			
+			writeSpecificImage(report, new LineGraph(enrichments, minGraphValue, maxGraphValue, "Position in read (bp)", xLabels, xCategories, "Log2 Obs/Exp"),"kmer_profiles.png", "Kmer graph", Math.max(800, groups.length*15), 600);
+		}
+		
+		
+		ResultsTable table = new ResultsTable(enrichedKmers);
+		
+		XMLStreamWriter xhtml = report.xhtmlStream();
+		
+		if (enrichedKmers.length == 0)
+			{
+			xhtml.writeStartElement("p");
+			xhtml.writeCharacters("No overrepresented Kmers");
+			xhtml.writeEndElement();
+			}
+		
+		else
+			{
+			super.writeTable(report, table);
+			}
+	}
+	
+	private class Kmer implements Comparable<Kmer>{
+		
+		private String sequence;
+		private long count = 0;
+		private float lowestPValue = 0;
+		private float [] obsExpPositions = null;
+		private long [] positions = new long[0];
+		
+		public Kmer (String sequence, int position, int seqLength) {
+
+			// Do this slightly convoluted dance to try to avoid
+			// keeping the whole original sequence in memory
+			char [] chars = sequence.toCharArray();
+			this.sequence = new String(chars);
+			count = 1;
+			positions = new long[seqLength];
+			++positions[position];
+		}
+		
+		public void incrementCount (int position) {
+			++count;
+			
+			if (position >= positions.length) {
+				long [] newPositions = new long[position+1];
+				for (int i=0;i<positions.length;i++) {
+					newPositions[i] = positions[i];
+				}
+				positions = newPositions;
+			}
+			
+			++positions[position];
+			
+		}
+		
+		public long [] getPositions () {
+			return positions;
+		}
+		
+		public String sequence () {
+			return sequence;
+		}
+		
+		public long count () {
+			return count;
+		}
+		
+		public void setLowestPValue (float p) {
+			this.lowestPValue = p;
+		}
+		
+		public void setObsExpPositions (float [] oePositions) {
+			this.obsExpPositions = oePositions;
+		}
+		
+		public float [] getObsExpPositions () {
+			return obsExpPositions;
+		}
+		
+		public float pValue () {
+			return lowestPValue;
+		}
+				
+		public float maxObsExp () {
+			float max = 0;
+			for (int i=0;i<obsExpPositions.length;i++) {
+				if (obsExpPositions[i]>max) max = obsExpPositions[i];
+			}
+			return max;
+		}
+
+		public int maxPosition () {
+			float max = 0;
+			int position = 0;
+			for (int i=0;i<obsExpPositions.length;i++) {
+				if (obsExpPositions[i]>max) {
+					max = obsExpPositions[i];
+					position = i+1;
+				}
+			}
+			
+			if (position == 0) {
+				System.err.println("No value > 0 for "+sequence);
+				position = 1;
+			}
+			
+			return position;
+		}
+
+		public int compareTo(Kmer o) {
+			return Float.compare(o.maxObsExp(), maxObsExp());
+		}
+	}
+	
+	
+	private class ResultsTable extends AbstractTableModel
+		{
+		private static final long serialVersionUID = 1L;
+		private Kmer [] kmers;
+		
+		public ResultsTable (Kmer [] kmers) {
+			this.kmers = kmers;
+		}
+		
+		
+		// Sequence - Count - Obs/Exp
+		public int getColumnCount() {
+			return 5;
+		}
+
+		public int getRowCount() {
+			return kmers.length;
+		}
+
+		public Object getValueAt(int rowIndex, int columnIndex) {
+			switch (columnIndex) {
+				case 0: return kmers[rowIndex].sequence();
+				case 1: return kmers[rowIndex].count()*5;
+				case 2: return kmers[rowIndex].pValue();
+				case 3: return kmers[rowIndex].maxObsExp();
+				case 4: return groups[kmers[rowIndex].maxPosition()-1].toString();
+						
+			}
+			return null;
+		}
+		
+		public String getColumnName (int columnIndex) {
+			switch (columnIndex) {
+				case 0: return "Sequence";
+				case 1: return "Count";
+				case 2: return "PValue";
+				case 3: return "Obs/Exp Max";
+				case 4: return "Max Obs/Exp Position";
+			}
+			return null;
+		}
+		
+		public Class<?> getColumnClass (int columnIndex) {
+			switch (columnIndex) {
+			case 0: return String.class;
+			case 1: return Integer.class;
+			case 2: return Float.class;
+			case 3: return Float.class;
+			case 4: return String.class;
+		}
+		return null;
+			
+		}
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Modules/ModuleConfig.java b/uk/ac/babraham/FastQC/Modules/ModuleConfig.java
index 9c3b783..24080b7 100644
--- a/uk/ac/babraham/FastQC/Modules/ModuleConfig.java
+++ b/uk/ac/babraham/FastQC/Modules/ModuleConfig.java
@@ -1,154 +1,154 @@
-/**
- * Copyright Copyright 2013-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.HashMap;
-
-import uk.ac.babraham.FastQC.FastQCConfig;
-import uk.ac.babraham.FastQC.Sequence.Contaminant.ContaminentFinder;
-
-public class ModuleConfig {
-
-	private static HashMap<String, Double>parameters = readParams();
-	
-	
-	private static HashMap<String, Double> readParams () {
-		
-		HashMap<String, Double>params = new HashMap<String, Double>();
-		
-		// Set the defaults to use if we don't have any overrides		
-		params.put("duplication:warn",70d);
-		params.put("duplication:error",	50d);
-		params.put("kmer:warn",	2d);
-		params.put("kmer:error",5d);
-		params.put("n_content:warn",5d);
-		params.put("n_content:error",20d);
-		params.put("overrepresented:warn",	0.1);
-		params.put("overrepresented:error",1d);
-		params.put("quality_base_lower:warn",10d);
-		params.put("quality_base_lower:error",	5d);
-		params.put("quality_base_median:warn",	25d);
-		params.put("quality_base_median:error",	20d);
-		params.put("sequence:warn",	10d);
-		params.put("sequence:error",20d);
-		params.put("gc_sequence:warn",15d);
-		params.put("gc_sequence:error",30d);
-		params.put("quality_sequence:warn",	20d);
-		params.put("quality_sequence:error",27d);
-		params.put("tile:warn",	5d);
-		params.put("tile:error",10d);
-		params.put("sequence_length:warn",1d);
-		params.put("sequence_length:error",	1d);
-		params.put("adapter:warn", 5d);
-		params.put("adapter:error", 10d);
-		
-		params.put("duplication:ignore",0d);
-		params.put("kmer:ignore",0d);
-		params.put("n_content:ignore",0d);
-		params.put("overrepresented:ignore",0d);
-		params.put("quality_base:ignore",0d);
-		params.put("sequence:ignore",0d);
-		params.put("gc_quality:ignore",0d);
-		params.put("quality_sequence:ignore",0d);
-		params.put("tile:ignore",0d);
-		params.put("sequence_length:ignore",0d);
-		params.put("adapter:ignore",0d);
-				
-		// Now read the config file to see if there are updated values for any of these.
-		
-		BufferedReader br;
-		
-		try {
-			if (FastQCConfig.getInstance().limits_file == null) {
-				InputStream rsrc=ContaminentFinder.class.getResourceAsStream("/Configuration/limits.txt");
-				if (rsrc==null) throw new FileNotFoundException("cannot find Configuration/limits.txt");
-				br =new BufferedReader(new InputStreamReader(rsrc));
-			}
-			else {
-				br=new BufferedReader(new FileReader(FastQCConfig.getInstance().limits_file));
-			}
-			
-			String line;
-			while ((line = br.readLine()) != null) {
-				
-				if (line.startsWith("#")) continue;
-				
-				if (line.trim().length() == 0) continue;
-				
-				String [] sections = line.split("\\s+");
-				if (sections.length != 3) {	
-					System.err.println("Config line '"+line+"' didn't contain the 3 required sections");
-				}
-				
-				if (!(sections[1].equals("warn") || sections[1].equals("error") || sections[1].equals("ignore"))) {
-					System.err.println("Second config field must be error, warn or ignore, not '"+sections[1]+"'");
-					continue;
-				}
-				
-				double value;
-				try {
-					value = Double.parseDouble(sections[2]);
-				}
-				catch (NumberFormatException nfe) {
-					System.err.println("Value "+sections[2]+" didn't look like a number");
-					continue;
-				}
-				
-				String key = sections[0]+":"+sections[1];
-				params.put(key, value);
-				
-				
-			}
-		
-		}
-		catch (Exception e) {
-			e.printStackTrace();
-		}
-		
-
-		
-		
-		return 	params;
-		
-	}
-	
-	public static Double getParam(String module, String level) {
-		
-		if (!(level.equals("warn") || level.equals("error") || level.equals("ignore"))) {
-			throw new IllegalArgumentException("Level must be warn, error or ignore");
-		}
-		
-		String key = module+":"+level;
-		
-		if (! parameters.containsKey(key)) {
-			throw new IllegalArgumentException("No key called "+key+" in the config data");
-		}
-		
-		return parameters.get(key);
-		
-	}
-	
-	
-}
+/**
+ * Copyright Copyright 2013-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+
+import uk.ac.babraham.FastQC.FastQCConfig;
+import uk.ac.babraham.FastQC.Sequence.Contaminant.ContaminentFinder;
+
+public class ModuleConfig {
+
+	private static HashMap<String, Double>parameters = readParams();
+	
+	
+	private static HashMap<String, Double> readParams () {
+		
+		HashMap<String, Double>params = new HashMap<String, Double>();
+		
+		// Set the defaults to use if we don't have any overrides		
+		params.put("duplication:warn",70d);
+		params.put("duplication:error",	50d);
+		params.put("kmer:warn",	2d);
+		params.put("kmer:error",5d);
+		params.put("n_content:warn",5d);
+		params.put("n_content:error",20d);
+		params.put("overrepresented:warn",	0.1);
+		params.put("overrepresented:error",1d);
+		params.put("quality_base_lower:warn",10d);
+		params.put("quality_base_lower:error",	5d);
+		params.put("quality_base_median:warn",	25d);
+		params.put("quality_base_median:error",	20d);
+		params.put("sequence:warn",	10d);
+		params.put("sequence:error",20d);
+		params.put("gc_sequence:warn",15d);
+		params.put("gc_sequence:error",30d);
+		params.put("quality_sequence:warn",	20d);
+		params.put("quality_sequence:error",27d);
+		params.put("tile:warn",	5d);
+		params.put("tile:error",10d);
+		params.put("sequence_length:warn",1d);
+		params.put("sequence_length:error",	1d);
+		params.put("adapter:warn", 5d);
+		params.put("adapter:error", 10d);
+		
+		params.put("duplication:ignore",0d);
+		params.put("kmer:ignore",0d);
+		params.put("n_content:ignore",0d);
+		params.put("overrepresented:ignore",0d);
+		params.put("quality_base:ignore",0d);
+		params.put("sequence:ignore",0d);
+		params.put("gc_quality:ignore",0d);
+		params.put("quality_sequence:ignore",0d);
+		params.put("tile:ignore",0d);
+		params.put("sequence_length:ignore",0d);
+		params.put("adapter:ignore",0d);
+				
+		// Now read the config file to see if there are updated values for any of these.
+		
+		BufferedReader br;
+		
+		try {
+			if (FastQCConfig.getInstance().limits_file == null) {
+				InputStream rsrc=ContaminentFinder.class.getResourceAsStream("/Configuration/limits.txt");
+				if (rsrc==null) throw new FileNotFoundException("cannot find Configuration/limits.txt");
+				br =new BufferedReader(new InputStreamReader(rsrc));
+			}
+			else {
+				br=new BufferedReader(new FileReader(FastQCConfig.getInstance().limits_file));
+			}
+			
+			String line;
+			while ((line = br.readLine()) != null) {
+				
+				if (line.startsWith("#")) continue;
+				
+				if (line.trim().length() == 0) continue;
+				
+				String [] sections = line.split("\\s+");
+				if (sections.length != 3) {	
+					System.err.println("Config line '"+line+"' didn't contain the 3 required sections");
+				}
+				
+				if (!(sections[1].equals("warn") || sections[1].equals("error") || sections[1].equals("ignore"))) {
+					System.err.println("Second config field must be error, warn or ignore, not '"+sections[1]+"'");
+					continue;
+				}
+				
+				double value;
+				try {
+					value = Double.parseDouble(sections[2]);
+				}
+				catch (NumberFormatException nfe) {
+					System.err.println("Value "+sections[2]+" didn't look like a number");
+					continue;
+				}
+				
+				String key = sections[0]+":"+sections[1];
+				params.put(key, value);
+				
+				
+			}
+		
+		}
+		catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+
+		
+		
+		return 	params;
+		
+	}
+	
+	public static Double getParam(String module, String level) {
+		
+		if (!(level.equals("warn") || level.equals("error") || level.equals("ignore"))) {
+			throw new IllegalArgumentException("Level must be warn, error or ignore");
+		}
+		
+		String key = module+":"+level;
+		
+		if (! parameters.containsKey(key)) {
+			throw new IllegalArgumentException("No key called "+key+" in the config data");
+		}
+		
+		return parameters.get(key);
+		
+	}
+	
+	
+}
diff --git a/uk/ac/babraham/FastQC/Modules/ModuleFactory.java b/uk/ac/babraham/FastQC/Modules/ModuleFactory.java
index 65f39bf..35668f7 100644
--- a/uk/ac/babraham/FastQC/Modules/ModuleFactory.java
+++ b/uk/ac/babraham/FastQC/Modules/ModuleFactory.java
@@ -1,46 +1,46 @@
-/**
- * Copyright Copyright 2014-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-public class ModuleFactory {
-
-	public static QCModule [] getStandardModuleList () {
-
-		OverRepresentedSeqs os = new OverRepresentedSeqs();
-		
-		QCModule [] module_list = new QCModule [] {
-				new BasicStats(),
-				new PerBaseQualityScores(),
-				new PerTileQualityScores(),
-				new PerSequenceQualityScores(),
-				new PerBaseSequenceContent(),
-				new PerSequenceGCContent(),
-				new NContent(),
-				new SequenceLengthDistribution(),
-				os.duplicationLevelModule(),
-				os,
-				new AdapterContent(),
-				new KmerContent(),
-			};
-	
-		return (module_list);
-	}
-	
-}
+/**
+ * Copyright Copyright 2014-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+public class ModuleFactory {
+
+	public static QCModule [] getStandardModuleList () {
+
+		OverRepresentedSeqs os = new OverRepresentedSeqs();
+		
+		QCModule [] module_list = new QCModule [] {
+				new BasicStats(),
+				new PerBaseQualityScores(),
+				new PerTileQualityScores(),
+				new PerSequenceQualityScores(),
+				new PerBaseSequenceContent(),
+				new PerSequenceGCContent(),
+				new NContent(),
+				new SequenceLengthDistribution(),
+				os.duplicationLevelModule(),
+				os,
+				new AdapterContent(),
+				new KmerContent(),
+			};
+	
+		return (module_list);
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Modules/NContent.java b/uk/ac/babraham/FastQC/Modules/NContent.java
index e09bc10..c727455 100644
--- a/uk/ac/babraham/FastQC/Modules/NContent.java
+++ b/uk/ac/babraham/FastQC/Modules/NContent.java
@@ -1,165 +1,165 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-import java.io.IOException;
-
-import javax.swing.JPanel;
-import javax.xml.stream.XMLStreamException;
-
-import uk.ac.babraham.FastQC.Graphs.BaseGroup;
-import uk.ac.babraham.FastQC.Graphs.LineGraph;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-
-public class NContent extends AbstractQCModule {
-
-	public long [] nCounts = new long [0];
-	public long [] notNCounts = new long [0];
-	public boolean calculated = false;
-	public double [] percentages = null;
-	public String [] xCategories = new String[0];
-	
-	public JPanel getResultsPanel() {
-		
-		if (!calculated) getPercentages();
-		return new LineGraph(new double [][] {percentages}, 0d, 100d, "Position in read (bp)",new String [] {"%N"}, xCategories, "N content across all bases");
-	}
-
-	public boolean ignoreFilteredSequences() {
-		return true;
-	}
-	
-	public boolean ignoreInReport () {
-		if (ModuleConfig.getParam("n_content", "ignore") > 0) {
-			return true;
-		}
-		return false;
-	}
-	
-	private synchronized void getPercentages () {
-		
-		BaseGroup [] groups = BaseGroup.makeBaseGroups(nCounts.length);
-		
-		xCategories = new String[groups.length];
-
-		percentages = new double [groups.length];
-
-		long total;
-		long nCount;
-
-		for (int i=0;i<groups.length;i++) {
-						
-			xCategories[i] = groups[i].toString();
-
-			nCount = 0;
-			total = 0;
-			
-			for (int bp=groups[i].lowerCount()-1;bp<groups[i].upperCount();bp++) {		
-				nCount += nCounts[bp];
-				total += nCounts[bp];
-				total += notNCounts[bp];
-			}
-			
-			percentages[i] = 100*(nCount/(double)total);
-		}
-				
-		calculated = true;
-		
-	}
-		
-	public void processSequence(Sequence sequence) {
-		calculated = false;
-		char [] seq = sequence.getSequence().toCharArray();
-		if (nCounts.length < seq.length) {
-			// We need to expand the size of the data structures
-			
-			long [] nCountsNew = new long [seq.length];
-			long [] notNCountsNew = new long [seq.length];
-
-			for (int i=0;i<nCounts.length;i++) {
-				nCountsNew[i] = nCounts[i];
-				notNCountsNew[i] = notNCounts[i];
-			}
-			
-			nCounts = nCountsNew;
-			notNCounts = notNCountsNew;
-		}
-		
-		for (int i=0;i<seq.length;i++) {
-			if (seq[i] == 'N') {
-				++nCounts[i];
-			}
-			else {
-				++notNCounts[i];
-			}
-		}
-		
-	}
-	
-	public void reset () {
-		nCounts = new long[0];
-		notNCounts = new long[0];
-	}
-
-	public String description() {
-		return "Shows the percentage of bases at each position which are not being called";
-	}
-
-	public String name() {
-		return "Per base N content";
-	}
-
-	public boolean raisesError() {
-		if (!calculated) getPercentages();
-		for (int i=0;i<percentages.length;i++) {
-			if (percentages[i] > ModuleConfig.getParam("n_content", "error")) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	public boolean raisesWarning() {
-		if (!calculated) getPercentages();
-		for (int i=0;i<percentages.length;i++) {
-			if (percentages[i] > ModuleConfig.getParam("n_content", "warn")) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	public void makeReport(HTMLReportArchive report) throws XMLStreamException,IOException {
-		if (!calculated) getPercentages();
-		
-		writeDefaultImage(report, "per_base_n_content.png", "N content graph", Math.max(800, percentages.length*15), 600);		
-		
-		StringBuffer sb = report.dataDocument();
-		sb.append("#Base\tN-Count\n");
-		for (int i=0;i<xCategories.length;i++) {
-			sb.append(xCategories[i]);
-			sb.append("\t");
-			sb.append(percentages[i]);
-			sb.append("\n");
-		}
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+import java.io.IOException;
+
+import javax.swing.JPanel;
+import javax.xml.stream.XMLStreamException;
+
+import uk.ac.babraham.FastQC.Graphs.BaseGroup;
+import uk.ac.babraham.FastQC.Graphs.LineGraph;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+
+public class NContent extends AbstractQCModule {
+
+	public long [] nCounts = new long [0];
+	public long [] notNCounts = new long [0];
+	public boolean calculated = false;
+	public double [] percentages = null;
+	public String [] xCategories = new String[0];
+	
+	public JPanel getResultsPanel() {
+		
+		if (!calculated) getPercentages();
+		return new LineGraph(new double [][] {percentages}, 0d, 100d, "Position in read (bp)",new String [] {"%N"}, xCategories, "N content across all bases");
+	}
+
+	public boolean ignoreFilteredSequences() {
+		return true;
+	}
+	
+	public boolean ignoreInReport () {
+		if (ModuleConfig.getParam("n_content", "ignore") > 0) {
+			return true;
+		}
+		return false;
+	}
+	
+	private synchronized void getPercentages () {
+		
+		BaseGroup [] groups = BaseGroup.makeBaseGroups(nCounts.length);
+		
+		xCategories = new String[groups.length];
+
+		percentages = new double [groups.length];
+
+		long total;
+		long nCount;
+
+		for (int i=0;i<groups.length;i++) {
+						
+			xCategories[i] = groups[i].toString();
+
+			nCount = 0;
+			total = 0;
+			
+			for (int bp=groups[i].lowerCount()-1;bp<groups[i].upperCount();bp++) {		
+				nCount += nCounts[bp];
+				total += nCounts[bp];
+				total += notNCounts[bp];
+			}
+			
+			percentages[i] = 100*(nCount/(double)total);
+		}
+				
+		calculated = true;
+		
+	}
+		
+	public void processSequence(Sequence sequence) {
+		calculated = false;
+		char [] seq = sequence.getSequence().toCharArray();
+		if (nCounts.length < seq.length) {
+			// We need to expand the size of the data structures
+			
+			long [] nCountsNew = new long [seq.length];
+			long [] notNCountsNew = new long [seq.length];
+
+			for (int i=0;i<nCounts.length;i++) {
+				nCountsNew[i] = nCounts[i];
+				notNCountsNew[i] = notNCounts[i];
+			}
+			
+			nCounts = nCountsNew;
+			notNCounts = notNCountsNew;
+		}
+		
+		for (int i=0;i<seq.length;i++) {
+			if (seq[i] == 'N') {
+				++nCounts[i];
+			}
+			else {
+				++notNCounts[i];
+			}
+		}
+		
+	}
+	
+	public void reset () {
+		nCounts = new long[0];
+		notNCounts = new long[0];
+	}
+
+	public String description() {
+		return "Shows the percentage of bases at each position which are not being called";
+	}
+
+	public String name() {
+		return "Per base N content";
+	}
+
+	public boolean raisesError() {
+		if (!calculated) getPercentages();
+		for (int i=0;i<percentages.length;i++) {
+			if (percentages[i] > ModuleConfig.getParam("n_content", "error")) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public boolean raisesWarning() {
+		if (!calculated) getPercentages();
+		for (int i=0;i<percentages.length;i++) {
+			if (percentages[i] > ModuleConfig.getParam("n_content", "warn")) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public void makeReport(HTMLReportArchive report) throws XMLStreamException,IOException {
+		if (!calculated) getPercentages();
+		
+		writeDefaultImage(report, "per_base_n_content.png", "N content graph", Math.max(800, percentages.length*15), 600);		
+		
+		StringBuffer sb = report.dataDocument();
+		sb.append("#Base\tN-Count\n");
+		for (int i=0;i<xCategories.length;i++) {
+			sb.append(xCategories[i]);
+			sb.append("\t");
+			sb.append(percentages[i]);
+			sb.append("\n");
+		}
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Modules/PerBaseQualityScores.java b/uk/ac/babraham/FastQC/Modules/PerBaseQualityScores.java
index e6f240c..aea537f 100644
--- a/uk/ac/babraham/FastQC/Modules/PerBaseQualityScores.java
+++ b/uk/ac/babraham/FastQC/Modules/PerBaseQualityScores.java
@@ -1,264 +1,264 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-import java.io.IOException;
-
-import javax.swing.JPanel;
-import javax.xml.stream.XMLStreamException;
-
-import uk.ac.babraham.FastQC.Graphs.BaseGroup;
-import uk.ac.babraham.FastQC.Graphs.QualityBoxPlot;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-import uk.ac.babraham.FastQC.Sequence.QualityEncoding.PhredEncoding;
-import uk.ac.babraham.FastQC.Utilities.QualityCount;
-
-public class PerBaseQualityScores extends AbstractQCModule {
-
-	public QualityCount [] qualityCounts = new QualityCount[0];
-	double [] means = null;
-	double [] medians = null;
-	double [] lowerQuartile = null;
-	double [] upperQuartile = null;
-	double [] lowest = null;
-	double [] highest = null;
-	String [] xLabels;
-	int low = 0;
-	int high = 0;
-	PhredEncoding encodingScheme;
-	private boolean calculated = false;
-		
-	public JPanel getResultsPanel() {
-		
-		if (!calculated) getPercentages();
-
-		return new QualityBoxPlot(means,medians,lowest,highest,lowerQuartile,upperQuartile, low, high, 2d, xLabels, "Quality scores across all bases ("+encodingScheme+" encoding)");
-	}
-	
-	public boolean ignoreFilteredSequences() {
-		return true;
-	}
-	
-	public boolean ignoreInReport () {
-		// We don't show this if there is no quality data.
-		if (ModuleConfig.getParam("quality_base", "ignore") > 0 || qualityCounts.length == 0) {
-			return true;
-		}
-		return false;
-	}
-
-	private synchronized void getPercentages () {
-		
-		char [] range = calculateOffsets();
-		encodingScheme = PhredEncoding.getFastQEncodingOffset(range[0]);
-		low = 0;
-		high = range[1] - encodingScheme.offset();
-		if (high < 35) {
-			high = 35;
-		}
-		
-		BaseGroup [] groups = BaseGroup.makeBaseGroups(qualityCounts.length);
-		
-		means = new double[groups.length];
-		medians = new double[groups.length];
-		lowest = new double[groups.length];
-		highest = new double[groups.length];
-		lowerQuartile = new double[groups.length];
-		upperQuartile = new double[groups.length];
-		xLabels = new String[groups.length];
-		
-		for (int i=0;i<groups.length;i++) {
-			xLabels[i] = groups[i].toString();
-			int minBase = groups[i].lowerCount();
-			int maxBase = groups[i].upperCount();
-			lowest[i] = getPercentile(minBase, maxBase, encodingScheme.offset(), 10);
-			highest[i] = getPercentile(minBase, maxBase, encodingScheme.offset(), 90);
-			means[i] = getMean(minBase,maxBase,encodingScheme.offset());
-			medians[i] = getPercentile(minBase, maxBase, encodingScheme.offset(), 50);
-			lowerQuartile[i] = getPercentile(minBase, maxBase, encodingScheme.offset(), 25);
-			upperQuartile[i] = getPercentile(minBase, maxBase, encodingScheme.offset(), 75);
-		}
-
-		calculated = true;
-
-	}
-	
-	private char [] calculateOffsets () {
-		// Works out from the set of chars what is the most
-		// likely encoding scale for this file.
-		
-		char minChar = 0;
-		char maxChar = 0;
-		
-		for (int q=0;q<qualityCounts.length;q++) {
-			if (q == 0) {
-				minChar = qualityCounts[q].getMinChar();
-				maxChar = qualityCounts[q].getMaxChar();
-			}
-			else {
-				if (qualityCounts[q].getMinChar() < minChar) {
-					minChar = qualityCounts[q].getMinChar();
-				}
-				if (qualityCounts[q].getMaxChar() > maxChar) {
-					maxChar = qualityCounts[q].getMaxChar();
-				}
-			}
-		}
-		
-		return new char[] {minChar,maxChar};
-	}
-	
-	public void processSequence(Sequence sequence) {
-		
-		calculated = false;
-		char [] qual = sequence.getQualityString().toCharArray();
-		if (qualityCounts.length < qual.length) {
-			
-			QualityCount [] qualityCountsNew = new QualityCount[qual.length];
-			
-			for (int i=0;i<qualityCounts.length;i++) {
-				qualityCountsNew[i] = qualityCounts[i];
-			}
-			for (int i=qualityCounts.length;i<qualityCountsNew.length;i++) {
-				qualityCountsNew[i] = new QualityCount();				
-			}
-			qualityCounts = qualityCountsNew;
-			
-		}
-		
-		for (int i=0;i<qual.length;i++) {
-			qualityCounts[i].addValue(qual[i]);
-		}
-		
-	}
-	
-	public void reset () {
-		qualityCounts = new QualityCount[0];
-	}
-
-	public String description() {
-		return "Shows the Quality scores of all bases at a given position in a sequencing run";
-	}
-
-	public String name() {
-		return "Per base sequence quality";
-	}
-
-	public boolean raisesError() {
-		if (!calculated) getPercentages();
-
-		for (int i=0;i<lowerQuartile.length;i++) {
-			if (Double.isNaN(lowerQuartile[i])) {
-				// There wasn't enough data for this group to make an assessment
-				continue;
-			}
-			if (lowerQuartile[i] < ModuleConfig.getParam("quality_base_lower", "error") || medians[i] < ModuleConfig.getParam("quality_base_median", "error")) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	public boolean raisesWarning() {
-		if (!calculated) getPercentages();
-
-		for (int i=0;i<lowerQuartile.length;i++) {
-			if (Double.isNaN(lowerQuartile[i])) {
-				// There wasn't enough data for this group to make an assessment
-				continue;
-			}
-			if (lowerQuartile[i] < ModuleConfig.getParam("quality_base_lower", "warn") || medians[i] < ModuleConfig.getParam("quality_base_median", "warn")) {
-				return true;
-			}
-		}
-		return false;
-	}
-	
-	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException
-		{
-		if (!calculated) getPercentages();
-
-		writeDefaultImage(report, "per_base_quality.png", "Per base quality graph", Math.max(800, means.length*15), 600);		
-		
-		StringBuffer sb = report.dataDocument();
-		sb.append("#Base\tMean\tMedian\tLower Quartile\tUpper Quartile\t10th Percentile\t90th Percentile\n");
-		for (int i=0;i<means.length;i++) {
-			sb.append(xLabels[i]);
-			sb.append("\t");
-
-			sb.append(means[i]);
-			sb.append("\t");
-
-			sb.append(medians[i]);
-			sb.append("\t");
-
-			sb.append(lowerQuartile[i]);
-			sb.append("\t");
-
-			sb.append(upperQuartile[i]);
-			sb.append("\t");
-
-			sb.append(lowest[i]);
-			sb.append("\t");
-
-			sb.append(highest[i]);
-
-			sb.append("\n");
-		}
-	}
-	
-	private double getPercentile (int minbp, int maxbp, int offset, int percentile) {
-		int count = 0;
-		double total = 0;
-	
-		for (int i=minbp-1;i<maxbp;i++) {
-			if (qualityCounts[i].getTotalCount() > 100) {
-				count++;
-				total += qualityCounts[i].getPercentile(offset, percentile);
-			}
-		}
-		
-		if (count > 0) {
-			return total/count;
-		}
-		return Double.NaN;
-		
-	}
-
-	private double getMean (int minbp, int maxbp, int offset) {
-		int count = 0;
-		double total = 0;
-	
-		for (int i=minbp-1;i<maxbp;i++) {
-			if (qualityCounts[i].getTotalCount() > 0) {
-				count++;
-				total += qualityCounts[i].getMean(offset);
-			}
-		}
-		
-		if (count > 0) {
-			return total/count;
-		}
-		return 0;
-		
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+import java.io.IOException;
+
+import javax.swing.JPanel;
+import javax.xml.stream.XMLStreamException;
+
+import uk.ac.babraham.FastQC.Graphs.BaseGroup;
+import uk.ac.babraham.FastQC.Graphs.QualityBoxPlot;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+import uk.ac.babraham.FastQC.Sequence.QualityEncoding.PhredEncoding;
+import uk.ac.babraham.FastQC.Utilities.QualityCount;
+
+public class PerBaseQualityScores extends AbstractQCModule {
+
+	public QualityCount [] qualityCounts = new QualityCount[0];
+	double [] means = null;
+	double [] medians = null;
+	double [] lowerQuartile = null;
+	double [] upperQuartile = null;
+	double [] lowest = null;
+	double [] highest = null;
+	String [] xLabels;
+	int low = 0;
+	int high = 0;
+	PhredEncoding encodingScheme;
+	private boolean calculated = false;
+		
+	public JPanel getResultsPanel() {
+		
+		if (!calculated) getPercentages();
+
+		return new QualityBoxPlot(means,medians,lowest,highest,lowerQuartile,upperQuartile, low, high, 2d, xLabels, "Quality scores across all bases ("+encodingScheme+" encoding)");
+	}
+	
+	public boolean ignoreFilteredSequences() {
+		return true;
+	}
+	
+	public boolean ignoreInReport () {
+		// We don't show this if there is no quality data.
+		if (ModuleConfig.getParam("quality_base", "ignore") > 0 || qualityCounts.length == 0) {
+			return true;
+		}
+		return false;
+	}
+
+	private synchronized void getPercentages () {
+		
+		char [] range = calculateOffsets();
+		encodingScheme = PhredEncoding.getFastQEncodingOffset(range[0]);
+		low = 0;
+		high = range[1] - encodingScheme.offset();
+		if (high < 35) {
+			high = 35;
+		}
+		
+		BaseGroup [] groups = BaseGroup.makeBaseGroups(qualityCounts.length);
+		
+		means = new double[groups.length];
+		medians = new double[groups.length];
+		lowest = new double[groups.length];
+		highest = new double[groups.length];
+		lowerQuartile = new double[groups.length];
+		upperQuartile = new double[groups.length];
+		xLabels = new String[groups.length];
+		
+		for (int i=0;i<groups.length;i++) {
+			xLabels[i] = groups[i].toString();
+			int minBase = groups[i].lowerCount();
+			int maxBase = groups[i].upperCount();
+			lowest[i] = getPercentile(minBase, maxBase, encodingScheme.offset(), 10);
+			highest[i] = getPercentile(minBase, maxBase, encodingScheme.offset(), 90);
+			means[i] = getMean(minBase,maxBase,encodingScheme.offset());
+			medians[i] = getPercentile(minBase, maxBase, encodingScheme.offset(), 50);
+			lowerQuartile[i] = getPercentile(minBase, maxBase, encodingScheme.offset(), 25);
+			upperQuartile[i] = getPercentile(minBase, maxBase, encodingScheme.offset(), 75);
+		}
+
+		calculated = true;
+
+	}
+	
+	private char [] calculateOffsets () {
+		// Works out from the set of chars what is the most
+		// likely encoding scale for this file.
+		
+		char minChar = 0;
+		char maxChar = 0;
+		
+		for (int q=0;q<qualityCounts.length;q++) {
+			if (q == 0) {
+				minChar = qualityCounts[q].getMinChar();
+				maxChar = qualityCounts[q].getMaxChar();
+			}
+			else {
+				if (qualityCounts[q].getMinChar() < minChar) {
+					minChar = qualityCounts[q].getMinChar();
+				}
+				if (qualityCounts[q].getMaxChar() > maxChar) {
+					maxChar = qualityCounts[q].getMaxChar();
+				}
+			}
+		}
+		
+		return new char[] {minChar,maxChar};
+	}
+	
+	public void processSequence(Sequence sequence) {
+		
+		calculated = false;
+		char [] qual = sequence.getQualityString().toCharArray();
+		if (qualityCounts.length < qual.length) {
+			
+			QualityCount [] qualityCountsNew = new QualityCount[qual.length];
+			
+			for (int i=0;i<qualityCounts.length;i++) {
+				qualityCountsNew[i] = qualityCounts[i];
+			}
+			for (int i=qualityCounts.length;i<qualityCountsNew.length;i++) {
+				qualityCountsNew[i] = new QualityCount();				
+			}
+			qualityCounts = qualityCountsNew;
+			
+		}
+		
+		for (int i=0;i<qual.length;i++) {
+			qualityCounts[i].addValue(qual[i]);
+		}
+		
+	}
+	
+	public void reset () {
+		qualityCounts = new QualityCount[0];
+	}
+
+	public String description() {
+		return "Shows the Quality scores of all bases at a given position in a sequencing run";
+	}
+
+	public String name() {
+		return "Per base sequence quality";
+	}
+
+	public boolean raisesError() {
+		if (!calculated) getPercentages();
+
+		for (int i=0;i<lowerQuartile.length;i++) {
+			if (Double.isNaN(lowerQuartile[i])) {
+				// There wasn't enough data for this group to make an assessment
+				continue;
+			}
+			if (lowerQuartile[i] < ModuleConfig.getParam("quality_base_lower", "error") || medians[i] < ModuleConfig.getParam("quality_base_median", "error")) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public boolean raisesWarning() {
+		if (!calculated) getPercentages();
+
+		for (int i=0;i<lowerQuartile.length;i++) {
+			if (Double.isNaN(lowerQuartile[i])) {
+				// There wasn't enough data for this group to make an assessment
+				continue;
+			}
+			if (lowerQuartile[i] < ModuleConfig.getParam("quality_base_lower", "warn") || medians[i] < ModuleConfig.getParam("quality_base_median", "warn")) {
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException
+		{
+		if (!calculated) getPercentages();
+
+		writeDefaultImage(report, "per_base_quality.png", "Per base quality graph", Math.max(800, means.length*15), 600);		
+		
+		StringBuffer sb = report.dataDocument();
+		sb.append("#Base\tMean\tMedian\tLower Quartile\tUpper Quartile\t10th Percentile\t90th Percentile\n");
+		for (int i=0;i<means.length;i++) {
+			sb.append(xLabels[i]);
+			sb.append("\t");
+
+			sb.append(means[i]);
+			sb.append("\t");
+
+			sb.append(medians[i]);
+			sb.append("\t");
+
+			sb.append(lowerQuartile[i]);
+			sb.append("\t");
+
+			sb.append(upperQuartile[i]);
+			sb.append("\t");
+
+			sb.append(lowest[i]);
+			sb.append("\t");
+
+			sb.append(highest[i]);
+
+			sb.append("\n");
+		}
+	}
+	
+	private double getPercentile (int minbp, int maxbp, int offset, int percentile) {
+		int count = 0;
+		double total = 0;
+	
+		for (int i=minbp-1;i<maxbp;i++) {
+			if (qualityCounts[i].getTotalCount() > 100) {
+				count++;
+				total += qualityCounts[i].getPercentile(offset, percentile);
+			}
+		}
+		
+		if (count > 0) {
+			return total/count;
+		}
+		return Double.NaN;
+		
+	}
+
+	private double getMean (int minbp, int maxbp, int offset) {
+		int count = 0;
+		double total = 0;
+	
+		for (int i=minbp-1;i<maxbp;i++) {
+			if (qualityCounts[i].getTotalCount() > 0) {
+				count++;
+				total += qualityCounts[i].getMean(offset);
+			}
+		}
+		
+		if (count > 0) {
+			return total/count;
+		}
+		return 0;
+		
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Modules/PerBaseSequenceContent.java b/uk/ac/babraham/FastQC/Modules/PerBaseSequenceContent.java
index 8c32b7e..62160ed 100644
--- a/uk/ac/babraham/FastQC/Modules/PerBaseSequenceContent.java
+++ b/uk/ac/babraham/FastQC/Modules/PerBaseSequenceContent.java
@@ -1,223 +1,223 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-import java.io.IOException;
-
-import javax.swing.JPanel;
-import javax.xml.stream.XMLStreamException;
-
-import uk.ac.babraham.FastQC.Graphs.BaseGroup;
-import uk.ac.babraham.FastQC.Graphs.LineGraph;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-
-public class PerBaseSequenceContent extends AbstractQCModule {
-
-	public long [] gCounts = new long [0];
-	public long [] aCounts = new long [0];
-	public long [] cCounts = new long [0];
-	public long [] tCounts = new long [0];
-	private double [][] percentages = null;
-	private String [] xCategories = new String[0];
-	private boolean calculated = false;
-		
-	
-	public JPanel getResultsPanel() {
-		
-		if (!calculated) getPercentages();
-
-		return new LineGraph(percentages, 0d, 100d, "Position in read (bp)", new String [] {"%T","%C","%A","%G"}, xCategories, "Sequence content across all bases");
-	}
-	
-	public boolean ignoreFilteredSequences() {
-		return true;
-	}
-	
-	public boolean ignoreInReport () {
-		if (ModuleConfig.getParam("sequence", "ignore") > 0) {
-			return true;
-		}
-		return false;
-	}
-
-	private synchronized void getPercentages () {
-
-		BaseGroup [] groups = BaseGroup.makeBaseGroups(gCounts.length);
-		
-		xCategories = new String[groups.length];
-
-		
-		double [] gPercent = new double[groups.length];
-		double [] aPercent = new double[groups.length];
-		double [] tPercent = new double[groups.length];
-		double [] cPercent = new double[groups.length];
-
-		long total;
-		long gCount;
-		long aCount;
-		long tCount;
-		long cCount;
-
-		for (int i=0;i<groups.length;i++) {
-						
-			xCategories[i] = groups[i].toString();
-
-			gCount = 0;
-			aCount = 0;
-			tCount = 0;
-			cCount = 0;
-			total = 0;
-			
-			for (int bp=groups[i].lowerCount()-1;bp<groups[i].upperCount();bp++) {
-
-				total += gCounts[bp];
-				total += cCounts[bp];
-				total += aCounts[bp];
-				total += tCounts[bp];
-
-				aCount += aCounts[bp];
-				tCount += tCounts[bp];
-				cCount += cCounts[bp];
-				gCount += gCounts[bp];				
-			}
-			
-			gPercent[i] = (gCount/(double)total)*100;
-			aPercent[i] = (aCount/(double)total)*100;
-			tPercent[i] = (tCount/(double)total)*100;
-			cPercent[i] = (cCount/(double)total)*100;			
-						
-		}
-		
-		percentages = new double [][] {tPercent,cPercent,aPercent,gPercent};
-		
-		calculated = true;
-	}
-	
-	public void processSequence(Sequence sequence) {
-		calculated = false;
-		char [] seq = sequence.getSequence().toCharArray();
-		if (gCounts.length < seq.length) {
-			
-			long [] gCountsNew = new long [seq.length];
-			long [] aCountsNew = new long [seq.length];
-			long [] cCountsNew = new long [seq.length];
-			long [] tCountsNew = new long [seq.length];
-
-			for (int i=0;i<gCounts.length;i++) {
-				gCountsNew[i] = gCounts[i];
-				aCountsNew[i] = aCounts[i];
-				tCountsNew[i] = tCounts[i];
-				cCountsNew[i] = cCounts[i];
-			}		
-
-			gCounts = gCountsNew;
-			aCounts = aCountsNew;
-			tCounts = tCountsNew;
-			cCounts = cCountsNew;
-		}
-		
-		for (int i=0;i<seq.length;i++) {
-			if (seq[i] == 'G') {
-				++gCounts[i];
-			}
-			else if (seq[i] == 'A') {
-				++aCounts[i];
-			}
-			else if (seq[i] == 'T') {
-				++tCounts[i];
-			}
-			else if (seq[i] == 'C') {
-				++cCounts[i];
-			}
-		}
-		
-	}
-	
-	public void reset () {
-		gCounts = new long[0];
-		aCounts = new long[0];
-		tCounts = new long[0];
-		cCounts = new long[0];
-	}
-
-	public String description() {
-		return "Shows the relative amounts of each base at each position in a sequencing run";
-	}
-
-	public String name() {
-		return "Per base sequence content";
-	}
-
-	public boolean raisesError() {
-		if (!calculated) getPercentages();
-
-		// Percentages come in the order GATC
-		for (int i=0;i<percentages[0].length;i++) {
-
-			double gcDiff = Math.abs(percentages[0][i]-percentages[3][i]);
-			double atDiff = Math.abs(percentages[1][i]-percentages[2][i]);
-			
-			if (gcDiff > ModuleConfig.getParam("sequence", "error") || atDiff > ModuleConfig.getParam("sequence", "error")) return true;
-			
-		}
-		return false;
-	}
-
-	public boolean raisesWarning() {
-
-		if (!calculated) getPercentages();
-
-		// Percentages come in the order GATC
-		for (int i=0;i<percentages[0].length;i++) {
-
-			double gcDiff = Math.abs(percentages[0][i]-percentages[3][i]);
-			double atDiff = Math.abs(percentages[1][i]-percentages[2][i]);
-			
-			if (gcDiff > ModuleConfig.getParam("sequence", "warn") || atDiff > ModuleConfig.getParam("sequence", "warn")) return true;
-			
-		}
-		return false;
-	}
-
-	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
-		
-		if (!calculated) getPercentages();
-		
-		writeDefaultImage(report, "per_base_sequence_content.png", "Per base sequence content", Math.max(800, xCategories.length*15), 600);
-		
-		StringBuffer sb = report.dataDocument();
-		sb.append("#Base\tG\tA\tT\tC\n");
-		for (int i=0;i<xCategories.length;i++) {
-			sb.append(xCategories[i]);
-			sb.append("\t");
-			sb.append(percentages[3][i]);
-			sb.append("\t");
-			sb.append(percentages[2][i]);
-			sb.append("\t");
-			sb.append(percentages[0][i]);
-			sb.append("\t");
-			sb.append(percentages[1][i]);
-			sb.append("\n");
-		}
-		
-	} 
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+import java.io.IOException;
+
+import javax.swing.JPanel;
+import javax.xml.stream.XMLStreamException;
+
+import uk.ac.babraham.FastQC.Graphs.BaseGroup;
+import uk.ac.babraham.FastQC.Graphs.LineGraph;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+
+public class PerBaseSequenceContent extends AbstractQCModule {
+
+	public long [] gCounts = new long [0];
+	public long [] aCounts = new long [0];
+	public long [] cCounts = new long [0];
+	public long [] tCounts = new long [0];
+	private double [][] percentages = null;
+	private String [] xCategories = new String[0];
+	private boolean calculated = false;
+		
+	
+	public JPanel getResultsPanel() {
+		
+		if (!calculated) getPercentages();
+
+		return new LineGraph(percentages, 0d, 100d, "Position in read (bp)", new String [] {"%T","%C","%A","%G"}, xCategories, "Sequence content across all bases");
+	}
+	
+	public boolean ignoreFilteredSequences() {
+		return true;
+	}
+	
+	public boolean ignoreInReport () {
+		if (ModuleConfig.getParam("sequence", "ignore") > 0) {
+			return true;
+		}
+		return false;
+	}
+
+	private synchronized void getPercentages () {
+
+		BaseGroup [] groups = BaseGroup.makeBaseGroups(gCounts.length);
+		
+		xCategories = new String[groups.length];
+
+		
+		double [] gPercent = new double[groups.length];
+		double [] aPercent = new double[groups.length];
+		double [] tPercent = new double[groups.length];
+		double [] cPercent = new double[groups.length];
+
+		long total;
+		long gCount;
+		long aCount;
+		long tCount;
+		long cCount;
+
+		for (int i=0;i<groups.length;i++) {
+						
+			xCategories[i] = groups[i].toString();
+
+			gCount = 0;
+			aCount = 0;
+			tCount = 0;
+			cCount = 0;
+			total = 0;
+			
+			for (int bp=groups[i].lowerCount()-1;bp<groups[i].upperCount();bp++) {
+
+				total += gCounts[bp];
+				total += cCounts[bp];
+				total += aCounts[bp];
+				total += tCounts[bp];
+
+				aCount += aCounts[bp];
+				tCount += tCounts[bp];
+				cCount += cCounts[bp];
+				gCount += gCounts[bp];				
+			}
+			
+			gPercent[i] = (gCount/(double)total)*100;
+			aPercent[i] = (aCount/(double)total)*100;
+			tPercent[i] = (tCount/(double)total)*100;
+			cPercent[i] = (cCount/(double)total)*100;			
+						
+		}
+		
+		percentages = new double [][] {tPercent,cPercent,aPercent,gPercent};
+		
+		calculated = true;
+	}
+	
+	public void processSequence(Sequence sequence) {
+		calculated = false;
+		char [] seq = sequence.getSequence().toCharArray();
+		if (gCounts.length < seq.length) {
+			
+			long [] gCountsNew = new long [seq.length];
+			long [] aCountsNew = new long [seq.length];
+			long [] cCountsNew = new long [seq.length];
+			long [] tCountsNew = new long [seq.length];
+
+			for (int i=0;i<gCounts.length;i++) {
+				gCountsNew[i] = gCounts[i];
+				aCountsNew[i] = aCounts[i];
+				tCountsNew[i] = tCounts[i];
+				cCountsNew[i] = cCounts[i];
+			}		
+
+			gCounts = gCountsNew;
+			aCounts = aCountsNew;
+			tCounts = tCountsNew;
+			cCounts = cCountsNew;
+		}
+		
+		for (int i=0;i<seq.length;i++) {
+			if (seq[i] == 'G') {
+				++gCounts[i];
+			}
+			else if (seq[i] == 'A') {
+				++aCounts[i];
+			}
+			else if (seq[i] == 'T') {
+				++tCounts[i];
+			}
+			else if (seq[i] == 'C') {
+				++cCounts[i];
+			}
+		}
+		
+	}
+	
+	public void reset () {
+		gCounts = new long[0];
+		aCounts = new long[0];
+		tCounts = new long[0];
+		cCounts = new long[0];
+	}
+
+	public String description() {
+		return "Shows the relative amounts of each base at each position in a sequencing run";
+	}
+
+	public String name() {
+		return "Per base sequence content";
+	}
+
+	public boolean raisesError() {
+		if (!calculated) getPercentages();
+
+		// Percentages come in the order TCAG
+		for (int i=0;i<percentages[0].length;i++) {
+
+			double gcDiff = Math.abs(percentages[1][i]-percentages[3][i]);
+			double atDiff = Math.abs(percentages[0][i]-percentages[2][i]);
+			
+			if (gcDiff > ModuleConfig.getParam("sequence", "error") || atDiff > ModuleConfig.getParam("sequence", "error")) return true;
+			
+		}
+		return false;
+	}
+
+	public boolean raisesWarning() {
+
+		if (!calculated) getPercentages();
+
+		// Percentages come in the order TCAG
+		for (int i=0;i<percentages[0].length;i++) {
+
+			double gcDiff = Math.abs(percentages[1][i]-percentages[3][i]);
+			double atDiff = Math.abs(percentages[0][i]-percentages[2][i]);
+			
+			if (gcDiff > ModuleConfig.getParam("sequence", "warn") || atDiff > ModuleConfig.getParam("sequence", "warn")) return true;
+			
+		}
+		return false;
+	}
+
+	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
+		
+		if (!calculated) getPercentages();
+		
+		writeDefaultImage(report, "per_base_sequence_content.png", "Per base sequence content", Math.max(800, xCategories.length*15), 600);
+		
+		StringBuffer sb = report.dataDocument();
+		sb.append("#Base\tG\tA\tT\tC\n");
+		for (int i=0;i<xCategories.length;i++) {
+			sb.append(xCategories[i]);
+			sb.append("\t");
+			sb.append(percentages[3][i]);
+			sb.append("\t");
+			sb.append(percentages[2][i]);
+			sb.append("\t");
+			sb.append(percentages[0][i]);
+			sb.append("\t");
+			sb.append(percentages[1][i]);
+			sb.append("\n");
+		}
+		
+	} 
+
+}
diff --git a/uk/ac/babraham/FastQC/Modules/PerSequenceGCContent.java b/uk/ac/babraham/FastQC/Modules/PerSequenceGCContent.java
index 90c1741..bf2623f 100644
--- a/uk/ac/babraham/FastQC/Modules/PerSequenceGCContent.java
+++ b/uk/ac/babraham/FastQC/Modules/PerSequenceGCContent.java
@@ -1,266 +1,266 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-import java.io.IOException;
-
-import javax.swing.JPanel;
-import javax.xml.stream.XMLStreamException;
-
-import uk.ac.babraham.FastQC.Graphs.LineGraph;
-import uk.ac.babraham.FastQC.Modules.GCModel.GCModel;
-import uk.ac.babraham.FastQC.Modules.GCModel.GCModelValue;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-import uk.ac.babraham.FastQC.Statistics.NormalDistribution;
-
-public class PerSequenceGCContent extends AbstractQCModule {
-
-	private double [] gcDistribution = new double[101];
-	private double [] theoreticalDistribution  = new double[101];
-	private int [] xCategories = new int[0];
-	private double max = 0;
-	private double deviationPercent;
-	private boolean calculated = false;
-	
-	private GCModel [] cachedModels = new GCModel [200];
-	
-	public JPanel getResultsPanel() {
-	
-		if (!calculated) calculateDistribution();
-				
-		return new LineGraph(new double [][] {gcDistribution,theoreticalDistribution}, 0d, max, "Mean GC content (%)", new String [] {"GC count per read","Theoretical Distribution"}, xCategories, "GC distribution over all sequences");
-	}
-	
-	public boolean ignoreFilteredSequences() {
-		return true;
-	}
-	
-	public boolean ignoreInReport () {
-		if (ModuleConfig.getParam("gc_sequence", "ignore") > 0) {
-			return true;
-		}
-		return false;
-	}
-	
-	
-	private synchronized void calculateDistribution () {
-		max = 0;
-		xCategories = new int[gcDistribution.length];
-		double totalCount = 0;
-		
-		
-		// We use the mode to calculate the theoretical distribution
-		// so that we cope better with skewed distributions.
-		int firstMode = 0;
-		double modeCount = 0;
-		
-		for (int i=0;i<gcDistribution.length;i++) {
-			xCategories[i] = i;
-			totalCount += gcDistribution[i];
-			
-			if (gcDistribution[i] > modeCount) {
-				modeCount = gcDistribution[i];
-				firstMode = i;
-			}
-			if (gcDistribution[i] > max) max = gcDistribution[i];
-		}
-				
-		// The mode might not be a very good measure of the centre
-		// of the distribution either due to duplicated vales or
-		// several very similar values next to each other.  We therefore
-		// average over adjacent points which stay above 95% of the modal
-		// value
-
-		double mode = 0;
-		int modeDuplicates = 0;
-		
-		boolean fellOffTop = true;
-
-		for (int i=firstMode;i<gcDistribution.length;i++) {
-			if (gcDistribution[i] > gcDistribution[firstMode] - (gcDistribution[firstMode]/10)) {
-				mode += i;
-				modeDuplicates++;
-			}
-			else {
-				fellOffTop = false;
-				break;
-			}
-		}
-
-		boolean fellOffBottom = true;
-		
-		for (int i=firstMode-1;i>=0;i--) {
-			if (gcDistribution[i] > gcDistribution[firstMode] - (gcDistribution[firstMode]/10)) {
-				mode += i;
-				modeDuplicates++;
-			}
-			else {
-				fellOffBottom = false;
-				break;
-			}
-		}
-
-		if (fellOffBottom || fellOffTop) {
-			// If the distribution is so skewed that 95% of the mode
-			// is off the 0-100% scale then we keep the mode as the 
-			// centre of the model
-			mode = firstMode;
-		}
-		else {
-			mode /= modeDuplicates;
-		}
-		
-		
-		
-		// We can now work out a theoretical distribution
-		double stdev = 0;
-		
-		for (int i=0;i<gcDistribution.length;i++) {
-			stdev += Math.pow((i-mode),2) * gcDistribution[i];
-		}
-		
-		stdev /= totalCount-1;
-		
-		stdev = Math.sqrt(stdev);
-		
-		NormalDistribution nd = new NormalDistribution(mode, stdev);
-		
-		deviationPercent = 0;
-		
-		for (int i=0;i<theoreticalDistribution.length;i++) {
-			double probability = nd.getZScoreForValue(i);
-			theoreticalDistribution[i] = probability*totalCount;
-			
-			if (theoreticalDistribution[i] > max) {
-				max = theoreticalDistribution[i];
-			}
-			
-			deviationPercent += Math.abs(theoreticalDistribution[i]-gcDistribution[i]);
-		}
-		
-		deviationPercent /= totalCount;
-		deviationPercent *= 100;
-		
-//		System.out.println("Percentage deviation from normality is "+deviationPercent);
-		
-		
-		calculated = true;
-	}
-
-	public void processSequence(Sequence sequence) {
-		
-		// Because we keep a model around for every possible sequence length we
-		// encounter we need to reduce the number of models.  We can do this by
-		// rounding off the sequence once we get above a certain size
-		
-		char [] seq = truncateSequence(sequence);
-		
-		if (seq.length == 0) return; // Ignore empty sequences
-		
-		
-		int thisSeqGCCount = 0;
-		for (int i=0;i<seq.length;i++) {
-			if (seq[i] == 'G' || seq[i] == 'C') {
-				++thisSeqGCCount;
-			}
-		}
-
-		if (seq.length >= cachedModels.length) {
-			// We need to extend the length of cached models
-			
-			GCModel [] longerModels = new GCModel[seq.length+1];
-			for (int i=0;i<cachedModels.length;i++) {
-				longerModels[i] = cachedModels[i];
-			}
-			
-			cachedModels = longerModels;
-		}
-		
-		if (cachedModels[seq.length] == null) {
-			cachedModels[seq.length] = new GCModel(seq.length);
-		}
-
-		GCModelValue [] values = cachedModels[seq.length].getModelValues(thisSeqGCCount);
-
-		for (int i=0;i<values.length;i++) {
-			gcDistribution[values[i].percentage()] += values[i].increment();
-		}
-		
-	}
-	
-	private char [] truncateSequence (Sequence sequence) {
-		
-		String seq = sequence.getSequence();
-		
-		// TODO: We should return a random chunk of sequence, rather
-		// than the start.
-		
-		if (seq.length() > 1000) {
-			int length = (seq.length()/1000)*1000;
-			return seq.substring(0, length).toCharArray();
-		}
-		if (seq.length() > 100) {
-			int length = (seq.length()/100)*100;
-			return seq.substring(0, length).toCharArray();
-		}
-
-		return seq.toCharArray();		
-		
-	}
-	
-	public void reset () {
-		gcDistribution = new double[101];
-	}
-
-	public String description() {
-		return "Shows the distribution of GC contents for whole sequences";
-	}
-
-	public String name() {
-		return "Per sequence GC content";
-	}
-
-	public boolean raisesError() {
-		if (!calculated) calculateDistribution();
-
-		return deviationPercent > ModuleConfig.getParam("gc_sequence", "error");
-	}
-
-	public boolean raisesWarning() {
-		if (!calculated) calculateDistribution();
-
-		return deviationPercent > ModuleConfig.getParam("gc_sequence", "warn");
-	}
-
-	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
-		
-		writeDefaultImage(report, "per_sequence_gc_content.png", "Per sequence GC content graph", 800, 600);
-				
-		StringBuffer sb = report.dataDocument();
-		sb.append("#GC Content\tCount\n");
-		for (int i=0;i<xCategories.length;i++) {
-			sb.append(xCategories[i]);
-			sb.append("\t");
-			sb.append(gcDistribution[i]);
-			sb.append("\n");
-		}
-	}
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+import java.io.IOException;
+
+import javax.swing.JPanel;
+import javax.xml.stream.XMLStreamException;
+
+import uk.ac.babraham.FastQC.Graphs.LineGraph;
+import uk.ac.babraham.FastQC.Modules.GCModel.GCModel;
+import uk.ac.babraham.FastQC.Modules.GCModel.GCModelValue;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+import uk.ac.babraham.FastQC.Statistics.NormalDistribution;
+
+public class PerSequenceGCContent extends AbstractQCModule {
+
+	private double [] gcDistribution = new double[101];
+	private double [] theoreticalDistribution  = new double[101];
+	private int [] xCategories = new int[0];
+	private double max = 0;
+	private double deviationPercent;
+	private boolean calculated = false;
+	
+	private GCModel [] cachedModels = new GCModel [200];
+	
+	public JPanel getResultsPanel() {
+	
+		if (!calculated) calculateDistribution();
+				
+		return new LineGraph(new double [][] {gcDistribution,theoreticalDistribution}, 0d, max, "Mean GC content (%)", new String [] {"GC count per read","Theoretical Distribution"}, xCategories, "GC distribution over all sequences");
+	}
+	
+	public boolean ignoreFilteredSequences() {
+		return true;
+	}
+	
+	public boolean ignoreInReport () {
+		if (ModuleConfig.getParam("gc_sequence", "ignore") > 0) {
+			return true;
+		}
+		return false;
+	}
+	
+	
+	private synchronized void calculateDistribution () {
+		max = 0;
+		xCategories = new int[gcDistribution.length];
+		double totalCount = 0;
+		
+		
+		// We use the mode to calculate the theoretical distribution
+		// so that we cope better with skewed distributions.
+		int firstMode = 0;
+		double modeCount = 0;
+		
+		for (int i=0;i<gcDistribution.length;i++) {
+			xCategories[i] = i;
+			totalCount += gcDistribution[i];
+			
+			if (gcDistribution[i] > modeCount) {
+				modeCount = gcDistribution[i];
+				firstMode = i;
+			}
+			if (gcDistribution[i] > max) max = gcDistribution[i];
+		}
+				
+		// The mode might not be a very good measure of the centre
+		// of the distribution either due to duplicated vales or
+		// several very similar values next to each other.  We therefore
+		// average over adjacent points which stay above 95% of the modal
+		// value
+
+		double mode = 0;
+		int modeDuplicates = 0;
+		
+		boolean fellOffTop = true;
+
+		for (int i=firstMode;i<gcDistribution.length;i++) {
+			if (gcDistribution[i] > gcDistribution[firstMode] - (gcDistribution[firstMode]/10)) {
+				mode += i;
+				modeDuplicates++;
+			}
+			else {
+				fellOffTop = false;
+				break;
+			}
+		}
+
+		boolean fellOffBottom = true;
+		
+		for (int i=firstMode-1;i>=0;i--) {
+			if (gcDistribution[i] > gcDistribution[firstMode] - (gcDistribution[firstMode]/10)) {
+				mode += i;
+				modeDuplicates++;
+			}
+			else {
+				fellOffBottom = false;
+				break;
+			}
+		}
+
+		if (fellOffBottom || fellOffTop) {
+			// If the distribution is so skewed that 95% of the mode
+			// is off the 0-100% scale then we keep the mode as the 
+			// centre of the model
+			mode = firstMode;
+		}
+		else {
+			mode /= modeDuplicates;
+		}
+		
+		
+		
+		// We can now work out a theoretical distribution
+		double stdev = 0;
+		
+		for (int i=0;i<gcDistribution.length;i++) {
+			stdev += Math.pow((i-mode),2) * gcDistribution[i];
+		}
+		
+		stdev /= totalCount-1;
+		
+		stdev = Math.sqrt(stdev);
+		
+		NormalDistribution nd = new NormalDistribution(mode, stdev);
+		
+		deviationPercent = 0;
+		
+		for (int i=0;i<theoreticalDistribution.length;i++) {
+			double probability = nd.getZScoreForValue(i);
+			theoreticalDistribution[i] = probability*totalCount;
+			
+			if (theoreticalDistribution[i] > max) {
+				max = theoreticalDistribution[i];
+			}
+			
+			deviationPercent += Math.abs(theoreticalDistribution[i]-gcDistribution[i]);
+		}
+		
+		deviationPercent /= totalCount;
+		deviationPercent *= 100;
+		
+//		System.out.println("Percentage deviation from normality is "+deviationPercent);
+		
+		
+		calculated = true;
+	}
+
+	public void processSequence(Sequence sequence) {
+		
+		// Because we keep a model around for every possible sequence length we
+		// encounter we need to reduce the number of models.  We can do this by
+		// rounding off the sequence once we get above a certain size
+		
+		char [] seq = truncateSequence(sequence);
+		
+		if (seq.length == 0) return; // Ignore empty sequences
+		
+		
+		int thisSeqGCCount = 0;
+		for (int i=0;i<seq.length;i++) {
+			if (seq[i] == 'G' || seq[i] == 'C') {
+				++thisSeqGCCount;
+			}
+		}
+
+		if (seq.length >= cachedModels.length) {
+			// We need to extend the length of cached models
+			
+			GCModel [] longerModels = new GCModel[seq.length+1];
+			for (int i=0;i<cachedModels.length;i++) {
+				longerModels[i] = cachedModels[i];
+			}
+			
+			cachedModels = longerModels;
+		}
+		
+		if (cachedModels[seq.length] == null) {
+			cachedModels[seq.length] = new GCModel(seq.length);
+		}
+
+		GCModelValue [] values = cachedModels[seq.length].getModelValues(thisSeqGCCount);
+
+		for (int i=0;i<values.length;i++) {
+			gcDistribution[values[i].percentage()] += values[i].increment();
+		}
+		
+	}
+	
+	private char [] truncateSequence (Sequence sequence) {
+		
+		String seq = sequence.getSequence();
+		
+		// TODO: We should return a random chunk of sequence, rather
+		// than the start.
+		
+		if (seq.length() > 1000) {
+			int length = (seq.length()/1000)*1000;
+			return seq.substring(0, length).toCharArray();
+		}
+		if (seq.length() > 100) {
+			int length = (seq.length()/100)*100;
+			return seq.substring(0, length).toCharArray();
+		}
+
+		return seq.toCharArray();		
+		
+	}
+	
+	public void reset () {
+		gcDistribution = new double[101];
+	}
+
+	public String description() {
+		return "Shows the distribution of GC contents for whole sequences";
+	}
+
+	public String name() {
+		return "Per sequence GC content";
+	}
+
+	public boolean raisesError() {
+		if (!calculated) calculateDistribution();
+
+		return deviationPercent > ModuleConfig.getParam("gc_sequence", "error");
+	}
+
+	public boolean raisesWarning() {
+		if (!calculated) calculateDistribution();
+
+		return deviationPercent > ModuleConfig.getParam("gc_sequence", "warn");
+	}
+
+	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
+		
+		writeDefaultImage(report, "per_sequence_gc_content.png", "Per sequence GC content graph", 800, 600);
+				
+		StringBuffer sb = report.dataDocument();
+		sb.append("#GC Content\tCount\n");
+		for (int i=0;i<xCategories.length;i++) {
+			sb.append(xCategories[i]);
+			sb.append("\t");
+			sb.append(gcDistribution[i]);
+			sb.append("\n");
+		}
+	}
+}
diff --git a/uk/ac/babraham/FastQC/Modules/PerSequenceQualityScores.java b/uk/ac/babraham/FastQC/Modules/PerSequenceQualityScores.java
index 30c19c5..69f8581 100644
--- a/uk/ac/babraham/FastQC/Modules/PerSequenceQualityScores.java
+++ b/uk/ac/babraham/FastQC/Modules/PerSequenceQualityScores.java
@@ -1,166 +1,166 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.HashMap;
-
-import javax.swing.JPanel;
-import javax.xml.stream.XMLStreamException;
-
-import uk.ac.babraham.FastQC.Graphs.LineGraph;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-import uk.ac.babraham.FastQC.Sequence.QualityEncoding.PhredEncoding;
-
-public class PerSequenceQualityScores extends AbstractQCModule {
-
-	private HashMap<Integer, Long> averageScoreCounts = new HashMap<Integer, Long>();
-	private double [] qualityDistribution = null;
-	private int [] xCategories = new int[0];
-	private char lowestChar = 126;
-	private int maxCount = 0;
-	private int mostFrequentScore;
-	private boolean calculated = false;
-	
-	public JPanel getResultsPanel() {
-	
-		if (!calculated) calculateDistribution();
-				
-		return new LineGraph(new double [][] {qualityDistribution}, 0d, maxCount, "Mean Sequence Quality (Phred Score)",new String [] {"Average Quality per read"}, xCategories, "Quality score distribution over all sequences");
-	}
-	
-	public boolean ignoreInReport () {
-		// We don't show this if they didn't have any quality data.
-		if (ModuleConfig.getParam("quality_sequence", "ignore") > 0  || averageScoreCounts.size() == 0) {
-			return true;
-		}
-		return false;
-	}
-	
-	private synchronized void calculateDistribution () {
-		
-		PhredEncoding encoding = PhredEncoding.getFastQEncodingOffset(lowestChar);
-		
-		Integer [] rawScores = averageScoreCounts.keySet().toArray(new Integer [0]);
-		Arrays.sort(rawScores);
-		
-		// We'll run from the lowest to the highest
-		qualityDistribution = new double [1+(rawScores[rawScores.length-1]-rawScores[0])] ;
-		
-		xCategories = new int[qualityDistribution.length];
-		
-		for (int i=0;i<qualityDistribution.length;i++) {
-			xCategories[i] = (rawScores[0]+i)-encoding.offset();
-			if (averageScoreCounts.containsKey(rawScores[0]+i)) {
-				qualityDistribution[i] = averageScoreCounts.get(rawScores[0]+i);
-			}
-		}
-
-		
-		for (int i=0;i<qualityDistribution.length;i++) {
-			if (qualityDistribution[i]>maxCount) {
-				maxCount = (int)qualityDistribution[i];
-				mostFrequentScore = xCategories[i];
-			}
-		}
-				
-		calculated = true;
-	}
-
-	public void processSequence(Sequence sequence) {
-				
-		char [] seq = sequence.getQualityString().toCharArray();
-		int averageQuality = 0;
-		
-		for (int i=0;i<seq.length;i++) {
-			if (seq[i] < lowestChar) {
-				lowestChar = seq[i];
-			}
-			averageQuality += seq[i];
-		}
-
-		if (seq.length > 0) {
-			averageQuality /= seq.length;
-					
-			if (averageScoreCounts.containsKey(averageQuality)) {
-				long currentCount = averageScoreCounts.get(averageQuality);
-				currentCount++;
-				averageScoreCounts.put(averageQuality, currentCount);
-			}
-			else {
-				averageScoreCounts.put(averageQuality, 1L);
-			}
-		}
-	}
-	
-	public void reset () {
-		averageScoreCounts.clear();
-		lowestChar = 126;
-		maxCount = 0;
-		calculated = false;
-	}
-
-	public String description() {
-		return "Shows the distribution of average quality scores for whole sequences";
-	}
-
-	public String name() {
-		return "Per sequence quality scores";
-	}
-
-	public boolean raisesError() {
-		if (!calculated) calculateDistribution();
-
-		if (mostFrequentScore <= ModuleConfig.getParam("quality_sequence", "error")) return true;
-		
-		return false;
-	}
-
-	public boolean raisesWarning() {
-		if (!calculated) calculateDistribution();
-
-		if (mostFrequentScore <= ModuleConfig.getParam("quality_sequence", "warn")) return true;
-		
-		return false;
-	}
-
-	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
-		if (!calculated) calculateDistribution();
-		
-		writeDefaultImage(report, "per_sequence_quality.png", "Per Sequence quality graph", 800, 600);
-
-		StringBuffer sb = report.dataDocument();
-		sb.append("#Quality\tCount\n");
-		for (int i=0;i<xCategories.length;i++) {
-			sb.append(xCategories[i]);
-			sb.append("\t");
-			sb.append(qualityDistribution[i]);
-			sb.append("\n");
-		}
-	}
-
-
-	public boolean ignoreFilteredSequences() {
-		return true;
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+
+import javax.swing.JPanel;
+import javax.xml.stream.XMLStreamException;
+
+import uk.ac.babraham.FastQC.Graphs.LineGraph;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+import uk.ac.babraham.FastQC.Sequence.QualityEncoding.PhredEncoding;
+
+public class PerSequenceQualityScores extends AbstractQCModule {
+
+	private HashMap<Integer, Long> averageScoreCounts = new HashMap<Integer, Long>();
+	private double [] qualityDistribution = null;
+	private int [] xCategories = new int[0];
+	private char lowestChar = 126;
+	private int maxCount = 0;
+	private int mostFrequentScore;
+	private boolean calculated = false;
+	
+	public JPanel getResultsPanel() {
+	
+		if (!calculated) calculateDistribution();
+				
+		return new LineGraph(new double [][] {qualityDistribution}, 0d, maxCount, "Mean Sequence Quality (Phred Score)",new String [] {"Average Quality per read"}, xCategories, "Quality score distribution over all sequences");
+	}
+	
+	public boolean ignoreInReport () {
+		// We don't show this if they didn't have any quality data.
+		if (ModuleConfig.getParam("quality_sequence", "ignore") > 0  || averageScoreCounts.size() == 0) {
+			return true;
+		}
+		return false;
+	}
+	
+	private synchronized void calculateDistribution () {
+		
+		PhredEncoding encoding = PhredEncoding.getFastQEncodingOffset(lowestChar);
+		
+		Integer [] rawScores = averageScoreCounts.keySet().toArray(new Integer [0]);
+		Arrays.sort(rawScores);
+		
+		// We'll run from the lowest to the highest
+		qualityDistribution = new double [1+(rawScores[rawScores.length-1]-rawScores[0])] ;
+		
+		xCategories = new int[qualityDistribution.length];
+		
+		for (int i=0;i<qualityDistribution.length;i++) {
+			xCategories[i] = (rawScores[0]+i)-encoding.offset();
+			if (averageScoreCounts.containsKey(rawScores[0]+i)) {
+				qualityDistribution[i] = averageScoreCounts.get(rawScores[0]+i);
+			}
+		}
+
+		
+		for (int i=0;i<qualityDistribution.length;i++) {
+			if (qualityDistribution[i]>maxCount) {
+				maxCount = (int)qualityDistribution[i];
+				mostFrequentScore = xCategories[i];
+			}
+		}
+				
+		calculated = true;
+	}
+
+	public void processSequence(Sequence sequence) {
+				
+		char [] seq = sequence.getQualityString().toCharArray();
+		int averageQuality = 0;
+		
+		for (int i=0;i<seq.length;i++) {
+			if (seq[i] < lowestChar) {
+				lowestChar = seq[i];
+			}
+			averageQuality += seq[i];
+		}
+
+		if (seq.length > 0) {
+			averageQuality /= seq.length;
+					
+			if (averageScoreCounts.containsKey(averageQuality)) {
+				long currentCount = averageScoreCounts.get(averageQuality);
+				currentCount++;
+				averageScoreCounts.put(averageQuality, currentCount);
+			}
+			else {
+				averageScoreCounts.put(averageQuality, 1L);
+			}
+		}
+	}
+	
+	public void reset () {
+		averageScoreCounts.clear();
+		lowestChar = 126;
+		maxCount = 0;
+		calculated = false;
+	}
+
+	public String description() {
+		return "Shows the distribution of average quality scores for whole sequences";
+	}
+
+	public String name() {
+		return "Per sequence quality scores";
+	}
+
+	public boolean raisesError() {
+		if (!calculated) calculateDistribution();
+
+		if (mostFrequentScore <= ModuleConfig.getParam("quality_sequence", "error")) return true;
+		
+		return false;
+	}
+
+	public boolean raisesWarning() {
+		if (!calculated) calculateDistribution();
+
+		if (mostFrequentScore <= ModuleConfig.getParam("quality_sequence", "warn")) return true;
+		
+		return false;
+	}
+
+	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
+		if (!calculated) calculateDistribution();
+		
+		writeDefaultImage(report, "per_sequence_quality.png", "Per Sequence quality graph", 800, 600);
+
+		StringBuffer sb = report.dataDocument();
+		sb.append("#Quality\tCount\n");
+		for (int i=0;i<xCategories.length;i++) {
+			sb.append(xCategories[i]);
+			sb.append("\t");
+			sb.append(qualityDistribution[i]);
+			sb.append("\n");
+		}
+	}
+
+
+	public boolean ignoreFilteredSequences() {
+		return true;
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Modules/PerTileQualityScores.java b/uk/ac/babraham/FastQC/Modules/PerTileQualityScores.java
index 18f6f58..f43e008 100644
--- a/uk/ac/babraham/FastQC/Modules/PerTileQualityScores.java
+++ b/uk/ac/babraham/FastQC/Modules/PerTileQualityScores.java
@@ -1,359 +1,359 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import javax.swing.JPanel;
-import javax.xml.stream.XMLStreamException;
-
-import uk.ac.babraham.FastQC.Graphs.BaseGroup;
-import uk.ac.babraham.FastQC.Graphs.TileGraph;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-import uk.ac.babraham.FastQC.Sequence.QualityEncoding.PhredEncoding;
-import uk.ac.babraham.FastQC.Utilities.QualityCount;
-
-public class PerTileQualityScores extends AbstractQCModule {
-
-
-	public HashMap<Integer, QualityCount []> perTileQualityCounts = new HashMap<Integer, QualityCount[]>();
-	private int currentLength = 0;
-	private double [][] means = null;
-	private String [] xLabels;
-	private int [] tiles;
-	private int high = 0;
-	PhredEncoding encodingScheme;
-	private boolean calculated = false;
-	
-	private long totalCount = 0;
-	
-	private int splitPosition = -1;
-	
-	private double maxDeviation = 0;
-
-	private boolean ignoreInReport = false;
-
-	public JPanel getResultsPanel() {
-
-		if (!calculated) getPercentages();
-
-		return new TileGraph(xLabels, tiles, means);
-
-	}
-
-	public boolean ignoreFilteredSequences() {
-		return true;
-	}
-
-	public boolean ignoreInReport () {
-		if (ignoreInReport || ModuleConfig.getParam("tile", "ignore") > 0  || currentLength == 0) {
-			return true;
-		}
-		return false;
-	}
-
-	private synchronized void getPercentages () {
-
-		char [] range = calculateOffsets();
-		encodingScheme = PhredEncoding.getFastQEncodingOffset(range[0]);
-		high = range[1] - encodingScheme.offset();
-		if (high < 35) {
-			high = 35;
-		}
-
-		BaseGroup [] groups = BaseGroup.makeBaseGroups(currentLength);
-
-		Integer [] tileNumbers = perTileQualityCounts.keySet().toArray(new Integer[0]);
-		
-		Arrays.sort(tileNumbers);
-		
-		tiles = new int[tileNumbers.length];
-		for (int i=0;i<tiles.length;i++) {
-			tiles[i] = tileNumbers[i];
-		}
-		
-		means = new double[tileNumbers.length][groups.length];
-		xLabels = new String[groups.length];
-
-		for (int t=0;t<tileNumbers.length;t++){
-			for (int i=0;i<groups.length;i++) {
-				if (t==0)
-					xLabels[i] = groups[i].toString();
-
-				int minBase = groups[i].lowerCount();
-				int maxBase = groups[i].upperCount();
-				means[t][i] = getMean(tileNumbers[t],minBase,maxBase,encodingScheme.offset());
-			}
-		}
-		
-		// Now we normalise across each column to see if there are any tiles with unusually
-		// high or low quality.
-		
-		double maxDeviation = 0;
-		
-		double [] averageQualitiesPerGroup = new double[groups.length];
-		
-		for (int t=0;t<tileNumbers.length;t++) {		
-			for (int i=0;i<groups.length;i++) {
-				averageQualitiesPerGroup[i] += means[t][i];
-			}
-		}
-		
-		for (int i=0;i<averageQualitiesPerGroup.length;i++) {
-			averageQualitiesPerGroup[i] /= tileNumbers.length;
-		}
-
-		for (int i=0;i<groups.length;i++) {
-			for (int t=0;t<tileNumbers.length;t++) {
-				means[t][i] -= averageQualitiesPerGroup[i];
-				if (Math.abs(means[t][i])> maxDeviation) {
-					maxDeviation = Math.abs(means[t][i]);
-				}
-			}
-		}
-		
-		this.maxDeviation = maxDeviation;
-
-		calculated = true;
-
-	}
-
-	private char [] calculateOffsets () {
-		// Works out from the set of chars what is the most
-		// likely encoding scale for this file.
-
-		char minChar = 0;
-		char maxChar = 0;
-
-		// Use the data from the first tile
-		QualityCount [] qualityCounts = perTileQualityCounts.get(perTileQualityCounts.keySet().toArray()[0]);
-
-		for (int q=0;q<qualityCounts.length;q++) {
-			if (q == 0) {
-				minChar = qualityCounts[q].getMinChar();
-				maxChar = qualityCounts[q].getMaxChar();
-			}
-			else {
-				if (qualityCounts[q].getMinChar() < minChar) {
-					minChar = qualityCounts[q].getMinChar();
-				}
-				if (qualityCounts[q].getMaxChar() > maxChar) {
-					maxChar = qualityCounts[q].getMaxChar();
-				}
-			}
-		}
-
-		return new char[] {minChar,maxChar};
-	}
-
-	public void processSequence(Sequence sequence) {
-
-		// Check if we can skip counting because the module is being ignored anyway
-		if (totalCount == 0) {
-			if (ModuleConfig.getParam("tile", "ignore") > 0) {
-				ignoreInReport = true;
-			}
-		}
-
-		
-		// Don't waste time calculating this if we're not going to use it anyway
-		if (ignoreInReport) return;
-				
-		calculated = false;
-
-		// Try to find the tile id.  This can come in one of two forms:
-		//		@HWI-1KL136:211:D1LGAACXX:1:1101:18518:48851 3:N:0:ATGTCA
-		//                                ^
-		//		@HWUSI-EAS493_0001:2:1:1000:16900#0/1
-		//                         ^
-
-		// These would appear at sections 2 or 3 of an array split on :
-
-		// This module does quite a lot of work and ends up being the limiting
-		// step when calculating.  We'll therefore take only a sample of the 
-		// sequences to try to get a representative selection.
-		
-		++totalCount;
-		if (totalCount % 10 != 0) return;
-		
-		// First try to split the id by :
-		int tile = 0;
-		
-		String [] splitID = sequence.getID().split(":");
-
-
-		// If there are 7 or more fields then it's a 1.8+ file
-		try {
-
-			if (splitPosition >=0) {
-				tile = Integer.parseInt(splitID[splitPosition]);
-			}
-			
-			else if (splitID.length>=7) {
-				splitPosition = 4;
-				tile = Integer.parseInt(splitID[4]);
-			}
-			else if (splitID.length >=5) {
-				splitPosition = 2;
-				// We can try the older format
-				tile = Integer.parseInt(splitID[2]);
-			}
-			else {
-				// We're not going to get a tile out of this
-				ignoreInReport = true;
-				return;
-			}
-			
-			
-		}
-		catch (NumberFormatException nfe) {
-			// This doesn't conform
-			ignoreInReport = true;
-			return;
-		}
-
-
-		char [] qual = sequence.getQualityString().toCharArray();
-		if (currentLength < qual.length) {
-
-			Iterator<Integer> tiles = perTileQualityCounts.keySet().iterator();
-			while (tiles.hasNext()) {
-				int thisTile = tiles.next();
-
-				QualityCount [] qualityCounts = perTileQualityCounts.get(thisTile);
-				QualityCount [] qualityCountsNew = new QualityCount[qual.length];
-
-				for (int i=0;i<qualityCounts.length;i++) {
-					qualityCountsNew[i] = qualityCounts[i];
-				}
-				for (int i=qualityCounts.length;i<qualityCountsNew.length;i++) {
-					qualityCountsNew[i] = new QualityCount();				
-				}
-				perTileQualityCounts.put(thisTile, qualityCountsNew);
-			}
-
-			currentLength = qual.length;
-
-		}
-
-		if (! perTileQualityCounts.containsKey(tile)) {
-			
-			if (perTileQualityCounts.size() > 500) {
-				// There are too many tiles, so we're probably parsing this wrong.
-				// Let's give up
-				System.err.println("Too many tiles (>500) so giving up trying to do per-tile qualities since we're probably parsing the file wrongly");
-				ignoreInReport = true;
-				perTileQualityCounts.clear();
-				return;
-			}
-			
-			QualityCount [] qualityCounts = new QualityCount[currentLength];
-			for (int i=0;i<currentLength;i++) {
-				qualityCounts[i] = new QualityCount();
-			}
-
-			perTileQualityCounts.put(tile, qualityCounts);
-		}
-
-		QualityCount [] qualityCounts = perTileQualityCounts.get(tile);
-
-		for (int i=0;i<qual.length;i++) {
-			qualityCounts[i].addValue(qual[i]);
-		}
-
-	}
-
-	public void reset () {
-		totalCount = 0;
-		perTileQualityCounts = new HashMap<Integer, QualityCount[]>();
-	}
-
-	public String description() {
-		return "Shows the perl tile Quality scores of all bases at a given position in a sequencing run";
-	}
-
-	public String name() {
-		return "Per tile sequence quality";
-	}
-
-	public boolean raisesError() {
-		if (!calculated) getPercentages();
-
-		if (maxDeviation > ModuleConfig.getParam("tile", "error")) return true;
-		return false;
-	}
-
-	public boolean raisesWarning() {
-		if (!calculated) getPercentages();
-		
-		if (maxDeviation > ModuleConfig.getParam("tile", "warn")) return true;
-		return false;
-	}
-
-	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
-		if (!calculated) getPercentages();
-		
-		writeDefaultImage(report, "per_tile_quality.png", "Per base quality graph", Math.max(800, xLabels.length*15), 600);
-
-		StringBuffer sb = report.dataDocument();
-		sb.append("#Tile\tBase\tMean\n");
-
-		for (int t=0;t<tiles.length;t++) {
-			for (int i=0;i<means[t].length;i++) {
-
-				sb.append(tiles[t]);
-				sb.append("\t");
-
-				sb.append(xLabels[i]);
-				sb.append("\t");
-
-				sb.append(means[t][i]);
-
-				sb.append("\n");
-			}
-		}
-	}
-
-	private double getMean (int tile, int minbp, int maxbp, int offset) {
-		int count = 0;
-		double total = 0;
-
-		QualityCount [] qualityCounts = perTileQualityCounts.get(tile);
-
-		for (int i=minbp-1;i<maxbp;i++) {
-			if (qualityCounts[i].getTotalCount() > 0) {
-				count++;
-				total += qualityCounts[i].getMean(offset);
-			}
-		}
-
-		if (count > 0) {
-			return total/count;
-		}
-		return 0;
-
-	}
-
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import javax.swing.JPanel;
+import javax.xml.stream.XMLStreamException;
+
+import uk.ac.babraham.FastQC.Graphs.BaseGroup;
+import uk.ac.babraham.FastQC.Graphs.TileGraph;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+import uk.ac.babraham.FastQC.Sequence.QualityEncoding.PhredEncoding;
+import uk.ac.babraham.FastQC.Utilities.QualityCount;
+
+public class PerTileQualityScores extends AbstractQCModule {
+
+
+	public HashMap<Integer, QualityCount []> perTileQualityCounts = new HashMap<Integer, QualityCount[]>();
+	private int currentLength = 0;
+	private double [][] means = null;
+	private String [] xLabels;
+	private int [] tiles;
+	private int high = 0;
+	PhredEncoding encodingScheme;
+	private boolean calculated = false;
+	
+	private long totalCount = 0;
+	
+	private int splitPosition = -1;
+	
+	private double maxDeviation = 0;
+
+	private boolean ignoreInReport = false;
+
+	public JPanel getResultsPanel() {
+
+		if (!calculated) getPercentages();
+
+		return new TileGraph(xLabels, tiles, means);
+
+	}
+
+	public boolean ignoreFilteredSequences() {
+		return true;
+	}
+
+	public boolean ignoreInReport () {
+		if (ignoreInReport || ModuleConfig.getParam("tile", "ignore") > 0  || currentLength == 0) {
+			return true;
+		}
+		return false;
+	}
+
+	private synchronized void getPercentages () {
+
+		char [] range = calculateOffsets();
+		encodingScheme = PhredEncoding.getFastQEncodingOffset(range[0]);
+		high = range[1] - encodingScheme.offset();
+		if (high < 35) {
+			high = 35;
+		}
+
+		BaseGroup [] groups = BaseGroup.makeBaseGroups(currentLength);
+
+		Integer [] tileNumbers = perTileQualityCounts.keySet().toArray(new Integer[0]);
+		
+		Arrays.sort(tileNumbers);
+		
+		tiles = new int[tileNumbers.length];
+		for (int i=0;i<tiles.length;i++) {
+			tiles[i] = tileNumbers[i];
+		}
+		
+		means = new double[tileNumbers.length][groups.length];
+		xLabels = new String[groups.length];
+
+		for (int t=0;t<tileNumbers.length;t++){
+			for (int i=0;i<groups.length;i++) {
+				if (t==0)
+					xLabels[i] = groups[i].toString();
+
+				int minBase = groups[i].lowerCount();
+				int maxBase = groups[i].upperCount();
+				means[t][i] = getMean(tileNumbers[t],minBase,maxBase,encodingScheme.offset());
+			}
+		}
+		
+		// Now we normalise across each column to see if there are any tiles with unusually
+		// high or low quality.
+		
+		double maxDeviation = 0;
+		
+		double [] averageQualitiesPerGroup = new double[groups.length];
+		
+		for (int t=0;t<tileNumbers.length;t++) {		
+			for (int i=0;i<groups.length;i++) {
+				averageQualitiesPerGroup[i] += means[t][i];
+			}
+		}
+		
+		for (int i=0;i<averageQualitiesPerGroup.length;i++) {
+			averageQualitiesPerGroup[i] /= tileNumbers.length;
+		}
+
+		for (int i=0;i<groups.length;i++) {
+			for (int t=0;t<tileNumbers.length;t++) {
+				means[t][i] -= averageQualitiesPerGroup[i];
+				if (Math.abs(means[t][i])> maxDeviation) {
+					maxDeviation = Math.abs(means[t][i]);
+				}
+			}
+		}
+		
+		this.maxDeviation = maxDeviation;
+
+		calculated = true;
+
+	}
+
+	private char [] calculateOffsets () {
+		// Works out from the set of chars what is the most
+		// likely encoding scale for this file.
+
+		char minChar = 0;
+		char maxChar = 0;
+
+		// Use the data from the first tile
+		QualityCount [] qualityCounts = perTileQualityCounts.get(perTileQualityCounts.keySet().toArray()[0]);
+
+		for (int q=0;q<qualityCounts.length;q++) {
+			if (q == 0) {
+				minChar = qualityCounts[q].getMinChar();
+				maxChar = qualityCounts[q].getMaxChar();
+			}
+			else {
+				if (qualityCounts[q].getMinChar() < minChar) {
+					minChar = qualityCounts[q].getMinChar();
+				}
+				if (qualityCounts[q].getMaxChar() > maxChar) {
+					maxChar = qualityCounts[q].getMaxChar();
+				}
+			}
+		}
+
+		return new char[] {minChar,maxChar};
+	}
+
+	public void processSequence(Sequence sequence) {
+
+		// Check if we can skip counting because the module is being ignored anyway
+		if (totalCount == 0) {
+			if (ModuleConfig.getParam("tile", "ignore") > 0) {
+				ignoreInReport = true;
+			}
+		}
+
+		
+		// Don't waste time calculating this if we're not going to use it anyway
+		if (ignoreInReport) return;
+				
+		calculated = false;
+
+		// Try to find the tile id.  This can come in one of two forms:
+		//		@HWI-1KL136:211:D1LGAACXX:1:1101:18518:48851 3:N:0:ATGTCA
+		//                                ^
+		//		@HWUSI-EAS493_0001:2:1:1000:16900#0/1
+		//                         ^
+
+		// These would appear at sections 2 or 3 of an array split on :
+
+		// This module does quite a lot of work and ends up being the limiting
+		// step when calculating.  We'll therefore take only a sample of the 
+		// sequences to try to get a representative selection.
+		
+		++totalCount;
+		if (totalCount % 10 != 0) return;
+		
+		// First try to split the id by :
+		int tile = 0;
+		
+		String [] splitID = sequence.getID().split(":");
+
+
+		// If there are 7 or more fields then it's a 1.8+ file
+		try {
+
+			if (splitPosition >=0) {
+				tile = Integer.parseInt(splitID[splitPosition]);
+			}
+			
+			else if (splitID.length>=7) {
+				splitPosition = 4;
+				tile = Integer.parseInt(splitID[4]);
+			}
+			else if (splitID.length >=5) {
+				splitPosition = 2;
+				// We can try the older format
+				tile = Integer.parseInt(splitID[2]);
+			}
+			else {
+				// We're not going to get a tile out of this
+				ignoreInReport = true;
+				return;
+			}
+			
+			
+		}
+		catch (NumberFormatException nfe) {
+			// This doesn't conform
+			ignoreInReport = true;
+			return;
+		}
+
+
+		char [] qual = sequence.getQualityString().toCharArray();
+		if (currentLength < qual.length) {
+
+			Iterator<Integer> tiles = perTileQualityCounts.keySet().iterator();
+			while (tiles.hasNext()) {
+				int thisTile = tiles.next();
+
+				QualityCount [] qualityCounts = perTileQualityCounts.get(thisTile);
+				QualityCount [] qualityCountsNew = new QualityCount[qual.length];
+
+				for (int i=0;i<qualityCounts.length;i++) {
+					qualityCountsNew[i] = qualityCounts[i];
+				}
+				for (int i=qualityCounts.length;i<qualityCountsNew.length;i++) {
+					qualityCountsNew[i] = new QualityCount();				
+				}
+				perTileQualityCounts.put(thisTile, qualityCountsNew);
+			}
+
+			currentLength = qual.length;
+
+		}
+
+		if (! perTileQualityCounts.containsKey(tile)) {
+			
+			if (perTileQualityCounts.size() > 500) {
+				// There are too many tiles, so we're probably parsing this wrong.
+				// Let's give up
+				System.err.println("Too many tiles (>500) so giving up trying to do per-tile qualities since we're probably parsing the file wrongly");
+				ignoreInReport = true;
+				perTileQualityCounts.clear();
+				return;
+			}
+			
+			QualityCount [] qualityCounts = new QualityCount[currentLength];
+			for (int i=0;i<currentLength;i++) {
+				qualityCounts[i] = new QualityCount();
+			}
+
+			perTileQualityCounts.put(tile, qualityCounts);
+		}
+
+		QualityCount [] qualityCounts = perTileQualityCounts.get(tile);
+
+		for (int i=0;i<qual.length;i++) {
+			qualityCounts[i].addValue(qual[i]);
+		}
+
+	}
+
+	public void reset () {
+		totalCount = 0;
+		perTileQualityCounts = new HashMap<Integer, QualityCount[]>();
+	}
+
+	public String description() {
+		return "Shows the perl tile Quality scores of all bases at a given position in a sequencing run";
+	}
+
+	public String name() {
+		return "Per tile sequence quality";
+	}
+
+	public boolean raisesError() {
+		if (!calculated) getPercentages();
+
+		if (maxDeviation > ModuleConfig.getParam("tile", "error")) return true;
+		return false;
+	}
+
+	public boolean raisesWarning() {
+		if (!calculated) getPercentages();
+		
+		if (maxDeviation > ModuleConfig.getParam("tile", "warn")) return true;
+		return false;
+	}
+
+	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
+		if (!calculated) getPercentages();
+		
+		writeDefaultImage(report, "per_tile_quality.png", "Per base quality graph", Math.max(800, xLabels.length*15), 600);
+
+		StringBuffer sb = report.dataDocument();
+		sb.append("#Tile\tBase\tMean\n");
+
+		for (int t=0;t<tiles.length;t++) {
+			for (int i=0;i<means[t].length;i++) {
+
+				sb.append(tiles[t]);
+				sb.append("\t");
+
+				sb.append(xLabels[i]);
+				sb.append("\t");
+
+				sb.append(means[t][i]);
+
+				sb.append("\n");
+			}
+		}
+	}
+
+	private double getMean (int tile, int minbp, int maxbp, int offset) {
+		int count = 0;
+		double total = 0;
+
+		QualityCount [] qualityCounts = perTileQualityCounts.get(tile);
+
+		for (int i=minbp-1;i<maxbp;i++) {
+			if (qualityCounts[i].getTotalCount() > 0) {
+				count++;
+				total += qualityCounts[i].getMean(offset);
+			}
+		}
+
+		if (count > 0) {
+			return total/count;
+		}
+		return 0;
+
+	}
+
+
+}
diff --git a/uk/ac/babraham/FastQC/Modules/QCModule.java b/uk/ac/babraham/FastQC/Modules/QCModule.java
index 68c9117..71c4018 100644
--- a/uk/ac/babraham/FastQC/Modules/QCModule.java
+++ b/uk/ac/babraham/FastQC/Modules/QCModule.java
@@ -1,59 +1,59 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-
-import java.io.IOException;
-
-import javax.swing.JPanel;
-import javax.xml.stream.XMLStreamException;
-
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-
-public interface QCModule {
-
-	public void processSequence(Sequence sequence);
-
-	public JPanel getResultsPanel();
-	
-	public String name ();
-	
-	public String description ();
-	
-	public void reset ();
-	
-	public boolean raisesError();
-	
-	public boolean raisesWarning();
-	
-	public boolean ignoreFilteredSequences();
-	
-	/**
-	 * Allows you to say that this module shouldn't be included in the final report.
-	 * Useful for modules which have a use under some circumstances but not others.
-	 * @return
-	 */
-	public boolean ignoreInReport();
-
-	public void makeReport(HTMLReportArchive report) throws XMLStreamException,IOException;
-	
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+
+import java.io.IOException;
+
+import javax.swing.JPanel;
+import javax.xml.stream.XMLStreamException;
+
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+
+public interface QCModule {
+
+	public void processSequence(Sequence sequence);
+
+	public JPanel getResultsPanel();
+	
+	public String name ();
+	
+	public String description ();
+	
+	public void reset ();
+	
+	public boolean raisesError();
+	
+	public boolean raisesWarning();
+	
+	public boolean ignoreFilteredSequences();
+	
+	/**
+	 * Allows you to say that this module shouldn't be included in the final report.
+	 * Useful for modules which have a use under some circumstances but not others.
+	 * @return
+	 */
+	public boolean ignoreInReport();
+
+	public void makeReport(HTMLReportArchive report) throws XMLStreamException,IOException;
+	
+	
+}
diff --git a/uk/ac/babraham/FastQC/Modules/SequenceLengthDistribution.java b/uk/ac/babraham/FastQC/Modules/SequenceLengthDistribution.java
index 11dfc99..c393210 100644
--- a/uk/ac/babraham/FastQC/Modules/SequenceLengthDistribution.java
+++ b/uk/ac/babraham/FastQC/Modules/SequenceLengthDistribution.java
@@ -1,240 +1,240 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Modules;
-
-import java.io.IOException;
-
-import javax.swing.JPanel;
-import javax.xml.stream.XMLStreamException;
-
-import uk.ac.babraham.FastQC.Graphs.LineGraph;
-import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
-import uk.ac.babraham.FastQC.Sequence.Sequence;
-
-public class SequenceLengthDistribution extends AbstractQCModule {
-
-	private long [] lengthCounts = new long[0];
-	private double [] graphCounts = null;
-	private String [] xCategories = new String[0];
-	private double max = 0;
-	private boolean calculated = false;
-	
-	public JPanel getResultsPanel() {
-	
-		if (!calculated) calculateDistribution();
-				
-		return new LineGraph(new double [][] {graphCounts}, 0d, max, "Sequence Length (bp)",new String [] {"Sequence Length"}, xCategories, "Distribution of sequence lengths over all sequences");
-	}
-	
-	public boolean ignoreFilteredSequences() {
-		return true;
-	}
-	
-	public boolean ignoreInReport () {
-		if (ModuleConfig.getParam("sequence_length", "ignore") > 0) {
-			return true;
-		}
-		return false;
-	}
-	
-	private synchronized void calculateDistribution () {
-		int maxLen = 0;
-		int minLen = -1;
-		max = 0;
-		
-		// Find the min and max lengths
-		for (int i=0;i<lengthCounts.length;i++) {
-			if (lengthCounts[i]>0) {
-				if (minLen < 0) {
-					minLen = i;
-				}
-				maxLen = i;
-			}
-		}		
-		
-		// We put one extra category either side of the actual size
-		if (minLen>0) minLen--;
-		maxLen++;
-		
-		int [] startAndInterval = getSizeDistribution(minLen, maxLen);
-				
-		// Work out how many categories we need
-		int categories = 0;
-		int currentValue = startAndInterval[0];
-		while (currentValue<= maxLen) {
-			++categories;
-			currentValue+= startAndInterval[1];
-		}
-		
-		graphCounts = new double[categories];
-		xCategories = new String[categories];
-		
-		for (int i=0;i<graphCounts.length;i++) {
-			
-			int minValue = startAndInterval[0]+(startAndInterval[1]*i);
-			int maxValue = (startAndInterval[0]+(startAndInterval[1]*(i+1)))-1;
-
-			if (maxValue > maxLen) {
-				maxValue = maxLen;
-			}
-			
-			for (int bp=minValue;bp<=maxValue;bp++) {
-				if (bp < lengthCounts.length) {
-					graphCounts[i] += lengthCounts[bp];
-				}
-			}
-
-			if (startAndInterval[1] == 1) {
-				xCategories[i] = ""+minValue;
-			}
-			else {
-				xCategories[i] = minValue+"-"+maxValue;
-			}
-			
-			if (graphCounts[i] > max) max = graphCounts[i];
-		}
-		calculated = true;
-	}
-
-	public void processSequence(Sequence sequence) {
-		int seqLen = sequence.getSequence().length();
-
-		if (seqLen+2 > lengthCounts.length) {
-			long [] newLengthCounts = new long[seqLen+2];
-			for (int i=0;i<lengthCounts.length;i++) {
-				newLengthCounts[i] = lengthCounts[i];
-			}
-			lengthCounts = newLengthCounts;
-		}
-		
-		++lengthCounts[seqLen];
-		
-	}
-	
-	private int [] getSizeDistribution (int min, int max) {
-		
-		int base = 1;
-		
-		while (base > (max-min)) {
-			base /= 10;
-		}
-				
-		int interval;
-		int starting;
-
-		int [] divisions = new int [] {1,2,5};
-		
-		OUTER: while (true) {
-			
-			for (int d=0;d<divisions.length;d++) {
-				int tester = base * divisions[d];
-				if (((max-min) / tester) <= 50) {
-					interval = tester;
-					break OUTER;
-				}
-			}
-		
-			base *=10;
-			
-		}
-		
-		// Now we work out the first value to be plotted
-		int basicDivision = (int)(min/interval);
-				
-		int testStart = basicDivision * interval;
-				
-		starting = testStart;
-		
-		return new int[] {starting,interval};
-		
-	}
-	
-	
-	
-	public void reset () {
-		lengthCounts = new long[0];
-	}
-
-	public String description() {
-		return "Shows the distribution of sequence length over all sequences";
-	}
-
-	public String name() {
-		return "Sequence Length Distribution";
-	}
-
-	public boolean raisesError() {
-		if (!calculated) calculateDistribution();
-		
-		// See if they've turned this test off
-		if (ModuleConfig.getParam("sequence_length", "error") == 0) {
-			return false;
-		}
-
-
-		if (lengthCounts[0] > 0) {
-			return true;
-		}
-		return false;
-	}
-
-	public boolean raisesWarning() {
-		if (!calculated) calculateDistribution();
-
-		// See if they've turned this test off
-		if (ModuleConfig.getParam("sequence_length", "warn") == 0) {
-			return false;
-		}
-		
-		// Warn if they're not all the same length
-		boolean seenLength = false;
-		for (int i=0;i<lengthCounts.length;i++) {
-			if (lengthCounts[i] > 0) {
-				if (seenLength) {
-					return true;
-				}
-				else {
-					seenLength = true;
-				}
-			}
-		}
-		return false;
-	}
-
-	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
-		if (!calculated) calculateDistribution();
-
-		writeDefaultImage(report, "sequence_length_distribution.png", "Sequence length distribution", 800, 600);
-		
-		StringBuffer sb = report.dataDocument();
-		sb.append("#Length\tCount\n");
-		for (int i=0;i<xCategories.length;i++) {
-			// Remove any padding we added to make the graph look better
-			if ((i==0 || i== xCategories.length-1) && graphCounts[i] == 0) {
-				continue;
-			}
-			sb.append(xCategories[i]);
-			sb.append("\t");
-			sb.append(graphCounts[i]);
-			sb.append("\n");
-		}
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Modules;
+
+import java.io.IOException;
+
+import javax.swing.JPanel;
+import javax.xml.stream.XMLStreamException;
+
+import uk.ac.babraham.FastQC.Graphs.LineGraph;
+import uk.ac.babraham.FastQC.Report.HTMLReportArchive;
+import uk.ac.babraham.FastQC.Sequence.Sequence;
+
+public class SequenceLengthDistribution extends AbstractQCModule {
+
+	private long [] lengthCounts = new long[0];
+	private double [] graphCounts = null;
+	private String [] xCategories = new String[0];
+	private double max = 0;
+	private boolean calculated = false;
+	
+	public JPanel getResultsPanel() {
+	
+		if (!calculated) calculateDistribution();
+				
+		return new LineGraph(new double [][] {graphCounts}, 0d, max, "Sequence Length (bp)",new String [] {"Sequence Length"}, xCategories, "Distribution of sequence lengths over all sequences");
+	}
+	
+	public boolean ignoreFilteredSequences() {
+		return true;
+	}
+	
+	public boolean ignoreInReport () {
+		if (ModuleConfig.getParam("sequence_length", "ignore") > 0) {
+			return true;
+		}
+		return false;
+	}
+	
+	private synchronized void calculateDistribution () {
+		int maxLen = 0;
+		int minLen = -1;
+		max = 0;
+		
+		// Find the min and max lengths
+		for (int i=0;i<lengthCounts.length;i++) {
+			if (lengthCounts[i]>0) {
+				if (minLen < 0) {
+					minLen = i;
+				}
+				maxLen = i;
+			}
+		}		
+		
+		// We put one extra category either side of the actual size
+		if (minLen>0) minLen--;
+		maxLen++;
+		
+		int [] startAndInterval = getSizeDistribution(minLen, maxLen);
+				
+		// Work out how many categories we need
+		int categories = 0;
+		int currentValue = startAndInterval[0];
+		while (currentValue<= maxLen) {
+			++categories;
+			currentValue+= startAndInterval[1];
+		}
+		
+		graphCounts = new double[categories];
+		xCategories = new String[categories];
+		
+		for (int i=0;i<graphCounts.length;i++) {
+			
+			int minValue = startAndInterval[0]+(startAndInterval[1]*i);
+			int maxValue = (startAndInterval[0]+(startAndInterval[1]*(i+1)))-1;
+
+			if (maxValue > maxLen) {
+				maxValue = maxLen;
+			}
+			
+			for (int bp=minValue;bp<=maxValue;bp++) {
+				if (bp < lengthCounts.length) {
+					graphCounts[i] += lengthCounts[bp];
+				}
+			}
+
+			if (startAndInterval[1] == 1) {
+				xCategories[i] = ""+minValue;
+			}
+			else {
+				xCategories[i] = minValue+"-"+maxValue;
+			}
+			
+			if (graphCounts[i] > max) max = graphCounts[i];
+		}
+		calculated = true;
+	}
+
+	public void processSequence(Sequence sequence) {
+		int seqLen = sequence.getSequence().length();
+
+		if (seqLen+2 > lengthCounts.length) {
+			long [] newLengthCounts = new long[seqLen+2];
+			for (int i=0;i<lengthCounts.length;i++) {
+				newLengthCounts[i] = lengthCounts[i];
+			}
+			lengthCounts = newLengthCounts;
+		}
+		
+		++lengthCounts[seqLen];
+		
+	}
+	
+	private int [] getSizeDistribution (int min, int max) {
+		
+		int base = 1;
+		
+		while (base > (max-min)) {
+			base /= 10;
+		}
+				
+		int interval;
+		int starting;
+
+		int [] divisions = new int [] {1,2,5};
+		
+		OUTER: while (true) {
+			
+			for (int d=0;d<divisions.length;d++) {
+				int tester = base * divisions[d];
+				if (((max-min) / tester) <= 50) {
+					interval = tester;
+					break OUTER;
+				}
+			}
+		
+			base *=10;
+			
+		}
+		
+		// Now we work out the first value to be plotted
+		int basicDivision = (int)(min/interval);
+				
+		int testStart = basicDivision * interval;
+				
+		starting = testStart;
+		
+		return new int[] {starting,interval};
+		
+	}
+	
+	
+	
+	public void reset () {
+		lengthCounts = new long[0];
+	}
+
+	public String description() {
+		return "Shows the distribution of sequence length over all sequences";
+	}
+
+	public String name() {
+		return "Sequence Length Distribution";
+	}
+
+	public boolean raisesError() {
+		if (!calculated) calculateDistribution();
+		
+		// See if they've turned this test off
+		if (ModuleConfig.getParam("sequence_length", "error") == 0) {
+			return false;
+		}
+
+
+		if (lengthCounts[0] > 0) {
+			return true;
+		}
+		return false;
+	}
+
+	public boolean raisesWarning() {
+		if (!calculated) calculateDistribution();
+
+		// See if they've turned this test off
+		if (ModuleConfig.getParam("sequence_length", "warn") == 0) {
+			return false;
+		}
+		
+		// Warn if they're not all the same length
+		boolean seenLength = false;
+		for (int i=0;i<lengthCounts.length;i++) {
+			if (lengthCounts[i] > 0) {
+				if (seenLength) {
+					return true;
+				}
+				else {
+					seenLength = true;
+				}
+			}
+		}
+		return false;
+	}
+
+	public void makeReport(HTMLReportArchive report) throws IOException,XMLStreamException {
+		if (!calculated) calculateDistribution();
+
+		writeDefaultImage(report, "sequence_length_distribution.png", "Sequence length distribution", 800, 600);
+		
+		StringBuffer sb = report.dataDocument();
+		sb.append("#Length\tCount\n");
+		for (int i=0;i<xCategories.length;i++) {
+			// Remove any padding we added to make the graph look better
+			if ((i==0 || i== xCategories.length-1) && graphCounts[i] == 0) {
+				continue;
+			}
+			sb.append(xCategories[i]);
+			sb.append("\t");
+			sb.append(graphCounts[i]);
+			sb.append("\n");
+		}
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Report/stylesheet.txt b/uk/ac/babraham/FastQC/Report/stylesheet.txt
index f52e99e..3d5a57b 100644
--- a/uk/ac/babraham/FastQC/Report/stylesheet.txt
+++ b/uk/ac/babraham/FastQC/Report/stylesheet.txt
@@ -1,55 +1,55 @@
-      body {    
-      font-family: sans-serif;   
-      color: #000000;   
-      background-color: #FFFFFF; 
-      }
-      
-	  a {
-      color: #000080;
-      }
-
-      a:hover {
-      color: #800000;
-      }
-      
-      h2 {
-      color: #800000;
-      padding-bottom: 0;
-      margin-bottom: 0;
-      padding-top: 2em;
-      }
-
-      table { 
-      margin-left: 3em;
-      text-align: center;
-      }
-
-      th { 
-      text-align: center;
-      background-color: #000080;
-      color: #FFFFFF;
-      padding: 0.4em;
-      }      
-
-      td { 
-      font-family: monospace; 
-      text-align: left;
-      background-color: #EEEEEE;
-      color: #000000;
-      padding: 0.4em;
-      }
-
-      img {
-      padding-top: 0;
-      margin-top: 0;
-      border-top: 0;
-      }
-
-      img.indented {
-      margin-left: 3em;
-      }
-
-      p {
-      padding-top: 0;
-      margin-top: 0;
-      }
+      body {    
+      font-family: sans-serif;   
+      color: #000000;   
+      background-color: #FFFFFF; 
+      }
+      
+	  a {
+      color: #000080;
+      }
+
+      a:hover {
+      color: #800000;
+      }
+      
+      h2 {
+      color: #800000;
+      padding-bottom: 0;
+      margin-bottom: 0;
+      padding-top: 2em;
+      }
+
+      table { 
+      margin-left: 3em;
+      text-align: center;
+      }
+
+      th { 
+      text-align: center;
+      background-color: #000080;
+      color: #FFFFFF;
+      padding: 0.4em;
+      }      
+
+      td { 
+      font-family: monospace; 
+      text-align: left;
+      background-color: #EEEEEE;
+      color: #000000;
+      padding: 0.4em;
+      }
+
+      img {
+      padding-top: 0;
+      margin-top: 0;
+      border-top: 0;
+      }
+
+      img.indented {
+      margin-left: 3em;
+      }
+
+      p {
+      padding-top: 0;
+      margin-top: 0;
+      }
diff --git a/uk/ac/babraham/FastQC/Results/ResultsPanel.java b/uk/ac/babraham/FastQC/Results/ResultsPanel.java
index 0c1fc2a..bea8af1 100644
--- a/uk/ac/babraham/FastQC/Results/ResultsPanel.java
+++ b/uk/ac/babraham/FastQC/Results/ResultsPanel.java
@@ -1,162 +1,162 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Results;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.util.Vector;
-
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.ImageIcon;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-import uk.ac.babraham.FastQC.Analysis.AnalysisListener;
-import uk.ac.babraham.FastQC.Modules.QCModule;
-import uk.ac.babraham.FastQC.Sequence.SequenceFile;
-
-public class ResultsPanel extends JPanel implements ListSelectionListener, AnalysisListener{
-
-	private static final ImageIcon ERROR_ICON = new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/error.png"));
-	private static final ImageIcon WARNING_ICON = new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/warning.png"));
-	private static final ImageIcon OK_ICON = new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/tick.png"));
-
-	
-	private QCModule [] modules;
-	private JList moduleList;
-	private JPanel [] panels;
-	private JPanel currentPanel = null;
-	private JLabel progressLabel;
-	private SequenceFile sequenceFile;
-	
-	public ResultsPanel (SequenceFile sequenceFile) {
-		this.sequenceFile = sequenceFile;
-		setLayout(new BorderLayout());
-		progressLabel = new JLabel("Waiting to start...",JLabel.CENTER);
-		add(progressLabel,BorderLayout.CENTER);
-	}
-
-	public void valueChanged(ListSelectionEvent e) {
-		int index = moduleList.getSelectedIndex();
-		if (index >= 0) {
-			remove(currentPanel);
-			currentPanel = panels[index]; 
-			add(currentPanel,BorderLayout.CENTER);
-			validate();
-			repaint();
-		}
-	}
-	
-	public SequenceFile sequenceFile () {
-		return sequenceFile;
-	}
-	
-	public QCModule [] modules () {
-		return modules;
-	}
-	
-	private class ModuleRenderer extends DefaultListCellRenderer {
-
-		public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
-			if (! (value instanceof QCModule)) {
-				return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-			}
-			
-			QCModule module = (QCModule)value;
-			ImageIcon icon = OK_ICON;
-			if (module.raisesError()) {
-				icon = ERROR_ICON;
-			}
-			else if (module.raisesWarning()) {
-				icon = WARNING_ICON;
-			}
-
-			JLabel returnLabel = new JLabel(module.name(),icon,JLabel.LEFT);
-			returnLabel.setOpaque(true);
-			if (isSelected) {
-				returnLabel.setBackground(Color.LIGHT_GRAY);
-			}
-			else {
-				returnLabel.setBackground(Color.WHITE);
-			}
-			
-			return returnLabel;
-		}
-		
-	}
-
-	public void analysisComplete(SequenceFile file, QCModule[] rawModules) {
-		remove(progressLabel);
-
-		Vector<QCModule> modulesToDisplay = new Vector<QCModule>();
-		
-		for (int m=0;m<rawModules.length;m++) {
-			if (!rawModules[m].ignoreInReport()) {
-				modulesToDisplay.add(rawModules[m]);
-			}
-		}
-		
-		modules = modulesToDisplay.toArray(new QCModule[0]);
-		
-		panels = new JPanel[modules.length];
-		
-		for (int m=0;m<modules.length;m++) {
-			panels[m] = modules[m].getResultsPanel();
-		}
-		
-		moduleList = new JList(modules);
-		moduleList.setCellRenderer(new ModuleRenderer());
-		moduleList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-		moduleList.setSelectedIndex(0);
-		moduleList.addListSelectionListener(this);
-		
-		add(new JScrollPane(moduleList),BorderLayout.WEST);
-		
-		currentPanel = panels[0];
-		add(currentPanel,BorderLayout.CENTER);
-		validate();
-		
-	}
-
-	public void analysisUpdated(SequenceFile file, int sequencesProcessed, int percentComplete) {
-		if (percentComplete > 99) {
-			progressLabel.setText("Read "+sequencesProcessed+" sequences");			
-		}
-		else {
-			progressLabel.setText("Read "+sequencesProcessed+" sequences ("+percentComplete+"%)");
-		}
-	}
-
-	public void analysisExceptionReceived(SequenceFile file, Exception e) {
-		progressLabel.setText("Failed to process file: "+e.getLocalizedMessage());
-	}
-
-	public void analysisStarted(SequenceFile file) {
-		progressLabel.setText("Starting analysis...");		
-	}
-	
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Results;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.util.Vector;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import uk.ac.babraham.FastQC.Analysis.AnalysisListener;
+import uk.ac.babraham.FastQC.Modules.QCModule;
+import uk.ac.babraham.FastQC.Sequence.SequenceFile;
+
+public class ResultsPanel extends JPanel implements ListSelectionListener, AnalysisListener{
+
+	private static final ImageIcon ERROR_ICON = new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/error.png"));
+	private static final ImageIcon WARNING_ICON = new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/warning.png"));
+	private static final ImageIcon OK_ICON = new ImageIcon(ClassLoader.getSystemResource("uk/ac/babraham/FastQC/Resources/tick.png"));
+
+	
+	private QCModule [] modules;
+	private JList moduleList;
+	private JPanel [] panels;
+	private JPanel currentPanel = null;
+	private JLabel progressLabel;
+	private SequenceFile sequenceFile;
+	
+	public ResultsPanel (SequenceFile sequenceFile) {
+		this.sequenceFile = sequenceFile;
+		setLayout(new BorderLayout());
+		progressLabel = new JLabel("Waiting to start...",JLabel.CENTER);
+		add(progressLabel,BorderLayout.CENTER);
+	}
+
+	public void valueChanged(ListSelectionEvent e) {
+		int index = moduleList.getSelectedIndex();
+		if (index >= 0) {
+			remove(currentPanel);
+			currentPanel = panels[index]; 
+			add(currentPanel,BorderLayout.CENTER);
+			validate();
+			repaint();
+		}
+	}
+	
+	public SequenceFile sequenceFile () {
+		return sequenceFile;
+	}
+	
+	public QCModule [] modules () {
+		return modules;
+	}
+	
+	private class ModuleRenderer extends DefaultListCellRenderer {
+
+		public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+			if (! (value instanceof QCModule)) {
+				return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+			}
+			
+			QCModule module = (QCModule)value;
+			ImageIcon icon = OK_ICON;
+			if (module.raisesError()) {
+				icon = ERROR_ICON;
+			}
+			else if (module.raisesWarning()) {
+				icon = WARNING_ICON;
+			}
+
+			JLabel returnLabel = new JLabel(module.name(),icon,JLabel.LEFT);
+			returnLabel.setOpaque(true);
+			if (isSelected) {
+				returnLabel.setBackground(Color.LIGHT_GRAY);
+			}
+			else {
+				returnLabel.setBackground(Color.WHITE);
+			}
+			
+			return returnLabel;
+		}
+		
+	}
+
+	public void analysisComplete(SequenceFile file, QCModule[] rawModules) {
+		remove(progressLabel);
+
+		Vector<QCModule> modulesToDisplay = new Vector<QCModule>();
+		
+		for (int m=0;m<rawModules.length;m++) {
+			if (!rawModules[m].ignoreInReport()) {
+				modulesToDisplay.add(rawModules[m]);
+			}
+		}
+		
+		modules = modulesToDisplay.toArray(new QCModule[0]);
+		
+		panels = new JPanel[modules.length];
+		
+		for (int m=0;m<modules.length;m++) {
+			panels[m] = modules[m].getResultsPanel();
+		}
+		
+		moduleList = new JList(modules);
+		moduleList.setCellRenderer(new ModuleRenderer());
+		moduleList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+		moduleList.setSelectedIndex(0);
+		moduleList.addListSelectionListener(this);
+		
+		add(new JScrollPane(moduleList),BorderLayout.WEST);
+		
+		currentPanel = panels[0];
+		add(currentPanel,BorderLayout.CENTER);
+		validate();
+		
+	}
+
+	public void analysisUpdated(SequenceFile file, int sequencesProcessed, int percentComplete) {
+		if (percentComplete > 99) {
+			progressLabel.setText("Read "+sequencesProcessed+" sequences");			
+		}
+		else {
+			progressLabel.setText("Read "+sequencesProcessed+" sequences ("+percentComplete+"%)");
+		}
+	}
+
+	public void analysisExceptionReceived(SequenceFile file, Exception e) {
+		progressLabel.setText("Failed to process file: "+e.getLocalizedMessage());
+	}
+
+	public void analysisStarted(SequenceFile file) {
+		progressLabel.setText("Starting analysis...");		
+	}
+	
+	
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/BAMFile.java b/uk/ac/babraham/FastQC/Sequence/BAMFile.java
index 409d939..49e7363 100644
--- a/uk/ac/babraham/FastQC/Sequence/BAMFile.java
+++ b/uk/ac/babraham/FastQC/Sequence/BAMFile.java
@@ -1,220 +1,220 @@
-/**
- * Copyright Copyright 2010-12 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-
-import net.sf.samtools.CigarElement;
-import net.sf.samtools.CigarOperator;
-import net.sf.samtools.SAMFileReader;
-import net.sf.samtools.SAMFormatException;
-import net.sf.samtools.SAMRecord;
-
-public class BAMFile implements SequenceFile {
-
-	private File file;
-	private boolean onlyMapped;
-	private long fileSize = 0;
-	private long recordSize = 0;
-	
-	// We keep the file stream around just so we can see how far through
-	// the file we've got.  We don't read from this directly, but it's the
-	// only way to access the file pointer.
-	private FileInputStream fis;
-
-	private SAMFileReader br;
-	private String name;
-	private Sequence nextSequence = null;
-	Iterator<SAMRecord> it;
-	
-	
-	protected BAMFile (File file, boolean onlyMapped) throws SequenceFormatException, IOException {
-		this.file = file;
-		fileSize = file.length();
-		name = file.getName();
-		this.onlyMapped = onlyMapped;
-
-		SAMFileReader.setDefaultValidationStringency(SAMFileReader.ValidationStringency.SILENT);
-
-		fis = new FileInputStream(file);
-		
-		br = new SAMFileReader(fis);
-		
-		it = br.iterator();
-		readNext();
-	}
-	
-	public String name () {
-		return name;
-	}
-		
-	public int getPercentComplete() {
-		if (!hasNext()) return 100;
-		
-		try {
-			int percent = (int) (((double)fis.getChannel().position()/ fileSize)*100);
-			return percent;
-		} 
-		catch (IOException e) {
-			e.printStackTrace();
-		}
-		return 0;
-	}
-
-	public boolean isColorspace () {
-		return false;
-	}
-		
-	public boolean hasNext() {
-		return nextSequence != null;
-	}
-
-	public Sequence next () throws SequenceFormatException {
-		Sequence returnSeq = nextSequence;
-		readNext();
-		return returnSeq;
-	}
-	
-	private void readNext() throws SequenceFormatException {
-		
-		SAMRecord record;
-		
-		while (true) {
-			
-			if (!it.hasNext()) {
-				nextSequence = null;
-				try {
-					br.close();
-					fis.close();
-				}
-				catch (IOException ioe) {
-					ioe.printStackTrace();
-				}
-				return;
-			}
-		
-			try {
-				record = it.next();
-			}
-			catch (SAMFormatException sfe) {
-				throw new SequenceFormatException(sfe.getMessage());
-			}
-		
-			// We skip over entries with no mapping if that's what the user asked for
-			if (onlyMapped && record.getReadUnmappedFlag()) {
-				continue;
-			}
-			else {
-				break;
-			}
-		}
-		
-		// This is a very rough calculation of the record size so we can approximately track progress
-		// through the file.
-		if (recordSize == 0) {
-			recordSize = (record.getReadLength()*2)+150;
-			if (br.isBinary()) {
-				recordSize /= 4;
-			}
-		}
-				
-
-		String sequence = record.getReadString();
-		String qualities = record.getBaseQualityString();
-		
-		
-		// TODO: TEST THIS!!!
-		// If we're only working with mapped data then we need to exclude any regions which have been either
-		// hard or soft clipped by our aligner.
-		if (onlyMapped) {
-			List<CigarElement> elements = record.getCigar().getCigarElements();
-
-			// We need to clip the 3' end first otherwise the numbers at the 5' end won't be right.
-			if (elements.get(elements.size()-1).getOperator().equals(CigarOperator.S)) {
-				int value = elements.get(elements.size()-1).getLength();
-				sequence = sequence.substring(0,sequence.length()-value);
-				qualities = qualities.substring(0,qualities.length()-value);
-				
-			}
-
-			
-			if (elements.get(0).getOperator().equals(CigarOperator.S)) {
-				int value = elements.get(0).getLength();
-				sequence = sequence.substring(value);
-				qualities = qualities.substring(value);
-			}
-			
-			
-		}
-		
-
-		// BAM/SAM files always show sequence relative to the top strand of
-		// the mapped reference so if this sequence maps to the reverse strand
-		// we need to reverse complement the sequence and reverse the qualities
-		// to get the original orientation of the read.
-		if (record.getReadNegativeStrandFlag()) {
-			sequence = reverseComplement(sequence);
-			qualities = reverse(qualities);
-		}
-
-		nextSequence = new Sequence(this, sequence, qualities, record.getReadName());
-
-	}
-
-	
-	private String reverseComplement (String sequence) {
-		
-		char [] letters = reverse(sequence).toUpperCase().toCharArray();
-		char [] rc = new char[letters.length];
-		
-		for (int i=0;i<letters.length;i++) {
-			switch(letters[i]) {
-			case 'G': rc[i] = 'C';break;
-			case 'A': rc[i] = 'T';break;
-			case 'T': rc[i] = 'A';break;
-			case 'C': rc[i] = 'G';break;
-			default: rc[i] = letters[i];
-			}
-		}
-	
-		return new String(rc);
-
-	}
-	
-	private String reverse (String sequence) {
-		char [] starting = sequence.toCharArray();
-		char [] reversed = new char[starting.length];
-		
-		for (int i=0;i<starting.length;i++) {
-			reversed[reversed.length-(1+i)] = starting[i];
-		}
-		
-		return new String(reversed);
-	}
-
-	public File getFile() {
-		return file;
-	}
-	
-}
+/**
+ * Copyright Copyright 2010-12 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import net.sf.samtools.CigarElement;
+import net.sf.samtools.CigarOperator;
+import net.sf.samtools.SAMFileReader;
+import net.sf.samtools.SAMFormatException;
+import net.sf.samtools.SAMRecord;
+
+public class BAMFile implements SequenceFile {
+
+	private File file;
+	private boolean onlyMapped;
+	private long fileSize = 0;
+	private long recordSize = 0;
+	
+	// We keep the file stream around just so we can see how far through
+	// the file we've got.  We don't read from this directly, but it's the
+	// only way to access the file pointer.
+	private FileInputStream fis;
+
+	private SAMFileReader br;
+	private String name;
+	private Sequence nextSequence = null;
+	Iterator<SAMRecord> it;
+	
+	
+	protected BAMFile (File file, boolean onlyMapped) throws SequenceFormatException, IOException {
+		this.file = file;
+		fileSize = file.length();
+		name = file.getName();
+		this.onlyMapped = onlyMapped;
+
+		SAMFileReader.setDefaultValidationStringency(SAMFileReader.ValidationStringency.SILENT);
+
+		fis = new FileInputStream(file);
+		
+		br = new SAMFileReader(fis);
+		
+		it = br.iterator();
+		readNext();
+	}
+	
+	public String name () {
+		return name;
+	}
+		
+	public int getPercentComplete() {
+		if (!hasNext()) return 100;
+		
+		try {
+			int percent = (int) (((double)fis.getChannel().position()/ fileSize)*100);
+			return percent;
+		} 
+		catch (IOException e) {
+			e.printStackTrace();
+		}
+		return 0;
+	}
+
+	public boolean isColorspace () {
+		return false;
+	}
+		
+	public boolean hasNext() {
+		return nextSequence != null;
+	}
+
+	public Sequence next () throws SequenceFormatException {
+		Sequence returnSeq = nextSequence;
+		readNext();
+		return returnSeq;
+	}
+	
+	private void readNext() throws SequenceFormatException {
+		
+		SAMRecord record;
+		
+		while (true) {
+			
+			if (!it.hasNext()) {
+				nextSequence = null;
+				try {
+					br.close();
+					fis.close();
+				}
+				catch (IOException ioe) {
+					ioe.printStackTrace();
+				}
+				return;
+			}
+		
+			try {
+				record = it.next();
+			}
+			catch (SAMFormatException sfe) {
+				throw new SequenceFormatException(sfe.getMessage());
+			}
+		
+			// We skip over entries with no mapping if that's what the user asked for
+			if (onlyMapped && record.getReadUnmappedFlag()) {
+				continue;
+			}
+			else {
+				break;
+			}
+		}
+		
+		// This is a very rough calculation of the record size so we can approximately track progress
+		// through the file.
+		if (recordSize == 0) {
+			recordSize = (record.getReadLength()*2)+150;
+			if (br.isBinary()) {
+				recordSize /= 4;
+			}
+		}
+				
+
+		String sequence = record.getReadString();
+		String qualities = record.getBaseQualityString();
+		
+		
+		// TODO: TEST THIS!!!
+		// If we're only working with mapped data then we need to exclude any regions which have been either
+		// hard or soft clipped by our aligner.
+		if (onlyMapped) {
+			List<CigarElement> elements = record.getCigar().getCigarElements();
+
+			// We need to clip the 3' end first otherwise the numbers at the 5' end won't be right.
+			if (elements.get(elements.size()-1).getOperator().equals(CigarOperator.S)) {
+				int value = elements.get(elements.size()-1).getLength();
+				sequence = sequence.substring(0,sequence.length()-value);
+				qualities = qualities.substring(0,qualities.length()-value);
+				
+			}
+
+			
+			if (elements.get(0).getOperator().equals(CigarOperator.S)) {
+				int value = elements.get(0).getLength();
+				sequence = sequence.substring(value);
+				qualities = qualities.substring(value);
+			}
+			
+			
+		}
+		
+
+		// BAM/SAM files always show sequence relative to the top strand of
+		// the mapped reference so if this sequence maps to the reverse strand
+		// we need to reverse complement the sequence and reverse the qualities
+		// to get the original orientation of the read.
+		if (record.getReadNegativeStrandFlag()) {
+			sequence = reverseComplement(sequence);
+			qualities = reverse(qualities);
+		}
+
+		nextSequence = new Sequence(this, sequence, qualities, record.getReadName());
+
+	}
+
+	
+	private String reverseComplement (String sequence) {
+		
+		char [] letters = reverse(sequence).toUpperCase().toCharArray();
+		char [] rc = new char[letters.length];
+		
+		for (int i=0;i<letters.length;i++) {
+			switch(letters[i]) {
+			case 'G': rc[i] = 'C';break;
+			case 'A': rc[i] = 'T';break;
+			case 'T': rc[i] = 'A';break;
+			case 'C': rc[i] = 'G';break;
+			default: rc[i] = letters[i];
+			}
+		}
+	
+		return new String(rc);
+
+	}
+	
+	private String reverse (String sequence) {
+		char [] starting = sequence.toCharArray();
+		char [] reversed = new char[starting.length];
+		
+		for (int i=0;i<starting.length;i++) {
+			reversed[reversed.length-(1+i)] = starting[i];
+		}
+		
+		return new String(reversed);
+	}
+
+	public File getFile() {
+		return file;
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/Contaminant/Contaminant.java b/uk/ac/babraham/FastQC/Sequence/Contaminant/Contaminant.java
index eacce86..464a088 100644
--- a/uk/ac/babraham/FastQC/Sequence/Contaminant/Contaminant.java
+++ b/uk/ac/babraham/FastQC/Sequence/Contaminant/Contaminant.java
@@ -1,154 +1,154 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence.Contaminant;
-
-public class Contaminant {
-
-	private String name;
-	private char [] forward;
-	private char [] reverse;
-	
-	public Contaminant (String name, String sequence) {
-		this.name = name;
-		
-		sequence = sequence.toUpperCase();
-		forward = sequence.toCharArray();
-		reverse = new char[forward.length];
-		for (int c=0;c<forward.length;c++) {
-			int revPos = (reverse.length-1)-c;
-			switch (forward[c]) {
-				case 'G':
-					reverse[revPos] = 'C';
-					break;
-				case 'A':
-					reverse[revPos] = 'T';
-					break;
-				case 'T':
-					reverse[revPos] = 'A';
-					break;
-				case 'C':
-					reverse[revPos] = 'G';
-					break;
-				default:
-					throw new IllegalArgumentException("Contaminant contained the illegal character '"+forward[c]+"'");
-			}
-		}
-		
-	}
-	
-	public ContaminantHit findMatch (String query) {
-		query = query.toUpperCase();
-		
-		// We have a special case for queries between 8 - 20bp where we will allow a hit
-		// if it's an exact substring of this contaminant
-		if (query.length()<20 && query.length()>=8) {
-			if ((new String(forward)).contains(query)) {
-				return new ContaminantHit(this, ContaminantHit.FORWARD, query.length(), 100);
-			}
-			if ((new String(reverse)).contains(query)) {
-				return new ContaminantHit(this, ContaminantHit.REVERSE, query.length(), 100);
-			}
-			
-		}
-		
-		
-		char [] q = query.toCharArray();
-		
-		ContaminantHit bestHit = null;
-		
-		// We're going to allow only one mismatch and will require 
-		// a match of at least 20bp to consider this a match at all
-		
-		for (int offset=0-(forward.length-20);offset<q.length-20;offset++) {
-			ContaminantHit thisHit = findMatch(forward,q,offset,ContaminantHit.FORWARD);
-//			System.out.println("Best match from offset "+offset+" was "+thisHit);
-			if (thisHit == null) continue;
-			if (bestHit == null || thisHit.length()>bestHit.length()) {
-				bestHit = thisHit;
-			}
-		}
-
-		for (int offset=0-(forward.length-20);offset<q.length-20;offset++) {
-			ContaminantHit thisHit = findMatch(reverse,q,offset,ContaminantHit.REVERSE);
-			if (thisHit == null) continue;
-			if (bestHit == null || thisHit.length()>bestHit.length()) {
-				bestHit = thisHit;
-			}
-		}
-		
-		return bestHit;
-		
-	}
-	
-	private ContaminantHit findMatch (char [] ca, char [] cb, int offset, int direction) {
-		
-		ContaminantHit bestHit = null;
-		
-		int mismatchCount = 0;
-		int start = 0;
-		int end = 0;
-				
-		for (int i=0;i<ca.length;i++) {
-			if (i+offset < 0) {
-				start=i+1;
-				continue;
-			}
-			if (i+offset >= cb.length) break;
-			
-			if (ca[i] == cb[i+offset]) {
-				end = i;
-			}
-			else {
-				++mismatchCount;
-				if (mismatchCount>1) {
-					// That's the end of this match, see if it's worth recording
-					if (1+(end-start) > 20) {
-						int id = (((1+(end-start))-(mismatchCount-1))*100)/(1+(end-start));
-						if (bestHit == null || bestHit.length()< 1+(end-start) || (bestHit.length() == 1+(end-start) && bestHit.percentID()<id)) {
-//							System.out.println("New best hit from "+start+"-"+end);
-							bestHit = new ContaminantHit(this, direction, 1+(end-start), id);
-						}
-					}
-					start = i+1;
-					end = i+1;
-					mismatchCount = 0;
-				}
-			}		
-		}
-		
-		// See if we ended with a match.
-		if (1+(end-start) > 20) {
-			int id = (((1+(end-start))-mismatchCount)*100)/(1+(end-start));
-			if (bestHit == null || bestHit.length()< 1+(end-start) || (bestHit.length() == 1+(end-start) && bestHit.percentID()<id)) {
-//				System.out.println("New best hit from "+start+"-"+end);
-				bestHit = new ContaminantHit(this, direction, 1+(end-start), id);
-			}
-		}
-		
-		return bestHit;		
-		
-	}
-	
-	public String name () {
-		return name;
-	}
-	
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence.Contaminant;
+
+public class Contaminant {
+
+	private String name;
+	private char [] forward;
+	private char [] reverse;
+	
+	public Contaminant (String name, String sequence) {
+		this.name = name;
+		
+		sequence = sequence.toUpperCase();
+		forward = sequence.toCharArray();
+		reverse = new char[forward.length];
+		for (int c=0;c<forward.length;c++) {
+			int revPos = (reverse.length-1)-c;
+			switch (forward[c]) {
+				case 'G':
+					reverse[revPos] = 'C';
+					break;
+				case 'A':
+					reverse[revPos] = 'T';
+					break;
+				case 'T':
+					reverse[revPos] = 'A';
+					break;
+				case 'C':
+					reverse[revPos] = 'G';
+					break;
+				default:
+					throw new IllegalArgumentException("Contaminant contained the illegal character '"+forward[c]+"'");
+			}
+		}
+		
+	}
+	
+	public ContaminantHit findMatch (String query) {
+		query = query.toUpperCase();
+		
+		// We have a special case for queries between 8 - 20bp where we will allow a hit
+		// if it's an exact substring of this contaminant
+		if (query.length()<20 && query.length()>=8) {
+			if ((new String(forward)).contains(query)) {
+				return new ContaminantHit(this, ContaminantHit.FORWARD, query.length(), 100);
+			}
+			if ((new String(reverse)).contains(query)) {
+				return new ContaminantHit(this, ContaminantHit.REVERSE, query.length(), 100);
+			}
+			
+		}
+		
+		
+		char [] q = query.toCharArray();
+		
+		ContaminantHit bestHit = null;
+		
+		// We're going to allow only one mismatch and will require 
+		// a match of at least 20bp to consider this a match at all
+		
+		for (int offset=0-(forward.length-20);offset<q.length-20;offset++) {
+			ContaminantHit thisHit = findMatch(forward,q,offset,ContaminantHit.FORWARD);
+//			System.out.println("Best match from offset "+offset+" was "+thisHit);
+			if (thisHit == null) continue;
+			if (bestHit == null || thisHit.length()>bestHit.length()) {
+				bestHit = thisHit;
+			}
+		}
+
+		for (int offset=0-(forward.length-20);offset<q.length-20;offset++) {
+			ContaminantHit thisHit = findMatch(reverse,q,offset,ContaminantHit.REVERSE);
+			if (thisHit == null) continue;
+			if (bestHit == null || thisHit.length()>bestHit.length()) {
+				bestHit = thisHit;
+			}
+		}
+		
+		return bestHit;
+		
+	}
+	
+	private ContaminantHit findMatch (char [] ca, char [] cb, int offset, int direction) {
+		
+		ContaminantHit bestHit = null;
+		
+		int mismatchCount = 0;
+		int start = 0;
+		int end = 0;
+				
+		for (int i=0;i<ca.length;i++) {
+			if (i+offset < 0) {
+				start=i+1;
+				continue;
+			}
+			if (i+offset >= cb.length) break;
+			
+			if (ca[i] == cb[i+offset]) {
+				end = i;
+			}
+			else {
+				++mismatchCount;
+				if (mismatchCount>1) {
+					// That's the end of this match, see if it's worth recording
+					if (1+(end-start) > 20) {
+						int id = (((1+(end-start))-(mismatchCount-1))*100)/(1+(end-start));
+						if (bestHit == null || bestHit.length()< 1+(end-start) || (bestHit.length() == 1+(end-start) && bestHit.percentID()<id)) {
+//							System.out.println("New best hit from "+start+"-"+end);
+							bestHit = new ContaminantHit(this, direction, 1+(end-start), id);
+						}
+					}
+					start = i+1;
+					end = i+1;
+					mismatchCount = 0;
+				}
+			}		
+		}
+		
+		// See if we ended with a match.
+		if (1+(end-start) > 20) {
+			int id = (((1+(end-start))-mismatchCount)*100)/(1+(end-start));
+			if (bestHit == null || bestHit.length()< 1+(end-start) || (bestHit.length() == 1+(end-start) && bestHit.percentID()<id)) {
+//				System.out.println("New best hit from "+start+"-"+end);
+				bestHit = new ContaminantHit(this, direction, 1+(end-start), id);
+			}
+		}
+		
+		return bestHit;		
+		
+	}
+	
+	public String name () {
+		return name;
+	}
+	
+	
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminantHit.java b/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminantHit.java
index b070164..8c19432 100644
--- a/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminantHit.java
+++ b/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminantHit.java
@@ -1,64 +1,64 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence.Contaminant;
-
-public class ContaminantHit {
-
-	private Contaminant contaminant;
-	private int direction;
-	private int length;
-	private int percentID;
-	
-	public static final int FORWARD = 1;
-	public static final int REVERSE = 2;
-	
-	public ContaminantHit (Contaminant contaminant, int direction, int length, int percentID) {
-		if (direction == FORWARD || direction == REVERSE) {
-			this.direction = direction;
-		}
-		else {
-			throw new IllegalArgumentException("Direction of hit must be FORWARD or REVERSE");
-		}
-		this.contaminant = contaminant;
-		this.length = length;
-		this.percentID = percentID;
-	}
-
-	
-	public Contaminant contaminant () {
-		return contaminant;
-	}
-	
-	public int direction () {
-		return direction;
-	}
-	
-	public int length () {
-		return length;
-	}
-	
-	public int percentID () {
-		return percentID;
-	}
-	
-	public String toString () {
-		return contaminant.name()+" ("+percentID+"% over "+length+"bp)";
-	}
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence.Contaminant;
+
+public class ContaminantHit {
+
+	private Contaminant contaminant;
+	private int direction;
+	private int length;
+	private int percentID;
+	
+	public static final int FORWARD = 1;
+	public static final int REVERSE = 2;
+	
+	public ContaminantHit (Contaminant contaminant, int direction, int length, int percentID) {
+		if (direction == FORWARD || direction == REVERSE) {
+			this.direction = direction;
+		}
+		else {
+			throw new IllegalArgumentException("Direction of hit must be FORWARD or REVERSE");
+		}
+		this.contaminant = contaminant;
+		this.length = length;
+		this.percentID = percentID;
+	}
+
+	
+	public Contaminant contaminant () {
+		return contaminant;
+	}
+	
+	public int direction () {
+		return direction;
+	}
+	
+	public int length () {
+		return length;
+	}
+	
+	public int percentID () {
+		return percentID;
+	}
+	
+	public String toString () {
+		return contaminant.name()+" ("+percentID+"% over "+length+"bp)";
+	}
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminentFinder.java b/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminentFinder.java
index 1906233..419bbe6 100644
--- a/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminentFinder.java
+++ b/uk/ac/babraham/FastQC/Sequence/Contaminant/ContaminentFinder.java
@@ -1,113 +1,113 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence.Contaminant;
-
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Vector;
-
-import uk.ac.babraham.FastQC.FastQCConfig;
-
-public class ContaminentFinder {
-
-	private static Contaminant [] contaminants;
-	
-	public static ContaminantHit findContaminantHit (String sequence) {
-		if (contaminants == null) {
-			contaminants = makeContaminantList();
-		}
-		
-		ContaminantHit bestHit = null;
-		
-		for (int c=0;c<contaminants.length;c++) {
-			ContaminantHit thisHit = contaminants[c].findMatch(sequence);
-			
-//			System.out.println("Best hit from "+c+" is "+thisHit);
-			
-			if (thisHit == null) continue; // No hit
-			
-			if (bestHit == null || thisHit.length() > bestHit.length()) {
-				bestHit = thisHit;
-			}
-			
-		}
-		
-		return bestHit;
-		
-	}
-	
-	
-	private static Contaminant [] makeContaminantList () {
-		Vector<Contaminant>c = new Vector<Contaminant>();
-		
-		try {
-			
-			BufferedReader br = null;
-			if (FastQCConfig.getInstance().contaminant_file == null) {
-				InputStream rsrc=ContaminentFinder.class.getResourceAsStream("/Configuration/contaminant_list.txt");
-				if (rsrc==null) throw new FileNotFoundException("cannot find Confituration/contaminant_list.txt");
-				br =new BufferedReader(new InputStreamReader(rsrc));
-			}
-			else {
-				br=new BufferedReader(new FileReader(FastQCConfig.getInstance().contaminant_file));
-			}
-			
-			
-
-			String line;
-			while ((line = br.readLine())!= null){
-				
-				if (line.startsWith("#")) continue; // Skip comments
-				if (line.trim().length() == 0) continue; // Skip blank lines
-				
-				String [] sections = line.split("\\t+");
-				if (sections.length != 2) {
-					System.err.println("Expected 2 sections for contaminant line but got "+sections.length+" from "+line);
-					continue;
-				}
-				Contaminant con = new Contaminant(sections[0], sections[1]);
-				c.add(con);	
-			}
-			
-			br.close();
-		}
-		catch (IOException e) {
-			e.printStackTrace();
-		}
-		
-		return c.toArray(new Contaminant[0]);
-	}
-	/*
-	public static void main (String [] args) {
-		
-		Config cfg=new Config();
-		String query = "agagtgtagatctccgtggtcgccgtatca";
-		
-		ContaminantHit c = findContaminantHit(cfg,query);
-		
-		System.out.println("Query was "+query.length()+"bp Found hit "+c);
-		
-	}*/
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence.Contaminant;
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Vector;
+
+import uk.ac.babraham.FastQC.FastQCConfig;
+
+public class ContaminentFinder {
+
+	private static Contaminant [] contaminants;
+	
+	public static ContaminantHit findContaminantHit (String sequence) {
+		if (contaminants == null) {
+			contaminants = makeContaminantList();
+		}
+		
+		ContaminantHit bestHit = null;
+		
+		for (int c=0;c<contaminants.length;c++) {
+			ContaminantHit thisHit = contaminants[c].findMatch(sequence);
+			
+//			System.out.println("Best hit from "+c+" is "+thisHit);
+			
+			if (thisHit == null) continue; // No hit
+			
+			if (bestHit == null || thisHit.length() > bestHit.length()) {
+				bestHit = thisHit;
+			}
+			
+		}
+		
+		return bestHit;
+		
+	}
+	
+	
+	private static Contaminant [] makeContaminantList () {
+		Vector<Contaminant>c = new Vector<Contaminant>();
+		
+		try {
+			
+			BufferedReader br = null;
+			if (FastQCConfig.getInstance().contaminant_file == null) {
+				InputStream rsrc=ContaminentFinder.class.getResourceAsStream("/Configuration/contaminant_list.txt");
+				if (rsrc==null) throw new FileNotFoundException("cannot find Confituration/contaminant_list.txt");
+				br =new BufferedReader(new InputStreamReader(rsrc));
+			}
+			else {
+				br=new BufferedReader(new FileReader(FastQCConfig.getInstance().contaminant_file));
+			}
+			
+			
+
+			String line;
+			while ((line = br.readLine())!= null){
+				
+				if (line.startsWith("#")) continue; // Skip comments
+				if (line.trim().length() == 0) continue; // Skip blank lines
+				
+				String [] sections = line.split("\\t+");
+				if (sections.length != 2) {
+					System.err.println("Expected 2 sections for contaminant line but got "+sections.length+" from "+line);
+					continue;
+				}
+				Contaminant con = new Contaminant(sections[0], sections[1]);
+				c.add(con);	
+			}
+			
+			br.close();
+		}
+		catch (IOException e) {
+			e.printStackTrace();
+		}
+		
+		return c.toArray(new Contaminant[0]);
+	}
+	/*
+	public static void main (String [] args) {
+		
+		Config cfg=new Config();
+		String query = "agagtgtagatctccgtggtcgccgtatca";
+		
+		ContaminantHit c = findContaminantHit(cfg,query);
+		
+		System.out.println("Query was "+query.length()+"bp Found hit "+c);
+		
+	}*/
+	
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/Fast5File.java b/uk/ac/babraham/FastQC/Sequence/Fast5File.java
index 235ca10..8e7e71e 100644
--- a/uk/ac/babraham/FastQC/Sequence/Fast5File.java
+++ b/uk/ac/babraham/FastQC/Sequence/Fast5File.java
@@ -1,89 +1,89 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence;
-
-import java.io.File;
-import java.io.IOException;
-
-import ch.systemsx.cisd.hdf5.HDF5Factory;
-import ch.systemsx.cisd.hdf5.IHDF5SimpleReader;
-
-public class Fast5File implements SequenceFile {
-
-	private Sequence nextSequence = null;
-	private File file;
-
-	private String name;
-
-	protected Fast5File(File file) throws SequenceFormatException, IOException {
-		this.file = file;
-		name = file.getName();
-
-		IHDF5SimpleReader reader = HDF5Factory.openForReading(file);
-		
-		if (reader.exists("Analyses/Basecall_2D_000/BaseCalled_template/Fastq")) {
-		
-			String fastq = reader.readString("Analyses/Basecall_2D_000/BaseCalled_template/Fastq");
-		
-			String [] sections = fastq.split("\\n");
-			
-			if (sections.length != 4) {
-				throw new SequenceFormatException("Didn't get 4 sections from "+fastq);
-			}
-			
-			nextSequence = new Sequence(this, sections[1].toUpperCase(),sections[3], sections[0]);
-		}
-		reader.close();
-
-	}
-
-	public String name() {
-		return name;
-	}
-
-	public int getPercentComplete() {
-		if (! hasNext()) return 100;
-
-		return 0;		
-	}
-
-	public boolean isColorspace() {
-		return false;
-	}
-
-	public boolean hasNext() {
-		return nextSequence != null;
-	}
-
-	public Sequence next() throws SequenceFormatException {
-		Sequence seq = nextSequence;
-		nextSequence = null;
-		return seq;
-	}
-
-	public void remove() {
-		// No action here
-	}
-
-	public File getFile() {
-		return file;
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence;
+
+import java.io.File;
+import java.io.IOException;
+
+import ch.systemsx.cisd.hdf5.HDF5Factory;
+import ch.systemsx.cisd.hdf5.IHDF5SimpleReader;
+
+public class Fast5File implements SequenceFile {
+
+	private Sequence nextSequence = null;
+	private File file;
+
+	private String name;
+
+	protected Fast5File(File file) throws SequenceFormatException, IOException {
+		this.file = file;
+		name = file.getName();
+
+		IHDF5SimpleReader reader = HDF5Factory.openForReading(file);
+		
+		if (reader.exists("Analyses/Basecall_2D_000/BaseCalled_template/Fastq")) {
+		
+			String fastq = reader.readString("Analyses/Basecall_2D_000/BaseCalled_template/Fastq");
+		
+			String [] sections = fastq.split("\\n");
+			
+			if (sections.length != 4) {
+				throw new SequenceFormatException("Didn't get 4 sections from "+fastq);
+			}
+			
+			nextSequence = new Sequence(this, sections[1].toUpperCase(),sections[3], sections[0]);
+		}
+		reader.close();
+
+	}
+
+	public String name() {
+		return name;
+	}
+
+	public int getPercentComplete() {
+		if (! hasNext()) return 100;
+
+		return 0;		
+	}
+
+	public boolean isColorspace() {
+		return false;
+	}
+
+	public boolean hasNext() {
+		return nextSequence != null;
+	}
+
+	public Sequence next() throws SequenceFormatException {
+		Sequence seq = nextSequence;
+		nextSequence = null;
+		return seq;
+	}
+
+	public void remove() {
+		// No action here
+	}
+
+	public File getFile() {
+		return file;
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/FastQFile.java b/uk/ac/babraham/FastQC/Sequence/FastQFile.java
index 6a8ff00..88ca95b 100644
--- a/uk/ac/babraham/FastQC/Sequence/FastQFile.java
+++ b/uk/ac/babraham/FastQC/Sequence/FastQFile.java
@@ -1,350 +1,350 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.itadaki.bzip2.BZip2InputStream;
-
-import uk.ac.babraham.FastQC.FastQCConfig;
-import uk.ac.babraham.FastQC.Utilities.MultiMemberGZIPInputStream;
-
-public class FastQFile implements SequenceFile {
-
-	private Sequence nextSequence = null;
-	private File file;
-	private long fileSize = 0;
-
-	private boolean casavaMode = false;
-	private boolean nofilter = false;
-
-	// We actually read our final data from this buffered reader
-	private BufferedReader br;
-
-	// We keep the file stream around just so we can see how far through
-	// the file we've got.  We don't read from this directly, but it's the
-	// only way to access the file pointer.
-	private FileInputStream fis;
-
-	private String name;
-	private boolean isColorspace = false;
-
-	protected FastQFile(FastQCConfig config,File file) throws SequenceFormatException, IOException {
-		this.file = file;
-		if (file.getName().equals("stdin")) {
-			fileSize = Long.MAX_VALUE;
-		}
-		else {
-			fileSize = file.length();
-		}
-		name = file.getName();
-
-		if (config.casava) {
-			casavaMode = true;
-			if (config.nofilter) {
-				nofilter = true;
-			}
-		}
-
-		if (!file.getName().equals("stdin")) {
-			fis = new FileInputStream(file);
-		}
-		
-		if (file.getName().equals("stdin")) {
-			br = new BufferedReader(new InputStreamReader(System.in));
-		}
-		else if (file.getName().toLowerCase().endsWith(".gz")) {
-			br = new BufferedReader(new InputStreamReader(new MultiMemberGZIPInputStream(fis)));
-		} 
-		else if (file.getName().toLowerCase().endsWith(".bz2")) {
-			br = new BufferedReader(new InputStreamReader(new BZip2InputStream(fis,false)));
-		} 
-
-		else {
-			br = new BufferedReader(new InputStreamReader(fis));
-		}
-		readNext();
-	}
-
-	public String name() {
-		return name;
-	}
-
-	public int getPercentComplete() {
-		if (! hasNext()) return 100;
-		if (file.getName().equals("stdin")) {
-			return 0;
-		}
-		try {
-			int percent = (int) (((double)fis.getChannel().position()/ fileSize)*100);
-			return percent;
-		} 
-		catch (IOException e) {
-			e.printStackTrace();
-		}
-		return 0;
-	}
-
-	public boolean isColorspace() {
-		return isColorspace;
-	}
-
-	public void setIsColorspace(boolean isColorspace) {
-		this.isColorspace = isColorspace;
-	}
-
-	public boolean hasNext() {
-		return nextSequence != null;
-	}
-
-	public Sequence next() throws SequenceFormatException {
-		Sequence seq = nextSequence;
-		readNext();
-		return seq;
-	}
-
-	private void readNext() throws SequenceFormatException {
-		try {
-			// First line should be the id
-
-			// We might have blank lines between entries or at the end
-			// so allow for this
-			String id;
-
-			while (true) {
-				id = br.readLine();
-
-				if (id == null) {
-					nextSequence = null;
-					br.close();
-					if (fis != null) {
-						fis.close();
-					}
-					return;
-				}
-				if (id.length()==0) {
-					continue;
-				}				
-
-				break;
-			}
-
-
-			if (!id.startsWith("@")) {
-				nextSequence = null;
-				throw new SequenceFormatException("ID line didn't start with '@'");
-			}
-
-			String seq;
-			String midLine;
-			String quality;
-			try {
-				// Then the sequence
-				seq = br.readLine();
-				if (seq == null) throw new IOException("No more data");
-				// Then another id which we don't need
-				midLine = br.readLine();
-				if (midLine == null) throw new IOException("No more data");
-				if (!midLine.startsWith("+")) {
-					throw new SequenceFormatException("Midline '"+midLine+"' didn't start with '+'");
-				}
-				// Then the quality string
-				quality = br.readLine();
-				if (quality == null) throw new IOException("No more data");
-			}
-			catch (IOException ioe) {
-				throw new SequenceFormatException("Ran out of data in the middle of a fastq entry.  Your file is probably truncated");
-			}
-
-
-			// We only check for colourspace on the first entry.  After that we assume
-			// the rest of the file is the same.  For the first entry the nextSequence
-			// will be null, but we'll have real data in seq
-			if (nextSequence == null && seq != null) {
-				checkColorspace(seq);
-			}
-
-			if (isColorspace()) {
-				nextSequence = new Sequence(this,convertColorspaceToBases(seq.toUpperCase()), seq.toUpperCase(), quality, id);
-			} 
-			else {
-				nextSequence = new Sequence(this, seq.toUpperCase(),quality, id);
-			}
-
-			// If we're running in --casava mode then we will flag any sequences which
-			// are marked as being filtered.
-			if (casavaMode  && !nofilter) {
-
-				// This is the test illumina suggest, but it's a bit flakey, and I'm not
-				// sure it's not going to catch things it shouldn't.
-				if (id.indexOf(":Y:") > 0) {
-					nextSequence.setIsFiltered(true);
-				}
-			}
-
-
-
-
-		} 
-		catch (IOException ioe) {
-			nextSequence = null;
-			ioe.printStackTrace();
-		}
-	}
-
-	private void checkColorspace(String seq) {
-		// Some basecalled files can be all dots, which leads to them
-		// being identified as colorspace data. This check should find
-		// only true colorspace files.
-		String regex = "^[GATCNgatcn][\\.0123456]+$";
-		Pattern pattern = Pattern.compile(regex);
-		Matcher matcher = pattern.matcher(seq);
-		if (matcher.find()) {
-			isColorspace = true;
-		} else {
-			isColorspace = false;
-		}
-	}
-
-	private String convertColorspaceToBases(String s) {
-
-		char[] cs = s.toUpperCase().toCharArray();
-
-		// We've had a crash report where a file contained a zero length
-		// colorspace entry.  This is completely invalid, but we should
-		// handle it anyway.
-		if (cs.length == 0) {
-			return "";
-		}
-
-		char[] bp = new char[cs.length - 1];
-
-		char refBase;
-
-		for (int i = 1; i < cs.length; i++) {
-			if (i == 1) {
-				refBase = cs[i - 1];
-			} else {
-				refBase = bp[i - 2];
-			}
-			if (!(refBase == 'G' || refBase == 'A' || refBase == 'T' || refBase == 'C')) {
-				throw new IllegalArgumentException("Colourspace sequence data should always start with a real DNA letter.  Line '"+s+"' started with " + refBase
-						+ " at position " + i);
-			}
-			switch (cs[i]) {
-			case ('0'):
-				switch (refBase) {
-				case ('G'):
-					bp[i - 1] = 'G';
-				break;
-				case ('A'):
-					bp[i - 1] = 'A';
-				break;
-				case ('T'):
-					bp[i - 1] = 'T';
-				break;
-				case ('C'):
-					bp[i - 1] = 'C';
-				break;
-				}
-			break;
-			case ('1'):
-				switch (refBase) {
-				case ('G'):
-					bp[i - 1] = 'T';
-				break;
-				case ('A'):
-					bp[i - 1] = 'C';
-				break;
-				case ('T'):
-					bp[i - 1] = 'G';
-				break;
-				case ('C'):
-					bp[i - 1] = 'A';
-				break;
-				}
-			break;
-
-			case ('2'):
-				switch (refBase) {
-				case ('G'):
-					bp[i - 1] = 'A';
-				break;
-				case ('A'):
-					bp[i - 1] = 'G';
-				break;
-				case ('T'):
-					bp[i - 1] = 'C';
-				break;
-				case ('C'):
-					bp[i - 1] = 'T';
-				break;
-				}
-			break;
-
-			case ('3'):
-				switch (refBase) {
-				case ('G'):
-					bp[i - 1] = 'C';
-				break;
-				case ('A'):
-					bp[i - 1] = 'T';
-				break;
-				case ('T'):
-					bp[i - 1] = 'A';
-				break;
-				case ('C'):
-					bp[i - 1] = 'G';
-				break;
-				}
-			break;
-
-			case ('.'):
-			case ('4'):
-			case ('5'):
-			case ('6'):
-				for (; i < cs.length; i++) {
-					bp[i - 1] = 'N';
-				}
-			break;
-			default:
-				throw new IllegalArgumentException("Unexpected cs char "
-						+ cs[i]);
-			}
-		}
-
-		return new String(bp);
-	}
-
-	public void remove() {
-		// No action here
-	}
-
-	public File getFile() {
-		return file;
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.itadaki.bzip2.BZip2InputStream;
+
+import uk.ac.babraham.FastQC.FastQCConfig;
+import uk.ac.babraham.FastQC.Utilities.MultiMemberGZIPInputStream;
+
+public class FastQFile implements SequenceFile {
+
+	private Sequence nextSequence = null;
+	private File file;
+	private long fileSize = 0;
+
+	private boolean casavaMode = false;
+	private boolean nofilter = false;
+
+	// We actually read our final data from this buffered reader
+	private BufferedReader br;
+
+	// We keep the file stream around just so we can see how far through
+	// the file we've got.  We don't read from this directly, but it's the
+	// only way to access the file pointer.
+	private FileInputStream fis;
+
+	private String name;
+	private boolean isColorspace = false;
+
+	protected FastQFile(FastQCConfig config,File file) throws SequenceFormatException, IOException {
+		this.file = file;
+		if (file.getName().equals("stdin")) {
+			fileSize = Long.MAX_VALUE;
+		}
+		else {
+			fileSize = file.length();
+		}
+		name = file.getName();
+
+		if (config.casava) {
+			casavaMode = true;
+			if (config.nofilter) {
+				nofilter = true;
+			}
+		}
+
+		if (!file.getName().equals("stdin")) {
+			fis = new FileInputStream(file);
+		}
+		
+		if (file.getName().equals("stdin")) {
+			br = new BufferedReader(new InputStreamReader(System.in));
+		}
+		else if (file.getName().toLowerCase().endsWith(".gz")) {
+			br = new BufferedReader(new InputStreamReader(new MultiMemberGZIPInputStream(fis)));
+		} 
+		else if (file.getName().toLowerCase().endsWith(".bz2")) {
+			br = new BufferedReader(new InputStreamReader(new BZip2InputStream(fis,false)));
+		} 
+
+		else {
+			br = new BufferedReader(new InputStreamReader(fis));
+		}
+		readNext();
+	}
+
+	public String name() {
+		return name;
+	}
+
+	public int getPercentComplete() {
+		if (! hasNext()) return 100;
+		if (file.getName().equals("stdin")) {
+			return 0;
+		}
+		try {
+			int percent = (int) (((double)fis.getChannel().position()/ fileSize)*100);
+			return percent;
+		} 
+		catch (IOException e) {
+			e.printStackTrace();
+		}
+		return 0;
+	}
+
+	public boolean isColorspace() {
+		return isColorspace;
+	}
+
+	public void setIsColorspace(boolean isColorspace) {
+		this.isColorspace = isColorspace;
+	}
+
+	public boolean hasNext() {
+		return nextSequence != null;
+	}
+
+	public Sequence next() throws SequenceFormatException {
+		Sequence seq = nextSequence;
+		readNext();
+		return seq;
+	}
+
+	private void readNext() throws SequenceFormatException {
+		try {
+			// First line should be the id
+
+			// We might have blank lines between entries or at the end
+			// so allow for this
+			String id;
+
+			while (true) {
+				id = br.readLine();
+
+				if (id == null) {
+					nextSequence = null;
+					br.close();
+					if (fis != null) {
+						fis.close();
+					}
+					return;
+				}
+				if (id.length()==0) {
+					continue;
+				}				
+
+				break;
+			}
+
+
+			if (!id.startsWith("@")) {
+				nextSequence = null;
+				throw new SequenceFormatException("ID line didn't start with '@'");
+			}
+
+			String seq;
+			String midLine;
+			String quality;
+			try {
+				// Then the sequence
+				seq = br.readLine();
+				if (seq == null) throw new IOException("No more data");
+				// Then another id which we don't need
+				midLine = br.readLine();
+				if (midLine == null) throw new IOException("No more data");
+				if (!midLine.startsWith("+")) {
+					throw new SequenceFormatException("Midline '"+midLine+"' didn't start with '+'");
+				}
+				// Then the quality string
+				quality = br.readLine();
+				if (quality == null) throw new IOException("No more data");
+			}
+			catch (IOException ioe) {
+				throw new SequenceFormatException("Ran out of data in the middle of a fastq entry.  Your file is probably truncated");
+			}
+
+
+			// We only check for colourspace on the first entry.  After that we assume
+			// the rest of the file is the same.  For the first entry the nextSequence
+			// will be null, but we'll have real data in seq
+			if (nextSequence == null && seq != null) {
+				checkColorspace(seq);
+			}
+
+			if (isColorspace()) {
+				nextSequence = new Sequence(this,convertColorspaceToBases(seq.toUpperCase()), seq.toUpperCase(), quality, id);
+			} 
+			else {
+				nextSequence = new Sequence(this, seq.toUpperCase(),quality, id);
+			}
+
+			// If we're running in --casava mode then we will flag any sequences which
+			// are marked as being filtered.
+			if (casavaMode  && !nofilter) {
+
+				// This is the test illumina suggest, but it's a bit flakey, and I'm not
+				// sure it's not going to catch things it shouldn't.
+				if (id.indexOf(":Y:") > 0) {
+					nextSequence.setIsFiltered(true);
+				}
+			}
+
+
+
+
+		} 
+		catch (IOException ioe) {
+			nextSequence = null;
+			ioe.printStackTrace();
+		}
+	}
+
+	private void checkColorspace(String seq) {
+		// Some basecalled files can be all dots, which leads to them
+		// being identified as colorspace data. This check should find
+		// only true colorspace files.
+		String regex = "^[GATCNgatcn][\\.0123456]+$";
+		Pattern pattern = Pattern.compile(regex);
+		Matcher matcher = pattern.matcher(seq);
+		if (matcher.find()) {
+			isColorspace = true;
+		} else {
+			isColorspace = false;
+		}
+	}
+
+	private String convertColorspaceToBases(String s) {
+
+		char[] cs = s.toUpperCase().toCharArray();
+
+		// We've had a crash report where a file contained a zero length
+		// colorspace entry.  This is completely invalid, but we should
+		// handle it anyway.
+		if (cs.length == 0) {
+			return "";
+		}
+
+		char[] bp = new char[cs.length - 1];
+
+		char refBase;
+
+		for (int i = 1; i < cs.length; i++) {
+			if (i == 1) {
+				refBase = cs[i - 1];
+			} else {
+				refBase = bp[i - 2];
+			}
+			if (!(refBase == 'G' || refBase == 'A' || refBase == 'T' || refBase == 'C')) {
+				throw new IllegalArgumentException("Colourspace sequence data should always start with a real DNA letter.  Line '"+s+"' started with " + refBase
+						+ " at position " + i);
+			}
+			switch (cs[i]) {
+			case ('0'):
+				switch (refBase) {
+				case ('G'):
+					bp[i - 1] = 'G';
+				break;
+				case ('A'):
+					bp[i - 1] = 'A';
+				break;
+				case ('T'):
+					bp[i - 1] = 'T';
+				break;
+				case ('C'):
+					bp[i - 1] = 'C';
+				break;
+				}
+			break;
+			case ('1'):
+				switch (refBase) {
+				case ('G'):
+					bp[i - 1] = 'T';
+				break;
+				case ('A'):
+					bp[i - 1] = 'C';
+				break;
+				case ('T'):
+					bp[i - 1] = 'G';
+				break;
+				case ('C'):
+					bp[i - 1] = 'A';
+				break;
+				}
+			break;
+
+			case ('2'):
+				switch (refBase) {
+				case ('G'):
+					bp[i - 1] = 'A';
+				break;
+				case ('A'):
+					bp[i - 1] = 'G';
+				break;
+				case ('T'):
+					bp[i - 1] = 'C';
+				break;
+				case ('C'):
+					bp[i - 1] = 'T';
+				break;
+				}
+			break;
+
+			case ('3'):
+				switch (refBase) {
+				case ('G'):
+					bp[i - 1] = 'C';
+				break;
+				case ('A'):
+					bp[i - 1] = 'T';
+				break;
+				case ('T'):
+					bp[i - 1] = 'A';
+				break;
+				case ('C'):
+					bp[i - 1] = 'G';
+				break;
+				}
+			break;
+
+			case ('.'):
+			case ('4'):
+			case ('5'):
+			case ('6'):
+				for (; i < cs.length; i++) {
+					bp[i - 1] = 'N';
+				}
+			break;
+			default:
+				throw new IllegalArgumentException("Unexpected cs char "
+						+ cs[i]);
+			}
+		}
+
+		return new String(bp);
+	}
+
+	public void remove() {
+		// No action here
+	}
+
+	public File getFile() {
+		return file;
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/QualityEncoding/PhredEncoding.java b/uk/ac/babraham/FastQC/Sequence/QualityEncoding/PhredEncoding.java
index c5ada6b..a49c2db 100644
--- a/uk/ac/babraham/FastQC/Sequence/QualityEncoding/PhredEncoding.java
+++ b/uk/ac/babraham/FastQC/Sequence/QualityEncoding/PhredEncoding.java
@@ -1,94 +1,94 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence.QualityEncoding;
-
-public class PhredEncoding {
-
-	private String name;
-	private int offset;
-	
-	private static final int SANGER_ENCODING_OFFSET = 33;
-	private static final int ILLUMINA_1_3_ENCODING_OFFSET = 64;
-	
-	public static PhredEncoding getFastQEncodingOffset (char lowestChar) {
-		if (lowestChar < 33) {
-			throw new IllegalArgumentException("No known encodings with chars < 33 (Yours was "+lowestChar+")");
-		}
-		else if (lowestChar < 64) {
-			return new PhredEncoding("Sanger / Illumina 1.9", SANGER_ENCODING_OFFSET);
-		}
-		
-		// There are potentially two encodings using an offset of 64.  Illumina
-		// v1.3 allowed quality values of 1, whereas from v1.5 onwards the lowest
-		// value allowed was 2.  If we guess wrong between these two then it's not
-		// the end of the world since they use the same offset.
-		else if (lowestChar == ILLUMINA_1_3_ENCODING_OFFSET+1) {
-			return new PhredEncoding("Illumina 1.3", ILLUMINA_1_3_ENCODING_OFFSET);			
-		}
-		else if (lowestChar <= 126) {
-			return new PhredEncoding("Illumina 1.5", ILLUMINA_1_3_ENCODING_OFFSET);
-		}
-		throw new IllegalArgumentException("No known encodings with chars > 126 (Yours was "+lowestChar+")");
-	}
-	
-	public static double convertSangerPhredToProbability (int phred) {
-		return Math.pow(10,phred/-10d);
-	}
-	
-	public static double convertOldIlluminaPhredToProbability (int phred) {
-		return Math.pow(10, ((double)phred/(phred+1))/-10d);
-	}
-	
-	public static int convertProbabilityToSangerPhred (double p) {
-		return (int)Math.round(-10d*Math.log10(p));
-	}
-
-	public static int convertProbabilityToOldIlluminaPhred (double p) {
-		return (int)Math.round(-10d*Math.log10(p/1-p));
-	}
-
-	private PhredEncoding (String name, int offset) {
-		this.name = name;
-		this.offset = offset;
-	}
-	
-	public String name () {
-		return name;
-	}
-	
-	public String toString () {
-		return name();
-	}
-	
-	public int offset () {
-		return offset;
-	}
-	
-	
-	public static void main (String [] args) {
-		double p = 0.4;
-		
-		System.out.println("Sanger phred for p="+p+" is "+convertProbabilityToSangerPhred(p));
-		
-		int phred=4;
-		System.out.println("P value for Sanger phred="+phred+" is "+convertSangerPhredToProbability(phred));
-
-	}
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence.QualityEncoding;
+
+public class PhredEncoding {
+
+	private String name;
+	private int offset;
+	
+	private static final int SANGER_ENCODING_OFFSET = 33;
+	private static final int ILLUMINA_1_3_ENCODING_OFFSET = 64;
+	
+	public static PhredEncoding getFastQEncodingOffset (char lowestChar) {
+		if (lowestChar < 33) {
+			throw new IllegalArgumentException("No known encodings with chars < 33 (Yours was "+lowestChar+")");
+		}
+		else if (lowestChar < 64) {
+			return new PhredEncoding("Sanger / Illumina 1.9", SANGER_ENCODING_OFFSET);
+		}
+		
+		// There are potentially two encodings using an offset of 64.  Illumina
+		// v1.3 allowed quality values of 1, whereas from v1.5 onwards the lowest
+		// value allowed was 2.  If we guess wrong between these two then it's not
+		// the end of the world since they use the same offset.
+		else if (lowestChar == ILLUMINA_1_3_ENCODING_OFFSET+1) {
+			return new PhredEncoding("Illumina 1.3", ILLUMINA_1_3_ENCODING_OFFSET);			
+		}
+		else if (lowestChar <= 126) {
+			return new PhredEncoding("Illumina 1.5", ILLUMINA_1_3_ENCODING_OFFSET);
+		}
+		throw new IllegalArgumentException("No known encodings with chars > 126 (Yours was "+lowestChar+")");
+	}
+	
+	public static double convertSangerPhredToProbability (int phred) {
+		return Math.pow(10,phred/-10d);
+	}
+	
+	public static double convertOldIlluminaPhredToProbability (int phred) {
+		return Math.pow(10, ((double)phred/(phred+1))/-10d);
+	}
+	
+	public static int convertProbabilityToSangerPhred (double p) {
+		return (int)Math.round(-10d*Math.log10(p));
+	}
+
+	public static int convertProbabilityToOldIlluminaPhred (double p) {
+		return (int)Math.round(-10d*Math.log10(p/1-p));
+	}
+
+	private PhredEncoding (String name, int offset) {
+		this.name = name;
+		this.offset = offset;
+	}
+	
+	public String name () {
+		return name;
+	}
+	
+	public String toString () {
+		return name();
+	}
+	
+	public int offset () {
+		return offset;
+	}
+	
+	
+	public static void main (String [] args) {
+		double p = 0.4;
+		
+		System.out.println("Sanger phred for p="+p+" is "+convertProbabilityToSangerPhred(p));
+		
+		int phred=4;
+		System.out.println("P value for Sanger phred="+phred+" is "+convertSangerPhredToProbability(phred));
+
+	}
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/Sequence.java b/uk/ac/babraham/FastQC/Sequence/Sequence.java
index ed33904..af54315 100644
--- a/uk/ac/babraham/FastQC/Sequence/Sequence.java
+++ b/uk/ac/babraham/FastQC/Sequence/Sequence.java
@@ -1,76 +1,76 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence;
-
-public class Sequence {
-
-	private String sequence;
-	private String quality;
-	private String id;
-	private SequenceFile file;
-	private String colorspace;
-	private boolean isFiltered;
-	
-	public Sequence (SequenceFile file,String sequence, String quality, String id) {
-		this.id = id;
-		this.file = file;
-		this.sequence = sequence.toUpperCase();
-		this.quality = quality;
-		this.colorspace = null;
-		this.isFiltered = false;
-	}
-	
-	public Sequence (SequenceFile file,String sequence, String colorspace, String quality, String id) {
-		this.id = id;
-		this.file = file;
-		this.sequence = sequence;
-		this.quality = quality;
-		this.colorspace = colorspace;
-	}
-	
-	public void setIsFiltered (boolean isFiltered) {
-		this.isFiltered = isFiltered;
-	}
-	
-	public boolean isFiltered () {
-		return isFiltered;
-	}
-	
-	public SequenceFile file () {
-		return file;
-	}
-	
-	public String getSequence () {
-		return sequence;
-	}
-	
-	public String getColorspace () {
-		return colorspace;
-	}
-	
-	public String getQualityString () {
-		return quality;
-	}
-	
-	public String getID () {
-		return id;
-	}
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence;
+
+public class Sequence {
+
+	private String sequence;
+	private String quality;
+	private String id;
+	private SequenceFile file;
+	private String colorspace;
+	private boolean isFiltered;
+	
+	public Sequence (SequenceFile file,String sequence, String quality, String id) {
+		this.id = id;
+		this.file = file;
+		this.sequence = sequence.toUpperCase();
+		this.quality = quality;
+		this.colorspace = null;
+		this.isFiltered = false;
+	}
+	
+	public Sequence (SequenceFile file,String sequence, String colorspace, String quality, String id) {
+		this.id = id;
+		this.file = file;
+		this.sequence = sequence;
+		this.quality = quality;
+		this.colorspace = colorspace;
+	}
+	
+	public void setIsFiltered (boolean isFiltered) {
+		this.isFiltered = isFiltered;
+	}
+	
+	public boolean isFiltered () {
+		return isFiltered;
+	}
+	
+	public SequenceFile file () {
+		return file;
+	}
+	
+	public String getSequence () {
+		return sequence;
+	}
+	
+	public String getColorspace () {
+		return colorspace;
+	}
+	
+	public String getQualityString () {
+		return quality;
+	}
+	
+	public String getID () {
+		return id;
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/SequenceFactory.java b/uk/ac/babraham/FastQC/Sequence/SequenceFactory.java
index 3aac47b..c298ec1 100644
--- a/uk/ac/babraham/FastQC/Sequence/SequenceFactory.java
+++ b/uk/ac/babraham/FastQC/Sequence/SequenceFactory.java
@@ -1,113 +1,113 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence;
-
-import java.io.File;
-import java.io.IOException;
-
-import uk.ac.babraham.FastQC.FastQCConfig;
-import uk.ac.babraham.FastQC.Utilities.CasavaBasename;
-import uk.ac.babraham.FastQC.Utilities.NameFormatException;
-
-public class SequenceFactory {
-	/**
-	 * 
-	 * This option is used when multiple files are to be treated as a group to produce
-	 * a single output.  This is currently used for groups of files generated by casava
-	 * 
-	 * @param files
-	 * @return
-	 * @throws SequenceFormatException
-	 * @throws IOException
-	 */
-	public static SequenceFile getSequenceFile (File [] files) throws SequenceFormatException, IOException {
-		
-		/*
-		 * We used to build a set of SequenceFile objects to make a sequence group, but we found that
-		 * doing this caused too many files to be open simultaneously and caused crashes on large
-		 * runs.  We now just pass the files to the group and let it open them as and when they're needed.
-		 */
-		
-		if (files.length == 1) {
-			
-			if (FastQCConfig.getInstance().casava) {
-				try {
-					// We do this simply to find out if the casava basename is valid.  If it is then the 
-					// Sequencefilegroup is created at the end of this sub.  If it's not then we do a 
-					// simple creation without modifying the file name.
-					CasavaBasename.getCasavaBasename(files[0].getName());
-				}
-				catch (NameFormatException nfe) {
-					return getSequenceFile(files[0]);
-				}
-			}
-			else {
-				return getSequenceFile(files[0]);	
-			}
-		}
-		
-		
-		return new SequenceFileGroup(files);
-		
-	}
-	
-	public static SequenceFile getSequenceFile(File file) throws SequenceFormatException, IOException {
-		
-		FastQCConfig config = FastQCConfig.getInstance();
-
-//		System.err.println("Format is "+config.sequence_format);
-		
-		if (config.sequence_format != null) {
-			// We're not autodetecting the format, but taking whatever they said
-			
-			if (config.sequence_format.equals("bam") || config.sequence_format.equals("sam")) {
-				return new BAMFile(file,false);				
-			}
-			else if (config.sequence_format.equals("bam_mapped") || config.sequence_format.equals("sam_mapped")) {
-				return new BAMFile(file,true);				
-			}
-			else if (config.sequence_format.equals("fastq")) {
-				return new FastQFile(config,file);
-			}
-			else {
-				throw new SequenceFormatException("Didn't understand format name '"+config.sequence_format+"'");
-			}
-			
-		}
-		
-		
-		// Otherwise we just use the extension on the end of the file name to try to determine
-		// the type
-		if (file.getName().toLowerCase().endsWith(".bam") || file.getName().toLowerCase().endsWith(".sam")) {
-			// We default to using all reads
-			return new BAMFile(file,false);
-		}
-		else if (file.getName().toLowerCase().endsWith(".fast5")) {
-			return new Fast5File(file);
-		}
-		else {
-			return new FastQFile(config,file);
-		}
-
-		
-	}
-	
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence;
+
+import java.io.File;
+import java.io.IOException;
+
+import uk.ac.babraham.FastQC.FastQCConfig;
+import uk.ac.babraham.FastQC.Utilities.CasavaBasename;
+import uk.ac.babraham.FastQC.Utilities.NameFormatException;
+
+public class SequenceFactory {
+	/**
+	 * 
+	 * This option is used when multiple files are to be treated as a group to produce
+	 * a single output.  This is currently used for groups of files generated by casava
+	 * 
+	 * @param files
+	 * @return
+	 * @throws SequenceFormatException
+	 * @throws IOException
+	 */
+	public static SequenceFile getSequenceFile (File [] files) throws SequenceFormatException, IOException {
+		
+		/*
+		 * We used to build a set of SequenceFile objects to make a sequence group, but we found that
+		 * doing this caused too many files to be open simultaneously and caused crashes on large
+		 * runs.  We now just pass the files to the group and let it open them as and when they're needed.
+		 */
+		
+		if (files.length == 1) {
+			
+			if (FastQCConfig.getInstance().casava) {
+				try {
+					// We do this simply to find out if the casava basename is valid.  If it is then the 
+					// Sequencefilegroup is created at the end of this sub.  If it's not then we do a 
+					// simple creation without modifying the file name.
+					CasavaBasename.getCasavaBasename(files[0].getName());
+				}
+				catch (NameFormatException nfe) {
+					return getSequenceFile(files[0]);
+				}
+			}
+			else {
+				return getSequenceFile(files[0]);	
+			}
+		}
+		
+		
+		return new SequenceFileGroup(files);
+		
+	}
+	
+	public static SequenceFile getSequenceFile(File file) throws SequenceFormatException, IOException {
+		
+		FastQCConfig config = FastQCConfig.getInstance();
+
+//		System.err.println("Format is "+config.sequence_format);
+		
+		if (config.sequence_format != null) {
+			// We're not autodetecting the format, but taking whatever they said
+			
+			if (config.sequence_format.equals("bam") || config.sequence_format.equals("sam")) {
+				return new BAMFile(file,false);				
+			}
+			else if (config.sequence_format.equals("bam_mapped") || config.sequence_format.equals("sam_mapped")) {
+				return new BAMFile(file,true);				
+			}
+			else if (config.sequence_format.equals("fastq")) {
+				return new FastQFile(config,file);
+			}
+			else {
+				throw new SequenceFormatException("Didn't understand format name '"+config.sequence_format+"'");
+			}
+			
+		}
+		
+		
+		// Otherwise we just use the extension on the end of the file name to try to determine
+		// the type
+		if (file.getName().toLowerCase().endsWith(".bam") || file.getName().toLowerCase().endsWith(".sam")) {
+			// We default to using all reads
+			return new BAMFile(file,false);
+		}
+		else if (file.getName().toLowerCase().endsWith(".fast5")) {
+			return new Fast5File(file);
+		}
+		else {
+			return new FastQFile(config,file);
+		}
+
+		
+	}
+	
+	
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/SequenceFile.java b/uk/ac/babraham/FastQC/Sequence/SequenceFile.java
index 8795b0c..dff64ae 100644
--- a/uk/ac/babraham/FastQC/Sequence/SequenceFile.java
+++ b/uk/ac/babraham/FastQC/Sequence/SequenceFile.java
@@ -1,33 +1,33 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence;
-
-import java.io.File;
-
-public interface SequenceFile {
-
-	public boolean hasNext();
-	public Sequence next() throws SequenceFormatException;
-	public boolean isColorspace();
-	public String name();
-	public int getPercentComplete();
-	public File getFile();
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence;
+
+import java.io.File;
+
+public interface SequenceFile {
+
+	public boolean hasNext();
+	public Sequence next() throws SequenceFormatException;
+	public boolean isColorspace();
+	public String name();
+	public int getPercentComplete();
+	public File getFile();
+	
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/SequenceFileGroup.java b/uk/ac/babraham/FastQC/Sequence/SequenceFileGroup.java
index df327ca..55f3a55 100644
--- a/uk/ac/babraham/FastQC/Sequence/SequenceFileGroup.java
+++ b/uk/ac/babraham/FastQC/Sequence/SequenceFileGroup.java
@@ -1,93 +1,93 @@
-/**
- * Copyright Copyright 2013-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence;
-
-import java.io.File;
-import java.io.IOException;
-
-import uk.ac.babraham.FastQC.Utilities.CasavaBasename;
-import uk.ac.babraham.FastQC.Utilities.NameFormatException;
-
-public class SequenceFileGroup implements SequenceFile {
-
-	private File [] files;
-	private SequenceFile sequenceFile;
-	private File groupFile;
-	private int currentIndex = 0;
-
-	public SequenceFileGroup( File [] files) throws IOException, SequenceFormatException {
-		this.files = files;
-		sequenceFile = SequenceFactory.getSequenceFile(files[0]);
-				
-		try {
-			String baseName = CasavaBasename.getCasavaBasename(sequenceFile.name());
-			if (sequenceFile.getFile().getParent() == null) {
-				groupFile = new File(baseName);
-			} else {
-				groupFile = new File(sequenceFile.getFile().getParent() + "/"
-						+ baseName);
-			}
-		} catch (NameFormatException nfe) {
-			groupFile = sequenceFile.getFile();
-		}
-	}
-
-	public File getFile() {
-		return groupFile;
-	}
-
-	public int getPercentComplete() {
-		return ((100 * currentIndex) / files.length)
-				+ (sequenceFile.getPercentComplete() / files.length);
-	}
-
-	public boolean hasNext() {
-		if (sequenceFile.hasNext()) {
-			return true;
-		} 
-		else {
-			while (currentIndex < files.length - 1) {
-				++currentIndex;
-				try {
-					sequenceFile = SequenceFactory.getSequenceFile(files[currentIndex]);
-				}
-				catch (Exception e) {
-					e.printStackTrace();
-					return false;
-				}
-				if (sequenceFile.hasNext()) break;
-			}
-			return sequenceFile.hasNext();
-		}
-	}
-
-	public boolean isColorspace() {
-		return sequenceFile.isColorspace();
-	}
-
-	public String name() {
-		return groupFile.getName();
-	}
-
-	public Sequence next() throws SequenceFormatException {
-		return sequenceFile.next();
-	}
-
-}
+/**
+ * Copyright Copyright 2013-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence;
+
+import java.io.File;
+import java.io.IOException;
+
+import uk.ac.babraham.FastQC.Utilities.CasavaBasename;
+import uk.ac.babraham.FastQC.Utilities.NameFormatException;
+
+public class SequenceFileGroup implements SequenceFile {
+
+	private File [] files;
+	private SequenceFile sequenceFile;
+	private File groupFile;
+	private int currentIndex = 0;
+
+	public SequenceFileGroup( File [] files) throws IOException, SequenceFormatException {
+		this.files = files;
+		sequenceFile = SequenceFactory.getSequenceFile(files[0]);
+				
+		try {
+			String baseName = CasavaBasename.getCasavaBasename(sequenceFile.name());
+			if (sequenceFile.getFile().getParent() == null) {
+				groupFile = new File(baseName);
+			} else {
+				groupFile = new File(sequenceFile.getFile().getParent() + "/"
+						+ baseName);
+			}
+		} catch (NameFormatException nfe) {
+			groupFile = sequenceFile.getFile();
+		}
+	}
+
+	public File getFile() {
+		return groupFile;
+	}
+
+	public int getPercentComplete() {
+		return ((100 * currentIndex) / files.length)
+				+ (sequenceFile.getPercentComplete() / files.length);
+	}
+
+	public boolean hasNext() {
+		if (sequenceFile.hasNext()) {
+			return true;
+		} 
+		else {
+			while (currentIndex < files.length - 1) {
+				++currentIndex;
+				try {
+					sequenceFile = SequenceFactory.getSequenceFile(files[currentIndex]);
+				}
+				catch (Exception e) {
+					e.printStackTrace();
+					return false;
+				}
+				if (sequenceFile.hasNext()) break;
+			}
+			return sequenceFile.hasNext();
+		}
+	}
+
+	public boolean isColorspace() {
+		return sequenceFile.isColorspace();
+	}
+
+	public String name() {
+		return groupFile.getName();
+	}
+
+	public Sequence next() throws SequenceFormatException {
+		return sequenceFile.next();
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Sequence/SequenceFormatException.java b/uk/ac/babraham/FastQC/Sequence/SequenceFormatException.java
index 5d555ef..8762ace 100644
--- a/uk/ac/babraham/FastQC/Sequence/SequenceFormatException.java
+++ b/uk/ac/babraham/FastQC/Sequence/SequenceFormatException.java
@@ -1,28 +1,28 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Sequence;
-
-public class SequenceFormatException extends Exception {
-	
-	public SequenceFormatException (String message) {
-		super(message);
-	}
-
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Sequence;
+
+public class SequenceFormatException extends Exception {
+	
+	public SequenceFormatException (String message) {
+		super(message);
+	}
+
+}
diff --git a/uk/ac/babraham/FastQC/Statistics/NormalDistribution.java b/uk/ac/babraham/FastQC/Statistics/NormalDistribution.java
index e6a935d..df7ad81 100644
--- a/uk/ac/babraham/FastQC/Statistics/NormalDistribution.java
+++ b/uk/ac/babraham/FastQC/Statistics/NormalDistribution.java
@@ -1,49 +1,49 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Statistics;
-
-public class NormalDistribution {
-
-	private double mean;
-	private double stdev;
-	
-	public NormalDistribution (double mean, double stdev) {
-//		System.out.println("Made distribution with mean "+mean+" and variance "+stdev);
-		this.mean = mean;
-		this.stdev = stdev;
-	}
-	
-	public double getZScoreForValue (double value) {
-		double lhs = 1d/(Math.sqrt(2*Math.PI*stdev*stdev));
-		double rhs = Math.pow(Math.E, 0 - (Math.pow(value-mean,2)/(2*stdev*stdev)));
-		
-		return lhs*rhs;
-	}
-	
-	
-//	public static void main (String [] args) {
-//		NormalDistribution nd = new NormalDistribution(50, 5);
-//		
-//		for (int i=0;i<=100;i++) {
-//			System.out.println(i+"\t"+nd.getZScoreForValue(i));
-//		}
-//	}
-	
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Statistics;
+
+public class NormalDistribution {
+
+	private double mean;
+	private double stdev;
+	
+	public NormalDistribution (double mean, double stdev) {
+//		System.out.println("Made distribution with mean "+mean+" and variance "+stdev);
+		this.mean = mean;
+		this.stdev = stdev;
+	}
+	
+	public double getZScoreForValue (double value) {
+		double lhs = 1d/(Math.sqrt(2*Math.PI*stdev*stdev));
+		double rhs = Math.pow(Math.E, 0 - (Math.pow(value-mean,2)/(2*stdev*stdev)));
+		
+		return lhs*rhs;
+	}
+	
+	
+//	public static void main (String [] args) {
+//		NormalDistribution nd = new NormalDistribution(50, 5);
+//		
+//		for (int i=0;i<=100;i++) {
+//			System.out.println(i+"\t"+nd.getZScoreForValue(i));
+//		}
+//	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Statistics/PearsonCorrelation.java b/uk/ac/babraham/FastQC/Statistics/PearsonCorrelation.java
index 6792c33..4399b88 100644
--- a/uk/ac/babraham/FastQC/Statistics/PearsonCorrelation.java
+++ b/uk/ac/babraham/FastQC/Statistics/PearsonCorrelation.java
@@ -1,105 +1,105 @@
-/**
- * Copyright Copyright 2010-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Statistics;
-
-
-/**
- * A Class to calculate the Pearson Correlation.
- */
-public class PearsonCorrelation {
-
-	
-	/**
-	 * Calculate correlation.
-	 * 
-	 * @param data1 the first dataset
-	 * @param data2 the second dataset
-	 * @return the Pearson r-value
-	 * @throws SeqMonkException if the two datasets don't have the same number of points in them.
-	 */
-	public static float calculateCorrelation (long [] data1, long [] data2) {
-
-		float [] d1 = new float[data1.length];
-		float [] d2 = new float[data2.length];
-		for (int i=0;i<data1.length;i++)d1[i] = data1[i];
-		for (int i=0;i<data2.length;i++)d2[i] = data2[i];
-		
-		return calculateCorrelation(d1, d2);
-		
-	}
-	
-	/**
-	 * Calculate correlation.
-	 * 
-	 * @param data1 the first dataset
-	 * @param data2 the second dataset
-	 * @return the Pearson r-value
-	 * @throws SeqMonkException if the two datasets don't have the same number of points in them.
-	 */
-	public static float calculateCorrelation (long [] data1, long [] data2, int offset) {
-
-		float [] d1 = new float[data1.length-offset];
-		float [] d2 = new float[data2.length-offset];
-		for (int i=0;i<d1.length;i++)d1[i] = data1[i];
-		for (int i=0;i<d2.length;i++)d2[i] = data2[i+offset];
-		
-		return calculateCorrelation(d1, d2);
-		
-	}
-	
-	
-	/**
-	 * Calculate correlation.
-	 * 
-	 * @param data1 the first dataset
-	 * @param data2 the second dataset
-	 * @return the Pearson r-value
-	 * @throws SeqMonkException if the two datasets don't have the same number of points in them.
-	 */
-	public static float calculateCorrelation (float [] data1, float [] data2) {
-	
-		if (data1.length != data2.length) {
-			throw new IllegalArgumentException("Data sets must be the same length when calculating correlation");
-		}
-		
-		float sum12 = 0;
-		float sum1 = 0;
-		float sum2 = 0;
-		float sum1square = 0;
-		float sum2square =0;
-		
-		for (int i=0;i<data1.length;i++) {
-			sum12 += data1[i]*data2[i];
-			sum1 += data1[i];
-			sum2 += data2[i];
-			sum1square += data1[i]*data1[i];
-			sum2square += data2[i]*data2[i];
-		}
-		
-		float top = sum12 - ((sum1*sum2)/data1.length);
-		float bottomRight = sum2square - ((sum2*sum2)/data1.length);
-		float bottomLeft = sum1square - ((sum1*sum1)/data1.length);
-		float bottom = (float)Math.sqrt(bottomLeft * bottomRight);
-		
-		
-		return top/bottom;
-	}
-		
-}
+/**
+ * Copyright Copyright 2010-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Statistics;
+
+
+/**
+ * A Class to calculate the Pearson Correlation.
+ */
+public class PearsonCorrelation {
+
+	
+	/**
+	 * Calculate correlation.
+	 * 
+	 * @param data1 the first dataset
+	 * @param data2 the second dataset
+	 * @return the Pearson r-value
+	 * @throws SeqMonkException if the two datasets don't have the same number of points in them.
+	 */
+	public static float calculateCorrelation (long [] data1, long [] data2) {
+
+		float [] d1 = new float[data1.length];
+		float [] d2 = new float[data2.length];
+		for (int i=0;i<data1.length;i++)d1[i] = data1[i];
+		for (int i=0;i<data2.length;i++)d2[i] = data2[i];
+		
+		return calculateCorrelation(d1, d2);
+		
+	}
+	
+	/**
+	 * Calculate correlation.
+	 * 
+	 * @param data1 the first dataset
+	 * @param data2 the second dataset
+	 * @return the Pearson r-value
+	 * @throws SeqMonkException if the two datasets don't have the same number of points in them.
+	 */
+	public static float calculateCorrelation (long [] data1, long [] data2, int offset) {
+
+		float [] d1 = new float[data1.length-offset];
+		float [] d2 = new float[data2.length-offset];
+		for (int i=0;i<d1.length;i++)d1[i] = data1[i];
+		for (int i=0;i<d2.length;i++)d2[i] = data2[i+offset];
+		
+		return calculateCorrelation(d1, d2);
+		
+	}
+	
+	
+	/**
+	 * Calculate correlation.
+	 * 
+	 * @param data1 the first dataset
+	 * @param data2 the second dataset
+	 * @return the Pearson r-value
+	 * @throws SeqMonkException if the two datasets don't have the same number of points in them.
+	 */
+	public static float calculateCorrelation (float [] data1, float [] data2) {
+	
+		if (data1.length != data2.length) {
+			throw new IllegalArgumentException("Data sets must be the same length when calculating correlation");
+		}
+		
+		float sum12 = 0;
+		float sum1 = 0;
+		float sum2 = 0;
+		float sum1square = 0;
+		float sum2square =0;
+		
+		for (int i=0;i<data1.length;i++) {
+			sum12 += data1[i]*data2[i];
+			sum1 += data1[i];
+			sum2 += data2[i];
+			sum1square += data1[i]*data1[i];
+			sum2square += data2[i]*data2[i];
+		}
+		
+		float top = sum12 - ((sum1*sum2)/data1.length);
+		float bottomRight = sum2square - ((sum2*sum2)/data1.length);
+		float bottomLeft = sum1square - ((sum1*sum1)/data1.length);
+		float bottom = (float)Math.sqrt(bottomLeft * bottomRight);
+		
+		
+		return top/bottom;
+	}
+		
+}
diff --git a/uk/ac/babraham/FastQC/Utilities/CasavaBasename.java b/uk/ac/babraham/FastQC/Utilities/CasavaBasename.java
index 984b920..73ac432 100644
--- a/uk/ac/babraham/FastQC/Utilities/CasavaBasename.java
+++ b/uk/ac/babraham/FastQC/Utilities/CasavaBasename.java
@@ -1,135 +1,135 @@
-/**
- * Copyright Copyright 2011-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-package uk.ac.babraham.FastQC.Utilities;
-
-import java.io.File;
-import java.util.Hashtable;
-import java.util.Vector;
-
-public class CasavaBasename {
-
-	/**
-	 * This method finds the core name from a CASAVA 1.8 fastq file.  It strips off the
-	 * part which indicates that this file is one of a set and returns the base name with
-	 * this part removed.
-	 * 
-	 * If the filename does not conform to standard CASAVA naming then a NameFormatException
-	 * is thrown.
-	 * 
-	 * @param originalName
-	 * @return
-	 * @throws NameFormatException
-	 */
-	
-	public static String getCasavaBasename (String originalName) throws NameFormatException {
-		
-		// Find the base name.  We need to remove the 123 numbers from
-		// files of the form:
-		//
-		// anyold_text_123.fastq.gz
-		//
-		// where the base name will be
-		//
-		// anyoldtext.fastq.gz
-		
-		// The file must usually end with .fastq.gz, but you can tell cassava to not
-		// compress, in which case the .gz is missing.
-
-		
-		if (originalName.endsWith(".fastq.gz")) {
-			
-			// They must have an _ 13 chars before the end
-			if (originalName.substring(originalName.length()-13, originalName.length()-12).equals("_")) {
-				
-				// They must have numbers for the 3 positions before .fastq
-				try {
-					Integer.parseInt(originalName.substring(originalName.length()-12, originalName.length()-9));
-					
-					// If we get here then everything is OK to use the base name from this file
-					String baseName = originalName.substring(0,originalName.length()-13)+".fastq.gz";
-					return baseName;
-				}
-				catch (NumberFormatException nfe) {}
-			}
-		}
-
-		
-		else if (originalName.endsWith(".fastq")) {
-			
-			// They must have an _ 10 chars before the end
-			if (originalName.substring(originalName.length()-10, originalName.length()-9).equals("_")) {
-				
-				// They must have numbers for the 3 positions before .fastq
-				try {
-					Integer.parseInt(originalName.substring(originalName.length()-9, originalName.length()-6));
-					
-					// If we get here then everything is OK to use the base name from this file
-					String baseName = originalName.substring(0,originalName.length()-10)+".fastq";
-					return baseName;
-				}
-				catch (NumberFormatException nfe) {}
-			}
-		}
-
-		
-		throw new NameFormatException();
-	}
-	
-	public static File [][] getCasavaGroups (File [] files) {
-		Hashtable<String, Vector<File>> fileBases = new Hashtable<String, Vector<File>>();
-		
-		for (int f=0;f<files.length;f++) {
-
-			// If a file forms part of a CASAVA group then put it into that
-			// group.
-			try {
-				String baseName = CasavaBasename.getCasavaBasename(files[f].getName());
-				if (! fileBases.containsKey(baseName)) {
-					fileBases.put(baseName,new Vector<File>());
-				}
-				fileBases.get(baseName).add(files[f]);
-
-			}
-			
-			// If the file name doesn't appear to be part of a CASAVA group
-			// then add it as a singleton
-			catch (NameFormatException nfe) {
-				
-				System.err.println("File '"+files[f].getName()+"' didn't look like part of a CASAVA group");
-				Vector<File> newVector = new Vector<File>();
-				newVector.add(files[f]);
-				fileBases.put(files[f].getName(), newVector);				
-			}
-			
-		}
-		
-		String [] baseNames = fileBases.keySet().toArray(new String [0]);
-		
-		File [][] fileGroups = new File[baseNames.length][];
-		
-		for (int i=0;i<baseNames.length;i++) {
-			fileGroups[i] = fileBases.get(baseNames[i]).toArray(new File[0]);
-		}
-		
-		return fileGroups;		
-	}
-	
-}
+/**
+ * Copyright Copyright 2011-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+package uk.ac.babraham.FastQC.Utilities;
+
+import java.io.File;
+import java.util.Hashtable;
+import java.util.Vector;
+
+public class CasavaBasename {
+
+	/**
+	 * This method finds the core name from a CASAVA 1.8 fastq file.  It strips off the
+	 * part which indicates that this file is one of a set and returns the base name with
+	 * this part removed.
+	 * 
+	 * If the filename does not conform to standard CASAVA naming then a NameFormatException
+	 * is thrown.
+	 * 
+	 * @param originalName
+	 * @return
+	 * @throws NameFormatException
+	 */
+	
+	public static String getCasavaBasename (String originalName) throws NameFormatException {
+		
+		// Find the base name.  We need to remove the 123 numbers from
+		// files of the form:
+		//
+		// anyold_text_123.fastq.gz
+		//
+		// where the base name will be
+		//
+		// anyoldtext.fastq.gz
+		
+		// The file must usually end with .fastq.gz, but you can tell cassava to not
+		// compress, in which case the .gz is missing.
+
+		
+		if (originalName.endsWith(".fastq.gz")) {
+			
+			// They must have an _ 13 chars before the end
+			if (originalName.substring(originalName.length()-13, originalName.length()-12).equals("_")) {
+				
+				// They must have numbers for the 3 positions before .fastq
+				try {
+					Integer.parseInt(originalName.substring(originalName.length()-12, originalName.length()-9));
+					
+					// If we get here then everything is OK to use the base name from this file
+					String baseName = originalName.substring(0,originalName.length()-13)+".fastq.gz";
+					return baseName;
+				}
+				catch (NumberFormatException nfe) {}
+			}
+		}
+
+		
+		else if (originalName.endsWith(".fastq")) {
+			
+			// They must have an _ 10 chars before the end
+			if (originalName.substring(originalName.length()-10, originalName.length()-9).equals("_")) {
+				
+				// They must have numbers for the 3 positions before .fastq
+				try {
+					Integer.parseInt(originalName.substring(originalName.length()-9, originalName.length()-6));
+					
+					// If we get here then everything is OK to use the base name from this file
+					String baseName = originalName.substring(0,originalName.length()-10)+".fastq";
+					return baseName;
+				}
+				catch (NumberFormatException nfe) {}
+			}
+		}
+
+		
+		throw new NameFormatException();
+	}
+	
+	public static File [][] getCasavaGroups (File [] files) {
+		Hashtable<String, Vector<File>> fileBases = new Hashtable<String, Vector<File>>();
+		
+		for (int f=0;f<files.length;f++) {
+
+			// If a file forms part of a CASAVA group then put it into that
+			// group.
+			try {
+				String baseName = CasavaBasename.getCasavaBasename(files[f].getName());
+				if (! fileBases.containsKey(baseName)) {
+					fileBases.put(baseName,new Vector<File>());
+				}
+				fileBases.get(baseName).add(files[f]);
+
+			}
+			
+			// If the file name doesn't appear to be part of a CASAVA group
+			// then add it as a singleton
+			catch (NameFormatException nfe) {
+				
+				System.err.println("File '"+files[f].getName()+"' didn't look like part of a CASAVA group");
+				Vector<File> newVector = new Vector<File>();
+				newVector.add(files[f]);
+				fileBases.put(files[f].getName(), newVector);				
+			}
+			
+		}
+		
+		String [] baseNames = fileBases.keySet().toArray(new String [0]);
+		
+		File [][] fileGroups = new File[baseNames.length][];
+		
+		for (int i=0;i<baseNames.length;i++) {
+			fileGroups[i] = fileBases.get(baseNames[i]).toArray(new File[0]);
+		}
+		
+		return fileGroups;		
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Utilities/HotColdColourGradient.java b/uk/ac/babraham/FastQC/Utilities/HotColdColourGradient.java
index 7768859..c5851b3 100644
--- a/uk/ac/babraham/FastQC/Utilities/HotColdColourGradient.java
+++ b/uk/ac/babraham/FastQC/Utilities/HotColdColourGradient.java
@@ -1,155 +1,155 @@
-/**
- * Copyright Copyright 2007-15 Simon Andrews
- *
- *    This file is part of SeqMonk.
- *
- *    SeqMonk is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    SeqMonk is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with SeqMonk; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Utilities;
-
-import java.awt.Color;
-
-/**
- * Provides a range of colours which form a smooth gradient
- * from Blue through Green to Red.
- */
-public class HotColdColourGradient {
-	
-	
-	// To save generating ridiculous numbers of colours and wasting
-	// memory we're going to make up a pool of 100 colours and pick
-	// the closest one from that set to return.
-	
-	private final Color [] colors = makeColors();
-	
-	public String toString() {
-		return "Hot Cold Colour Gradient";
-	}
-	
-	/**
-	 * A method initially called to create a palette of 100 pre-cached
-	 * colours from which the closest match will be selected to 
-	 * return for future queries.  Setting the colours this way
-	 * saves on the overhead of generating a lot of new objects
-	 * 
-	 * @return An array of colours crossing the full palette.
-	 */
-	protected Color [] makeColors() {
-		/*
-		 * We pre-generate a list of 100 colours we're going to
-		 * use for this display.
-		 * 
-		 * Because a linear gradient ends up leaving too much
-		 * green in the spectrum we put this on a log scale
-		 * to emphasise low and high values so the display
-		 * is clearer.
-		 */
-		
-		Color [] colors = new Color[100];
-		
-		// We base colors on the square root of their raw value
-		
-		double min = 0 - Math.pow(50, 0.5);
-		double max = Math.pow(99-50,0.5);
-		for (int c=0;c<100;c++) {
-			int actualC = c-50;
-			if (actualC < 0) actualC = 0-actualC;
-			double corrected = Math.pow(actualC, 0.5);
-			if (c<50 && corrected > 0) corrected = 0-corrected;
-			RGB r = getRGB(corrected, min, max);
-			colors[c] = new Color(r.r,r.g,r.b);			
-		}
-				
-		return colors;
-	}
-	
-	/**
-	 * Gets a colour from the gradient
-	 * 
-	 * @param value The value for which you want a colour
-	 * @param min The minimum value in the gradient
-	 * @param max The maximum value in the gradient
-	 * @return A colour from the appropriate part of the gradient
-	 */
-	public Color getColor (double value,double min, double max) {
-		if (colors[0] == null) makeColors();
-
-		int percentage = (int)((100 * (value-min)) / (max-min));
-	
-		if (percentage > 100) percentage = 100;
-		if (percentage < 1) percentage = 1;
-		
-		return colors[percentage-1];
-	}
-
-	/**
-	 * Gets an RGB object for separate colour values
-	 * 
-	 * @param value The value stored
-	 * @param min The minimum value in the gradient
-	 * @param max The maximum value in the gradient
-	 * @return An RGB object representing the colour
-	 */
-	private RGB getRGB (double value, double min, double max) {
-		
-		int red;
-		int green;
-		int blue;
-		
-		double diff = max - min;
-		
-		// Red
-		// Red is 0 for the first 50%, scales from 0-200 over 50-75%
-		// and stays at 200 from 75-100%
-
-		// Green
-		// Green scales from 0-200 over the first 25%, stays at
-		// 200 from 25-75% and then scales from 200-0 from 75-100%
-
-		// Blue
-		// Blue starts at 200 until 25%, then scales from 200-0
-		// from 25-50%, then stays at 0 until 100%
-
-		// Since all transitions happen in quarters of the spectrum
-		// range it's easiest to deal with colour values in those
-		// ranges
-		
-		
-		if (value < (min+(diff*0.25))) {
-			red = 0;
-			blue = 200;
-			green = (int)(200 * ((value-min) / (diff*0.25)));
-		
-		}
-		else if (value < (min+(diff*0.5))) {
-			red = 0;
-			green = 200;
-			blue = (int)(200 - (200 * ((value-(min+(diff*0.25))) / (diff*0.25))));
-		}
-		else if (value < (min+(diff*0.75))) {
-			green = 200;
-			blue = 0;
-			red = (int)(200 * ((value-(min+(diff*0.5))) / (diff*0.25)));
-		}
-		else {
-			red = 200;
-			blue = 0;
-			green = (int)(200 - (200 * ((value-(min+(diff*0.75))) / (diff*0.25))));
-		}
-
-		return new RGB(red,green,blue);
-	}
-	
-}
+/**
+ * Copyright Copyright 2007-15 Simon Andrews
+ *
+ *    This file is part of SeqMonk.
+ *
+ *    SeqMonk is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    SeqMonk is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with SeqMonk; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Utilities;
+
+import java.awt.Color;
+
+/**
+ * Provides a range of colours which form a smooth gradient
+ * from Blue through Green to Red.
+ */
+public class HotColdColourGradient {
+	
+	
+	// To save generating ridiculous numbers of colours and wasting
+	// memory we're going to make up a pool of 100 colours and pick
+	// the closest one from that set to return.
+	
+	private final Color [] colors = makeColors();
+	
+	public String toString() {
+		return "Hot Cold Colour Gradient";
+	}
+	
+	/**
+	 * A method initially called to create a palette of 100 pre-cached
+	 * colours from which the closest match will be selected to 
+	 * return for future queries.  Setting the colours this way
+	 * saves on the overhead of generating a lot of new objects
+	 * 
+	 * @return An array of colours crossing the full palette.
+	 */
+	protected Color [] makeColors() {
+		/*
+		 * We pre-generate a list of 100 colours we're going to
+		 * use for this display.
+		 * 
+		 * Because a linear gradient ends up leaving too much
+		 * green in the spectrum we put this on a log scale
+		 * to emphasise low and high values so the display
+		 * is clearer.
+		 */
+		
+		Color [] colors = new Color[100];
+		
+		// We base colors on the square root of their raw value
+		
+		double min = 0 - Math.pow(50, 0.5);
+		double max = Math.pow(99-50,0.5);
+		for (int c=0;c<100;c++) {
+			int actualC = c-50;
+			if (actualC < 0) actualC = 0-actualC;
+			double corrected = Math.pow(actualC, 0.5);
+			if (c<50 && corrected > 0) corrected = 0-corrected;
+			RGB r = getRGB(corrected, min, max);
+			colors[c] = new Color(r.r,r.g,r.b);			
+		}
+				
+		return colors;
+	}
+	
+	/**
+	 * Gets a colour from the gradient
+	 * 
+	 * @param value The value for which you want a colour
+	 * @param min The minimum value in the gradient
+	 * @param max The maximum value in the gradient
+	 * @return A colour from the appropriate part of the gradient
+	 */
+	public Color getColor (double value,double min, double max) {
+		if (colors[0] == null) makeColors();
+
+		int percentage = (int)((100 * (value-min)) / (max-min));
+	
+		if (percentage > 100) percentage = 100;
+		if (percentage < 1) percentage = 1;
+		
+		return colors[percentage-1];
+	}
+
+	/**
+	 * Gets an RGB object for separate colour values
+	 * 
+	 * @param value The value stored
+	 * @param min The minimum value in the gradient
+	 * @param max The maximum value in the gradient
+	 * @return An RGB object representing the colour
+	 */
+	private RGB getRGB (double value, double min, double max) {
+		
+		int red;
+		int green;
+		int blue;
+		
+		double diff = max - min;
+		
+		// Red
+		// Red is 0 for the first 50%, scales from 0-200 over 50-75%
+		// and stays at 200 from 75-100%
+
+		// Green
+		// Green scales from 0-200 over the first 25%, stays at
+		// 200 from 25-75% and then scales from 200-0 from 75-100%
+
+		// Blue
+		// Blue starts at 200 until 25%, then scales from 200-0
+		// from 25-50%, then stays at 0 until 100%
+
+		// Since all transitions happen in quarters of the spectrum
+		// range it's easiest to deal with colour values in those
+		// ranges
+		
+		
+		if (value < (min+(diff*0.25))) {
+			red = 0;
+			blue = 200;
+			green = (int)(200 * ((value-min) / (diff*0.25)));
+		
+		}
+		else if (value < (min+(diff*0.5))) {
+			red = 0;
+			green = 200;
+			blue = (int)(200 - (200 * ((value-(min+(diff*0.25))) / (diff*0.25))));
+		}
+		else if (value < (min+(diff*0.75))) {
+			green = 200;
+			blue = 0;
+			red = (int)(200 * ((value-(min+(diff*0.5))) / (diff*0.25)));
+		}
+		else {
+			red = 200;
+			blue = 0;
+			green = (int)(200 - (200 * ((value-(min+(diff*0.75))) / (diff*0.25))));
+		}
+
+		return new RGB(red,green,blue);
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Utilities/MultiMemberGZIPInputStream.java b/uk/ac/babraham/FastQC/Utilities/MultiMemberGZIPInputStream.java
index 82fbd27..3455c18 100644
--- a/uk/ac/babraham/FastQC/Utilities/MultiMemberGZIPInputStream.java
+++ b/uk/ac/babraham/FastQC/Utilities/MultiMemberGZIPInputStream.java
@@ -1,112 +1,112 @@
-package uk.ac.babraham.FastQC.Utilities;
-
-/**
- * This class is a work round for a bug in the core java gzip decompression
- * code which can't handle multiple compressed blocks being concatenated within
- * the same file.  It incorrectly reports that it has hit EOF when it gets to 
- * the end of the first compressed block.
- * 
- * This work round was posted in the bug report at:
- * 
- * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4691425
- * 
- * Unfortunately the Sun bug database doesn't show who posted it so I can't
- * provide an attribution. They didn't specify under what licence this code
- * was being provided, but I'm going to assume that since it was posted as
- * a work round for a reported bug that it's open enough to use here.
- */
-
-
-import java.io.InputStream;
-import java.io.PushbackInputStream;
-import java.io.IOException;
-import java.util.zip.GZIPInputStream;
-
-public class MultiMemberGZIPInputStream extends GZIPInputStream {
-
-	public MultiMemberGZIPInputStream(InputStream in, int size) throws IOException
-	{
-		// Wrap the stream in a PushbackInputStream...
-		super(new PushbackInputStream(in, size), size);
-		this.size=size;
-	}
-
-	public MultiMemberGZIPInputStream(InputStream in) throws IOException
-	{
-		// Wrap the stream in a PushbackInputStream...
-		super(new PushbackInputStream(in, 1024));
-		this.size=-1;
-	}
-
-	private MultiMemberGZIPInputStream(MultiMemberGZIPInputStream parent) throws IOException
-	{
-		super(parent.in);
-		this.size=-1;
-		this.parent=parent.parent==null ? parent : parent.parent;
-		this.parent.child=this;
-	}
-
-	private MultiMemberGZIPInputStream(MultiMemberGZIPInputStream parent, int size) throws IOException
-	{
-		super(parent.in, size);
-		this.size=size;
-		this.parent=parent.parent==null ? parent : parent.parent;
-		this.parent.child=this;
-	}
-
-	private MultiMemberGZIPInputStream parent;
-	private MultiMemberGZIPInputStream child;
-	private int size;
-	private boolean eos;
-
-	public int read(byte[] inputBuffer, int inputBufferOffset, int inputBufferLen) throws IOException {
-
-		if (eos) { return -1;}
-		if (this.child!=null)
-			return this.child.read(inputBuffer, inputBufferOffset, inputBufferLen);
-
-		int charsRead=super.read(inputBuffer, inputBufferOffset, inputBufferLen);
-		if (charsRead==-1)
-		{
-			// Push any remaining buffered data back onto the stream
-			// If the stream is then not empty, use it to construct
-			// a new instance of this class and delegate this and any
-			// future calls to it...
-			int n = inf.getRemaining() - 8;
-			if (n > 0)
-			{
-				// More than 8 bytes remaining in deflater
-				// First 8 are gzip trailer. Add the rest to
-				// any un-read data...
-				((PushbackInputStream)this.in).unread(buf, len-n, n);
-			}
-			else
-			{
-				// Nothing in the buffer. We need to know whether or not
-				// there is unread data available in the underlying stream
-				// since the base class will not handle an empty file.
-				// Read a byte to see if there is data and if so,
-				// push it back onto the stream...
-				byte[] b=new byte[1];
-				int ret=in.read(b,0,1);
-				if (ret==-1)
-				{
-					eos=true;
-					return -1;
-				}
-				else
-					((PushbackInputStream)this.in).unread(b, 0, 1);
-			}
-
-			MultiMemberGZIPInputStream child;
-			if (this.size==-1)
-				child=new MultiMemberGZIPInputStream(this);
-			else
-				child=new MultiMemberGZIPInputStream(this, this.size);
-			return child.read(inputBuffer, inputBufferOffset, inputBufferLen);
-		}
-		else
-			return charsRead;
-	}
-
+package uk.ac.babraham.FastQC.Utilities;
+
+/**
+ * This class is a work round for a bug in the core java gzip decompression
+ * code which can't handle multiple compressed blocks being concatenated within
+ * the same file.  It incorrectly reports that it has hit EOF when it gets to 
+ * the end of the first compressed block.
+ * 
+ * This work round was posted in the bug report at:
+ * 
+ * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4691425
+ * 
+ * Unfortunately the Sun bug database doesn't show who posted it so I can't
+ * provide an attribution. They didn't specify under what licence this code
+ * was being provided, but I'm going to assume that since it was posted as
+ * a work round for a reported bug that it's open enough to use here.
+ */
+
+
+import java.io.InputStream;
+import java.io.PushbackInputStream;
+import java.io.IOException;
+import java.util.zip.GZIPInputStream;
+
+public class MultiMemberGZIPInputStream extends GZIPInputStream {
+
+	public MultiMemberGZIPInputStream(InputStream in, int size) throws IOException
+	{
+		// Wrap the stream in a PushbackInputStream...
+		super(new PushbackInputStream(in, size), size);
+		this.size=size;
+	}
+
+	public MultiMemberGZIPInputStream(InputStream in) throws IOException
+	{
+		// Wrap the stream in a PushbackInputStream...
+		super(new PushbackInputStream(in, 1024));
+		this.size=-1;
+	}
+
+	private MultiMemberGZIPInputStream(MultiMemberGZIPInputStream parent) throws IOException
+	{
+		super(parent.in);
+		this.size=-1;
+		this.parent=parent.parent==null ? parent : parent.parent;
+		this.parent.child=this;
+	}
+
+	private MultiMemberGZIPInputStream(MultiMemberGZIPInputStream parent, int size) throws IOException
+	{
+		super(parent.in, size);
+		this.size=size;
+		this.parent=parent.parent==null ? parent : parent.parent;
+		this.parent.child=this;
+	}
+
+	private MultiMemberGZIPInputStream parent;
+	private MultiMemberGZIPInputStream child;
+	private int size;
+	private boolean eos;
+
+	public int read(byte[] inputBuffer, int inputBufferOffset, int inputBufferLen) throws IOException {
+
+		if (eos) { return -1;}
+		if (this.child!=null)
+			return this.child.read(inputBuffer, inputBufferOffset, inputBufferLen);
+
+		int charsRead=super.read(inputBuffer, inputBufferOffset, inputBufferLen);
+		if (charsRead==-1)
+		{
+			// Push any remaining buffered data back onto the stream
+			// If the stream is then not empty, use it to construct
+			// a new instance of this class and delegate this and any
+			// future calls to it...
+			int n = inf.getRemaining() - 8;
+			if (n > 0)
+			{
+				// More than 8 bytes remaining in deflater
+				// First 8 are gzip trailer. Add the rest to
+				// any un-read data...
+				((PushbackInputStream)this.in).unread(buf, len-n, n);
+			}
+			else
+			{
+				// Nothing in the buffer. We need to know whether or not
+				// there is unread data available in the underlying stream
+				// since the base class will not handle an empty file.
+				// Read a byte to see if there is data and if so,
+				// push it back onto the stream...
+				byte[] b=new byte[1];
+				int ret=in.read(b,0,1);
+				if (ret==-1)
+				{
+					eos=true;
+					return -1;
+				}
+				else
+					((PushbackInputStream)this.in).unread(b, 0, 1);
+			}
+
+			MultiMemberGZIPInputStream child;
+			if (this.size==-1)
+				child=new MultiMemberGZIPInputStream(this);
+			else
+				child=new MultiMemberGZIPInputStream(this, this.size);
+			return child.read(inputBuffer, inputBufferOffset, inputBufferLen);
+		}
+		else
+			return charsRead;
+	}
+
 }
\ No newline at end of file
diff --git a/uk/ac/babraham/FastQC/Utilities/NameFormatException.java b/uk/ac/babraham/FastQC/Utilities/NameFormatException.java
index db6634e..1fcb86d 100644
--- a/uk/ac/babraham/FastQC/Utilities/NameFormatException.java
+++ b/uk/ac/babraham/FastQC/Utilities/NameFormatException.java
@@ -1,26 +1,26 @@
-/**
- * Copyright Copyright 2011-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-package uk.ac.babraham.FastQC.Utilities;
-
- at SuppressWarnings("serial")
-public class NameFormatException extends Exception {
-
-}
+/**
+ * Copyright Copyright 2011-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+package uk.ac.babraham.FastQC.Utilities;
+
+ at SuppressWarnings("serial")
+public class NameFormatException extends Exception {
+
+}
diff --git a/uk/ac/babraham/FastQC/Utilities/NanoporeBasename.java b/uk/ac/babraham/FastQC/Utilities/NanoporeBasename.java
index 630642f..72300b7 100644
--- a/uk/ac/babraham/FastQC/Utilities/NanoporeBasename.java
+++ b/uk/ac/babraham/FastQC/Utilities/NanoporeBasename.java
@@ -1,99 +1,99 @@
-/**
- * Copyright Copyright 2011-15 Simon Andrews
- *
- *    This file is part of FastQC.
- *
- *    FastQC is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    FastQC is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with FastQC; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-package uk.ac.babraham.FastQC.Utilities;
-
-import java.io.File;
-import java.util.Hashtable;
-import java.util.Vector;
-
-public class NanoporeBasename {
-
-	/**
-	 * This method finds the core name from a CASAVA 1.8 fastq file.  It strips off the
-	 * part which indicates that this file is one of a set and returns the base name with
-	 * this part removed.
-	 * 
-	 * If the filename does not conform to standard CASAVA naming then a NameFormatException
-	 * is thrown.
-	 * 
-	 * @param originalName
-	 * @return
-	 * @throws NameFormatException
-	 */
-	
-	public static String getNanoporeBasename (String originalName) throws NameFormatException {
-		
-		// Files from nanopores look like: Computer_Samplename_number_chXXX_fileXXX_strand.fast5
-		// We need to reduce this to Computer_Samplename_number
-
-		String basename = originalName.replaceAll("_ch\\d+_file\\d+_strand.fast5$", "");
-		
-		if (basename.equals(originalName)) {
-			throw new NameFormatException();
-		}
-		
-		return basename;
-		
-	}
-	
-	public static File [][] getNanoporeGroups (File [] files) {
-		Hashtable<String, Vector<File>> fileBases = new Hashtable<String, Vector<File>>();
-		
-		for (int f=0;f<files.length;f++) {
-
-			
-			if (files[f].getName().contains("muxscan")) continue; // Control files not containing real data.
-			
-			// If a file forms part of a nanopore group then put it into that
-			// group.
-			try {
-				String baseName = NanoporeBasename.getNanoporeBasename(files[f].getName());
-				if (! fileBases.containsKey(baseName)) {
-					fileBases.put(baseName,new Vector<File>());
-				}
-				fileBases.get(baseName).add(files[f]);
-
-			}
-			
-			// If the file name doesn't appear to be part of a nanopore group
-			// then add it as a singleton
-			catch (NameFormatException nfe) {
-				
-				System.err.println("File '"+files[f].getName()+"' didn't look like part of a CASAVA group");
-				Vector<File> newVector = new Vector<File>();
-				newVector.add(files[f]);
-				fileBases.put(files[f].getName(), newVector);				
-			}
-			
-		}
-		
-		String [] baseNames = fileBases.keySet().toArray(new String [0]);
-				
-		File [][] fileGroups = new File[baseNames.length][];
-		
-		for (int i=0;i<baseNames.length;i++) {
-			fileGroups[i] = fileBases.get(baseNames[i]).toArray(new File[0]);
-		}
-		
-		return fileGroups;		
-	}
-	
-}
+/**
+ * Copyright Copyright 2011-15 Simon Andrews
+ *
+ *    This file is part of FastQC.
+ *
+ *    FastQC is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    FastQC is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with FastQC; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+package uk.ac.babraham.FastQC.Utilities;
+
+import java.io.File;
+import java.util.Hashtable;
+import java.util.Vector;
+
+public class NanoporeBasename {
+
+	/**
+	 * This method finds the core name from a CASAVA 1.8 fastq file.  It strips off the
+	 * part which indicates that this file is one of a set and returns the base name with
+	 * this part removed.
+	 * 
+	 * If the filename does not conform to standard CASAVA naming then a NameFormatException
+	 * is thrown.
+	 * 
+	 * @param originalName
+	 * @return
+	 * @throws NameFormatException
+	 */
+	
+	public static String getNanoporeBasename (String originalName) throws NameFormatException {
+		
+		// Files from nanopores look like: Computer_Samplename_number_chXXX_fileXXX_strand.fast5
+		// We need to reduce this to Computer_Samplename_number
+
+		String basename = originalName.replaceAll("_ch\\d+_file\\d+_strand.fast5$", "");
+		
+		if (basename.equals(originalName)) {
+			throw new NameFormatException();
+		}
+		
+		return basename;
+		
+	}
+	
+	public static File [][] getNanoporeGroups (File [] files) {
+		Hashtable<String, Vector<File>> fileBases = new Hashtable<String, Vector<File>>();
+		
+		for (int f=0;f<files.length;f++) {
+
+			
+			if (files[f].getName().contains("muxscan")) continue; // Control files not containing real data.
+			
+			// If a file forms part of a nanopore group then put it into that
+			// group.
+			try {
+				String baseName = NanoporeBasename.getNanoporeBasename(files[f].getName());
+				if (! fileBases.containsKey(baseName)) {
+					fileBases.put(baseName,new Vector<File>());
+				}
+				fileBases.get(baseName).add(files[f]);
+
+			}
+			
+			// If the file name doesn't appear to be part of a nanopore group
+			// then add it as a singleton
+			catch (NameFormatException nfe) {
+				
+				System.err.println("File '"+files[f].getName()+"' didn't look like part of a CASAVA group");
+				Vector<File> newVector = new Vector<File>();
+				newVector.add(files[f]);
+				fileBases.put(files[f].getName(), newVector);				
+			}
+			
+		}
+		
+		String [] baseNames = fileBases.keySet().toArray(new String [0]);
+				
+		File [][] fileGroups = new File[baseNames.length][];
+		
+		for (int i=0;i<baseNames.length;i++) {
+			fileGroups[i] = fileBases.get(baseNames[i]).toArray(new File[0]);
+		}
+		
+		return fileGroups;		
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Utilities/QualityCount.java b/uk/ac/babraham/FastQC/Utilities/QualityCount.java
index 4c8c3c9..ad81079 100644
--- a/uk/ac/babraham/FastQC/Utilities/QualityCount.java
+++ b/uk/ac/babraham/FastQC/Utilities/QualityCount.java
@@ -1,95 +1,95 @@
-/**
- * Copyright Copyright 2013-15 Simon Andrews
- *
- *    This file is part of SeqMonk.
- *
- *    SeqMonk is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    SeqMonk is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with SeqMonk; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-package uk.ac.babraham.FastQC.Utilities;
-
-public class QualityCount {
-
-	/*
-	 * So I'm on my third go at writing this.  I've now tried an all
-	 * primitive version of this class so that we don't have to do 
-	 * hash lookps which require a conversion from chr to Character.
-	 * We should also be safe with 150 slots which will give us up to
-	 * Phred 86 with a 64 offset, which should be plenty.
-	 */
-	
-	private long [] actualCounts = new long[150];
-	
-	private long totalCounts = 0;
-
-	public void addValue(char c) {
-		totalCounts++;
-		actualCounts[(int)c]++;
-	}
-	
-	public long getTotalCount () {
-		return totalCounts;
-	}
-	
-	public char getMinChar () {
-		
-		for (int i=0;i<actualCounts.length;i++) {
-			if (actualCounts[i]>0) return (char)i;
-		}
-		
-		return (char)1000;
-	}
-	
-	public char getMaxChar () {
-		for (int i=actualCounts.length-1;i>=0;i--) {
-			if (actualCounts[i]>0) return (char)i;
-		}
-		
-		return (char)1000;
-
-	}
-			
-	public double getMean (int offset) {
-		long total = 0;
-		long count = 0;
-	
-		for (int i=offset;i<actualCounts.length;i++) {
-			total += actualCounts[i]*(i-offset);
-			count += actualCounts[i];
-		}
-		
-		return ((double)total)/count;
-	}
-	
-	public double getPercentile (int offset, int percentile) {
-
-		long total = totalCounts;
-		
-		total *= percentile;
-		total /= 100;
-		
-		long count = 0;
-		for (int i=offset;i<actualCounts.length;i++) {
-			count += actualCounts[i];
-			if (count >=total) {
-				return((char)(i-offset));
-			}
-		}
-		
-		return -1;
-		
-	}
-	
-}
+/**
+ * Copyright Copyright 2013-15 Simon Andrews
+ *
+ *    This file is part of SeqMonk.
+ *
+ *    SeqMonk is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    SeqMonk is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with SeqMonk; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+package uk.ac.babraham.FastQC.Utilities;
+
+public class QualityCount {
+
+	/*
+	 * So I'm on my third go at writing this.  I've now tried an all
+	 * primitive version of this class so that we don't have to do 
+	 * hash lookps which require a conversion from chr to Character.
+	 * We should also be safe with 150 slots which will give us up to
+	 * Phred 86 with a 64 offset, which should be plenty.
+	 */
+	
+	private long [] actualCounts = new long[150];
+	
+	private long totalCounts = 0;
+
+	public void addValue(char c) {
+		totalCounts++;
+		actualCounts[(int)c]++;
+	}
+	
+	public long getTotalCount () {
+		return totalCounts;
+	}
+	
+	public char getMinChar () {
+		
+		for (int i=0;i<actualCounts.length;i++) {
+			if (actualCounts[i]>0) return (char)i;
+		}
+		
+		return (char)1000;
+	}
+	
+	public char getMaxChar () {
+		for (int i=actualCounts.length-1;i>=0;i--) {
+			if (actualCounts[i]>0) return (char)i;
+		}
+		
+		return (char)1000;
+
+	}
+			
+	public double getMean (int offset) {
+		long total = 0;
+		long count = 0;
+	
+		for (int i=offset;i<actualCounts.length;i++) {
+			total += actualCounts[i]*(i-offset);
+			count += actualCounts[i];
+		}
+		
+		return ((double)total)/count;
+	}
+	
+	public double getPercentile (int offset, int percentile) {
+
+		long total = totalCounts;
+		
+		total *= percentile;
+		total /= 100;
+		
+		long count = 0;
+		for (int i=offset;i<actualCounts.length;i++) {
+			count += actualCounts[i];
+			if (count >=total) {
+				return((char)(i-offset));
+			}
+		}
+		
+		return -1;
+		
+	}
+	
+}
diff --git a/uk/ac/babraham/FastQC/Utilities/RGB.java b/uk/ac/babraham/FastQC/Utilities/RGB.java
index 467f0d3..3bc6cc8 100644
--- a/uk/ac/babraham/FastQC/Utilities/RGB.java
+++ b/uk/ac/babraham/FastQC/Utilities/RGB.java
@@ -1,44 +1,44 @@
-/**
- * Copyright Copyright 2007-15 Simon Andrews
- *
- *    This file is part of SeqMonk.
- *
- *    SeqMonk is free software; you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 3 of the License, or
- *    (at your option) any later version.
- *
- *    SeqMonk is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with SeqMonk; if not, write to the Free Software
- *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-package uk.ac.babraham.FastQC.Utilities;
-
-/**
- * A simple class to represent separate values for Red Green and Blue
- * components of a colour.
- */
-public class RGB {
-	
-	public int r;
-	public int g;
-	public int b;
-	
-	/**
-	 * Instantiates a new RGB colour.
-	 * 
-	 * @param r RED
-	 * @param g GREEN
-	 * @param b BLUE
-	 */
-	public RGB (int r, int g, int b) {
-		this.r = r;
-		this.g = g;
-		this.b = b;
-	}
-}
+/**
+ * Copyright Copyright 2007-15 Simon Andrews
+ *
+ *    This file is part of SeqMonk.
+ *
+ *    SeqMonk is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 3 of the License, or
+ *    (at your option) any later version.
+ *
+ *    SeqMonk is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with SeqMonk; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+package uk.ac.babraham.FastQC.Utilities;
+
+/**
+ * A simple class to represent separate values for Red Green and Blue
+ * components of a colour.
+ */
+public class RGB {
+	
+	public int r;
+	public int g;
+	public int b;
+	
+	/**
+	 * Instantiates a new RGB colour.
+	 * 
+	 * @param r RED
+	 * @param g GREEN
+	 * @param b BLUE
+	 */
+	public RGB (int r, int g, int b) {
+		this.r = r;
+		this.g = g;
+		this.b = b;
+	}
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/fastqc.git



More information about the debian-med-commit mailing list