<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[使用Diamond basta进行物种分类]]></title><description><![CDATA[<p dir="auto">一，diamond blastx -d /data_raid1/tt/diamond_result/nr -q dengu.fastq -o dengu.m8<br />
m8文件是标准的blast格式输出，从左到右的列的含义为：<br />
<strong>Query accession</strong>: the accession of the sequence that was the search query against the database, as specified in the input FASTA file after the &gt; character until the first blank.<br />
<strong>Target accession</strong>: the accession of the target database sequence (also called subject) that the query was aligned against.<br />
<strong>Sequence identity</strong>: The percentage of identical amino acid residues that were aligned against each other in the local alignment.<br />
<strong>Length</strong>: The total length of the local alignment, which including matching and mismatching positions of query and subject, as well as gap positions in the query and subject.<br />
<strong>Mismatches</strong>: The number of non-identical amino acid residues aligned against each other.<br />
<strong>Gap openings</strong>: The number of gap openings.<br />
<strong>Query start</strong>: The starting coordinate of the local alignment in the query (1-based).<br />
<strong>Query end</strong>: The ending coordinate of the local alignment in the query (1-based).<br />
<strong>Target start</strong>: The starting coordinate of the local alignment in the target (1-based).<br />
<strong>Target end</strong>: The ending coordinate of the local alignment in the target (1-based).<br />
<strong>E-value</strong>: The expected value of the hit quantifies the number of alignments of similar or better quality that you expect to find searching this query against a database of random sequences the same size as the actual target database. This number is most useful for measuring the significance of a hit. By default, DIAMOND will report all alignments with e-value &lt; 0.001, meaning that a hit of this quality will be found by chance on average once per 1,000 queries.<br />
<strong>Bit score</strong>: The bit score is a scoring matrix independent measure of the (local) similarity of the two aligned sequences, with higher numbers meaning more similar. It is always &gt;= 0 for local Smith Waterman alignments.</p>
<p dir="auto">二，basta安装和准备<br />
2.1 下载和初始化物种分类文件<br />
./bin/basta taxonomy<br />
会下载taxdump.tar.gz并导入本地leveldb数据库，basta内部用的是leveldb　和sqlite类似　这种把文件导入数据库的方式我们后面可以借鉴　可以考虑把这些数据导入hbase进行大规模保存和查询<br />
2.2 下载映射文件<br />
./bin/basta download MAPPING_FILE_TYPE<br />
MAPPING_FILE_TYPE can be one of<br />
<strong>prot</strong> - protein-to-taxonID mapping file (protein sequences hosted at the NCBI)<br />
uni - uniprot-to-taxonID mapping file (complete uniprot, will also be imported into database prot)<br />
<strong>gb</strong> - genbank-to-taxonID mapping file (for most nucleotide databases)<br />
wgs - whole-genome-sequence-to-taxonid mapping file<br />
pdb - protein-database-to-taxonID mapping file<br />
est - est-to-taxonID mapping file<br />
gss - gss-to-taxonID mapping file<br />
一般我们用gb(nt的映射)和prot(nr的映射)两个即可。<br />
2.3 进行物种LCA<br />
conda activate Diamond<br />
basta sequence dengu.m8 dengu.lca prot -e 0.005 -l 10 -i 50<br />
dengu.m8 是用blastx查的蛋白库　所以这个命令对应的查prot</p>
<p dir="auto">最后的结果：<br />
3d6008db-4c38-416d-9519-9ce9912fc43c    Viruses;Kitrinoviricota;Flasuviricetes;Amarillovirales;Flaviviridae;Flavivirus;Dengue_virus;</p>
]]></description><link>http://an.forum.genostack.com/topic/126/使用diamond-basta进行物种分类</link><generator>RSS for Node</generator><lastBuildDate>Sat, 13 Jun 2026 12:34:30 GMT</lastBuildDate><atom:link href="http://an.forum.genostack.com/topic/126.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 03 Dec 2020 06:14:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 使用Diamond basta进行物种分类 on Thu, 07 Apr 2022 07:49:26 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://currentprotocols.onlinelibrary.wiley.com/doi/10.1002/cpz1.59" rel="nofollow ugc">https://currentprotocols.onlinelibrary.wiley.com/doi/10.1002/cpz1.59</a><br />
这个文章写的很好  推荐了 Diamond+megan LCA  里面也提到了为什么要对比蛋白库 （但是感觉有点牵强）主要的论点是核酸库毕竟已知的物种很少</p>
]]></description><link>http://an.forum.genostack.com/post/1291</link><guid isPermaLink="true">http://an.forum.genostack.com/post/1291</guid><dc:creator><![CDATA[anneng]]></dc:creator><pubDate>Thu, 07 Apr 2022 07:49:26 GMT</pubDate></item><item><title><![CDATA[Reply to 使用Diamond basta进行物种分类 on Thu, 18 Mar 2021 09:12:35 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://github.com/etheleon/pymegan" rel="nofollow ugc">https://github.com/etheleon/pymegan</a><br />
对blast2lca做了python封装</p>
]]></description><link>http://an.forum.genostack.com/post/490</link><guid isPermaLink="true">http://an.forum.genostack.com/post/490</guid><dc:creator><![CDATA[anneng]]></dc:creator><pubDate>Thu, 18 Mar 2021 09:12:35 GMT</pubDate></item><item><title><![CDATA[Reply to 使用Diamond basta进行物种分类 on Thu, 18 Mar 2021 09:08:42 GMT]]></title><description><![CDATA[<p dir="auto">basta有个很大的问题是一次只能处理一个样本<br />
<a href="https://github.com/husonlab/megan-ce" rel="nofollow ugc">https://github.com/husonlab/megan-ce</a><br />
megan-ce　社区版本有个blast2lca的工具　可以单独使用</p>
<p dir="auto"><a href="https://www.seqomics.hu/index.php?option=com_content&amp;view=article&amp;id=58&amp;catid=2&amp;Itemid=137" rel="nofollow ugc">https://www.seqomics.hu/index.php?option=com_content&amp;view=article&amp;id=58&amp;catid=2&amp;Itemid=137</a><br />
LCA-assignment algorithm<br />
The main problem addressed by MEGAN is to compute a “species profile” by assigning the reads from a metagenomics sequencing experiment to appropriate taxa in the NCBI taxonomy. At present, this program implements the following naive approach to this problem:</p>
<ol>
<li>Compare a given set of DNA reads to a database of known sequences, such as NCBI-NR or NCBI-NT, using a sequence comparison tool such as BLAST.</li>
<li>Process this data to determine all hits of taxa by reads.</li>
<li>For each read r, let H be the set of all taxa that r hits.</li>
<li>Find the lowest node v in the NCBI taxonomy that encompasses the set of hit taxa H and assign the read r to the taxon represented by v.</li>
</ol>
<p dir="auto">We call this the naive LCA-assignment algorithm (LCA = “lowest common ancestor”). In this approach, every read is assigned to some taxon. If the read aligns very specifically only to a single taxon, then it is assigned to that taxon. The less specifically a read hits taxa, the higher up in the taxonomy it is placed. Reads that hit ubiquitously may even be assigned to the root node of the NCBI taxonomy.</p>
<p dir="auto">If a read has significant matches to two different taxa a and b, where a is an ancestor of b in the NCBI taxonomy, then the match to the ancestor a is discarded and only the more specific match to b is used.</p>
<p dir="auto">The program provides a threshold for the bit disjointScore of hits. Any hit that falls below the threshold is discarded. Secondly, a threshold can be set to discard any hit whose disjointScore falls below a given percentage of the best hit. Finally, a third threshold is used to report only taxa that are hit by a minimal number of reads or minimal percent of all assigned reads. By default, the program requires at least 0:1% of all assigned reads to hit a taxon, before that taxon is deemed present. All reads that are initially assigned to a taxon that is not deemed present are pushed up the taxonomy until a node is reached that has enough reads. This is set using the Min Support Percent or Min Support item.</p>
<p dir="auto">Taxa in the NCBI taxonomy can be excluded from the analysis. For example, taxa listed under root - unclassified sequences - metagenomes may give rise to matches that force the algorithm to place reads on the root node of the taxonomy. This feature is controlled by Preferences!Taxon Disabling menu. At present, the set of disabled taxa is saved as a program property and not as part of a MEGAN document.</p>
<p dir="auto">Note that the LCA-assignment algorithm is already used on a smaller scale when parsing individual blast matches. This is because an entry in a reference database may have more than one taxon associated with it. For example, in the NCBI-NR database, an entry may be associated with up to 1000 different taxa. This implies, in particular, that a read that may be assigned to a high level node (even the root node), even though it only has one significant hit, if the corresponding reference sequence is associated with a number of very different species.</p>
<p dir="auto">Note that the list of disabled taxa is also taken into consideration when parsing a BLAST file. Any taxa that are disabled are ignored when attempting to determine the taxon associated with a match, unless all recognized names are disabled, in which case the disabled names are used.</p>
<p dir="auto">Weighted LCA Algorithm<br />
The weighted LCA algorithm is identical to the weighted LCA algorithm used in Metascope. It operates as follows: In a first round of analysis, each reference sequence is given a weight. This is the number of reads that align to the given reference and that have the property that all the significant alignments for the read are to the same species as the reference sequence (but can also be to a strain or sub-species below the species node). In a second round of analysis, each read is placed on the node that is above 75% of the total weight of all references for which the read has a significant alignment.<br />
The Weighted LCA algorithm will assign reads more specifically than the naive LCA algorithm. Because it performs two rounds of read and match analysis, it takes twice as long as the naive algorithm.</p>
]]></description><link>http://an.forum.genostack.com/post/489</link><guid isPermaLink="true">http://an.forum.genostack.com/post/489</guid><dc:creator><![CDATA[anneng]]></dc:creator><pubDate>Thu, 18 Mar 2021 09:08:42 GMT</pubDate></item><item><title><![CDATA[Reply to 使用Diamond basta进行物种分类 on Thu, 01 Jul 2021 07:47:05 GMT]]></title><description><![CDATA[<p dir="auto">diamond 比较蛋白库可能有问题 直接用blastn比较nt库<br />
//转换fastq为fasta<br />
seqtk seq -a all.fastq &gt; all.fasta<br />
blastn -query all.fasta -db /ceph_disk2/MetaDatabase/NCBI_blast_db_FASTA/nt/ntdata/nt -num_threads 10 -out all.m8 -outfmt 6 -evalue 0.001</p>
]]></description><link>http://an.forum.genostack.com/post/455</link><guid isPermaLink="true">http://an.forum.genostack.com/post/455</guid><dc:creator><![CDATA[anneng]]></dc:creator><pubDate>Thu, 01 Jul 2021 07:47:05 GMT</pubDate></item><item><title><![CDATA[Reply to 使用Diamond basta进行物种分类 on Sat, 27 Feb 2021 13:07:02 GMT]]></title><description><![CDATA[<p dir="auto">m8格式<br />
qseqid means Query Seq-id<br />
sseqid means Subject Seq-id<br />
pident means Percentage of identical matches<br />
length means Alignment length<br />
mismatch means Number of mismatches<br />
gapopen means Number of gap openings<br />
qstart means Start of alignment in query<br />
qend means End of alignment in query<br />
sstart means Start of alignment in subject<br />
send means End of alignment in subject<br />
evalue means Expect value<br />
bitscore means Bit score</p>
<p dir="auto">注意：blast以前的版本有个-m 8 选项  diamond m8 就是来自这里  现在是 outfmt 6<br />
it should be '-outfmt 6' for blast+ and '-m 8' for legacy blast<br />
<a href="https://www.biostars.org/p/166013/" rel="nofollow ugc">https://www.biostars.org/p/166013/</a></p>
]]></description><link>http://an.forum.genostack.com/post/337</link><guid isPermaLink="true">http://an.forum.genostack.com/post/337</guid><dc:creator><![CDATA[anneng]]></dc:creator><pubDate>Sat, 27 Feb 2021 13:07:02 GMT</pubDate></item><item><title><![CDATA[Reply to 使用Diamond basta进行物种分类 on Thu, 03 Dec 2020 06:18:34 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1606976313054-22beab13-6d27-494a-bc09-388572f6b34a-image-resized.png" alt="22beab13-6d27-494a-bc09-388572f6b34a-image.png" class=" img-responsive img-markdown" /></p>
]]></description><link>http://an.forum.genostack.com/post/206</link><guid isPermaLink="true">http://an.forum.genostack.com/post/206</guid><dc:creator><![CDATA[anneng]]></dc:creator><pubDate>Thu, 03 Dec 2020 06:18:34 GMT</pubDate></item><item><title><![CDATA[Reply to 使用Diamond basta进行物种分类 on Thu, 03 Dec 2020 06:18:11 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://cran.r-project.org/web/packages/taxonomizr/readme/README.html" rel="nofollow ugc">https://cran.r-project.org/web/packages/taxonomizr/readme/README.html</a><br />
Convert accession numbers to taxonomy</p>
<p dir="auto"><a href="https://github.com/timkahlke/BASTA" rel="nofollow ugc">https://github.com/timkahlke/BASTA</a></p>
]]></description><link>http://an.forum.genostack.com/post/205</link><guid isPermaLink="true">http://an.forum.genostack.com/post/205</guid><dc:creator><![CDATA[anneng]]></dc:creator><pubDate>Thu, 03 Dec 2020 06:18:11 GMT</pubDate></item></channel></rss>