02 2025 档案
摘要:R语言中数据框中如何实现按照指定列的类别进行排序。 001、 dir() c1 <- rep(c("b","d", "a", "c"), each = 2) c1 c2 <- sample(1:20, 8) c2 dat <- data.frame(c1, c2) ## 生成一个测试数据 idx <
阅读全文
摘要:Linux 中sed命令的整行替换. 001、基本用法 [root@PC1 test2]# ls a.txt [root@PC1 test2]# cat a.txt ## 测试文件 a UU i a UU i b q j c q y [root@PC1 test2]# sed '/b/ s/.*/Q
阅读全文
摘要:001、 Linuxbash和source命令的区别在于,当你用bash命令执行脚本时,它告诉Linux内核创建一个新的Bash进程来读取和执行脚本,将输出复制到原先的shell进程中,并显示下来. 然而source命令是一个外置的shell,它读取和评估当前shell进程中的文件。为此,脚本所做的
阅读全文
摘要:Linux 中declare命令 001、普通测试 [root@PC1 dir1]# ls [root@PC1 dir1]# echo $var1 [root@PC1 dir1]# var1="hello world" [root@PC1 dir1]# echo $var1 hello world
阅读全文
摘要:001、-L :按照换行符的数量来传递 [root@PC1 dir1]# ls [root@PC1 dir1]# echo {0..9} 0 1 2 3 4 5 6 7 8 9 [root@PC1 dir1]# echo {0..9} | xargs -L 2 ## 利用echo生成一个1行的测试数
阅读全文
摘要:001、-i 选项 [root@PC1 dir1]# ls a.txt b.txt dir1 h.csv i.csv [root@PC1 dir1]# tree . ├── a.txt ├── b.txt ├── dir1 ├── h.csv └── i.csv 1 directory, 4 fil
阅读全文
摘要:Linux shell中如何一次迭代传入多个变量
阅读全文
摘要:001、 Linux 中sort命令 排序指定两个-k异常 [root@PC1 test]# ls a.txt [root@PC1 test]# cat a.txt ## 测试数据 4 a 8 5 7 a 3 8 2 b 5 3 3 b 9 5 5 a 6 9 9 b 1 4 7 a 6 3 2 a
阅读全文
摘要:001、R语言中输出数据框中某一列的字符串长度,并按照字符串的长度进行排序 a <- c("erw", "3s", "errrkk", "r", "r444") b <- letters[1:5] dat <- data.frame(a, b) ## 生成一个测试数据框 dat nchar(dat$
阅读全文
摘要:001、 plink --file file --sheep --allow-extra-chr --indep-pairwise 50 5 0.2 --set-missing-var-ids @:# --keep-allele-order --out tmp_result ## 依据ld过滤 pl
阅读全文
摘要:plink 中依据亲缘关系进行过滤: plink --bfile step4_filtered --genome --min 0.2 --out related_samples --allow-no-sex plink --bfile step4_filtered --remove related_
阅读全文
摘要:Linux中grep命令实现带有通配符.关键字符的精准匹配 001、 [b20223040323@admin2 test]$ ls a.txt [b20223040323@admin2 test]$ cat a.txt ## 测试文件 new_seq KRA6 Karakaya new_seq ss
阅读全文
摘要:该研究利用牛津纳米孔(ONT)超长读长、PacBio HiFi高精度测序及Hi-C技术
阅读全文
摘要:001、 Linux 中 awk正则匹配屏蔽原始字符串 [b20223040323@admin2 test]$ ls a.txt [b20223040323@admin2 test]$ cat a.txt ## 测试文件 0M6 FKDN240280192-1A 0.51 Fail 0M7 FKDN
阅读全文
摘要:000、原始文件ID [root@localhost test]# ls ## 测试文件 test.vcf [root@localhost test]# grep "^#" test.vcf | tail -n 1 #CHROM POS ID REF ALT QUAL FILTER INFO FOR
阅读全文
摘要:001、第一列 [root@localhost test]# ls a.txt [root@localhost test]# cat a.txt ## 测试数据 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 [root@loc
阅读全文
摘要:001、 shell zcat ${i}_trim_1P.fastq.gz | cat - <(zcat ${i}_trim_2P.fastq.gz) | awk 'NR % 4 == 0' > ${i}_quality.txt ## 将压缩后的fastq文件合并并提取出质量值 002、python
阅读全文
摘要:001、 [root@PC1 test]# echo a | awk 'function my_length(str) {return length(str)}; {text = "Hello"; print "Length of text:", my_length(text)}' Length o
阅读全文
摘要:python中实现两个文件的cat型的合并
阅读全文
摘要:python 中实现gz文件的解压。 001、 (base) [root@PC1 test]# ls a.txt.gz test.py (base) [root@PC1 test]# zcat a.txt.gz ## 测试的压缩文件 01 02 03 04 05 06 07 08 09 10 11
阅读全文
摘要:001、 def fastq_quality_to_phred(fastq_file): with open(fastq_file, 'r') as f: for line in f: if line.startswith('+'): continue # 跳过加号行 quality_line =
阅读全文
摘要:Linux 中 如何实现数字每个三个数字增加一个逗号 001、 [s20223040682@admin1 test]$ ls a.txt [s20223040682@admin1 test]$ cat a.txt 23453245533 9706634552 356662212 34566 [s20
阅读全文
摘要:001、 (base) [b20223040323@admin1 test]$ ls SRR1770413_1.fastq SRR1770413_2.fastq test.py (base) [b20223040323@admin1 test]$ cat test.py #!/usr/bin/env
阅读全文
摘要:001、 (base) [b20223040323@admin1 test]$ ls SRR1770413_1.fastq SRR1770413_2.fastq test.py (base) [b20223040323@admin1 test]$ cat test.py #!/bin/env pyt
阅读全文