Exemplo n.º 1
0
        private void MoveIntermediateOutput(SampleInfo info, IntermediateOutput output, IFileMover fileMover)
        {
            var stub = GetSingleSampleOutputStub(info);

            // Output:
            fileMover.Move(output.CnvVcf.VcfFile, SingleSampleCallset.GetVcfOutput(stub));

            // Files for visualization:
            fileMover.Move(output.CoverageBigwig, SingleSampleCallset.GetCoverageBigWig(stub));
            var targetBAlleleBedgraph = SingleSampleCallset.GetBAlleleBedGraph(stub);

            fileMover.Move(output.BAlleleBedgraph.FileLocation, targetBAlleleBedgraph.FileLocation);
            fileMover.Move(output.BAlleleBedgraph.TabixIndex, targetBAlleleBedgraph.TabixIndex);
            var targetCopyNumbedBedgraph = SingleSampleCallset.GetCopyNumberBedGraph(stub);

            fileMover.Move(output.CopyNumberBedgraph.FileLocation, targetCopyNumbedBedgraph.FileLocation);
            fileMover.Move(output.CopyNumberBedgraph.TabixIndex, targetCopyNumbedBedgraph.TabixIndex);

            // Deprecated files:
#pragma warning disable CS0618                                                                                                    // Type or member is obsolete
            fileMover.Move(output.CoverageAndVariantFrequencies, SingleSampleCallset.GetCoverageAndVariantFrequencyOutput(stub)); // Used for (non-dynamic) plotting
            fileMover.Move(output.Partitioned, SingleSampleCallset.GetPartitionedPath(stub));                                     // used by BSVI
            fileMover.Move(output.VariantFrequencies, SingleSampleCallset.GetVfSummaryPath(stub));                                // used by BSVI
            fileMover.Move(output.VariantFrequenciesBaf, SingleSampleCallset.GetVfSummaryBafPath(stub));                          // used by BSVI
#pragma warning restore CS0618                                                                                                    // Type or member is obsolete
        }
Exemplo n.º 2
0
        private void MoveIntermediateOutput(SampleInfo info, IntermediateOutput output, IFileMover fileMover)
        {
            var stub = GetStub(info.Id);

            fileMover.Move(output.CoverageAndVariantFrequencies, SingleSampleCallset.GetCoverageAndVariantFrequencyOutput(stub));
            if (_canvasWorkerFactory.IncludeIntermediateResults())
            {
                fileMover.Move(output.Partitioned, SingleSampleCallset.GetPartitionedPath(stub));
                fileMover.Move(output.VariantFrequencies, SingleSampleCallset.GetVfSummaryPath(stub));
                fileMover.Move(output.VariantFrequenciesBaf, SingleSampleCallset.GetVfSummaryPath(stub));
            }
        }
        private CanvasSmallPedigreeOutput GetCanvasOutput(SampleSet <Bam> pedigreeBams, IDirectoryLocation sampleSandbox)
        {
            var readGroupSamples    = pedigreeBams.SelectData(GetReadGroupSample);
            var intermediateResults = readGroupSamples.SelectData(readGroupSample =>
            {
                var variantFrequencies            = SingleSampleCallset.GetVfSummaryPath(sampleSandbox, readGroupSample);
                var variantFrequenciesBaf         = SingleSampleCallset.GetVfSummaryBafPath(sampleSandbox, readGroupSample);
                var partitioned                   = SingleSampleCallset.GetPartitionedPath(sampleSandbox, readGroupSample);
                var coverageAndVariantFrequencies = SingleSampleCallset.GetCoverageAndVariantFrequencyOutput(sampleSandbox, readGroupSample);
                return(new IntermediateOutput(coverageAndVariantFrequencies, variantFrequencies, variantFrequenciesBaf, partitioned));
            });
            var cnvVcf = new Vcf(sampleSandbox.GetFileLocation("CNV.vcf.gz"));

            return(new CanvasSmallPedigreeOutput(cnvVcf, intermediateResults));
        }
