Cody

Problem 811. Genome Sequence 004: Long 3rd Generation Segment Correction

Solution 1731969

Submitted on 20 Feb 2019 by William
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
feval(@assignin,'caller','score',0);

2   Pass
M=[]; flag=0; w=100; [M_fix,N]=PacBio_fix(M,w,flag); M_truth=randi(4,1,w,'uint8')-1; M=repmat(M_truth,N,1); % Apply 15% substitution error qerr=floor(.15*N*w); errvec=randi(N*w,qerr,1); errval=randi(4,qerr,1)-1; M(errvec)=errval; flag=1; tic [M_fix,N]=PacBio_fix(M,w,flag); toc assert(isequal(M_fix,M_truth),sprintf('Error Count=%i',sum(M_fix~=M_truth)))

Elapsed time is 0.015140 seconds.

3   Pass
M=[]; flag=0; w=6144; [M_fix,N]=PacBio_fix(M,w,flag); M_truth=randi(4,1,w,'uint8')-1; M=repmat(M_truth,N,1); % Apply 15% substitution error qerr=floor(.15*N*w); errvec=randi(N*w,qerr,1); errval=randi(4,qerr,1)-1; M(errvec)=errval; flag=1; tic [M_fix,N]=PacBio_fix(M,w,flag); toc assert(isequal(M_fix,M_truth),sprintf('Error Count=%i',sum(M_fix~=M_truth)))

Elapsed time is 0.001194 seconds.

4   Pass
% Size Performance is based on w=1024 case M=[]; flag=0; w=1024; [M_fix,N]=PacBio_fix(M,w,flag); M_truth=randi(4,1,w,'uint8')-1; M=repmat(M_truth,N,1); % Apply 15% substitution error qerr=floor(.15*N*w); errvec=randi(N*w,qerr,1); errval=randi(4,qerr,1)-1; M(errvec)=errval; flag=1; tic [M_fix,not_N]=PacBio_fix(M,w,flag); toc assert(isequal(M_fix,M_truth),sprintf('Error Count=%i',sum(M_fix~=M_truth))) feval(@assignin,'caller','score',min(20,N));

Elapsed time is 0.001590 seconds.