fastawrite error with string array as input datatype
古いコメントを表示
Dear MATLAB community,
I would like to create a fasta file from a cell array of character vectors. I have used the fastawrite function in Bioinformatics toolbox but I encounter the following error:
a=top50.dat.aa{2,1};
% 'a' is 50 X 1 cell array of character vectors
fastawrite('test.fasta',a)
Error using fastawrite (line 123)
Data is not a valid sequence or structure.
I have also tried to convert 'a' to a string but the error is still the same:
fastawrite('test.fasta',string(a))
Error using fastawrite (line 123)
Data is not a valid sequence or structure.
I have solved this issue by using a loop (since fasta write appends an existing file instead of overwriting it) but I would like to know if a more direct solution exists.
for i=1:50
fastawrite('test.fasta', string(a(i,1)))
end
Considering that since MATLAB 2018 all functions which take character array as an input work with string arrays, I would like to know if there is an issue with my code or with fastawrite.
Thank you,
Akshay
IIT D
2 件のコメント
madhan ravi
2020 年 6 月 20 日
https://www.mathworks.com/help/bioinfo/ref/fastawrite.html#FP462873 - See under Data to use it correctly.
Akshay Chenna
2020 年 6 月 20 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Large Files and Big Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!