Dear Ying,
I have my data.frame of 'karyotype' chromosomes:
> par.chr
seg.name seg.Start seg.End
1 mdm1 1 29289779
2 mdm2 29289779 65664585
3 mdm3 65664585 99375387
4 mdm4 99375387 122396126
5 mdm5 122396126 154003081
6 mdm6 154003081 179476216
7 mdm7 179476216 205859750
8 mdm8 205859750 235463689
9 mdm9 235463689 269181364
10 mdm10 269181364 302572599
11 mdm11 302572599 337872134
12 mdm12 337872134 369550824
13 mdm13 369550824 404269910
14 mdm14 404269910 433428769
15 mdm15 433428769 480609771
16 mdm16 480609771 501274164
17 mdm17 501274164 526197889
However, when I try to convert to the angle values I get the following error. I tried changing the colnames to c("chr", "seg.start", "seg.end") <- as shown in the ref. manual but I get the same error. I'm only using the three required columns, so I don't have the optional columns 4 and 5.
pchrs <- segAnglePo(seg.dat = par.chr, seg = seg.name)
Error in `colnames<-`(`*tmp*`, value = c("seg.name", "seg.Start", "seg.End", :
'names' attribute [5] must be the same length as the vector [3]
I also tried changing the seg.name names:
n <- 17
m <- paste("chr", 1:n, sep="")
m
[1] "chr1" "chr2" "chr3" "chr4" "chr5" "chr6" "chr7" "chr8" "chr9"
[10] "chr10" "chr11" "chr12" "chr13" "chr14" "chr15" "chr16" "chr17"
par.chr$seg.name <- m
head(par.chr)
seg.name seg.Start seg.End
1 chr1 1 29289779
2 chr2 29289779 65664585
3 chr3 65664585 99375387
4 chr4 99375387 122396126
5 chr5 122396126 154003081
6 chr6 154003081 179476216
pchrs <- segAnglePo(seg.dat = par.chr, seg = seg.name)
> attributes(par.chr)
$names
[1] "seg.name" "seg.Start" "seg.End"
$class
[1] "data.frame"
$row.names
[1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
I also looked this error up on stackoverflow and biostars. A workaround was to install a previous package version. Such was the case with dplyr 1.7. However, I wanted to contact you to ask you if I should install a previous version, the current developers version or if there is another way using the current package.
Thanks,
Franklin
> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.1 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats4 parallel stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] OmicCircos_1.8.1 GenomicRanges_1.22.4 GenomeInfoDb_1.6.3
[4] IRanges_2.4.8 S4Vectors_0.8.11 BiocGenerics_0.16.1
loaded via a namespace (and not attached):
[1] zlibbioc_1.16.0 tools_3.2.3 XVector_0.10.0