adding header - matlab
0
0
Entering edit mode
4.8 years ago
rotemkat ▴ 10

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 • 1.0k views
ADD COMMENT
0
Entering edit mode

why is this need to be done in matlab?

ADD REPLY

Login before adding your answer.

Traffic: 1936 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6