美文网首页
seqkit-【处理fasta/q 序列之父】

seqkit-【处理fasta/q 序列之父】

作者: 斩毛毛 | 来源:发表于2020-05-18 17:35 被阅读0次

之间处理fasta或者fastq时总是自己进行写脚本,比如:fasta-fastaq的转化,根据名称调取fasta序列等;自从发现了seqkit,着实方便,再也不用费时间写脚本。

安装

conda install seqkit

使用

序列操作 (seq)


## 取反向序列
seqkit   seq  test.fa   -r  >  test_re.fa

## 取互补序列
seqkit   seq   test.fa  -p  >  test_com.fa

## 取反向互补序列
seqkit   seq   test.fa  -r  -p  > test_re_com.fa

## RNA---> DNA序列
seqkit   seq  test.fa   rna2dna     >    test_dna.fa

## 小写字母输出
seqkit  seq  test.fa  -l  >  test_lower.fa

## 大写字母输出
seqkit   seq   test.fa  -u >  test_upper.fa

## 指定每行序列的输出长度(为0的话,代表为一整行,默认的输出 长度是60个碱基)
seqkit  seq  test.fa  -w  10  >  test_10.fa  (指定序列的长度为10)

## 将多行序列转换为一行序列
seqkit   seq  test.fa   -w   0   >  test_w.fa

## 只输出序列
seqkit   seq  test.fa  -s  -w 0 > test_seq.fa

## 将只输出的序列的,指定每行输出的碱基数
seqkit   seq  test_seq.fa  -s  -w 40 > test_seq40.fa

fasta/q以及tab格式相互转换

## 将fataq文件转化为fasta格式.
seqkit fq2fa   test.fq   -o   test.fa
## 将fasta格式转化为tab格式
seqkit  fx2tab  test.fa >  test_tab.fa (没有seq参数)

序列提取(grep)

## 给定序列名称文件 gene.txt(一行一个基因),fasta文件
seqkit grep -f gene test.fa |seqkit seq -i >gene.fa
-i:只输出ID,后面的信息不输出,比如长度等信息

截取序列(subseq)

## 给定一bed文件;name start end; 从fasta文件中截取相对应序列(序列从0开始计数)
seqkit subseq --bed gene.bed test.fa >>gene.subseq.fa

去除重复序列(rmdup)

给定一fasta/q序列,从重去除重复序列,保留唯一序列
seqkit rmdup -n   test.fa >test_rmdup.fa

##参数
-n: 根据ID(全部名称)去除重复
-s: 根据序列去除重复

切割序列(split)

seqkit split  test.fa -p 4
将test.fa 分隔为4个部分

相关文章

网友评论

      本文标题:seqkit-【处理fasta/q 序列之父】

      本文链接:https://www.haomeiwen.com/subject/eylpohtx.html