内容

库(dplyr)库(IHW)图书馆(fdrtool)图书馆(ggplot2)库(cowplot) theme_set (theme_cowplot())图书馆(tidyr)图书馆(尺度)库(latex2exp)

让我们先加载的数据:

file_loc < -系统。文件(“extdata”、“real_data”,“hqtl_chrom1_chrom2”,包=“IHWpaper”)

首先假定值对应的两个表两条染色体。注意,只有假定值< = 1的军医都存储在这些。

chr1_df < readRDS(文件。路径(file_loc chr1_subset.Rds)) chr2_df < readRDS(文件。路径(file_loc chr2_subset.Rds))
pval_threshold < - 10 ^ (4)

还记得每个假设对应于峰值(下面我们称之为基因)和一个SNP。因此,让我们对每个snp和峰值负载文件:

snp_chr1 < readRDS(文件。路径(file_loc snppos_chr1.Rds)) snp_chr2 < readRDS(文件。路径(file_loc snppos_chr2.Rds)) all_peaks < readRDS(文件。路径(file_loc peak_locations.Rds)) peaks_chr1 < - dplyr::过滤器(all_peaks,空空的= =“chr1”) peaks_chr2 < - dplyr::过滤器(all_peaks,空空的= =“chr2”)

我们可以使用这些来推断多少总共进行了假设(或在一个给定的距离),而且协变量来计算我们的SNP的函数和峰值(距离)。

现在让我们把新列的协变量(距离)的数据帧。

chr1_df < - left_join (chr1_df,选择(snp_chr1 snp, pos),由= (c(“民族党”=“民族党”)))% > % left_join (peaks_chr1, = (c(“基因”=“id”))) % > %变异(dist = pmin (abs (pos-start), abs (pos-end))) chr2_df < - left_join (chr2_df,选择(snp_chr2 snp, pos),由= (c(“民族党”=“民族党”)))% > % left_join (peaks_chr2, = (c(“基因”=“id”))) % > %变异(dist = pmin (abs (pos-start), abs (pos-end)))

现在我们的距离转换为一个分类装箱协变量:

my_breaks < - c (1、seq(从= 10000 = 290000 = 10000),seq(从= 300000 = 0.9 * 10 ^ 6 = 100000),seq(从= 10 ^ 6 = 25.1 * 10 ^ 7 = 10 ^ 7))myf1 < -削减(美元chr1_df dist my_breaks) myf2 < -削减(美元chr2_df dist my_breaks)

运用我们的方法尽管只有很小的假定值是可用的,我们将计算有多少假设每一个垃圾箱。上面的代码不是很有效,所以我们有预先计算的结果,不要运行下面的块。

