2009-05-16 05:02:12 +08:00
|
|
|
package org.broadinstitute.sting.gatk;
|
|
|
|
|
|
|
|
|
|
import org.broadinstitute.sting.gatk.traversals.TraversalEngine;
|
|
|
|
|
import org.broadinstitute.sting.utils.StingException;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileNotFoundException;
|
|
|
|
|
import java.util.List;
|
2009-06-10 21:39:32 +08:00
|
|
|
|
|
|
|
|
import net.sf.samtools.SAMFileReader;
|
2009-05-16 05:02:12 +08:00
|
|
|
/**
|
|
|
|
|
* User: hanna
|
|
|
|
|
* Date: May 14, 2009
|
|
|
|
|
* Time: 4:06:26 PM
|
|
|
|
|
* BROAD INSTITUTE SOFTWARE COPYRIGHT NOTICE AND AGREEMENT
|
|
|
|
|
* Software and documentation are copyright 2005 by the Broad Institute.
|
|
|
|
|
* All rights are reserved.
|
|
|
|
|
*
|
|
|
|
|
* Users acknowledge that this software is supplied without any warranty or support.
|
|
|
|
|
* The Broad Institute is not responsible for its use, misuse, or
|
|
|
|
|
* functionality.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A data structure containing information about the reads data sources as well as
|
|
|
|
|
* information about how they should be downsampled, sorted, and filtered.
|
|
|
|
|
*/
|
|
|
|
|
public class Reads {
|
|
|
|
|
private List<File> readsFiles = null;
|
2009-06-10 21:39:32 +08:00
|
|
|
private SAMFileReader.ValidationStringency validationStringency = SAMFileReader.ValidationStringency.STRICT;
|
2009-05-16 05:02:12 +08:00
|
|
|
private Double downsamplingFraction = null;
|
|
|
|
|
private Integer downsampleToCoverage = null;
|
|
|
|
|
private Boolean beSafe = null;
|
2009-05-29 22:51:08 +08:00
|
|
|
private Boolean filterZeroMappingQualityReads = null;
|
2009-05-16 05:02:12 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Gets a list of the files acting as sources of reads.
|
|
|
|
|
* @return A list of files storing reads data.
|
|
|
|
|
*/
|
|
|
|
|
public List<File> getReadsFiles() {
|
|
|
|
|
return readsFiles;
|
|
|
|
|
}
|
|
|
|
|
|
2009-06-10 21:39:32 +08:00
|
|
|
/**
|
|
|
|
|
* How strict should validation be?
|
|
|
|
|
* @return Stringency of validation.
|
|
|
|
|
*/
|
|
|
|
|
public SAMFileReader.ValidationStringency getValidationStringency() {
|
|
|
|
|
return validationStringency;
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-16 05:02:12 +08:00
|
|
|
/**
|
|
|
|
|
* Get the fraction of reads to downsample.
|
|
|
|
|
* @return Downsample fraction.
|
|
|
|
|
*/
|
|
|
|
|
public Double getDownsamplingFraction() {
|
|
|
|
|
return downsamplingFraction;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Downsample each locus to the specified coverage.
|
|
|
|
|
* @return Coverage to which to downsample.
|
|
|
|
|
*/
|
|
|
|
|
public Integer getDownsampleToCoverage() {
|
|
|
|
|
return downsampleToCoverage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return whether to 'verify' the reads as we pass through them.
|
|
|
|
|
* @return Whether to verify the reads.
|
|
|
|
|
*/
|
|
|
|
|
public Boolean getSafetyChecking() {
|
|
|
|
|
return beSafe;
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-29 22:51:08 +08:00
|
|
|
public Boolean getFilterZeroMappingQualityReads() {
|
|
|
|
|
return filterZeroMappingQualityReads;
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-16 05:02:12 +08:00
|
|
|
/**
|
|
|
|
|
* Simple constructor for unit testing.
|
|
|
|
|
* @param readsFiles List of reads files to open.
|
|
|
|
|
*/
|
|
|
|
|
public Reads( List<File> readsFiles ) {
|
|
|
|
|
this.readsFiles = readsFiles;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Extract the command-line arguments having to do with reads input
|
|
|
|
|
* files and store them in an easy-to-work-with package. Constructor
|
|
|
|
|
* is package protected.
|
2009-06-10 21:39:32 +08:00
|
|
|
* @param samFiles list of reads files.
|
|
|
|
|
* @param strictness Stringency of reads file parsing.
|
|
|
|
|
* @param downsampleFraction fraction of reads to downsample.
|
|
|
|
|
* @param downsampleCoverage downsampling per-locus.
|
|
|
|
|
* @param beSafe Whether to enable safety checking.
|
|
|
|
|
* @param filterZeroMappingQualityReads whether to filter zero mapping quality reads.
|
2009-05-16 05:02:12 +08:00
|
|
|
*/
|
2009-06-10 21:39:32 +08:00
|
|
|
Reads( List<File> samFiles,
|
|
|
|
|
SAMFileReader.ValidationStringency strictness,
|
|
|
|
|
Double downsampleFraction,
|
|
|
|
|
Integer downsampleCoverage,
|
|
|
|
|
Boolean beSafe,
|
|
|
|
|
Boolean filterZeroMappingQualityReads ) {
|
|
|
|
|
this.readsFiles = samFiles;
|
|
|
|
|
this.validationStringency = strictness;
|
|
|
|
|
this.downsamplingFraction = downsampleFraction;
|
|
|
|
|
this.downsampleToCoverage = downsampleCoverage;
|
|
|
|
|
this.beSafe = beSafe;
|
|
|
|
|
this.filterZeroMappingQualityReads = filterZeroMappingQualityReads;
|
2009-05-16 05:02:12 +08:00
|
|
|
}
|
|
|
|
|
}
|