要做一个进化树,第一步是要将一个文件里的所有碱基序列翻译成氨基酸序列,去年做进化树时,都是手动一个个翻译的,今天我决定试一下seqkit有没有这个功能。查看seqkit --help之后,发现了translate命令。具体命令如下:“seqkit translate 碱基序列文件 > 氨基酸系列文件”。然后再用seq命令提取序列ID到一个新的文件,命令如下“seqkit seq -n -i 文件名.fasta > 新文件名.fasta”。
seqkit rmdup -s -i file.fasta > file-clean.fasta 删除file中的重复序列后,存在一个新文件file-clean中。
seqkit rmdup -s -i file.fasta -d file1.fasta -D file2.fasta 将file中的重复序列ID和重复序列存到1和2两个文件夹中
引用一个笔记https://www.jianshu.com/p/f0e65738b7c7
以及一个网页https://bioinf.shenwei.me/seqkit/usage/
以下列出seqkit的其他命令
## 序列和子序列
**seq** 转换序列(序列颠倒,序列互补,提取ID)
**subseq** 从区域/gtf/bed中获得序列,包括侧面的序列
**sliding** 滑动序列,支持环式基因组
**stats** 对FASTA/Q files进行简单统计
**faidx** 创造fasta索引文件并提取子序列
**watch** 检测并连线序列特点的柱状图
**sana** 清除质量不好的单线的fastq文件
## 格式转换
**fx2tab** 将FASTA/Q 文件转变成表格形式 (1th: name/ID, 2nd: sequence, 3rd: quality)
**tab2fx** 转变表格形式为fasta/q格式
**fq2fa** 转变fastq文件为fasta文件
**convert** 在Sanger, Solexa and Illumina中转换fastq的质量编码
**translate** 将DNA/RNA序列转变成蛋白序列(支持模棱两可的碱基)
## 搜索
**grep** 根据ID/名称/序列/序列motif 搜索序列,且允许错配
**locate** 定位子序列/motif,且允许错配
**fish** 使用本地比对在较大序列中寻找短序列
**amplicon** 经由引物检索扩增子(或它附近特定的区域)
## bam文件的处理和监视
**bam** 监视和连线bam文件记录特点的直方图
## 设置参数
**head** 打印第一个Nfasta/q的记录
**range** 在一个范围内(start:end)打印fasta/q的记录
**sample** 通过数量或比例来体验序列
**rmdup** 通过id/名称/序列 来去除复制的序列
**duplicate** 复制N次的序列
**common** 通过id/名称/序列 发现多条序列中共有的序列
**split** 通过id/seq region/size/parts (mainly for FASTA) 将序列劈开成文件
**split2** 将序列通过大小或部分 劈开成文件
## 编辑
**replace** 通过规律表达来代替名字或序列
**rename** 重新命名复制的ID
**restart** 为环状基因组重新设置起始位置
**concat** 从多个文件中经由相同的ID来连接序列
**mutate** 编辑序列(点突,插入,删除)
## 排序
**shuffle** 变换序列位置
**sort** 将序列经由id/name/sequence 进行排序
以下命令来源于seqkit -- help
Available Commands:
amplicon retrieve amplicon (or specific region around it) via primer(s)
bam monitoring and online histograms of BAM record features
common find common sequences of multiple files by id/name/sequence
concat concatenate sequences with same ID from multiple files
convert convert FASTQ quality encoding between Sanger, Solexa and Illumina
duplicate duplicate sequences N times
faidx create FASTA index file and extract subsequence
fish look for short sequences in larger sequences using local alignment
fq2fa convert FASTQ to FASTA
fx2tab convert FASTA/Q to tabular format (with length/GC content/GC skew)
genautocomplete generate shell autocompletion script
grep search sequences by ID/name/sequence/sequence motifs, mismatch allowed
head print first N FASTA/Q records
help Help about any command
locate locate subsequences/motifs, mismatch allowed
mutate edit sequence (point mutation, insertion, deletion)
range print FASTA/Q records in a range (start:end)
rename rename duplicated IDs
replace replace name/sequence by regular expression
restart reset start position for circular genome
rmdup remove duplicated sequences by id/name/sequence
sample sample sequences by number or proportion
sana sanitize broken single line fastq files
seq transform sequences (revserse, complement, extract ID...)
shuffle shuffle sequences
sliding sliding sequences, circular genome supported
sort sort sequences by id/name/sequence/length
split split sequences into files by id/seq region/size/parts (mainly for FASTA)
split2 split sequences into files by size/parts (FASTA, PE/SE FASTQ)
stats simple statistics of FASTA/Q files
subseq get subsequences by region/gtf/bed, including flanking sequences
tab2fx convert tabular format to FASTA/Q format
translate translate DNA/RNA to protein sequence (supporting ambiguous bases)
version print version information and check for update
watch monitoring and online histograms of sequence features
网友评论