akdess / CaSpER

77 stars 28 forks source link

runCaSpER : Error in value[[jvseq[[jjj]]]] : subscript out of bounds #68

Closed nmc-ei closed 2 years ago

nmc-ei commented 3 years ago

Hello I need help.

>data("hg19_cytoband")
>xp <- read.table("/mnt/d/counts_n1_tpn.txt")
>xp <- as.matrix(xp)
>loh <- readBAFExtractOutput ( path="./casper/baf_n1/", sequencing.type="bulk")
>names(loh) <- gsub(".snp", "", names(loh))
>loh.name.mapping <- read.table("/mnt/d/loh_name_mapping.txt", header=T)
>control.sample.ids <- read.table("/mnt/d/control_sample_ids.txt")
>control.sample.ids <- as.character(control.sample.ids)
>annotation <- generateAnnotation(id_type="ensembl_gene_id", genes=rownames(xp), ishg19=T, centromere,host="uswest.ensembl.org")
>xp <- xp[match( annotation$Gene,rownames(xp)), ]
> object <- CreateCasperObject(raw.data=xp,loh.name.mapping=loh.name.mapping, sequencing.type="bulk", 
+                              cnv.scale=3, loh.scale=3, matrix.type="normalized", expr.cutoff=4.5,
+                              annotation=annotation, method="iterative", loh=loh, filter="median", 
+                              control.sample.ids=control.sample.ids, cytoband=cytoband)
Performing Median Filtering...
Scale:1...
Performing Median Filtering...
Scale:2...
Performing Median Filtering...
Scale:3...
There were 38 warnings (use warnings() to see them)
> final.objects <- runCaSpER(object, removeCentromere=T, cytoband=cytoband, method="iterative")
Performing recursive median filtering...
Performing HMM segmentation...
Processing cnv.scale:1 loh.scale:1...
Error in value[[jvseq[[jjj]]]] : subscript out of bounds
> obj <- final.objects[[9]]
Error: object 'final.objects' not found
> warnings()
Warning messages:
1: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
2: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
3: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
4: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
5: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
6: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
7: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
8: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
9: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
10: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
11: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
12: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
13: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
14: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
15: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
16: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
17: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
18: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
19: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
20: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
21: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
22: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
23: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
24: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
25: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
26: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
27: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
28: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
29: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
30: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
31: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
32: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
33: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
34: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
35: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
36: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
37: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
38: In runmed(x, filt$n) : 'k' is bigger than 'n'!  Changing 'k' to 133
jsialar commented 2 years ago

@nmc-ei I also ran into the same error, how did you resolve it?

Kaddea commented 1 year ago

I also had that error message once. It turned out, my "loh.name.mapping" file was comma separated instead of tab separated. Hope that helps ... :)

rustino commented 8 months ago

For solving this in my case, I ordered the samples in the same way on every file and vector (loh.name.mapping, expression table and control.sample.ids)