12 2021 档案
摘要:1、问题bcdedit无法打开启动配置数据存储拒绝访问 bcdedit /set hypervisorlaunchtype auto 2、原因及解决方法 是cmd不是以管理员的身份运行的,所以才会出现权限不足的问题,以管理员的身份运行命令提示符即可(win10 左下角windows图标右键)
阅读全文
摘要:1、测试数据 root@PC1:/home/test2# cat test.txt 01 02 03 04 05 06 07 08 09 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
阅读全文
摘要:a <- 1:5 b <- letters[1:5] c <- LETTERS[1:5] d <- rep(1,5) dat1 <- data.frame(rbind(a,b,c)) dat2 <- data.frame(rbind(b,c,d)) dat1 dat2 dat3 <- rbind(d
阅读全文
摘要:测试: test1 <- data.frame(v1 = 1:5, v2 = letters[1:5]) test1 test2 <- data.frame(v1 = 1:5, v2 = letters[1:5]) test2 test1 %in% test2 all(test1 == test2)
阅读全文
摘要:1、测试数据 v1 <- c(7,1,10,9,2,8) v2 <- letters[1:6] test <- data.frame(v1,v2) test test2 <- test[order(test$v1),] test2 v3 <- as.character(c(7,1,10,9,2,8)
阅读全文
摘要:1、 dat <- read.table("test.txt", header = F) dat dat$V2[dat$V2 == "<NA>"] = 100 dat dat$V2[dat$V2 == NA] = 100 dat dat$V2[is.na(dat$V2)] = 100 dat > d
阅读全文
摘要:1、 root@PC1:/home/test2# ls test1.txt test2.txt root@PC1:/home/test2# cat test1.txt 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 root@P
阅读全文
摘要:1、awk实现 root@PC1:/home/test2# ls test.txt root@PC1:/home/test2# cat test.txt ## 测试数据 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 root@
阅读全文
摘要:1、merge函数 dir() test1 <- read.table("test1.txt", header = F) test1 test2 <- read.table("test2.txt", header = F) test2 result <- merge(test1, test2, by
阅读全文
摘要:1、软件下载,下载地址:https://github.com/genetics-statistics/GEMMA/releases 下载过程: root@PC1:/home/gemma_test# ls root@PC1:/home/gemma_test# pwd /home/gemma_test
阅读全文
摘要:1、问题,下载压缩文件后,不能显示压缩文件的颜色(红色),执行source ./bashrc后系统可以显示 问题如下,因此推测是系统启动时没有自动执行source ./bashrc 2、解决方法,在~/.bash_profile增加如下语句: if [ -f ~/.bashrc ]; then .
阅读全文
摘要:1、find可以实现对指定文件大小的查找 root@PC1:/home/test2# ls b.ped outcome.map outcome.ped root@PC1:/home/test2# ll -h total 1.4G -rw-r--r-- 1 root root 1.3G 12月 22
阅读全文
摘要:1、 root@PC1:/home/test2# ls b.ped outcome.map outcome.ped xx root@PC1:/home/test2# du -ah ## 显示每一个文件的大小 4.0K ./xx 1.3M ./outcome.map 1.3G ./b.ped 158M
阅读全文
摘要:1、croc安装 方法1: curl https://getcroc.schollz.com | bash 方法2(ubuntu): gdebi croc_8.3.2_Linux-64bit.deb ## (需要提前下载好安装包) https://github.com/schollz/croc/re
阅读全文
摘要:1、测试主机PC1、PC2 root@PC1:/home/test2# ls root@PC1:/home/test2# hostname PC1 root@PC1:/home/test2# ifconfig | head -n 3 ens32: flags=4163<UP,BROADCAST,RU
阅读全文
摘要:1、 dir() dat <- read.table("test.ped") ## 读取测试数据,ped基因型数据 dat genoList =list() for ( i in 1:ncol(dat) ) { ## 将每一列数据保存为列表的一项 genoList[[i]]<- dat[,i] }
阅读全文
摘要:1、测试数据 root@PC1:/home/test# ls outcome.ped root@PC1:/home/test# cat outcome.ped ## 测试数据, 将每隔一个空格的两列并排为一列 G G C C G G G G G A A A G G G C G G G C G G G
阅读全文
摘要:1、 ## 测试数据test <- c("200005: Smoker_1","200076: Smoker_2","200087: Smoker_3","200088: Smoker_4","200106: Smoker_5","200107: Non-smoker_6") test list1
阅读全文
摘要:1、直接测试 dir() ## 列出当前目录中所有文件 myfile <- list.files() ## 将当前目录中的所有文件都保存为字符 myfile gzfile <- myfile[grep(myfile, pattern =".gz$")] ## 提取当前目录中以.gz结尾的文件 gzf
阅读全文
摘要:1、测试数据 root@PC1:/home/test# ls test.py test.txt root@PC1:/home/test# cat test.txt ## 测试数据 w r s f z s d g z c w d z d g g z c e w root@PC1:/home/test#
阅读全文
摘要:1、测试数据 root@PC1:/home/test# ls test.txt root@PC1:/home/test# cat test.txt ## 测试数据 w r s f a s d g z c w d a d g t z c e w 2、提取包含w的行 root@PC1:/home/tes
阅读全文
摘要:plink进行阈性状(质量性状)关联分析有两种方法 --assoc 和 --logistic, 这两种方法又分别有分是否校正: --assoc --adjust 和 --logistic --adjust --logistic方法有可以选择是否添加协变量: --logistic --covar 和
阅读全文
摘要:scale的作用 1、中心化: 减去平均值 2、标准化: 除以根方差 test <- c(2,3,4,6) ## 测试数据 a <- scale(test,center = F, scale = F) ## 既不中心化, 也不标准化 a b <- scale(test, center = T, sc
阅读全文
摘要:1、 dir() dat <- read.table('test.txt',fill = T) ## fill = T,读取列数不一致的行,用“”填充 dat result <- data.frame() ## 创建空数据框 result for (i in 1:nrow(dat)) { if ((
阅读全文
摘要:1、删除test.txt末尾的单个或者多个空格或者制表符 root@PC1:/home/test# ls test.txt root@PC1:/home/test# cat test.txt ## 测试数据 2 3 4 a 3 d d w e z v e z c g z v b root@PC1:/
阅读全文
摘要:1、测试数据,依据列数筛选数据 root@PC1:/home/test# ls test.txt root@PC1:/home/test# cat test.txt ## 测试数据 2 3 4 3 d a 3 d d w e f z v e z c g k e q z v b d root@PC1:
阅读全文
摘要:1、问题 ubuntu中解压rar文件, 如下: root@PC1:/home/test2# ls test.rar root@PC1:/home/test2# unrar e test.rar -bash: /usr/bin/unrar: No such file or directory 2、解
阅读全文
摘要:sort命令 -g选项忽略字母 1、测试数据 root@PC1:/home/test# ls a.txt root@PC1:/home/test# cat a.txt name gender score ddd 2 8 aa 1 87 ff 2 3 ss 1 23 root@PC1:/home/te
阅读全文
摘要:1、在a.txt中每行匹配的最后一个e替换为xxx(每行都有e的情况) dat <- read.table("a.txt", header = F) dat index <- data.frame() ## 创建数据框,储存匹配结果 for (i in 1:nrow(dat)) { count =
阅读全文
摘要:1、测试数据 root@PC1:/home/test/test# ls test.txt root@PC1:/home/test/test# cat test.txt ## 实现将每行最后一个e替换为xxx e r e y e u e e e g e 3 h r 1 3 e g e y e e s
阅读全文
摘要:1、创建测试数据 root@PC1:/home/test/test# seq -f %02g 40 | awk '{if(NR % 4 == 0) {print $0} else {printf("%s ", $0)}}' ## 利用seq命令产生连续数字,然后利用awk分配行 01 02 03 0
阅读全文
摘要:plink软件中 --update-map 用于更新snp的物理位置。 1、测试数据 root@PC1:/home/test# ls new.pos outcome.map outcome.ped root@PC1:/home/test# cat outcome.map ## 一共10个snp 1
阅读全文
摘要:R语言中统计数据框中指定字符出现的次数 1、利用unlist + sum实现 dat <- read.table("a.txt", header = F) ## 统计a.txt中e出现的次数 dat dat2 <- unlist(dat) sum(dat2 == "e") 2、利用for循环遍历实现
阅读全文
摘要:linux shell中统计文本中指定单词出现的次数 1、测试数据, 统计 a.txt中e出现的总次数 root@PC1:/home/test/test# cat a.txt e r e y e u e e e g e 3 h r 1 3 e g e y e e s e e e e e 2、awk实
阅读全文
摘要:1、测试数据如下, 实现将每行的第3个e及其以后的e替换为g root@PC1:/home/test/test# cat a.txt e r e y e u e e e g e 3 h r 1 3 e g e y e e s e e e e e 3、 root@PC1:/home/test/test
阅读全文
摘要:plink中 --set-missing-var-ids 用于对缺失snpID的snp设定名称 1、测试数据 root@PC1:/home/test# ls outcome.map outcome.ped root@PC1:/home/test# cat outcome.ped DOR 1 0 0
阅读全文
摘要:1、问题,莫名其妙出现下面的问题,折腾半天也没有找出原因,后来索性暴力解决,直接解压文件看看咋回事, 解压半天提示文件损坏,。。。。 Error: File read failure. 2、重新下载文件,测试 root@PC1:/home/GWA_tutorial/2_Population_stra
阅读全文
摘要:1、在最后一行的下一行追加字符 dat <- read.csv("test.csv", header = T) ## 读取测试数据 dat temp <- c("final", rep("", ncol(dat) - 1)) ## 生成要添加的字符 rbind(dat, temp) ## 利用行合并
阅读全文
摘要:1、最后一行末尾追加字符 root@ubuntu01:/home/test2# cat num.txt 1 1 1 2 root@ubuntu01:/home/test2# sed '$ s/$/ final/' num.txt ## 使用sed实现, 第一个$限制最后一行, 第二个$指出替换的位置
阅读全文
摘要:windows下如何运行shell脚本 1、安装 git 官网:https://git-scm.com/ 下载安装即可 2、打开git bash 3、进入工作目录 75377@DESKTOP-1N42TVH MINGW64 ~ $ pwd ## 查看当前目录 /c/Users/75377 75377
阅读全文
摘要:1、直接测试,R实现1至4各重复3次 result <- vector() ## 空向量 for (i in 1:4) { result <- c(result, rep(i, 3)) } result 2、可以直接实现 rep(1:4, each = 3)
阅读全文
摘要:1、将1至4各重复3次, shell双循环实现 root@ubuntu01:/home/test2# ls root@ubuntu01:/home/test2# for i in `seq 4`; do for j in `seq 3`; do echo $i >> num.txt; done; d
阅读全文
摘要:1、直接测试 dir() dat <- read.csv("test.csv", header = F) ## 读取测试数据,实现按照第二列指定次数重复各列 dat result <- data.frame() ## 创建结果数据框 for (i in 1:nrow(dat)) { ## 利用双循环
阅读全文
摘要:1、测试数据 root@ubuntu01:/home/test2# cat test.txt ## 实现将每一行按照第二行数字指定的行数重复 1 3 e3rt idf 2 2 32 ffj 3 5 cc kkk 4 4 wf 34 2、while + for双循环实现 root@ubuntu01:/
阅读全文
摘要:1、问题 apt install 慢, 如下: root@ubuntu01:/home/test# apt install git 2、解决方法 root@ubuntu01:/home/test# cd /etc/apt/ root@ubuntu01:/etc/apt# ls apt.conf.d
阅读全文
摘要:问题 1、apt remove net-tools Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. 2、结束这个占用的进程 root@ubuntu01:~# kill -9 5937 3、测试 root@
阅读全文
摘要:1、清屏:cls 2、获取家目录
阅读全文
摘要:python中pip命令主要用于安装和下载包 安装:pip install package_name 卸载:pip uninstall pakage_name 以numpy包为例进行测试。 1、查看python版本 C:\Users\75377>python --version Python 3.8
阅读全文
摘要:1、查看内核 2、安装open-vm-tools sudo apt-get install open-vm-tools sudo apt-get install open-vm-tools-desktop 3、重启即可 reboot reboot
阅读全文