how to open / access a .mat file in matlab ?
0
0
Entering edit mode
4.0 years ago
2001linana ▴ 40

Hi. I hope this is a appropriate place to ask this question, because it feels like a matlab question. So, I have the following piece of code,

clear;
load('metadata.mat');                                                            
seqF = fastaread('nCoV_align_trim_0310.fas');                                    
                                                         % seqF is a struct with two fields, i.e., Header and Sequence
seqMetadata = [];                                        

for i = 1:length(seqF)                                                  
    seqF(i).Header = erase(seqF(i).Header,'_');                         
    seqF(i).Header = erase(seqF(i).Header,' ');                         
    found = false;                                                      
    for j = 1:length(allMetadata)                                       
        md = allMetadata(j);                                            
        mdName = md.id;                                                 
        if strcmp(mdName(1:9),' BetaCoV/')                               
            mdName = mdName(10:end);
        end
        if strcmp(seqF(i).Header,mdName)                           
            found = true;
            break;
        end
    end
    if found
        seqMetadata = [seqMetadata md];
    end
end

I was confused about the second for loop. I mean, what exactly is this allMetadata variable ? It looks like it is not defined anywhere else, right? Any comments are greatly appreciated.

sequence • 776 views
ADD COMMENT
1
Entering edit mode

Abandon MATLAB for bioinformatics sooner rather than later, and you will spare yourself many weeks of agony.

ADD REPLY
0
Entering edit mode

If you have a license for MatLab then you can contact their tech support. While you may get an answer here, chances of that happening with programs that require a license are smaller than free/open-source programs.

Looks like this is a follow-up on the fasta parsing question you had asked earlier. This code appears to be some sort of fasta parser.

ADD REPLY

Login before adding your answer.

Traffic: 2696 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