Class 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
    • 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 object
        sampleId - the sample Id
        read - read number
        lane - lane number
        sampleDirname - sample directory name
        sampleName - name of the sample
        projectName - name of the project
        descriptionSample - description of the sample
        index - 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 sheet
        fastqDir - FASTQ directory
        tmpDir - temporary directory
        runId - the run id
        sampleId - the sample Id
        read - read number
        lane - lane number
        sampleDirname - sample directory name
        sampleName - name of the sample
        projectName - name of the project
        descriptionSample - description of the sample
        index - 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 bcl2fastq
        tmpDir - the temporary directory
        runId - the run id
        sampleId - the sampleId
        read - the read number
        sample - 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 object
        sampleId - the sample Id
        read - read number
        lane - 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 sheet
        fastqDir - the FASTQ directory
        tmpDir - the temporary directory
        runId - the runId
        sampleId - the sample Id
        read - read number
        lane - 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 object
        tmpDir - temporary directory
        runId - the run id
        sampleId - the sample Id
        read - read number
        lane - lane number
        sampleDirname - sample dir name
        sampleName - name of the sample
        projectName - name of the project
        descriptionSample - description of the sample
        index - value of index or if doesn't exists, NoIndex
        undeterminedIndex - undetermined index
        createEmptyFastq - 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 identifier
        sampleName - sample name
        Returns:
        the sample sub directory or an empty string