2020-12-16 seqkit分割phylosuite下载的sequence文件

使用phylosuite下载的多个序列保存在一个文件中,名为sequence.fas
可以使用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 进行排序

此处使用的是split命令

split sequences into files by name ID, subsequence of given region,
part size or number of parts.

If you just want to split by parts or sizes, please use "seqkit split2",
which also apply for paired- and single-end FASTQ.

The definition of region is 1-based and with some custom design.

Examples:

 1-based index    1 2 3 4 5 6 7 8 9 10
negative index    0-9-8-7-6-5-4-3-2-1
           seq    A C G T N a c g t n
           1:1    A
           2:4      C G T
         -4:-2                c g t
         -4:-1                c g t n
         -1:-1                      n
          2:-2      C G T N a c g t
          1:-1    A C G T N a c g t n
          1:12    A C G T N a c g t n
        -12:-1    A C G T N a c g t n

Usage:
  seqkit split [flags]

Flags:
  -i, --by-id              split squences according to sequence ID
  -p, --by-part int        split sequences into N parts
  -r, --by-region string   split squences according to subsequence of given region. e.g 1:12 for first 12 bases, -12:-1 for last 12 bases. type "seqkit split -h" for more examples
  -s, --by-size int        split sequences into multi parts with N sequences
  -d, --dry-run            dry run, just print message and no files will be created.
  -f, --force              overwrite output directory
  -h, --help               help for split
  -k, --keep-temp          keep tempory FASTA and .fai file when using 2-pass mode
  -O, --out-dir string     output directory (default value is $infile.split)
  -2, --two-pass           two-pass mode read files twice to lower memory usage. (only for FASTA format)

Global Flags:
      --alphabet-guess-seq-length int   length of sequence prefix of the first FASTA record based on which seqkit guesses the sequence type (0 for whole seq) (default 10000)
      --id-ncbi                         FASTA head is NCBI-style, e.g. >gi|110645304|ref|NC_002516.2| Pseud...
      --id-regexp string                regular expression for parsing ID (default "^(\\S+)\\s?")
      --infile-list string              file of input files list (one file per line), if given, they are appended to files from cli arguments
  -w, --line-width int                  line width when outputing FASTA format (0 for no wrap) (default 60)
  -o, --out-file string                 out file ("-" for stdout, suffix .gz for gzipped out) (default "-")
      --quiet                           be quiet and do not show extra information
  -t, --seq-type string                 sequence type (dna|rna|protein|unlimit|auto) (for auto, it automatically detect by the first sequence) (default "auto")
  -j, --threads int                     number of CPUs. (default value: 1 for single-CPU PC, 2 for others. can also set with environment variable SEQKIT_THREADS) (default 2)

在本次运行中,我们的代码为

seqkit split --by-id --id-regexp "\[(.+)\]" sequence.fas
图片.png

这就是本次的结果文件,对文件名不满意的话,可以使用quicker的重命名小工具对文件名进一步修改。

你可能感兴趣的:(2020-12-16 seqkit分割phylosuite下载的sequence文件)