Exemplo n.º 4
0
        private CanvasSmallPedigreeOutput Load(CanvasSmallPedigreeInput input)
        {
            var intermediateOutputs = input.Samples.SelectData((info, sample) =>
            {
                var stub = GetStub(info.Id);
                var coverageAndVariantFrequency = SingleSampleCallset.GetCoverageAndVariantFrequencyOutput(stub);
                if (!_canvasWorkerFactory.IncludeIntermediateResults())
                {
                    return(new IntermediateOutput(coverageAndVariantFrequency, null, null, null));
                }

                var partitioned           = SingleSampleCallset.GetPartitionedPath(stub);
                var variantFrequencies    = SingleSampleCallset.GetVfSummaryPath(stub);
                var variantFrequenciesBaf = SingleSampleCallset.GetVfSummaryPath(stub);
                return(new IntermediateOutput(coverageAndVariantFrequency, variantFrequencies, variantFrequenciesBaf, partitioned));
            });

            return(new CanvasSmallPedigreeOutput(new Vcf(GetCnvVcf()), intermediateOutputs));
        }
Exemplo n.º 5
0
        private CanvasSmallPedigreeOutput GetCanvasOutput(SampleSet <CanvasPedigreeSample> pedigreeSamples, IDirectoryLocation sampleSandbox)
        {
            var intermediateResults = pedigreeSamples.SelectSamples(sampleInfo =>
            {
                var sampleId                      = sampleInfo.Id;
                var variantFrequencies            = SingleSampleCallset.GetVfSummaryPath(sampleSandbox, sampleId);
                var variantFrequenciesBaf         = SingleSampleCallset.GetVfSummaryBafPath(sampleSandbox, sampleId);
                var partitioned                   = SingleSampleCallset.GetPartitionedPath(sampleSandbox, sampleId);
                var coverageAndVariantFrequencies = SingleSampleCallset.GetCoverageAndVariantFrequencyOutput(sampleSandbox, sampleId);
                var singleSampleVcf               = SingleSampleCallset.GetVcfOutput(sampleSandbox, sampleId);
                var coverageBigwig                = SingleSampleCallset.GetCoverageBigWig(sampleSandbox, sampleId);
                var bAlleleBedgraph               = SingleSampleCallset.GetBAlleleBedGraph(sampleSandbox, sampleId);
                var copyNumberBedgraph            = SingleSampleCallset.GetCopyNumberBedGraph(sampleSandbox, sampleId);
                return(new IntermediateOutput(new Vcf(singleSampleVcf), coverageAndVariantFrequencies, variantFrequencies, variantFrequenciesBaf,
                                              partitioned, coverageBigwig, bAlleleBedgraph, copyNumberBedgraph));
            });
            var cnvVcf = new Vcf(sampleSandbox.GetFileLocation("CNV.vcf.gz"));

            return(new CanvasSmallPedigreeOutput(cnvVcf, intermediateResults));
        }
Exemplo n.º 6
0
        private CanvasSmallPedigreeOutput Load(CanvasSmallPedigreeInput input)
        {
            var intermediateOutputs = input.Samples.SelectData((info, sample) =>
            {
                var stub = GetSingleSampleOutputStub(info);
                var coverageAndVariantFrequency = SingleSampleCallset.GetCoverageAndVariantFrequencyOutput(stub);
                var singleSampleVcf             = new Vcf(SingleSampleCallset.GetVcfOutput(stub));

                var partitioned           = SingleSampleCallset.GetPartitionedPath(stub);
                var variantFrequencies    = SingleSampleCallset.GetVfSummaryPath(stub);
                var variantFrequenciesBaf = SingleSampleCallset.GetVfSummaryBafPath(stub);

                var coverageBigwig     = SingleSampleCallset.GetCoverageBigWig(stub);
                var bAlleleBedgraph    = SingleSampleCallset.GetBAlleleBedGraph(stub);
                var copyNumberBedgraph = SingleSampleCallset.GetCopyNumberBedGraph(stub);


                return(new IntermediateOutput(singleSampleVcf, coverageAndVariantFrequency, variantFrequencies, variantFrequenciesBaf, partitioned,
                                              coverageBigwig, bAlleleBedgraph, copyNumberBedgraph));
            });

            return(new CanvasSmallPedigreeOutput(new Vcf(GetPedigreeVcf()), intermediateOutputs));
        }