www.gusucode.com > bioinfo 案例源码程序 matlab代码 > bioinfo/TrimSequencesInAFASTQFileExample.m

    %% Trim sequences in a FASTQ file
%  
%%
% Trim each sequence when the number of bases with quality below 20 is
% greater than 3 within a sliding window of size 25.
%
[outFile,nt,unt] =  seqtrim('SRR005164_1_50.fastq', 'Method', 'MaxNumberLowQualityBases', ...
                 'Threshold', [3 20], 'WindowSize', 25);
                
%%
% Check the number of sequences that were trimmed.
nt
%%
% Check the number of sequences that were untrimmed.
unt
%%
% Trim the first 10 bases of each sequence.
% 
%   [outfile,nt] = seqtrim('SRR005164_1_50.fastq','Method','Termini', ...
%                        'Threshold',[10 0]);
%    
%%
% Trim the last 5 bases.
% 
%   [outfile,nt] = seqtrim('SRR005164_1_50.fastq','Method','Termini', ...
%                        'Threshold',[0 5]);
% 
%%
% Trim each sequence at position 50.
%
%   [outfile,nt] = seqtrim('SRR005164_1_50.fastq','Method','BasePositions', ...
%                        'Threshold',[1 50]);
% 
%%
% Trim each sequence when the running average base quality becomes less
% than 20.
%
%   [outFile,nt,unt] = seqtrim('SRR005164_1_50.fastq','Method','MeanQuality', ...
%        'Threshold',20)
% 
%%
% Trim each sequence when the percentage of bases with quality below 10 is
% more than 15.
%  
%   [outFile,nt,unt] = seqtrim('SRR005164_1_50.fastq','Method','MaxPercentLowQualityBases', ...
%        'Threshold',[15 10])