我正在尝试构建一个气泡图,其中一个因子具有实心填充,另一个因素基于对数倍数变化填充 . 我有一个差异丰富的蛋白质列表,两个时间点之间的对数倍数变化值(我想要填充的两个因素不同) . 我可以根据日志折叠变化(第一个图)和基于时间(第二个图)来填充气泡,但我真的希望所有的2 am气泡都是黑色/灰色,并且所有8 pm气泡都要填充条件记录倍数变化 . 可以在不制作2个图表的情况下完成吗?

我正在使用包ggplot2和ggthemes在R v 3.3.2中工作 .

时间= 2个时间点ETS.category =基本上将单个蛋白质分组的蛋白质功能类别sumnsaf =每个蛋白质在每个时间点的蛋白质丰度值(气泡大小的比例)

我无法提供输出输出,因为它对于一个帖子来说太大了,但希望你能从第一行得到这个想法(我可以提供输入文件,如果需要的话):

Protein  Entry Protein.names LogFoldChange    ETS.category    Time
1  01554_comp1507_c0 Q9BLZ1    Luciferase        -1.581 bioluminescence 8:00 PM
2  01330_comp1408_c1 Q9BLZ1    Luciferase        -1.406 bioluminescence 8:00 PM
3 23772_comp16505_c1 Q9BLZ1    Luciferase        -1.355 bioluminescence 8:00 PM
4  01339_comp1414_c0 Q9BLZ1    Luciferase        -1.160 bioluminescence 8:00 PM
5  01279_comp1377_c0 Q9BLZ1    Luciferase        -1.093 bioluminescence 8:00 PM
6  01252_comp1362_c0 Q9BLZ1    Luciferase        -0.992 bioluminescence 8:00 PM
   xiphias1  xiphias2  xiphias3  xiphias4   xiphias5 xiphias6   sumnsaf
1  89.32287 138.36007 113.07703 100.67700  89.621533  55.3685  586.4270
2 360.74747 368.67670 369.56857 339.59370 188.797933 177.9319 1805.3163
3 121.36577 140.46653 140.11740 104.01390  32.485567   0.0000  538.4492
4   0.00000   0.00000   0.00000  15.78833  71.783467   0.0000   87.5718
5  45.70467   0.00000  76.76587  57.41630   9.734833   0.0000  189.6217
6  97.30740  98.25493 130.76463 132.09267 108.591567   0.0000  567.0112

对于基于对数倍数变化的填充:

ggplot(prot.sum2) + geom_jitter(aes(x=Time, y=ETS.category, colour=LogFoldChange, size=sumnsaf), alpha=0.5, width=0.2, height=0.2) + labs(y='Protein Category') + geom_hline(yintercept=c(1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5, 17.5, 18.5, 19.5, 20.5, 21.5, 22.5, 23.5), color='grey80') + theme_tufte()

bubble plot with log fold change fill

根据时间填写

ggplot(prot.sum2) + geom_jitter(aes(x=Time, y=ETS.category, size=sumnsaf, colour=factor(Time)), alpha=0.5, width=0.2, height=.2) + labs(y='Protein Category') + geom_hline(yintercept=c(1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5, 17.5, 18.5, 19.5, 20.5, 21.5, 22.5, 23.5), color='grey80') + guides(size=guide_legend(title='Abundance')) +  scale_colour_manual(values=c('black', 'red')) + guides(colour=F) + theme_tufte()

bubble plot with time fill