< -代表女士问= 0(0,长度(水平(myf1))) pb = txtProgressBar (min = 0, max = nrow (peaks_chr1),初始= 0),(我在1:nrow (peaks_chr1)) {setTxtProgressBar (pb, i) start_pos < - peaks_chr1开始[我]end_pos < - peaks_chr1美元结束[我]dist_vec < - pmin (abs (snp_chr1 pos - start_pos美元)、abs (snp_chr1 pos - end_pos)美元)< - ms +女士表(削减(dist_vec my_breaks))} saveRDS (ms,文件= " m_groups_chr1。Rds”)cnt = 0 ms_chr2 <- table(myf2)*0 pb = txtProgressBar(min = 0, max = nrow(peaks_chr2), initial = 0) for (i in 1:nrow(peaks_chr2)){ setTxtProgressBar(pb,i) start_pos <- peaks_chr1$start[i] end_pos <- peaks_chr1$end[i] dist_vec <- pmin( abs(snp_chr2$pos - start_pos), abs(snp_chr2$pos - end_pos) ) ms_chr2 <- ms_chr2 + table(cut(dist_vec, my_breaks)) } saveRDS( ms_chr2, file = "m_groups_chr2.Rds" )

让我们负载从上面的执行结果:

ms_chr1 < readRDS(文件。路径(file_loc m_groups_chr1.Rds)) ms_chr2 < readRDS(文件。路径(file_loc m_groups_chr2.Rds))

让我们一起把两条染色体的数据:

chr1_chr2_df < - rbind (chr1_df chr2_df) chr1_chr2_groups < - as.factor (c (myf1 myf2)) folds_vec < -。因子(c(代表(nrow (chr1_df)),代表(2,nrow (chr2_df)))) m_groups < - cbind (ms_chr1 ms_chr2)
m < - sum (m_groups) #假设m的总数
# # [1]15725016812

1直方图的情节

让我们的颜色:

beyonce_colors < - c (“# b72da0”、“# 7 c5bd2”、“# 0097版”,“# 00 c6c3”、“# 9 cd78a”、“# f7f7a7”、“# ebab5f”,“# e24344”、“# 04738 d”) #, # d8cdc9) beyonce_colors [6] < - c (“# dbcb09”) #厚的黄色pretty_colors < - beyonce_colors [c (2, 1, 3:5)]
qs < - c(0.025, 0.05)达标< - c(0分位数(chr1_chr2_df dist是美元,qs),正)cov_scatter_gg < - ggplot (chr1_chr2_df, aes (x =排名(经销)/ nrow (chr1_chr2_df), y = log10 (pvalue))) + geom_bin2d(箱= 150,下降= TRUE) + # geom_point(α= 0.2,=上校pretty_colors [1]) + geom_vline (xintercept = qs,线型=“冲”)+ ylab(表达式(粘贴(日志[10],(假定值))))+ xlab(表达式(粘贴(“分位数的距离”)))+ scale_fill_gradientn (trans =“log10”,颜色=α(pretty_colors [1], c (0.2, 1))) cov_scatter_gg

ggsave (cov_scatter_gg文件名= " cov_scatter_gg。pdf”,宽度= 4,身高= 3)
chr1_chr2_df cutoff_groups < -削减美元(美元chr1_chr2_df dist达标)表(chr1_chr2_df cutoff_groups美元)
# # # # (0,1.13 e + 05) (1.13 e + 05年,2.34 e + 06] (2.34 e + 06,正]# # 60404 60404 2295337

首先让我们绘制边缘直方图:

gg_marginal_hist < - ggplot (chr1_chr2_df aes (x = pvalue * 10 ^ 4)) + geom_histogram (aes (y = . .密度. .),α= 0.5,binwidth = 0.05,边界= 0,颜色=“黑人”,填补= pretty_colors [1]) + scale_x_continuous(扩大= c(0.02, 0),休息时间= c (0、0.5、1)) + scale_y_continuous(扩大= c(0.02, 0),限制= c (0, - 2.5)) + ylab(表达式(粘贴(“密度”)))+ xlab(特克斯(“假定值($ \ \ * 10 ^ {4}$)”))gg_marginal_hist

ggsave (gg_marginal_hist文件名= " gg_marginal_hist。pdf”,宽度= 4,身高= 3)
gg_stratified_hist < - ggplot (chr1_chr2_df aes (x = pvalue * 10 ^ 4)) + geom_histogram (aes (y = . .密度. .),α= 0.5,binwidth = 0.05,边界= 0,颜色=“黑人”,填补= pretty_colors [1]) + scale_x_continuous(扩大= c(0.02, 0),休息时间= c (0、0.5、1)) + scale_y_continuous(扩大= c(0.02, 0),限制= c (0, 11)) + ylab(“密度”)+ xlab(特克斯(“假定值($ \ \ * 10 ^ {4}$)”))+ facet_grid (~ cutoff_groups) +主题(地带。strip.text背景= element_blank ()。y = element_blank()) +主题(面板。间隔=单位gg_stratified_hist(2,“线”))

ggsave (gg_stratified_hist文件名= " gg_stratified_hist。pdf”,宽度= 7,身高= 3)

2应用IHW-BY和

我们想申请Benjamini-Yekutieliα= 0.1,因此我们将Benjamini-Hochberg纠正级别:

α< - . 01 /(日志(m) + 1)

现在让我们运行IHW过程:

ihw_chr1_chr2 < - ihw (chr1_chr2_df pvalue美元,chr1_chr2_groups,α,折叠= folds_vec m_groups = m_groupsλ= 2000)

拒绝的:

sum (p。调整(chr1_chr2_df pvalue美元,n = m方法=“黑洞”)< =α)
# # 9110年[1]

IHW-BY拒绝:

拒绝(ihw_chr1_chr2)
# # 21903年[1]

所以我们看到,发现增加了一倍多。

如果我们申请BH IHW-BH而不是由IHW-BY ?

alpha_bh < - 0.01 ihw_chr1_chr2_bh < ihw (chr1_chr2_df pvalue美元、chr1_chr2_groups alpha_bh,折叠= folds_vec m_groups = m_groupsλ= 2000)
sum (p。调整(chr1_chr2_df pvalue美元,n = m方法=“黑洞”)< = alpha_bh)
# # 19055年[1]
拒绝(ihw_chr1_chr2_bh)
# # 52488年[1]

3假设表所示

为表我们展示一个假说1号染色体上,被拒绝了两次(BH和IHW):

idx <——(rejected_hypotheses (ihw_chr1_chr2) & (p。调整(chr1_chr2_df pvalue美元,n = m方法=“黑洞”)>α)& ((ihw_chr1_chr2) = =反是;3)& (ihw_chr1_chr2@df折= = 1美元))idx_max < - which.max (pvalues (ihw_chr1_chr2) [idx]) ihw_chr1_chr2@df [idx [idx_max]]
# # [1]pvalue adj_pvalue重量weighted_pvalue # #[5]组协变量褶皱# # > < 0行(或0-length row.names)
chr1_df [idx [idx_max]]
# # #一个宠物猫:0×11 # # #…有11个变量:SNP <科>、< int >基因,β<双>,tstat <双>,# # # pvalue <双>、<双>的富兰克林·罗斯福,pos < int >, <科>,从而向开始< int >, < int >, # # # dist < int >

我们将展示一个假设1号染色体上,体重0:

idx <——(! rejected_hypotheses (ihw_chr1_chr2) & (p。调整(chr1_chr2_df pvalue美元,n = m方法=“黑洞”)>α)& ((ihw_chr1_chr2)反是= = 15)& (ihw_chr1_chr2@df折= = 1美元))idx_max < - which.max (pvalues (ihw_chr1_chr2) [idx]) ihw_chr1_chr2@df [idx [idx_max]]
# # [1]pvalue adj_pvalue重量weighted_pvalue # #[5]组协变量褶皱# # > < 0行(或0-length row.names)
chr1_df [idx [idx_max]]
# # #一个宠物猫:0×11 # # #…有11个变量:SNP <科>、< int >基因,β<双>,tstat <双>,# # # pvalue <双>、<双>的富兰克林·罗斯福,pos < int >, <科>,从而向开始< int >, < int >, # # # dist < int >

接下来,我们找到一个假说得到Chr2拒绝了在这两种情况下:

idx <——(rejected_hypotheses (ihw_chr1_chr2) & (p。调整(chr1_chr2_df pvalue美元,n = m方法=“黑洞”)< =α)& ((ihw_chr1_chr2) = =反是;3)& (ihw_chr1_chr2@df折美元= = 2))
ihw_chr1_chr2@df (idx [9],)
# # pvalue adj_pvalue重量weighted_pvalue组协变量褶皱# #不详不详不详不详不详< NA > < NA > < NA >
chr2_df [idx [9] -nrow (chr1_df))
# # #一个宠物猫:1×11 # # SNP基因βtstat pvalue罗斯福pos空空的开始结束dist # # <空空的> < int > <双> <双> <双> <双> < int > <空空的> < int > < int > < int > # # 1 < NA > NA不详不详不详不详不详< NA > NA NA NA

另一个,只有被拒绝在一个案例中

idx <——(rejected_hypotheses (ihw_chr1_chr2) & (p。调整(chr1_chr2_df pvalue美元,n = m方法=“黑洞”)>α)&(协变量(ihw_chr1_chr2) = = 1) & (ihw_chr1_chr2@df折= = 2)美元)idx_max < - which.max (pvalues (ihw_chr1_chr2) [idx]) ihw_chr1_chr2@df [idx [idx_max]]
# # [1]pvalue adj_pvalue重量weighted_pvalue # #[5]组协变量褶皱# # > < 0行(或0-length row.names)
chr2_df [idx [idx_max] -nrow (chr1_df))
# # #一个宠物猫:0×11 # # #…有11个变量:SNP <科>、< int >基因,β<双>,tstat <双>,# # # pvalue <双>、<双>的富兰克林·罗斯福,pos < int >, <科>,从而向开始< int >, < int >, # # # dist < int >

4着手做重量/阈值/ lfdr情节

第一次被拒绝的门槛:

t_bh < - get_bh_threshold (chr1_chr2_df pvalue美元,α,mtests = m) t_bh
# # 2.363825平台以及[1]

接下来写一个函数来估计当地罗斯福在给定阈值:

get_local_fdr < -函数(褶皱、组){idx < - (chr1_chr2_groups = =集团)& (folds_vec = =褶皱)pvals < -排序(chr1_chr2_df pvalue美元[idx]) m_true < - m_groups(集团、折叠)gren < - IHW::: presorted_grenander (pvals m_true)我< -阈值(ihw_chr1_chr2 levels_only = TRUE)(集团、折叠)id_ihw_myt <——(我< gren x.knots美元)[1]local_fdr_ihw < - ifelse(我= = 0,0,1 / gren slope.knots美元[id_ihw_myt-1]) id_bh_thresh <——(t_bh < gren x.knots美元)[1]local_fdr_bh < - 1 / gren美元的斜率。结[id_bh_thresh-1]₀< - (m_true -长度(pvals)) / (1 - 10 ^ (4)) / m_true data.frame(=折叠,折叠组=组,₀=₀t_ihw =我local_fdr_ihw = local_fdr_ihw local_fdr_bh = local_fdr_bh)}
fold_groups < -扩张。网格(1:62 1:2)

预先执行以下太,因为它需要一段时间:

lfdrs < - bind_rows (mapp (get_local_fdr fold_groups [[2]], fold_groups[[1]],简化= FALSE)) saveRDS (lfdrs、文件=“hqtl_estimated_lfdrs.Rds”)
lfdrs < readRDS(文件。路径(file_loc hqtl_estimated_lfdrs.Rds))
lfdrs < -变异(lfdrs染色体= paste0(“空空”,褶皱)、地层=集团t_bh = t_bh)

5开始策划

休息< - my_breaks / 10 ^ 3 < -[1]休息break_min < - 3000/10 ^ 3 breaks_left < - c (break_min,减免(长度(减免)])层< - 1:62 step_df_weight < - data.frame(地层=地层,chr2 =重量(ihw_chr1_chr2 levels_only = TRUE) [1], chr1 =重量(ihw_chr1_chr2 levels_only = TRUE)[2]) % > %收集(染色体、重量、地层)step_df_threshold < - data.frame(地层=地层,chr2 =阈值(ihw_chr1_chr2 levels_only = TRUE) [2], chr1 =阈值(ihw_chr1_chr2 levels_only = TRUE)[1]) % > %收集(染色体,阈值,地层)step_df < - left_join (step_df_weight step_df_threshold) % > % left_join (lfdrs)
# #加入,= c(“层”、“染色体”)加入,# # = c(“层”、“染色体”)
step_df < - step_df % > %变异(break_left = breaks_left(地层),break_right =优惠(地层),break_ratio = break_right / break_left break_left_init = break_left break_right_init = break_right break_left = break_left * break_ratio ^。2, break_right = break_right *break_ratio^(-.2)) stratum_fun <- function(df, colname="weight"){ stratum <- df$stratum weight <- df[[colname]] stratum_left <- stratum[stratum != length(stratum)] weight_left <- weight[stratum_left] break_left <- df$break_right[stratum_left] stratum_right <- stratum[stratum != 1] weight_right <- weight[stratum_right] break_right <- df$break_left[stratum_right] data.frame(stratum_left= stratum_left, weight_left= weight_left, stratum_right = stratum_right, weight_right = weight_right, break_left = break_left, break_right = break_right) } connecting_df_weights <- step_df %>% group_by(Chromosome) %>% do(stratum_fun(.)) %>% mutate(dashed = factor(ifelse(abs(weight_left - weight_right) > 0.5 , TRUE, FALSE), levels=c(FALSE,TRUE))) weights_panel <- ggplot(step_df, aes(x=break_left, xend=break_right,y=weight, yend=weight, col=Chromosome)) + geom_segment(size=0.8)+ geom_segment(data= connecting_df_weights, aes(x=break_left, xend=break_right, y=weight_left, yend=weight_right, linetype=dashed), size=0.8)+ scale_x_log10(breaks=c(10^4, 10^5,10^6,10^7,10^8), labels = trans_format("log10", math_format(10^.x))) + xlab("Genomic distance (bp)")+ ylab("Weight")+ theme(legend.position=c(0.8,0.6)) + theme(plot.margin = unit(c(2, 1.5, 1, 2.5), "lines"))+ theme(axis.title = element_text(face="bold" ))+ scale_color_manual(values=pretty_colors)+ guides(linetype=FALSE)
# #警告:“指南(<规模> = FALSE)”是弃用。请使用指南(<规模> = # #“没有”)”。
weights_panel

#权重1号染色体

weights_panel_1 < - ggplot(过滤器(step_df染色体= =“chr1”)、aes (x = break_left xend = break_right, y =重量,yend =重量,坳=染色体))+ geom_segment(大小= 0.8,lineend =“圆”)+ geom_segment (data =过滤器(connecting_df_weights染色体= =“chr1”)、aes (x = break_left xend = break_right y = weight_left yend = weight_right线型=冲),大小= 0.8,lineend =“圆”)+ scale_x_log10(休息= c(10 10 ^ 2 10 ^ 3, 10 ^ 4),标签= trans_format (“log10 math_format (10 ^。x))) + scale_y_continuous(休息= c (0, 1000, 2000)) + xlab(表达式(粘贴(距离(kbp)))) + ylab(表达式(粘贴(“重量”)))+主题(legend.position =“没有”)+主题(情节。利润=单位(c(2、1.5、1、2.5),“线”)(轴)+主题。title = element_text(幼圆“大胆”))+ scale_color_manual(值= pretty_colors) +导游(线型= FALSE)
# #警告:“指南(<规模> = FALSE)”是弃用。请使用指南(<规模> = # #“没有”)”。
weights_panel_1

ggsave (weights_panel_1文件名= " chr1_weights。pdf”、宽= 3.5,高= 2.5)
weights_panel_2 < - ggplot(过滤器(step_df染色体= =“chr2”)、aes (x = break_left xend = break_right, y =重量,yend =重量,坳=染色体))+ geom_segment(大小= 0.8,lineend =“圆”)+ geom_segment (data =过滤器(connecting_df_weights染色体= =“chr2”)、aes (x = break_left xend = break_right y = weight_left yend = weight_right线型=冲),大小= 0.8,lineend =“圆”)+ scale_x_log10(休息= c(10 10 ^ 2 10 ^ 3, 10 ^ 4),标签= trans_format (“log10 math_format (10 ^。x))) + scale_y_continuous(休息= c (0, 1000, 2000)) + xlab(表达式(粘贴(距离(kbp)))) + ylab(表达式(粘贴(“重量”)))+主题(legend.position =“没有”)+主题(情节。利润=单位(c(2、1.5、1、2.5),“线”)(轴)+主题。title = element_text(幼圆“大胆”))+ scale_color_manual(值= pretty_colors) +导游(线型= FALSE)
# #警告:“指南(<规模> = FALSE)”是弃用。请使用指南(<规模> = # #“没有”)”。
weights_panel_2

ggsave (weights_panel_2文件名= " chr2_weights。pdf”、宽= 3.5,高= 2.5)
connecting_df_thresholds_ihw < - step_df % > % group_by(染色体)(stratum_fun (% > %。,colname = " t_ihw ") % > %变异(冲= FALSE) #因子(ifelse (abs (weight_left - weight_right) > 10 ^{7},真的,假),#水平= c(假,真)))thresholds_ihw_panel < - ggplot (step_df, aes (x = break_left xend = break_right, y = t_ihw * 10 ^ 6 yend = t_ihw * 10 ^ 6 =染色体)上校)+ geom_segment(大小= 0.8,lineend =“圆”)+ geom_segment (data = connecting_df_thresholds_ihw, aes (x = break_left xend = break_right, y = weight_left * 10 ^ 6 yend = weight_right * 10 ^ 6,线型=冲),大小= 0.8,lineend =“圆”)+ scale_x_log10(休息= c(10 10 ^ 2 10 ^ 3, 10 ^ 4),标签= trans_format (“log10 math_format (10 ^。x))) + scale_y_continuous(限制= c(0, 1.8),休息时间= c (0,1)) + xlab(表达式(粘贴(距离(kbp)))) + ylab(表达式(粘贴(“IHW s (x)(10 ^ 6,)))) +主题(legend.position = c(0.6, 0.7),传奇。title = element_blank()) +主题(情节。利润=单位(c(2、1.5、1、2.5),“线”)(轴)+主题。title = element_text(幼圆“大胆”))+ scale_color_manual(值= pretty_colors) +导游(线型= FALSE)
# #警告:“指南(<规模> = FALSE)”是弃用。请使用指南(<规模> = # #“没有”)”。
thresholds_ihw_panel

ggsave (thresholds_ihw_panel文件名= " ihw_by_threshold。pdf”、宽= 3.5,高= 2.5)
connecting_df_thresholds_bh < - step_df % > % group_by(染色体)(stratum_fun (% > %。,colname = " t_bh ") % > %变异(冲= FALSE) #因子(ifelse (abs (weight_left - weight_right) > 10 ^{-11},真的,真的),#水平= c(假,真)))scientific_10 =函数(x) {ifelse (x = = 0,“0”,解析(文本= gsub (“(+)”、“gsub (“e”,“10 ^ % * %”, scientific_format () (x)))))} thresholds_bh_panel < - ggplot (step_df, aes (x = break_left xend = break_right, y = 10 ^ * t_bh yend = 10 ^ * t_bh坳=染色体))+ geom_segment(大小= 0.8)+ geom_segment (data = connecting_df_thresholds_bh, aes (x = break_left xend = break_right, y = weight_left 10 * 10 ^, yend = weight_right * 10 ^ 10,线型=冲),大小= 0.8)+ scale_x_log10(休息= c(10 10 ^ 2 10 ^ 3, 10 ^ 4),标签= trans_format (“log10 math_format (10 ^。x))) + scale_y_continuous(限制= c(0 5),休息时间= c (0、2、4)) + xlab(表达式(粘贴(距离(kbp)))) + ylab(表达式(粘贴(“s (x)(10 ^ -10)))) +主题(legend.position = c(0.6, 0.7),传奇。title = element_blank()) +主题(情节。利润=单位(c(2、1.5、1、2.5),“线”)(轴)+主题。title = element_text(幼圆“大胆”))+ scale_color_manual(值= pretty_colors) +导游(线型= FALSE)
# #警告:“指南(<规模> = FALSE)”是弃用。请使用指南(<规模> = # #“没有”)”。
thresholds_bh_panel

ggsave (thresholds_bh_panel文件名= " by_threshold。pdf”、宽= 3.5,高= 2.5)
connecting_df_lfdr_ihw < - step_df % > % group_by(染色体)(stratum_fun (% > %。,colname = " local_fdr_ihw ") % > %变异(冲= FALSE) lfdr_ihw_panel < - ggplot (step_df, aes (x = break_left xend = break_right, y = 10 ^ 1 * local_fdr_ihw yend = 10 ^ 1 * local_fdr_ihw坳=染色体))+ geom_segment(大小= 0.8,lineend =“圆”)+ geom_segment (data = connecting_df_lfdr_ihw, aes (x = break_left xend = break_right, y = 10 ^ 1 * weight_left yend = 10 ^ 1 * weight_right,线型=冲),大小= 0.8,lineend =“圆”)+ scale_x_log10(休息= c(10 10 ^ 2 10 ^ 3, 10 ^ 4),标签= trans_format (“log10 math_format (10 ^。x))) + xlab(表达式(粘贴(距离(kbp)))) + ylab(表达式(粘贴(“IHW罗斯福(s (x) | x)))) +主题(legend.position = c(0.6, 0.7),传奇。title = element_blank()) +主题(情节。利润=单位(c(2、1.5、1、2.5),“线”)(轴)+主题。title = element_text(幼圆“大胆”))+ scale_color_manual(值= pretty_colors) +导游(线型= FALSE)
# #警告:“指南(<规模> = FALSE)”是弃用。请使用指南(<规模> = # #“没有”)”。
lfdr_ihw_panel

ggsave (lfdr_ihw_panel文件名= " ihw_by_fdr。pdf”、宽= 3.5,高= 2.5)
connecting_df_lfdr_bh < - step_df % > % group_by(染色体)(stratum_fun (% > %。,colname = " local_fdr_bh ") % > %变异(冲= FALSE) #因子(ifelse (abs (weight_left - weight_right) > 0.5 * 10 ^(6),真的,假),#水平= c(假,真)))lfdr_bh_panel < - ggplot (step_df, aes (x = break_left xend = break_right y = local_fdr_bh yend = local_fdr_bh坳=染色体))+ geom_segment(大小= 0.8,lineend =“圆”)+ geom_segment (data = connecting_df_lfdr_bh, aes (x = break_left xend = break_right y = weight_left yend = weight_right线型=冲),大小= 0.8,lineend =“圆”)+ scale_x_log10(休息= c(10 10 ^ 2 10 ^ 3, 10 ^ 4),标签= trans_format (“log10 math_format (10 ^。x))) + scale_y_log10(标签= trans_format (“log10 math_format (10 ^。x))) + xlab(表达式(粘贴(距离(kbp)))) + ylab(表达式(粘贴(“罗斯福”(s (x) | x)))) +主题(legend.position = c(0.6, 0.4),传奇。title = element_blank()) +主题(情节。利润=单位(c(2、1.5、1、2.5),“线”)(轴)+主题。title = element_text(幼圆“大胆”))+ scale_color_manual(值= pretty_colors) +导游(线型= FALSE)
# #警告:“指南(<规模> = FALSE)”是弃用。请使用指南(<规模> = # #“没有”)”。
lfdr_bh_panel

ggsave (lfdr_bh_panel文件名= " by_fdr。pdf”、宽= 3.5,高= 2.5)