Search in sources :

Example 16 with ModeledSegment

use of org.broadinstitute.hellbender.tools.exome.ModeledSegment in project gatk-protected by broadinstitute.

the class PerformCopyRatioSegmentation method doWork.

@Override
public Object doWork() {
    final String sampleName = ReadCountCollectionUtils.getSampleNameForCLIsFromReadCountsFile(new File(coverageFile));
    final ReadCountCollection rcc;
    try {
        rcc = ReadCountCollectionUtils.parse(new File(coverageFile));
    } catch (final IOException ex) {
        throw new UserException.BadInput("could not read input file");
    }
    final CopyRatioSegmenter segmenter = new CopyRatioSegmenter(initialNumStates, rcc);
    final List<ModeledSegment> segments = segmenter.getModeledSegments();
    SegmentUtils.writeModeledSegmentFile(outputSegmentsFile, segments, sampleName, false);
    return "SUCCESS";
}
Also used : ReadCountCollection(org.broadinstitute.hellbender.tools.exome.ReadCountCollection) ModeledSegment(org.broadinstitute.hellbender.tools.exome.ModeledSegment) IOException(java.io.IOException) UserException(org.broadinstitute.hellbender.exceptions.UserException) File(java.io.File)

Aggregations

ModeledSegment (org.broadinstitute.hellbender.tools.exome.ModeledSegment)16 Test (org.testng.annotations.Test)12 RandomGenerator (org.apache.commons.math3.random.RandomGenerator)8 SimpleInterval (org.broadinstitute.hellbender.utils.SimpleInterval)8 File (java.io.File)6 Collectors (java.util.stream.Collectors)6 IntStream (java.util.stream.IntStream)6 RandomGeneratorFactory (org.apache.commons.math3.random.RandomGeneratorFactory)6 ReadCountCollection (org.broadinstitute.hellbender.tools.exome.ReadCountCollection)6 AllelicCountCollection (org.broadinstitute.hellbender.tools.exome.alleliccount.AllelicCountCollection)6 Assert (org.testng.Assert)6 java.util (java.util)4 Random (java.util.Random)4 Array2DRowRealMatrix (org.apache.commons.math3.linear.Array2DRowRealMatrix)4 CommandLineProgramTest (org.broadinstitute.hellbender.CommandLineProgramTest)4 Target (org.broadinstitute.hellbender.tools.exome.Target)4 AlleleFractionGlobalParameters (org.broadinstitute.hellbender.tools.exome.allelefraction.AlleleFractionGlobalParameters)4 AllelicPanelOfNormals (org.broadinstitute.hellbender.tools.pon.allelic.AllelicPanelOfNormals)4 IOException (java.io.IOException)2 Arrays (java.util.Arrays)2