ALTER:序列比對格式轉化小工具
- 2020 年 3 月 3 日
- 筆記
多序列比對結果可以存儲為很多格式(Multiple sequence alignments can be stored in a large variety of formats.)
比如最常見的:
Fasta
>ccsA1 ATGATATTTTCAACTTTAGAGCATATAT >ccsA2 ATGATATTTTCAACTTTAGAGCATATAT >ccsA3 ATGATATTTTCAACTTTAGAGCATATAT >ccsA4 ATGATATTTTCAACTTTAGAGCATATAT
clustal
CLUSTAL W (1.8) multiple sequence alignment (ALTER 1.3.3) ccsA1 ATGATATTTTCAACTTTAGAGCATATAT ccsA2 ATGATATTTTCAACTTTAGAGCATATAT ccsA3 ATGATATTTTCAACTTTAGAGCATATAT ccsA4 ATGATATTTTCAACTTTAGAGCATATAT ****************************
NEXUS
#NEXUS BEGIN DATA; dimensions ntax=4 nchar=28; format missing=? interleave=yes datatype=DNA gap=- match=.; matrix ccsA1 ATGATATTTTCAACTTTAGAGCATATAT ccsA2 ATGATATTTTCAACTTTAGAGCATATAT ccsA3 ATGATATTTTCAACTTTAGAGCATATAT ccsA4 ATGATATTTTCAACTTTAGAGCATATAT ; end;
PHYLIP
4 28 ccsA1 atgatatttt caactttaga gcatatat ccsA2 atgatatttt caactttaga gcatatat ccsA3 atgatatttt caactttaga gcatatat ccsA4 atgatatttt caactttaga gcatatat
MEGA
#mega TITLE: MSA converted with ALTER 1.3.3 #ccsA1 ATGATATTTT CAACTTTAGA GCATATAT #ccsA2 ATGATATTTT CAACTTTAGA GCATATAT #ccsA3 ATGATATTTT CAACTTTAGA GCATATAT #ccsA4 ATGATATTTT CAACTTTAGA GCATATAT
不同的比對軟體會輸出不一樣的比對格式;比對後分析用到的軟體對輸入格式的要求也不一樣。比如序列比對我習慣使用MAFFT。MAFFT輸出結果默認為fasta格式,clustal可選;如果後續需要使用MrBayes構建貝葉斯樹,需要將其轉化為NEXUS格式。這裡推薦 ALTER http://www.sing-group.org/ALTER/ 來完成比對格式轉化的任務。如果分析的序列不是很多,可以選擇網頁版;如果序列條數比較多可以選擇安裝本地版 https://github.com/sing-group/ALTER;按照安裝步驟執行即可,自己的安裝過程沒有遇到報錯;
安裝步驟
git clone https://github.com/sing-group/ALTER.git cd ALTER mvn package
依賴
Git tool for cloning the last version A Java Compiler and tool The Maven tool
以上依賴軟體都可以通過conda安裝;關於conda的安裝教程可以微信搜索教程價值999的全外顯子教學影片--免費送
安裝好以後執行
java -jar alter-lib/target/ALTER-1.3.4-jar-with-dependencies.jar help # 輸出結果 No argument is allowed: help -c (--collapse) : Collapse sequences to haplotypes. -cg (--collapseGaps) : Treat gaps as missing data when collapsing. -cl (--collapseLimit) N : Connection limit (sequences differing at <= l si tes will be collapsed) (default is l=0). -cm (--collapseMissing) : Count missing data as differences when collapsin g. -i (--input) FILE : Input file. -ia (--inputAutodetect) : Autodetect format (other input options are omitt ed). -if (--inputFormat) VAL : Input format (ALN, FASTA, GDE, MEGA, MSF, NEXUS, PHYLIP or PIR). -io (--inputOS) VAL : Input operating system (Linux, MacOS or Windows) . -ip (--inputProgram) VAL : Input program (Clustal, MAFFT, MUSCLE, PROBCONS or TCoffee). -o (--output) FILE : Output file. -of (--outputFormat) VAL : Output format (ALN, FASTA, GDE, MEGA, MSF, NEXUS , PHYLIP or PIR). -ol (--outputLowerCase) : Lowe case output. -om (--outputMatch) : Output match characters. -on (--outputResidueNumbers) : Output residue numbers (only ALN format). -oo (--outputOS) VAL : Output operating system (Linux, MacOS or Windows ). -op (--outputProgram) VAL : Output program (jModelTest, MrBayes, PAML, PAUP, PhyML, ProtTest, RAxML, TCS, CodABC, BioEdit, M EGA, dnaSP, Se-Al, Mesquite, SplitsTree, Clustal , MAFFT, MUSCLE, PROBCONS, TCoffee, Gblocks, Sea View, trimAl or GENERAL) -os (--outputSequential) : Sequential output (only NEXUS and PHYLIP formats ).
我自己將fasta格式轉化為NEXUX格式
java -jar alter-lib/target/ALTER-1.3.4-jar-with-dependencies.jar -i ~/mingyan/practice_assorted/Myrtales_CP_genomes/another/Myrtales_cp_genome_aligned.fasta-gb -ia -o ./output.nex -of NEXUS -op MrBayes -oo Linux # 運行結果 <INFO> : FASTA format detected. <INFO> : MSA read in FASTA format (Taxa = 90, Length = 106571). <INFO> : Nucleotide MSA type inferred. <INFO> : MSA successfully converted to NEXUS format!
小工具對應的論文
ALTER: program-oriented conversion of DNA and protein alignments
期刊
Nucleic Acids Research 2010年
