Entering edit mode
3.3 years ago
anasjamshed
▴
140
I have these 4 sequences:
X: TACCCGAT
Y: TAAACGAT
Z: AAAACGCG
W: AAAACGAT
I run this code in MATLAB:
%store all sequences in a single variable 'data'
data = {'X' 'TACCCGAT'
'Y' 'TAAACGAT'
'Z' 'AAAACGCG'
'W' 'AAAACGAT'}
%find number of sequences
num_seqs = length(data)
%find distance among all sequences
dist = seqpdist(data)
%build average linkage tree by using all 4 sequences
tree = seqlinkage(dist,'average',data)
%View Tree
phytreeviewer(tree);
num_boots = 5;
seq_len = length(data);
boots = cell(num_boots,1);
for n = 1:num_boots
reorder_index = randsample(seq_len,seq_len,true);
for i = num_seqs:-1:1 %reverse order to preallocate memory
bootseq(i) = data(i);
bootseq(i) = strrep(data(i),'-','');
end
boots{n} = bootseq;
end
fun = @(x) seqlinkage(x,'average',{data});
boot_trees = cell(num_boots,1);
parpool('local');
for i = num_seqs-1:-1:1 % for every branch, reverse order to preallocate
branch_pointer = i + num_seqs;
sub_tree = subtree(tree,branch_pointer);
orig_pointers{i} = getcanonical(sub_tree);
orig_species{i} = sort(get(sub_tree,'LeafNames'));
end
But I got the error that: you need 2 leaves at least to make subtree.
Can anyone help me to solve this and also help me Confidence Values of the tree?