Class FastqSample
- java.lang.Object
-
- fr.ens.biologie.genomique.aozan.io.FastqSample
-
public class FastqSample extends Object
The class correspond of one entity to treat by AbstractFastqCollector, so a sample per lane and in mode-paired one FastSample for each read (R1 and R2).- Since:
- 1.0
- Author:
- Sandrine Perrin
-
-
Field Summary
Fields Modifier and Type Field Description static String
FASTQ_EXTENSION
The Constant FASTQ_EXTENSION.static String
PROJECT_PREFIX
The Constant PROJECT_PREFIX.static String
SAMPLE_PREFIX
The Constant SAMPLE_PREFIX.static String
SUBSET_FASTQ_FILENAME_PREFIX
static String
UNDETERMINED_DIR_NAME
The Constant UNDETERMINED_DIR_NAME.static String
UNDETERMINED_PREFIX
The Constant UNDETERMINED_PREFIX.
-
Constructor Summary
Constructors Constructor Description FastqSample(Bcl2FastqOutput bcl2FastqOutput, File tmpDir, String runId, int sampleId, int read, int lane, String sampleDirname, String sampleName, String projectName, String descriptionSample, String index, boolean undeterminedIndex, boolean createEmptyFastq)
Public constructor corresponding of a undetermined index sample.FastqSample(Bcl2FastqOutput bcl2FastqOutput, File tmpDir, String runId, int sampleId, int read, fr.ens.biologie.genomique.kenetre.illumina.samplesheet.Sample sample)
Public constructor (used only for tests)FastqSample(QC qc, int sampleId, int read, int lane)
Public constructor corresponding of a undetermined index sample.FastqSample(QC qc, int sampleId, int read, int lane, String sampleDirname, String sampleName, String projectName, String descriptionSample, String index)
Public constructor corresponding of a technical replica sample.FastqSample(fr.ens.biologie.genomique.kenetre.illumina.samplesheet.SampleSheet sampleSheet, File fastqDir, File tmpDir, String runId, int sampleId, int read, int lane)
Public constructor corresponding of a undetermined index sample.FastqSample(fr.ens.biologie.genomique.kenetre.illumina.samplesheet.SampleSheet sampleSheet, File fastqDir, File tmpDir, String runId, int sampleId, int read, int lane, String sampleDirname, String sampleName, String projectName, String descriptionSample, String index)
Public constructor corresponding of a technical replica sample.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<File>
createListFastqFiles()
Keep files that satisfy the specified filter in this directory and beginning with this prefix.static String
defineSampleSubDirName(String sampleId, String sampleName)
Get the sample sub directory.fr.ens.biologie.genomique.kenetre.io.CompressionType
getCompressionType()
Get the compression type for fastq files.String
getDescription()
Get the description of the sample in run.String
getFastqFilenames()
Get list of fastq file names for this sample.List<File>
getFastqFiles()
Get list of fastq files for this sample.File
getFastqSampleParentDir()
Find fastq parent directory.String
getFilenamePrefix()
Get the prefix of the FASTQ file.String
getFilenamePrefix(int read)
Get the prefix of the FASTQ file.String
getIndex()
Gets the index.int
getLane()
Get the number of lane from the sample in run.String
getProjectName()
Get the project name from the sample in run.int
getRead()
Get the number of read from the sample in run.String
getRundataPrefix()
Create the prefix used for add data in a RunData for each FastqSample.String
getSampleDirectoryName()
Get the directory name of the sample.int
getSampleId()
Get the sample Id.String
getSampleName()
Get the sample name in run.File
getSubsetFastqFile()
Return the temporary if exists which correspond to the key.String
getSubsetFastqFilename()
Get the name for temporary fastq files uncompressed.long
getUncompressedSize()
Returns a estimation of the size of uncompressed fastq files according to the type extension of files and the coefficient of uncompression corresponding.boolean
isUncompressedNeeded()
Return if it must uncompress fastq files else false.boolean
isUndeterminedIndex()
Test if the sample is an undetermined index sample.String
toString()
-
-
-
Field Detail
-
FASTQ_EXTENSION
public static final String FASTQ_EXTENSION
The Constant FASTQ_EXTENSION.- See Also:
- Constant Field Values
-
UNDETERMINED_DIR_NAME
public static final String UNDETERMINED_DIR_NAME
The Constant UNDETERMINED_DIR_NAME.- See Also:
- Constant Field Values
-
PROJECT_PREFIX
public static final String PROJECT_PREFIX
The Constant PROJECT_PREFIX.- See Also:
- Constant Field Values
-
SAMPLE_PREFIX
public static final String SAMPLE_PREFIX
The Constant SAMPLE_PREFIX.- See Also:
- Constant Field Values
-
UNDETERMINED_PREFIX
public static final String UNDETERMINED_PREFIX
The Constant UNDETERMINED_PREFIX.- See Also:
- Constant Field Values
-
SUBSET_FASTQ_FILENAME_PREFIX
public static final String SUBSET_FASTQ_FILENAME_PREFIX
-
-
Constructor Detail
-
FastqSample
public FastqSample(QC qc, int sampleId, int read, int lane, String sampleDirname, String sampleName, String projectName, String descriptionSample, String index) throws IOException
Public constructor corresponding of a technical replica sample.- Parameters:
qc
- QC objectsampleId
- the sample Idread
- read numberlane
- lane numbersampleDirname
- sample directory namesampleName
- name of the sampleprojectName
- name of the projectdescriptionSample
- description of the sampleindex
- value of index or if doesn't exists, NoIndex- Throws:
IOException
- if an error occurs while reading bcl2fastq version
-
FastqSample
public FastqSample(fr.ens.biologie.genomique.kenetre.illumina.samplesheet.SampleSheet sampleSheet, File fastqDir, File tmpDir, String runId, int sampleId, int read, int lane, String sampleDirname, String sampleName, String projectName, String descriptionSample, String index) throws IOException
Public constructor corresponding of a technical replica sample.- Parameters:
sampleSheet
- the sample sheetfastqDir
- FASTQ directorytmpDir
- temporary directoryrunId
- the run idsampleId
- the sample Idread
- read numberlane
- lane numbersampleDirname
- sample directory namesampleName
- name of the sampleprojectName
- name of the projectdescriptionSample
- description of the sampleindex
- value of index or if doesn't exists, NoIndex- Throws:
IOException
- if an error occurs while reading bcl2fastq version
-
FastqSample
public FastqSample(Bcl2FastqOutput bcl2FastqOutput, File tmpDir, String runId, int sampleId, int read, fr.ens.biologie.genomique.kenetre.illumina.samplesheet.Sample sample) throws IOException
Public constructor (used only for tests)- Parameters:
bcl2FastqOutput
- the output of bcl2fastqtmpDir
- the temporary directoryrunId
- the run idsampleId
- the sampleIdread
- the read numbersample
- the sample- Throws:
IOException
- if an error occurs while reading bcl2fastq version
-
FastqSample
public FastqSample(QC qc, int sampleId, int read, int lane) throws IOException
Public constructor corresponding of a undetermined index sample.- Parameters:
qc
- QC objectsampleId
- the sample Idread
- read numberlane
- lane number- Throws:
IOException
- if an error occurs while reading bcl2fastq version
-
FastqSample
public FastqSample(fr.ens.biologie.genomique.kenetre.illumina.samplesheet.SampleSheet sampleSheet, File fastqDir, File tmpDir, String runId, int sampleId, int read, int lane) throws IOException
Public constructor corresponding of a undetermined index sample.- Parameters:
sampleSheet
- the sample sheetfastqDir
- the FASTQ directorytmpDir
- the temporary directoryrunId
- the runIdsampleId
- the sample Idread
- read numberlane
- lane number- Throws:
IOException
- if an error occurs while reading bcl2fastq version
-
FastqSample
public FastqSample(Bcl2FastqOutput bcl2FastqOutput, File tmpDir, String runId, int sampleId, int read, int lane, String sampleDirname, String sampleName, String projectName, String descriptionSample, String index, boolean undeterminedIndex, boolean createEmptyFastq) throws IOException
Public constructor corresponding of a undetermined index sample.- Parameters:
bcl2FastqOutput
- Bcl2FastqOutput objecttmpDir
- temporary directoryrunId
- the run idsampleId
- the sample Idread
- read numberlane
- lane numbersampleDirname
- sample dir namesampleName
- name of the sampleprojectName
- name of the projectdescriptionSample
- description of the sampleindex
- value of index or if doesn't exists, NoIndexundeterminedIndex
- undetermined indexcreateEmptyFastq
- enable the creation of empty FASTQ files- Throws:
IOException
- if an error occurs while reading bcl2fastq version
-
-
Method Detail
-
getSampleId
public int getSampleId()
Get the sample Id.- Returns:
- the sample Id
-
getRead
public int getRead()
Get the number of read from the sample in run.- Returns:
- number read
-
getLane
public int getLane()
Get the number of lane from the sample in run.- Returns:
- number lane
-
getSampleDirectoryName
public String getSampleDirectoryName()
Get the directory name of the sample. The value can be empty if there is not dedicated directory for the sample.- Returns:
- the directory name of the sample
-
getProjectName
public String getProjectName()
Get the project name from the sample in run.- Returns:
- project name
-
getSampleName
public String getSampleName()
Get the sample name in run.- Returns:
- sample name
-
getDescription
public String getDescription()
Get the description of the sample in run.- Returns:
- description of the sample
-
isUndeterminedIndex
public boolean isUndeterminedIndex()
Test if the sample is an undetermined index sample.- Returns:
- true if the sample has an undetermined index
-
getIndex
public String getIndex()
Gets the index.- Returns:
- the index
-
getFastqFiles
public List<File> getFastqFiles()
Get list of fastq files for this sample.- Returns:
- list fastq files
-
getFastqFilenames
public String getFastqFilenames()
Get list of fastq file names for this sample.- Returns:
- a String with the filename of the sample
-
getSubsetFastqFilename
public String getSubsetFastqFilename()
Get the name for temporary fastq files uncompressed.- Returns:
- temporary fastq file name
-
getCompressionType
public fr.ens.biologie.genomique.kenetre.io.CompressionType getCompressionType()
Get the compression type for fastq files.- Returns:
- compression type for fastq files
-
getRundataPrefix
public String getRundataPrefix()
Create the prefix used for add data in a RunData for each FastqSample.- Returns:
- prefix
-
isUncompressedNeeded
public boolean isUncompressedNeeded()
Return if it must uncompress fastq files else false.- Returns:
- true if it must uncompress fastq files else false.
-
getUncompressedSize
public long getUncompressedSize()
Returns a estimation of the size of uncompressed fastq files according to the type extension of files and the coefficient of uncompression corresponding.- Returns:
- size if uncompressed fastq files
-
getSubsetFastqFile
public File getSubsetFastqFile()
Return the temporary if exists which correspond to the key.- Returns:
- File temporary file or null if it not exists
-
getFastqSampleParentDir
public File getFastqSampleParentDir()
Find fastq parent directory.- Returns:
- the fastq output directory.
-
getFilenamePrefix
public String getFilenamePrefix()
Get the prefix of the FASTQ file.- Returns:
- the prefix of the FASTQ file
-
getFilenamePrefix
public String getFilenamePrefix(int read)
Get the prefix of the FASTQ file.- Parameters:
read
- the read of the sample- Returns:
- the prefix of the FASTQ file
-
createListFastqFiles
public List<File> createListFastqFiles()
Keep files that satisfy the specified filter in this directory and beginning with this prefix.- Returns:
- an array of abstract pathnames
-
defineSampleSubDirName
public static String defineSampleSubDirName(String sampleId, String sampleName)
Get the sample sub directory.- Parameters:
sampleId
- sample identifiersampleName
- sample name- Returns:
- the sample sub directory or an empty string
-
-