Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

sptread

Read data from SPOT file

Syntax

SPOTData = sptread(File)
SPOTData = sptread(File, 'CleanColNames', CleanColNamesValue)

Arguments

File

Either of the following:

  • Character vector specifying a file name, a path and file name, or a URL pointing to a file. The referenced file is a SPOT-formatted file (ASCII text file). If you specify only a file name, that file must be on the MATLAB® search path or in the MATLAB Current Folder.

  • MATLAB character array that contains the text of a SPOT-formatted file.

CleanColNamesValue

Controls the use of valid MATLAB variable names.

Description

SPOTData = sptread(File) reads File, a SPOT-formatted file, and creates SPOTData, a MATLAB structure containing the following fields:

Header
Data
Blocks
Columns
Rows
IDs
ColumnNames
Indices
Shape

SPOTData = sptread(File, 'CleanColNames', CleanColNamesValue) controls the use of valid MATLAB variable names. The column names in the SPOT-formatted file contain periods and some characters that cannot be used in MATLAB variable names. If you plan to use the column names as variable names in a function, use this option with CleanColNames set to true and the function will return the field ColumnNames with valid variable names.

The Indices field of the structure includes the indices that you can use for plotting heat maps of the data.

Examples

  1. Read in a sample SPOT file and plot the median foreground intensity for the 635 nm channel. Note that the example file spotdata.txt is not provided with the Bioinformatics Toolbox™ software.

    spotStruct = sptread('spotdata.txt')
    maimage(spotStruct,'Rmedian');
  2. Alternately, create a similar plot using more basic graphics commands.

    Rmedian = magetfield(spotStruct,'Rmedian');
    imagesc(Rmedian(spotStruct.Indices));
    colormap bone
    colorbar

Introduced before R2006a

Was this topic helpful?