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

使用phylosuite下載的多個序列保存在一個文件中,名為sequence.fas
可以使用seqkit將其分割為只包含一條序列的單個文件

## 序列和子序列
**seq**  轉換序列(序列顛倒,序列互補,提取ID)
**subseq** 從區(qū)域/gtf/bed中獲得序列,包括側面的序列
**sliding** 滑動序列,支持環(huán)式基因組
**stats**   對FASTA/Q files進行簡單統(tǒng)計
**faidx** 創(chuàng)造fasta索引文件并提取子序列
**watch** 檢測并連線序列特點的柱狀圖
**sana** 清除質(zhì)量不好的單線的fastq文件
## 格式轉換
**fx2tab**  將FASTA/Q 文件轉變成表格形式 (1th: name/ID, 2nd: sequence, 3rd: quality)
**tab2fx** 轉變表格形式為fasta/q格式
**fq2fa** 轉變fastq文件為fasta文件
**convert** 在Sanger, Solexa and Illumina中轉換fastq的質(zhì)量編碼
**translate** 將DNA/RNA序列轉變成蛋白序列(支持模棱兩可的堿基)
## 搜索
**grep** 根據(jù)ID/名稱/序列/序列motif 搜索序列,且允許錯配
**locate** 定位子序列/motif,且允許錯配
**fish** 使用本地比對在較大序列中尋找短序列
**amplicon** 經(jīng)由引物檢索擴增子(或它附近特定的區(qū)域)
## bam文件的處理和監(jiān)視
**bam** 監(jiān)視和連線bam文件記錄特點的直方圖
## 設置參數(shù)
**head** 打印第一個Nfasta/q的記錄
**range** 在一個范圍內(nèi)(start:end)打印fasta/q的記錄
**sample** 通過數(shù)量或比例來體驗序列
**rmdup** 通過id/名稱/序列 來去除復制的序列
**duplicate**  復制N次的序列
**common** 通過id/名稱/序列 發(fā)現(xiàn)多條序列中共有的序列
**split** 通過id/seq region/size/parts (mainly for FASTA) 將序列劈開成文件
**split2** 將序列通過大小或部分 劈開成文件
## 編輯
**replace** 通過規(guī)律表達來代替名字或序列
**rename** 重新命名復制的ID
**restart** 為環(huán)狀基因組重新設置起始位置
**concat** 從多個文件中經(jīng)由相同的ID來連接序列
**mutate** 編輯序列(點突,插入,刪除)
## 排序
**shuffle** 變換序列位置
**sort** 將序列經(jīng)由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的重命名小工具對文件名進一步修改。

?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容