| Contents | Index |
Alignment = cigar2align(Seqs,Cigars)
[GapSeq, Indices]
= cigar2align(Seqs,Cigars)
... = cigar2align(Seqs,Cigars,Name,Value)
Alignment = cigar2align(Seqs,Cigars) converts unaligned sequences in Seqs, a cell array of strings, into Alignment, a matrix of aligned sequences, using the information stored in Cigars, a cell array of CIGAR strings.
[GapSeq, Indices] = cigar2align(Seqs,Cigars) converts unaligned sequences in Seqs, a cell array of strings, into GapSeq, a cell array of strings of aligned sequences, and also returns Indices, a vector of numeric indices, using the information stored in Cigars, a cell array of CIGAR strings. When an alignment has many columns, this syntax uses less memory and is faster.
... = cigar2align(Seqs,Cigars,Name,Value) converts unaligned sequences in Seqs, a cell array of strings, into Alignment, a matrix of aligned sequences, using the information stored in Cigars, a cell array of CIGAR strings, with additional options specified by one or more Name,Value pair arguments.
Specify optional comma-separated pairs of Name,Value arguments, where Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
'Start' |
Vector of positive integers specifying the reference sequence position at which each aligned sequence starts. By default, each aligned sequence starts at position 1 of the reference sequence. |
'GapsInRef' |
Logical specifying whether to display positions in the aligned sequences that correspond to gaps in the reference sequence. Choices are true (1) or false (0). If your reference sequence has gaps and you set GapsInRef to false (0), and then later use Alignment as input to align2cigar, the returned CIGAR strings will not match the original CIGAR strings. Default: false (0) |
'SoftClipping' |
Logical specifying whether to include characters in the aligned read sequences corresponding to soft clipping ends. Choices are true (1) or false (0). Default: false (0) |
'OffsetPad' |
Logical specifying whether to add padding blanks to the left of each aligned read sequence to represent the offset of the start position from the first position of the reference sequence. Choices are true (1) or false (0). When false, the matrix of aligned sequences starts at the start position of the leftmost aligned read sequence. Default: false (0) |
Create a cell array of strings containing unaligned sequences, create a cell array of strings containing corresponding CIGAR strings associated with a reference sequence of ACGTATGC, and then reconstruct the alignment:
r = {'ACGACTGC', 'ACGTTGC', 'AGGTATC'}; % unaligned sequences
c = {'3M1D1M1I3M', '4M1D1P3M', '5M1P1M1D1M'}; % cigar strings
aln1 = cigar2align(r, c)aln1 = ACG-ATGC ACGT-TGC AGGTAT-C
Reconstruct the same alignment to display positions in the aligned sequences that correspond to gaps in the reference sequence:
aln2 = cigar2align(r, c,'GapsInRef',true)
aln2 = ACG-ACTGC ACGT--TGC AGGTA-T-C
Reconstruct the alignment adding an offset padding of 5:
aln3 = cigar2align(r, c, 'start', [5 5 5], 'OffsetPad', true)
aln3 =
ACG-ATGC
ACGT-TGC
AGGTAT-CWhen cigar2align reconstructs the alignment, it does not display hard clipped positions (H) or soft clipped positions (S). Also, it does not consider soft clipped positions as start positions for aligned sequences.
[1] Li, H., Handsaker, B., Wysoker, A., Fennell, T., Ruan, J., Homer, N., Marth, G., Goncalo, A., and Durbin, R. (2009). The Sequence Alignment/Map format and SAMtools. Bioinformatics 25, 16, 2078–2079.
If your CIGAR information is captured in the Signature property of a BioMap object, you can use the getAlignment method to construct the alignment.
align2cigar | BioMap | getAlignment | getBaseCoverage | getCompactAlignment | multialignviewer

See how to analyze, visualize, and model biological data and systems using MathWorks products.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |