MATLAB: Am I unable to access the NCBI Entrez Database using GENBANKREAD in MATLAB 7.7 (R2008b)

Bioinformatics Toolbox

I am trying to read from the Gene Database in the NCBI database using functionality similar to that located in the following demo:
$MATLABROOT\toolbox\bioinfo\biodemos\ncbieutilsdemo.m
The exact code is attached. I am getting the following error
??? Error using ==> genbankread at 94
FILE is not a valid GenBank file or url.

Best Answer

Bioinformatics Toolbox does not have a function to read in GENE files directly. GENBANKREAD can only read in GENBANK files from the NUCLEOTIDE databases at NCBI
To work around this issue, use URLREAD to retrieve a file from the GENE database.
From the demo code example with GENBANKREAD replaced with URLREAD:
ch97struct = urlread([baseURL,'efetch.fcgi?',dbParam,'&retmode=xml&WebEnv=',ncbi.WebEnv,'&query_key=',ncbi.QueryKey]);)
This will read in the file (in XML formatting) as a string, which can be parsed to extract the gene information. REGEXP can be used to parse the string using regular expression.