Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用R ggbio循环函数对每个染色体进行着色,使其具有不同的颜色_R - Fatal编程技术网

使用R ggbio循环函数对每个染色体进行着色,使其具有不同的颜色

使用R ggbio循环函数对每个染色体进行着色,使其具有不同的颜色,r,R,我使用ggbio的circle()函数有一个非常具体的例子 使用genomicranges软件包,我制作了一个make信念数据集 gr <- GRanges(seqnames = c("scaffold_13117","scaffold_6016","scaffold_13335"), ranges = IRanges( start = rep(1,3), end = c(5790199,5827,3335858), ),

我使用ggbio的circle()函数有一个非常具体的例子

使用genomicranges软件包,我制作了一个make信念数据集

gr <- GRanges(seqnames = 
    c("scaffold_13117","scaffold_6016","scaffold_13335"),
    ranges = IRanges(
        start = rep(1,3),
        end = c(5790199,5827,3335858),
    ),
    strand = rep("*",3),
    n = c("red","blue","red")
)
gr您可以试试这个(注意我还更改了“scaffold_6016”的大小,以便更好地看到蓝色):

gr
p <- ggbio() + circle(gr, geom = "ideo")
gr <- GRanges(seqnames = 
    c("scaffold_13117","scaffold_6016","scaffold_13335"),
    ranges = IRanges(
        start = rep(1,3),
        end = c(5790199,5000000,3335858),
    ),
    strand = rep("*",3),
    n = c("red","blue","red")
)

mycolours<-c("red","blue")
names(mycolours)<-mycolours

p<-ggbio() + circle(gr,geom="rect",aes(fill=n))+scale_fill_manual(values=mycolours,guide="none")
print(p)