Download some paired-end sequencing data in the FASTA format using the accession run number SRR26273031
.
Create a local nucleotide database using the downloaded FASTA file. Specify "SRR26273031_nucl_db"
as the base name of the output database. When creating the database, the function also generates multiple index files with the same base name. The blastplus
function uses these index files automatically when you search the database later in this example.
You can also specify additional database creation options using a MakeDatabaseOptions
object. For instance, specify the title of the database.
dbopts =
MakeDatabaseOptions with properties:
Default properties:
ExtraCommand: ""
IncludeAll: 0
InputType: "fasta"
ParseSequenceIDs: 0
Version: "2.14.0"
Modified properties:
Title: "SRR26273031_Nucleotide_DB"
You can then use the options object to make the database.
blastplusdatabase("nucleotide","SRR26273031.fasta","SRR26273031_nucl_db",dbopts);
Alternatively, you can use specify options, such as the title of the database, by using name-value arguments. For example:
blastplusdatabase("nucleotide","SRR26273031.fasta","SRR26273031_nucl_db",Title="SRR26273031_Nucleotide_DB");
To reset the property values to their default values, use the reset
function.
dopts2 =
MakeDatabaseOptions with properties:
Default properties:
ExtraCommand: ""
IncludeAll: 0
InputType: "fasta"
ParseSequenceIDs: 0
Title: [1×0 string]
Version: "2.14.0"
Modified properties:
No properties.
Search the database using the FASTA file queryFile.fasta
containing two nucleotide query sequences. This file is provided with the toolbox. Use the blastn
query program which lets you search nucleotide queries against a nucleotide database. Specify "search1"
as the name of the output report file. By default, the report file format is the traditional BLAST pairwise format. This format presents each query-subject pair alignment in detail.
Open the file to review the search results. The first query sequence returns no hits, while the second query sequence returns multiple hits.
You can also modify search options by creating a corresponding options object for the blastn
query program. Use blastplusoptions
or bioinfo.blastplus.*Options
to create the options object. For instance, change the report format to an XML format.
Alternatively, you can set the value of a property of the options object, such as ReportFormat
, using name-value argument syntax. For example:
blastplus("blastn","queryFile.fasta","SRR26273031_nucl_db","search2_xml",ReportFormat="BLASTXML");
You can use other query programs to search the database. For instance, use tblastx
to search translated nucleotide queries against a translated nucleotide database. Both query sequences return hits for this search. Use the compact tabular format for the report. For details about the generated columns and other report formats, see ReportFormat.
Delete the reports and downloaded FASTA file.