File Exchange

image thumbnail

MSKCC CGDS Cancer Genomics Toolbox

version 1.5.0.0 (23.9 KB) by Erik Larsson
Functions for retrieving data from the Cancer Genomics Data Server (CGDS) at MSKCC cBio.

4 Downloads

Updated 19 Sep 2013

View License

This toolbox provides direct access to cancer genomics data from within the MATLAB environment. The toolbox will query the Cancer Genomics Data Server Web API, provided by the Computational Biology Center at Memorial Sloan-Kettering Cancer Center, and return data in a structured format.

A tutorial ('showdemo cgdstutorial') makes it easy to get started.

Comments and Ratings (3)

This stems from a problem with the function 'urlgetcells'. Go
edit urlgetcells
change 'S = urlread(url)' to 'S = webread(url)'
delete the 'BufSize' parameter argument from textscan in lines 11 and 28
See the corrected function below
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function cells = urlgetcells(url, verbose)
% this function is only used internally by the CGDS matlab toolbox
% returns a 2D cell array where each cell contains a tab-delimited 'cell'
% from the server output

% decrease if out of memory errors are encountered
nPrealloc = 500;

S = webread(url);

rows = textscan(S, '%s', 'delimiter', '\n');
rows = rows{1};

cells = cell(nPrealloc, 1);
n = 0;
for i = 1:length(rows)
thisRow = rows{i};
if strcmp(thisRow(1), '#')
if verbose
fprintf('%s\n', thisRow);
end
elseif strcmp(thisRow(1:6), 'Error:')
fprintf('%s\n', thisRow);
error('Cgds:getcancertypes:CgdsError','CGDS returned an error.');
else
% this row contains data/header rather than status/warnings/errors
n = n + 1;
thisCells = textscan(thisRow, '%s', 'delimiter', '\t');
thisCells = thisCells{1};
cells(n, 1:length(thisCells)) = thisCells;
end
end
cells = cells(1:n, :);

im getting errors when i try to get any data.

cancerStudies = getcancerstudies(cgdsURL)
Error using textscan
Unknown parameter 'BufSize'.
Error in urlgetcells (line 11)
rows = textscan(S, '%s', 'delimiter', '\n', 'BufSize', 65535);
Error in getcancerstudies (line 24)
cells = urlgetcells([cgdsURL
'webservice.do?cmd=getCancerStudies'], verbose);

Updates

1.5.0.0

Version 1.06: Adapted to changes in web API (clinical data). Previous version no longer works correctly. Trailing '/' no longer required in URL. Updated URL in help pages. Updated tutorial for new clinical data format.

1.4.0.0

Bug fixes to cgdstutorial.m

1.3.0.0

Updates to comply with changed naming conventions for case set IDs and genetic profile IDs.

1.2.0.0

Minor update to cgdstutorial.m

1.1.0.0

v1.02 9/5/2011: Adapted to changes in web API.

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: MSKCC CGDS Cancer Genomics Toolbox v1.07

html/