org.broadinstitute.hellbender.tools.sv.PrintReadCounts Maven / Gradle / Ivy
The newest version!
package org.broadinstitute.hellbender.tools.sv;
import htsjdk.samtools.SAMFileHeader;
import htsjdk.samtools.SAMReadGroupRecord;
import htsjdk.samtools.SAMSequenceDictionary;
import htsjdk.samtools.SAMTextHeaderCodec;
import htsjdk.samtools.util.RuntimeIOException;
import htsjdk.tribble.Feature;
import org.broadinstitute.barclay.argparser.Argument;
import org.broadinstitute.barclay.argparser.CommandLineProgramProperties;
import org.broadinstitute.barclay.argparser.ExperimentalFeature;
import org.broadinstitute.barclay.help.DocumentedFeature;
import org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions;
import org.broadinstitute.hellbender.cmdline.programgroups.StructuralVariantDiscoveryProgramGroup;
import org.broadinstitute.hellbender.engine.*;
import org.broadinstitute.hellbender.exceptions.UserException;
import org.broadinstitute.hellbender.tools.copynumber.formats.metadata.SampleLocatableMetadata;
import org.broadinstitute.hellbender.tools.copynumber.formats.records.SimpleCount;
import org.broadinstitute.hellbender.utils.codecs.copynumber.SimpleCountCodec;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
/**
* Prints (and optionally subsets) an rd (DepthEvidence) file or a counts file
* as one or more (for multi-sample DepthEvidence files) counts files for CNV determination.
*
* Inputs
*
*
* -
* A locus-sorted DepthEvidence file (name ends with ".rd.txt", ".rd.txt.gz", or "rd.bci"),
* or a counts file (name ends with ".counts.tsv", or ".counts.tsv.gz").
*
*
*
* Output
*
*
* -
* A counts file (or files) for use by one of the CNV-calling tools.
*
*
* The output files are named "{output-prefix}{sample-name}.counts.tsv"
*
* Usage example
*
*
* gatk PrintCNVCounts \
* -F input.rd.txt.gz \
* -L chr1
*
*
* @author Ted Sharpe <[email protected]>
*/
@CommandLineProgramProperties(
summary = "Prints count files for CNV determination.",
oneLineSummary = "Prints count files for CNV determination.",
programGroup = StructuralVariantDiscoveryProgramGroup.class
)
@ExperimentalFeature
@DocumentedFeature
public class PrintReadCounts extends FeatureWalker {
public static final String INPUT_ARGNAME = "input-counts";
public static final String OUTPUT_PREFIX_ARGNAME = "output-prefix";
public static final String OUTPUT_FILES_ARGNAME = "output-file-list";
@Argument(
doc = "Input file of counts",
fullName = INPUT_ARGNAME,
shortName = StandardArgumentDefinitions.FEATURE_SHORT_NAME
)
private GATKPath inputPath;
@Argument(
doc = "Output file path prefix. Paths have the form \"{output-prefix}{sample-name}.counts.tsv\". " +
"Default is the current working directory.",
fullName = OUTPUT_PREFIX_ARGNAME,
optional = true
)
private String outputPrefix = "";
@Argument(
doc = "Two-column list of outputs in the form \\t © 2015 - 2025 Weber Informatics LLC | Privacy Policy