saminfo
R2026bReturn information about SAM file
Description
returns information about a SAM-formatted file.InfoStruct = saminfo(File)
uses additional options specified by one or more name-value arguments. For example,
you can specify to include the read count in the output.InfoStruct = saminfo(File,Name=Value)
Examples
Return information from the ex1.sam file
included with the toolbox.
info = saminfo("ex1.sam")info =
Filename: 'ex1.sam'
FilePath: [1x89 char]
FileSize: 254270
FileModDate: '12-May-2011 14:23:25'
Header: [1x1 struct]
SequenceDictionary: [1x1 struct]
ReadGroup: [1x2 struct]
NumReads: []
ScannedDictionary: {0x1 cell}
ScannedDictionaryCount: [0x1 uint64]Include the number of sequence reads.
info = saminfo("ex1.sam",NumOfReads=true)info =
Filename: 'ex1.sam'
FilePath: [1x89 char]
FileSize: 254270
FileModDate: '12-May-2011 14:23:25'
Header: [1x1 struct]
SequenceDictionary: [1x1 struct]
ReadGroup: [1x2 struct]
NumReads: 1501
ScannedDictionary: {0x1 cell}
ScannedDictionaryCount: [0x1 uint64]Input Arguments
SAM file, specified as a character vector or string scalar. Specify a filename or path and filename of a SAM-formatted file. If you specify only a filename, that file must be on the MATLAB® search path or in the current folder.
Tip
Use saminfo to investigate the size and content
of a SAM file before using the samread function to read
the file contents into a structure.
Data Types: char | string
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: InfoStruct = saminfo(File,NumOfReads=true) specifies to
include the number of sequence reads in the output structure.
Flag to include read counts in the output, specified as a numeric or
logical 1 (true) or 0 (false). If
true, the output structure includes a
NumReads field containing the number of sequence
reads in the file.
Note
Setting NumOfReads to true
can significantly increase the time to create the output
structure.
Data Types: logical
Reference scanning flag, specified as a numeric or logical 1
(true) or 0 (false). If
true, the output structure includes
ScannedDictionary and
ScannedDictionaryCount fields containing the
reference names and the number of reads aligned to each
reference.
Data Types: logical
Output Arguments
SAM file summary information, returned as a structure. The structure contains these fields.
| Field | Description |
|---|---|
Filename | Name of the SAM-formatted file. |
FilePath | Path to the file. |
FileSize | Size of the file in bytes. |
FileModDate | Modification date of the file. |
NumReads* | Number of sequence reads in the file. |
ScannedDictionary* | Cell array of character vectors specifying the names of the reference sequences in the SAM-formatted file. |
ScannedDictionaryCount* | Cell array specifying the number of reads aligned to each reference sequence. |
Header** | Structure containing the file format version, sort order, and group order. |
SequenceDictionary** | Structure containing the:
|
ReadGroup** | Structure containing the:
|
Program** | Structure containing the:
|
* — The NumReads field
is empty if you do not set the NumOfReads name-value
argument to true. The ScannedDictionary and ScannedDictionaryCount fields
are empty if you do not set the ScanDictionary name-value
argument to true.
** — These structures and their fields appear in the output structure only if they are in the SAM file. The information in these structures depends on the information in the SAM file.
Version History
Introduced in R2010a
See Also
samread | fastqread | fastqwrite | fastqinfo | fastainfo | fastaread | fastawrite | sffinfo | sffread | BioIndexedFile | BioMap
External Websites
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)