C# Class CanvasCommon.CanvasSegment

Contains information about a genomic interval. Has functions for computing copy numbers and their likelihoods.
Datei anzeigen Open project: Illumina/canvas Class Usage Examples

Public Properties

Property Type Description
Counts List
Filter string
MajorChromosomeCount int?
ModelDistance double
QScore double
RunnerUpModelDistance double
VariantFrequencies List
VariantTotalCoverage List
cnSwaped string

Public Methods

Method Description
AssignQualityScores ( List segments, QScoreMethod qscoreMethod ) : void

Apply quality scores.

CanvasSegment ( string chr, int begin, int end, List counts ) : System
ComputeQScore ( QScoreMethod qscoreMethod ) : int
ExpectedCount ( List segments ) : double

Compute the median count from a list of segments.

GetCnvType ( int referenceCopyNumber ) : CnvType
GetQScorePredictor ( QScorePredictor predictorId ) : double
GetSegmentsByChromosome ( List segments ) : List>.Dictionary
MergeIn ( CanvasSegment s ) : void

Merge another neighboring segment into this one.

MergeSegments ( List &segments, int MinimumCallSize, int maximumMergeSpan = 10000 ) : void

Iterates through a list of segments and merges those which have the same copy number call. Also, for segments smaller than MinimumCallSize, assimilate them into the neighbor with the best quality score. Two consecutive segments are considered neighbors if they're on the same chromosome and the space between them is not too large.

MergeSegmentsUsingExcludedIntervals ( List &segments, int MinimumCallSize, Dictionary excludedIntervals ) : void

Iterates through a list of segments and merges those which have the same copy number call. Also, for segments smaller than MinimumCallSize, assimilate them into the neighbor with the best quality score. Two consecutive segments are considered neighbors if they're on the same chromosome and the space between them doesn't overlap with any excluded intervals.

ReadSegments ( string infile ) : List

Loads in data produced by CanvasPartition.exe.

WriteCoveragePlotData ( List segments, double normalDiploidCoverage, PloidyInfo referencePloidy, string filePath, string referenceFolder ) : void

Generate a tabular file with information about coverage and allele frequency for each chunk of the genome. This file can be used to generate a pretty plot of coverage versus MAF.

WriteSegments ( string outVcfPath, List segments, string wholeGenomeFastaDirectory, string sampleName, List extraHeaders, PloidyInfo ploidy, int qualityThreshold = 10 ) : void

Outputs the copy number calls to a text file.

Private Methods

Method Description
IsForbiddenInterval ( string chr, int start, int end, Dictionary excludedIntervals ) : bool

Return true if we are not allowed to merge two segments separated by the interval (start, end).

SanityCheckChromosomeNames ( GenomeMetadata genome, List segments ) : void

Integrity check, to ensure that our reference FASTA file is in sync with our inputs.

Method Details

AssignQualityScores() public static method

Apply quality scores.
public static AssignQualityScores ( List segments, QScoreMethod qscoreMethod ) : void
segments List
qscoreMethod QScoreMethod
return void

CanvasSegment() public method

public CanvasSegment ( string chr, int begin, int end, List counts ) : System
chr string
begin int
end int
counts List
return System

ComputeQScore() public method

public ComputeQScore ( QScoreMethod qscoreMethod ) : int
qscoreMethod QScoreMethod
return int

ExpectedCount() public static method

Compute the median count from a list of segments.
public static ExpectedCount ( List segments ) : double
segments List List of segments.
return double

GetCnvType() public method

public GetCnvType ( int referenceCopyNumber ) : CnvType
referenceCopyNumber int
return CnvType

GetQScorePredictor() public method

public GetQScorePredictor ( QScorePredictor predictorId ) : double
predictorId QScorePredictor
return double

GetSegmentsByChromosome() public static method

public static GetSegmentsByChromosome ( List segments ) : List>.Dictionary
segments List
return List>.Dictionary

MergeIn() public method

Merge another neighboring segment into this one.
public MergeIn ( CanvasSegment s ) : void
s CanvasSegment Segment to merge in.
return void

MergeSegments() public static method

Iterates through a list of segments and merges those which have the same copy number call. Also, for segments smaller than MinimumCallSize, assimilate them into the neighbor with the best quality score. Two consecutive segments are considered neighbors if they're on the same chromosome and the space between them is not too large.
public static MergeSegments ( List &segments, int MinimumCallSize, int maximumMergeSpan = 10000 ) : void
segments List
MinimumCallSize int
maximumMergeSpan int
return void

MergeSegmentsUsingExcludedIntervals() public static method

Iterates through a list of segments and merges those which have the same copy number call. Also, for segments smaller than MinimumCallSize, assimilate them into the neighbor with the best quality score. Two consecutive segments are considered neighbors if they're on the same chromosome and the space between them doesn't overlap with any excluded intervals.
public static MergeSegmentsUsingExcludedIntervals ( List &segments, int MinimumCallSize, Dictionary excludedIntervals ) : void
segments List
MinimumCallSize int
excludedIntervals Dictionary
return void

ReadSegments() public static method

Loads in data produced by CanvasPartition.exe.
public static ReadSegments ( string infile ) : List
infile string Input file.
return List

WriteCoveragePlotData() public static method

Generate a tabular file with information about coverage and allele frequency for each chunk of the genome. This file can be used to generate a pretty plot of coverage versus MAF.
public static WriteCoveragePlotData ( List segments, double normalDiploidCoverage, PloidyInfo referencePloidy, string filePath, string referenceFolder ) : void
segments List
normalDiploidCoverage double
referencePloidy PloidyInfo
filePath string
referenceFolder string
return void

WriteSegments() public static method

Outputs the copy number calls to a text file.
public static WriteSegments ( string outVcfPath, List segments, string wholeGenomeFastaDirectory, string sampleName, List extraHeaders, PloidyInfo ploidy, int qualityThreshold = 10 ) : void
outVcfPath string
segments List
wholeGenomeFastaDirectory string
sampleName string
extraHeaders List
ploidy PloidyInfo
qualityThreshold int
return void

Property Details

Counts public_oe property

public List Counts
return List

Filter public_oe property

public string Filter
return string

MajorChromosomeCount public_oe property

public int? MajorChromosomeCount
return int?

ModelDistance public_oe property

public double ModelDistance
return double

QScore public_oe property

public double QScore
return double

RunnerUpModelDistance public_oe property

public double RunnerUpModelDistance
return double

VariantFrequencies public_oe property

public List VariantFrequencies
return List

VariantTotalCoverage public_oe property

public List VariantTotalCoverage
return List

cnSwaped public_oe property

public string cnSwaped
return string