Main Content


Return information about FASTA file



info = fastainfo(file) returns a structure info containing summary information about the FASTA file.


info = fastainfo(file,'TimeOut',TO) sets the connection timeout (in seconds) to read data from a remote file or URL.


collapse all

info = fastainfo('ex1ref.fasta')
info = struct with fields:
           Filename: 'ex1ref.fasta'
           FilePath: '/mathworks/devel/bat/Bdoc21a/build/matlab/toolbox/bioinfo/bioinfodata'
        FileModDate: '07-May-2010 16:12:06'
           FileSize: 1612
    NumberOfEntries: 1
             Header: 'Reference for ex1'
             Length: 1569

Input Arguments

collapse all

FASTA file, specified as one of the following:

  • Character vector or string specifying a FASTA file name, path and name of a FASTA file, or URL pointing to a FASTA file. If you specify only a file name, the file must be on the MATLAB® search path or in the current folder.

  • Character array containing the text of a FASTA file.

Data Types: char | string

Connection timeout to read data from a remote file, specified as a positive scalar. For details, see here.

Data Types: double
Complex Number Support: Yes

Output Arguments

collapse all

Summary information about the FASTA file, returned as a structure. The structure contains the following fields.



Name of the file.


Path to the file.


Modification date of the file.


Size of the file in bytes.


Number of sequence entries in the file.


If file contains only one sequence, then this is a character vector containing the header information from the FASTA file. Otherwise, this field is empty.


If file contains only one sequence, then this is a scalar specifying the length of the sequence. Otherwise, this field is empty.

Introduced in R2009b