uk.ac.sanger.npg.illumina
Class Lane

java.lang.Object
  extended by uk.ac.sanger.npg.illumina.Lane

public class Lane
extends java.lang.Object

Process an illumina run lane


Constructor Summary
Lane(java.lang.String intensityDir, java.lang.String baseCallDir, java.lang.String runFolder, int laneNumber, boolean secondCall, boolean pfFilter, java.io.File output, java.lang.String barcodeSeqTagName, java.lang.String barcodeQualTagName)
           
 
Method Summary
 java.util.HashMap<java.lang.String,int[]> checkCycleRangeByRead()
           
 net.sf.samtools.SAMFileHeader generateHeader()
           
 net.sf.samtools.SAMFileWriter generateOutputSamStream()
           
 net.sf.samtools.SAMProgramRecord getBaseCallProgram()
           
 java.util.HashMap<java.lang.String,int[]> getCycleRangeByRead()
           
 java.util.HashMap<java.lang.String,int[]> getCycleRangeByReadFromRunInfoFile()
           
 java.util.HashMap<java.lang.String,int[]> getCycleRangeByReadFromRunParametersFile()
           
 net.sf.samtools.SAMProgramRecord getIllumina2bamProgram()
           
 net.sf.samtools.SAMProgramRecord getInstrumentProgram()
           
 java.util.TreeMap<java.lang.Integer,org.w3c.dom.NamedNodeMap> getReadInfoFromRunParametersOrRunInfoFile(java.lang.String readInfoPath, org.w3c.dom.Document xmlDoc)
          From runParameters file: "RunParameters/Setup/Reads/Read" for HiSeq, "RunParameters/Reads/RunInfoRead" for MiSeq and no file for GA From RunInfo file: "RunInfo/Run/Reads/Read" only for HiSeq and MiSeq, not cope with GA
 java.util.Date getRunDateConfig()
           
 java.lang.String getRunfolderConfig()
           
 int[] getTileList()
           
 boolean processTiles(net.sf.samtools.SAMFileWriter outputSam)
          write BCL file to output stream tile by tile
 int[] readBarCodeIndexCycles()
           
 net.sf.samtools.SAMProgramRecord readBaseCallProgramRecord()
           
 boolean readConfigs()
          Read both config XML files under BaseCalls and Intensities.
 int[][] readCycleRangeByRead()
           
 java.lang.String readInstrumentAndRunID()
           
 net.sf.samtools.SAMProgramRecord readInstrumentProgramRecord()
           
 net.sf.samtools.SAMProgramRecord readInstrumentProgramRecordFromRunParameterFile()
           
 java.util.Date readRunDate()
           
 java.lang.String readRunfoder()
           
 int[] readTileList()
           
 int[] readTileRange()
           
 void reduceTileList(java.lang.Integer firstTile, java.lang.Integer tileLimit)
           
 void setCycleRangeByRead(java.util.HashMap<java.lang.String,int[]> cycleRangeByRead)
           
 void setId(java.lang.String id)
           
 void setIllumina2bamProgram(net.sf.samtools.SAMProgramRecord illumina2bamProgram)
           
 void setReadGroup(net.sf.samtools.SAMReadGroupRecord readGroup)
           
 void setSecondBarcodeQualTagName(java.lang.String secondBarcodeQualTagName)
           
 void setSecondBarcodeSeqTagName(java.lang.String secondBarcodeSeqTagName)
           
 void setTileList(int[] tileList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lane

public Lane(java.lang.String intensityDir,
            java.lang.String baseCallDir,
            java.lang.String runFolder,
            int laneNumber,
            boolean secondCall,
            boolean pfFilter,
            java.io.File output,
            java.lang.String barcodeSeqTagName,
            java.lang.String barcodeQualTagName)
Parameters:
intensityDir - Illumina intensities directory including config xml file and clocs files under lane directory. Required.
baseCallDir - Illumina basecalls directory including config xml file, and filter files, bcl, maybe scl files under lane cycle directory, using BaseCalls directory under intensities if not given.
runFolder - Illumina runfolder directory, upwards two levels from Intensities directory if not given
laneNumber - lane number
secondCall - including second base call or not, default false.
pfFilter - Filter cluster or not, default true.
output - Output file
barcodeSeqTagName -
barcodeQualTagName -
Method Detail

readConfigs

public boolean readConfigs()
                    throws java.lang.Exception
Read both config XML files under BaseCalls and Intensities. And RunInfo and runParameters xml under runfolder.

Returns:
true if successfully
Throws:
java.lang.Exception

generateOutputSamStream

public net.sf.samtools.SAMFileWriter generateOutputSamStream()
Returns:
outputSam with header to write bam records

processTiles

public boolean processTiles(net.sf.samtools.SAMFileWriter outputSam)
                     throws java.lang.Exception
write BCL file to output stream tile by tile

Parameters:
outputSam -
Returns:
true if successfully
Throws:
java.lang.Exception

readBaseCallProgramRecord

public net.sf.samtools.SAMProgramRecord readBaseCallProgramRecord()
Returns:
an object of SAMProgramRecord for base calling program

readTileList

public int[] readTileList()
Returns:
a list of tile number

readTileRange

public int[] readTileRange()
Returns:

readInstrumentAndRunID

public java.lang.String readInstrumentAndRunID()
Returns:
instrument name with id_run as part of read name, for example, HS13_6000

getCycleRangeByReadFromRunInfoFile

public java.util.HashMap<java.lang.String,int[]> getCycleRangeByReadFromRunInfoFile()
Returns:

getCycleRangeByReadFromRunParametersFile

public java.util.HashMap<java.lang.String,int[]> getCycleRangeByReadFromRunParametersFile()
Returns:

getReadInfoFromRunParametersOrRunInfoFile

public java.util.TreeMap<java.lang.Integer,org.w3c.dom.NamedNodeMap> getReadInfoFromRunParametersOrRunInfoFile(java.lang.String readInfoPath,
                                                                                                               org.w3c.dom.Document xmlDoc)
From runParameters file: "RunParameters/Setup/Reads/Read" for HiSeq, "RunParameters/Reads/RunInfoRead" for MiSeq and no file for GA From RunInfo file: "RunInfo/Run/Reads/Read" only for HiSeq and MiSeq, not cope with GA

Parameters:
readInfoPath -
xmlDoc -
Returns:

checkCycleRangeByRead

public java.util.HashMap<java.lang.String,int[]> checkCycleRangeByRead()
                                                                throws java.lang.Exception
Returns:
the cycle range for each read
Throws:
java.lang.Exception

readCycleRangeByRead

public int[][] readCycleRangeByRead()
Returns:
cycle range for a list of reads

readBarCodeIndexCycles

public int[] readBarCodeIndexCycles()
Returns:
indexing cycle number list

readInstrumentProgramRecord

public net.sf.samtools.SAMProgramRecord readInstrumentProgramRecord()
Returns:
instrument Program record

readInstrumentProgramRecordFromRunParameterFile

public net.sf.samtools.SAMProgramRecord readInstrumentProgramRecordFromRunParameterFile()
Returns:
instrument Program record

readRunfoder

public java.lang.String readRunfoder()
Returns:
runfolder name

readRunDate

public java.util.Date readRunDate()
Returns:
run date

generateHeader

public net.sf.samtools.SAMFileHeader generateHeader()
Returns:
BAM header

reduceTileList

public void reduceTileList(java.lang.Integer firstTile,
                           java.lang.Integer tileLimit)
Parameters:
firstTile - first tile number
tileLimit - the number of tiles to process

setId

public void setId(java.lang.String id)
Parameters:
id - the id to set

setCycleRangeByRead

public void setCycleRangeByRead(java.util.HashMap<java.lang.String,int[]> cycleRangeByRead)
Parameters:
cycleRangeByRead - the cycleRangeByRead to set

setTileList

public void setTileList(int[] tileList)
Parameters:
tileList - the tileList to set

getTileList

public int[] getTileList()
Returns:
the tileList

getIllumina2bamProgram

public net.sf.samtools.SAMProgramRecord getIllumina2bamProgram()
Returns:
the illumina2bamProgram

setIllumina2bamProgram

public void setIllumina2bamProgram(net.sf.samtools.SAMProgramRecord illumina2bamProgram)
Parameters:
illumina2bamProgram - the illumina2bamProgram to set

setReadGroup

public void setReadGroup(net.sf.samtools.SAMReadGroupRecord readGroup)
Parameters:
readGroup - the readGroup to set

getRunDateConfig

public java.util.Date getRunDateConfig()
Returns:
the runDateConfig

getRunfolderConfig

public java.lang.String getRunfolderConfig()
Returns:
the runfolderConfig

getBaseCallProgram

public net.sf.samtools.SAMProgramRecord getBaseCallProgram()
Returns:
the baseCallProgram

getInstrumentProgram

public net.sf.samtools.SAMProgramRecord getInstrumentProgram()
Returns:
the instrumentProgram

setSecondBarcodeSeqTagName

public void setSecondBarcodeSeqTagName(java.lang.String secondBarcodeSeqTagName)
Parameters:
secondBarcodeSeqTagName - the secondBarcodeSeqTagName to set

setSecondBarcodeQualTagName

public void setSecondBarcodeQualTagName(java.lang.String secondBarcodeQualTagName)
Parameters:
secondBarcodeQualTagName - the secondBarcodeQualTagName to set

getCycleRangeByRead

public java.util.HashMap<java.lang.String,int[]> getCycleRangeByRead()
Returns:
the cycleRangeByRead