自定义 BLAST 的输出?

发布于 2024-08-12 05:51:09 字数 356 浏览 3 评论 0原文

我知道这是一个与 BLAST 和生物信息学相关的非常具体的问题,但这里是:

我正在尝试使用独立的 BLAST(我已经下载了它并在命令行上测试了它运行)来执行 DNA 序列比对 (blastn)。我需要能够提供我自己的查询文件(fasta 格式)和我自己的数据库文件(也是 fasta 格式)。

关键是我想让程序只输出2个字段,而不是通常输出的详细报告。我想要输出对齐的最高分数和e值。我的想法是,一旦我完成了这项工作,我就可以将其包装在我自己的控制程序中,并使用不同的查询序列自动运行它多次,并记录分数和 e 值。

我知道这是一个渺茫的机会,但有人知道我该如何做到这一点吗?对我来说,两个障碍是使用我自己的数据库文件和自定义输出。

I know this is a very specific question relating to BLAST and Bioinformatics but here goes:

I am attempting to use standalone BLAST (I already have downloaded it and tested it running on the command line) to perform a DNA sequence alignment (blastn). I need to be able to provide both my own query file (fasta format) and my own database file (also fasta format).

The key is that I want to have the program only output 2 fields rather than the detailed reports that it usually outputs. I only want the highest score and the e-value for the alignment to be output. The idea is that once I have this working, I can wrap this in my own control program and automatically run it many times with different query sequences and log the scores and e-values.

I know this is a long shot, but does anybody have an idea on how I can go about doing this? The two hurdles for me are using my own database file and customizing the output.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

野稚 2024-08-19 05:51:09

事实上它很简单:blastall 有几个命令行选项可以帮助您:

  • 仅输出每个查询的单个最强命中:-v 1 -b 1
  • 以表格格式输出:-m 8

so您将运行如下所示的命令:

blastall -p blastn -i queries.fasta -d database -v1 -b1 -m8 > resultTable.txt

但是,表输出有几列。我不记得列的顺序,但您可以使用剪切工具仅选择您感兴趣的列。 中仅选择第1、7和8列

cut -d '\t' -f 1,7,8 < resultTable.txt

例如,以下命令将从blastoutput yannick

in fact it's simple: blastall has several command line option that will help you:

  • to output only the single strongest hit for each query: -v 1 -b 1
  • to output in table format: -m 8

so you'll be running something like this:

blastall -p blastn -i queries.fasta -d database -v1 -b1 -m8 > resultTable.txt

The table output has several columns however. I don't recall the order of columns, but you can use the cut tool to select only your columns of interest. For example the following command would select only columns 1, 7 and 8 from the blastoutput

cut -d '\t' -f 1,7,8 < resultTable.txt

yannick

放赐 2024-08-19 05:51:09

Yannick 的答案涵盖了如何从 blastall 获取您需要的特定输出 - 您关心的第二件事是使用您自己的数据库文件。独立的 BLAST 也提供了您所需的工具。

除了 blastall 之外,您还应该有一个名为 formatdb 的程序的副本,您可以将其与 fasta 序列数据库一起提供,它会为 BLAST 正确格式化它。对于核苷酸数据库,运行以下命令:

formatdb -i input_database.fa -p F

这将在您的工作目录中生成许多文件 (input_database.fa.nhr, input_database.fa.nininput_database.fa.nsq),您可以通过使用数据库的原始名称(即,忽略 .n* 后缀)。

HTH

PS formatdb -h 将为您提供 formatdb 选项的完整列表

Yannick's answer covers how to get the specific output you need from blastall - the second thing you're concerned about is using your own database file. Standalone BLAST provides the tools you need for this too.

Along with blastall, you should also have a copy of a program called formatdb, you can provide this with your fasta sequence database, and it will format it correctly for BLAST. For a nucleotide database, run the following:

formatdb -i input_database.fa -p F

This will produce a number of files in your working directory (input_database.fa.nhr, input_database.fa.nin, input_database.fa.nsq) which you can use in your blastall command by using the original name of your database (ie, miss off the .n* suffix).

HTH

PS formatdb -h will give you a full list of options for formatdb

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文