猛猛抓鬼

神器·起 星级 打法
泪痕碗之念 𖤐𖤐
噬魂齿之争 𖤐𖤐
魔息角之怒 𖤐
神器·转 星级 打法
历劫月光草 𖤐𖤐 每个人都要带九转
情葬泪痕碗 𖤐

shyf在NiceB的放映室看过的电影

史哥说按这个榜单往下看

https://www.bilibili.com/v/popular/rank/movie/

日期 电影名 备注
2023.06.04 >>航海王:红发歌姬<< BV1XV4y1B7Ld 史哥认为这是一个音乐番
2023.05.20 >>速度与激情<< BV1dY411U7zD 史哥今天才知道那个榜单是会变的..
不记得了 >>追凶者也<<
不记得了 >>扬名立万<<
不记得了 >>四海<< 很离谱,大家都是以一种很难受的心情看完的,对了,当时猹猹也在
不记得了 >>疯狂的赛车<<
不记得了 >>无人区<<
2023.05.10 >>宇宙探索编辑部<< BV1bz4y1a7QZ 史哥说他不明白,还问我悟了吗,我说要不就后天再看一遍
2023.05.16 >>流浪地球2<< BV1A54y1F7v6 史哥说居然有这个,不过可惜的是现在还要钱,不能一起看 2023-05-12 16:32:19
今天史哥用vr看了2023-05-16 21:06:17
2023.05.12 >>无名<< BV1Sc411W7tf old说何主任出来 扒车那地方 多此一举吧
2023.05.15 >>无耻混蛋<< BV1Ec411J7ea 史哥说谁飞出来了

更新日期 2023-05-20 18:28:15

R语言S4对象

创建类

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
setClass(
# 类名
"TumorPrognosis",

# 数据列表
slots = c(
rawdata = "data.frame",
data = "data.frame",
markers = "character",
survival_year = "numeric",
group = "character",
cutoff = "list",
roc = "list",
ROCPlot = "list",
KMCurve = "list"
)
)

构造函数
initialize是内置的构造函数,
这也是范式方法的增加方法,如果是范式方法,可以直接给S4类增加这个方法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
setMethod("initialize", signature(.Object = "TumorPrognosis"),
function(.Object, tumorName, markers, survival_year){
.Object@markers = markers
.Object@survival_year = survival_year
.Object@rawdata = read.xlsx("01.data/prognosis1.xlsx", sheet = tumorName)

colnames(.Object@rawdata) = c(
"ID",
"inTime",
"outInfo",
"stage",
markers
)

.Object = ScreenData(.Object)
.Object = GroupedSample(.Object)
.Object = CalcBestCutoff(.Object)
.Object = getKMCurve(.Object)

.Object
})

如果不是范式,就需要先创建一个范式的,然后再添加到S4类上

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
setGeneric("getKMCurve", function(.Object) standardGeneric("getKMCurve"))
setMethod("getKMCurve", signature(.Object = "TumorPrognosis"), function(.Object){

for (data_set_name in c("train", "valid")){




sur_data = getGroupSameples(.Object, data_set_name)
for (marker in c("stage", .Object@markers)){
if(marker == "stage"){
legend_labs = c("Stage I/II", "Stage III/IV")
}else{
legend_labs = paste0(marker, c(" high risk", " low rish"))
}

group = paste0(marker, "_b")
surv = Surv(sur_data$futime, sur_data$fustat2)
formula_this = as.formula(paste0("surv", "~", group))

ggl = surv_fit(formula_this, data = sur_data)
surv_diff = survdiff(formula_this, data = sur_data)
p = ggsurvplot(ggl,
# palette = c("blue", "red"),
xlab = "Time (Years)",
ylab = "OS (percentage)",
break.x.by = 365,
break.y.by = 0.25,
ylim = c(0, 1),
xlim = c(0, 365 * .Object@survival_year),
legend.title = paste0("Log-rank p = ", format(1 - pchisq(surv_diff$chisq, length(surv_diff$n) -1), digits = 3)), # 图例标题
legend.labs = legend_labs,
size = 0.8,
# pval = T,
# pval.size = 5,
# pval.coord=c(365,0.05),
censor.shape=124,
censor.size=2,
font.main = c(16, "plain", "darkblue"),
font.x = c(10, "plain", "black"),
font.y = c(10, "plain", "black"),
font.tickslab = c(8,"plain", "black"),
font.legend = c(8,"plain","black"),
risk.table =F,
tables.height = 0.25,
# legend.labs=c("LPA","Non-LPA"),
legend = c(0.3,0.28),
fontsize=4.5,
conf.int=T,
conf.int.style='ribbon',
conf.int.alpha=0.1
# surv.median.line="hv"
)

p = p$plot +
scale_x_continuous(breaks = seq(0, 1825, 365), labels = seq(0, 5))

.Object@KMCurve[[data_set_name]][[marker]] = p
}
}
.Object

})

创建类实例

1
T05_5 = new("TumorPrognosis", "T05", c("CEA", "CA199", "AFP")  , 5)

图床

目前用的图床是https://www.imgurl.org/,随便找的,,真的非常随便的那种

用起来也不难吧,不用注册,直接拖拽就可以上传了,会直接给出MarkDown的链接,我再复制一下就行了。

听说有上传限制, 我也不知道

ImgURL https://imgurl.org/ 又是一个比较老牌的免费图床服务,稳定性不错,无需注册。游客限制每日上传10张,单张图片不能超过 5M,支持 HTTPS。诞生于2017年12月,是一款开源图片管理系统(简称图床),无需注册即可支持多图上传、粘贴上传、URL上传,图片压缩、图片鉴黄等多种功能,同时也支持自建。

Every interaction is both precious and an opportunity to delight.


现在的图片有个问题就是, 直接放出来是全尺寸的,看起来很大,, 不方便也不美观

于是
给图床做了个优化,

说是给图床加了个优化, 其实是加了个Tampermonkey脚本上去
想法是生成的外链上自带一个宽度限制

1
2
3
4
5
6
$(document).on("click", ".layui-btn", function () {
$("#bbcode")[0].value = $("#bbcode")[0].value.replace("[img]", "{% img ").replace("[/img]", " 300 %}");
});
$(document).on("focus", "#bbcode", function () {
$("#bbcode")[0].value = $("#bbcode")[0].value.replace("[img]", "{% img ").replace("[/img]", " 300 %}");
});

加了两个监听事件, 先加的是下面那个,要复制url的时候先点一下url, 就可以把url上加个宽度限制

后来觉得要多点一下有点麻烦,就想在点按钮的时候就把这件事情干了,可是这时候上传到限制了。。

ggplot2中的底部标题

ggplot2 中的底部的标题不是title, 而是cation

所以如果需要放在底部的标题的话,应该

1
2
3
p + 
labs(caption = "Caption") + # title content
theme(plot.caption = element_text(hjust=0.5)) # align to center