01 2022 档案

R 矩阵数组
摘要:A<-matrix(11:16,nrow=3,ncol=2) # 实际按向量存储,根据保存的行数,列数对应到矩阵的元素,存储次序默认是按列存储。 B<-matrix(c(1,-1,1,1),nrow=2,ncol=2,byrow=TRUE) #设置byrow=TRUE,则按行存储 取矩阵的行数 nr 阅读全文

posted @ 2022-01-31 10:01 BioinformaticsMaster 阅读(41) 评论(0) 推荐(0) 编辑

R 列表
摘要:R 列表list 保存不同类型的数据,可提供R分析结果的包装,如输出一个包含回归系数、预测值、残差、检测结果等不规则数据结构的变量。 相比数据框,列表不要求各列等长 相比向量,列表不要求所有元素类型相同 赋值 如rec<-list(name="liming",age=30,scores=c(85,7 阅读全文

posted @ 2022-01-27 17:35 BioinformaticsMaster 阅读(100) 评论(0) 推荐(0) 编辑

uniq 搭配sort 去除重复行,查找重复行
摘要:去除重复行 sort $file |uniq 查看重复行 sort $file|uniq -d 统计重复情况 sort $file|uniq -c 查看非重复行 sort $file|uniq -u 阅读全文

posted @ 2022-01-27 09:38 BioinformaticsMaster 阅读(66) 评论(0) 推荐(0) 编辑

rsync 本地路径到挂盘路径 ;挂盘路径到本地
摘要:要解决的是每次都要输入密码,所以不能后台投递任务。 解决方案: 核心是expect spawn #!/usr/bin/expect -f set timeout 10 set username [lindex $argv 0] set password [lindex $argv 1] set ho 阅读全文

posted @ 2022-01-25 15:18 BioinformaticsMaster 阅读(53) 评论(0) 推荐(0) 编辑

GATK joint-calling 不需要手动设置--ploidy
摘要:A pooled experiment is different from joint calling. It means when you combined the DNA of many individuals and sequenced them together. The DNA is no 阅读全文

posted @ 2022-01-24 15:33 BioinformaticsMaster 阅读(239) 评论(0) 推荐(0) 编辑

作图与修图
摘要:作图与修图是个手艺,需要磨 1天不行,就两天,做个好图,花费很多时间很正常 作新图 数据梳理 核心画图函数掌握 修理 在现有脚本基础上做图 拷贝到Rstudio,逐个代码块运行,调试 需要参考时可以google,键入关键词 如roc ggplot2 阅读全文

posted @ 2022-01-23 20:52 BioinformaticsMaster 阅读(56) 评论(0) 推荐(0) 编辑

linux 帐号便捷登陆
摘要:核心 如设置便捷su #!/usr/bin/expect -f set port port_no set user st_mchri_bigdata set password Genomics20210 set timeout -1 spawn su $user expect "*assword:* 阅读全文

posted @ 2022-01-21 17:35 BioinformaticsMaster 阅读(49) 评论(0) 推荐(0) 编辑

集群.bashrc不涉及路径
摘要:集群个人目录下的.bashrc不要涉及source/export路径,不然有些盘故障,就会影响任何形式的访问。 1. 登陆卡住 2.scp 卡住 解决方法: 涉及路径的自定义环境变量可以写在如 ~/profile.sh这样的脚本里边,在使用时在shell里边source ~/profile.sh使环 阅读全文

posted @ 2022-01-21 10:01 BioinformaticsMaster 阅读(37) 评论(0) 推荐(0) 编辑

stringR包 字符串拼接,对字符串切分 替换 匹配提取 位置提取
摘要:paste("D","CMDCB0000013","-1",sep = "") 拼接字符串,可以用于新增列non_json$DNAcode<-paste("D",non_json$Sample,"-1",sep="") ,当然搭配mutate用也一样 stringR 包对字符串切分 替换 匹配提取 阅读全文

posted @ 2022-01-19 11:00 BioinformaticsMaster 阅读(267) 评论(0) 推荐(1) 编辑

身体健康和精神健康相互作用,其中之一受到打击时,另一个也会受到影响
摘要:身体健康和精神健康相互作用,其中之一受到打击时,另一个也会受到影响 阅读全文

posted @ 2022-01-18 22:41 BioinformaticsMaster 阅读(31) 评论(0) 推荐(0) 编辑

科研路上,能往前走,就往前走,不犯完美主义错误, 警惕常见读博误区
摘要:科研路上,能往前走,就往前走,可以先这么着,把这槛迈过去再说,后面再学习 不犯完美主义错误, 不拖延。 科研路,partner是非常重要的,遵循共为,共享。 警惕博士失败的常见情形 犹他大学计算机科学教授Matt Might写了一篇题为“10种容易让博士生失败的原因”的文章,他声称这个列表与任何学科 阅读全文

posted @ 2022-01-18 22:02 BioinformaticsMaster 阅读(143) 评论(0) 推荐(0) 编辑

excel 快速选中连续行
摘要:excel 快速选中第二行到最后一行 选中 第二行所需列 按 command(control) shift 下箭头 需要的话,复制或粘贴都可以了。 选中倒数多少行 选中最后一行 command shift 上箭头 选中指定行范围 选中左上 / 左下/ 右上/ 右下 其中之一的起始单元格 按住shif 阅读全文

posted @ 2022-01-15 14:12 BioinformaticsMaster 阅读(499) 评论(0) 推荐(0) 编辑

给指定用户开通读写权限
摘要:setfacl -m u:st_mchri_bigdata:rxw -R /jdfssz1/ST_HEALTH/P21Z10200N0047/lizhichao/data_transfer setfacl -m u:st_rm:rx -R /zfssz3/ST_MCHRI/BIGDATA/autoa 阅读全文

posted @ 2022-01-13 10:13 BioinformaticsMaster 阅读(98) 评论(0) 推荐(0) 编辑

tar 压缩文件list所有文件
摘要:行尾$替换为 \ 注:空格\ 第一行行首加tar czvf 压缩后文件前缀.tar.gz 最后一行行尾可以加 && echo "done" 结果如下: tar czvf test.tar.gz COVIDHarbin.list.csv \COVIDHarbin.list.csv_copy \COVI 阅读全文

posted @ 2022-01-12 21:23 BioinformaticsMaster 阅读(243) 评论(0) 推荐(0) 编辑

sort 命令对文件多列详细排序
摘要:sort 命令 默认是打印出来,可以通过定向符> 或-o 指定输出文件 -t ' ' 指定分隔符为空格 -k 指定按分隔后的第几域排序 -n 按数值大小排序,默认是升序(从小到大) -r 表示逆序 reverse sort -t ' ' -k 1 sort_test.file # 对第一域默认按AS 阅读全文

posted @ 2022-01-12 21:10 BioinformaticsMaster 阅读(949) 评论(0) 推荐(0) 编辑

linux按行取文件
摘要:文件前几行 head -n 5 $file 文件后几行 tail -n -5 $file 文件从第几行到结尾 tail -n +5 $file 区间行的文件 sed -n '2,5p' $file # 第二行到第5行 阅读全文

posted @ 2022-01-12 17:42 BioinformaticsMaster 阅读(53) 评论(0) 推荐(0) 编辑

python 好用的分隔字符串,切片,pop
摘要:linelist=line.rstrip().split(",") # 去掉末尾空白符(空格 换行)后,按,分成列表 切片 linelist[i:j] 取linelist[i]到linelist[j-1] #[]内为索引 缺省i ,默认为0,即从起始元素开始,如linelist[:j] 缺省j, 默 阅读全文

posted @ 2022-01-06 14:33 BioinformaticsMaster 阅读(191) 评论(0) 推荐(0) 编辑

python stderr.write() 和print()/stdout.write()不一个出口
摘要:print()默认情况下,和stdout.write()一个出口,区别是print()自带换行 stderr.write()另一个出口 1) 定义测试python脚本 import sys print ("print") sys.stdout.write("stdout") sys.stderr.w 阅读全文

posted @ 2022-01-04 16:46 BioinformaticsMaster 阅读(92) 评论(0) 推荐(0) 编辑

python 遍历大文件,处理数据时,时时把变量保存到文件,不增大变量,节省内存
摘要:# 多用write()def split_file(infile, n_parts, outdir): if not os.path.exists(infile): sys.stderr.write("Error: Can't find file: %s\n" % infile) sys.exit( 阅读全文

posted @ 2022-01-04 15:53 BioinformaticsMaster 阅读(144) 评论(0) 推荐(0) 编辑

保存重要,未完的工作空间
摘要:save.image("hello.RData") 保存整个工作空间到文件,加载方式: 下次打开默认工作目录时如果有.RData文件时会自动加载 通过load() 读取工作空间 #save 是可以选择些变量保存到文件,如save(numbers_1, file = "hello1.RData") 保 阅读全文

posted @ 2022-01-01 15:27 BioinformaticsMaster 阅读(201) 评论(0) 推荐(0) 编辑

R 随机取样 , 随机取文件的行
摘要:> sample(c(1:10),8) # 对向量取样,默认是不放回抽样,replace=FALSE > sample(c(1:10),8,replace=TRUE) # 放回抽样 对数据框不放回抽行 dataframe[sample(nrow(dataframe), 10), ] #datafra 阅读全文

posted @ 2022-01-01 15:01 BioinformaticsMaster 阅读(428) 评论(0) 推荐(0) 编辑

shell 判断目录是否存在
摘要:if [ ! -d "./shell" ];then mkdir ./shell fi # 注意[]内的各个空格 阅读全文

posted @ 2022-01-01 11:28 BioinformaticsMaster 阅读(87) 评论(0) 推荐(0) 编辑

mac bug
摘要:Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugin 原因是最近删了docker,导致的错误。 Fix: 1.创建docker app目录 mkdir -p /Applications/Docker.app 阅读全文

posted @ 2022-01-01 09:59 BioinformaticsMaster 阅读(116) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 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 1 2 3 4 5
点击右上角即可分享
微信分享提示