This is a test version of Biostars. For the public version, visit https://www.biostars.org.
adding header - matlab

Hi,

I need to create a tab-delimited file using via matlab.

I have a cell array and two line of headers I need to add before the actual data:

1: ##fileformat=VCFv4.0

2: #CHROM POS ID REF ALT QUAL FILTER INFO

so for the second line I created:

header={'#CHROM','POS','ID','REF','ALT','QUAL','FILTER','INFO'};

and then appended it to the matrix-table:

table = [header;table];

but when I tried to add the first line as well:

header={'##fileformat=VCFv4.0',{},{},{},{},{},{},{};
   '#CHROM','POS','ID','REF','ALT','QUAL','FILTER','INFO'};

and then table = [header;table];

and then tried to save it using writecell function, i got the following error:

Error using writecell (line 117)
Nested cell arrays are not supported.

Also, I want to mention that I tried to save as a matlab table and rename the variable name, but since is starts with # it's not a valid table variable name.

Any suggestion?

Thanks a lot!

I got an error:

matlab vcf tab-delimited file

why is this need to be done in matlab?

0 answers

No answers yet.

Log in to answer this question.