The problem occurred when I run referencecn.mops on paired exome sequencing data.
Here is the command:
resRef <- referencecn.mops(cases=X[,1],controls=X[,4],classes=c("CN0", "CN1", "CN2", "CN3", "CN4", "CN5", "CN6","CN7","CN8","CN16","CN32","CN64","CN128"),I = c(0.025, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 8, 16, 32, 64),segAlgorithm="DNAcopy")
and the error messasge said:
Starting local modeling, please be patient...
Reference sequence: chr1
Reference sequence: chr2
Reference sequence: chr3
Reference sequence: chr4
Reference sequence: chr5
Reference sequence: chr6
Reference sequence: chr7
Reference sequence: chr8
Reference sequence: chr9
Reference sequence: chrM
Reference sequence: chrX
Reference sequence: chrY
Reference sequence: chr10
Reference sequence: chr11
Reference sequence: chr12
Reference sequence: chr13
Reference sequence: chr14
Reference sequence: chr15
Reference sequence: chr16
Reference sequence: chr17
Reference sequence: chr18
Reference sequence: chr19
Reference sequence: chr20
Reference sequence: chr21
Reference sequence: chr22
Starting segmentation algorithm...
Using "DNAcopy" for segmentation.
Analyzing: Sample.1
Error in .Call2("solve_user_SEW0", start, end, width, PACKAGE = "IRanges") :
solving row 4: negative widths are not allowed
SO I try to run the algorithm with part of the segments information, which located the problem in line 2100:
However the the 2100 line seems to be without negative width:
X[2100,1]
GRanges object with 1 range and 1 metadata column:
seqnames ranges strand |
<Rle> <IRanges> <Rle> |
[1] chr1 [237060305, 237060418] * |
P1194_5_cancer_reclapse.final.bam
<integer>
[1] 112
-------
seqinfo: 25 sequences from an unspecified genome; no seqlengths
> X[2100,4]
GRanges object with 1 range and 1 metadata column:
seqnames ranges strand | P1194_NC.final.bam
<Rle> <IRanges> <Rle> | <integer>
[1] chr1 [237060305, 237060418] * | 93
-------
seqinfo: 25 sequences from an unspecified genome; no seqlengths
I don't know which part goes wrong ,could anyone help me please?
I've checked my bed files, which showed that the starting position and end position are correct, with segments end always larger than segments start point.
However, when I reviewed the whole bed files, I found that some segments are slightly disordered and sometimes overlapped (maybe because I used table browser from UCSC to get exon position, with different transcript corresponding to the same gene). Since I only remove duplicate entries, some overlapping still remained in my data. So I sort the bed files and merge those overlapping segments, the problem seemed to be gone!
The result looks fine. But there is a slight problem. I noticed that the result only give CNV regions information, with some of this regions showed "CN2". Then what is the copy number of those regions that do not present in the result matrix? Are they also with CN2?
Here is part of the results: