.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Bio::Graphics::Browser2::PadAlignment 3pm" .TH Bio::Graphics::Browser2::PadAlignment 3pm "2018-10-03" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::Graphics::Browser2::PadAlignment \- Insert pads into a multiple alignment .SH "VERSION (CVS-info)" .IX Header "VERSION (CVS-info)" .Vb 4 \& $RCSfile: PadAlignment.pm,v $ \& $Revision$ \& $Author: lstein $ \& $Date: 2008\-09\-09 20:53:36 $ .Ve .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Bio::Graphics::Browser2::PadAlignment; \& \& my @dnas = ( \& dna1 =>\*(AqFFFFgatcGATCgatcGATCgatcGATCgatcGBATCgatcGATCatcGATCgatcGATCgatcGATCgatcGATgatcGATCgatcNNNNGATC\*(Aq, \& dna2 =>\*(AqFFgatcGATCGATCgatcNNGATCgatcGATCgatcGATCgatcGATCgatcGATCtcGATBCgatcGATCatcGATCgatcNNNNGATCFFFF\*(Aq, \& dna3 =>\*(AqFFFFgatcGATCgatcGATCgatcGATCgatcBBBGATCgatcGATCatcGATCBgatcGATCgatcGATCgatcGATgatcGATCgatcNNNNGATCFF\*(Aq, \& dna4 =>\*(AqZZFFFFgatcGATCgatcGATCgatcGATCgatc\*(Aq, \& dna5 =>\*(AqATBGGATtcttttttt\*(Aq, \& ); \& \& # target st en tst ten \& my @alignments = ([ \*(Aqdna2\*(Aq, 4, 11, 2, 9 ], \& [ \*(Aqdna2\*(Aq, 16, 23, 10, 17 ], \& [ \*(Aqdna2\*(Aq, 24, 32, 20, 28 ], \& [ \*(Aqdna2\*(Aq, 34, 44, 29, 39 ], \& [ \*(Aqdna2\*(Aq, 45, 59, 41, 55 ], \& [ \*(Aqdna2\*(Aq, 62, 66, 56, 60 ], \& [ \*(Aqdna2\*(Aq, 67, 74, 62, 69 ], \& [ \*(Aqdna2\*(Aq, 76, 86, 71, 81 ], \& [ \*(Aqdna2\*(Aq, 91, 94, 86, 89 ], \& \& [ \*(Aqdna3\*(Aq, 4, 31, 4, 31 ], \& [ \*(Aqdna3\*(Aq, 33, 33, 34, 34 ], \& [ \*(Aqdna3\*(Aq, 34, 51, 36, 53 ], \& [ \*(Aqdna3\*(Aq, 52, 86, 55, 89 ], \& [ \*(Aqdna3\*(Aq, 91, 94, 94, 97 ], \& \& [ \*(Aqdna4\*(Aq, 0, 31, 2, 33 ], \& \& [ \*(Aqdna5\*(Aq, 17, 18, 0, 1 ], \& [ \*(Aqdna5\*(Aq, 41, 43, 4, 6 ], \& [ \*(Aqdna5\*(Aq, 85, 86, 7, 8 ], \& ); \& \& \& my $align = Bio::Graphics::Browser2::PadAlignment\->new(\e@dnas,\e@alignments); \& \& my @padded = $align\->padded_sequences; \& print join "\en",@padded,"\en"; \& # ..FFFFgatcGATCgatcGATCgatc\-\-GATCgatcG\-B\-ATCgatcGATC\-atcGATC\-gatcGATCgatcGAT\-CgatcGATgatcGATCgatcNNNNGATC.... \& # ....FFgatcGATC\-\-\-\-GATCgatcNNGATCgatcG\-\-\-ATCgatcGATCgatcGATC\-gatcGATC\-\-tcGATBCgatcGATCatcGATCgatcNNNNGATCFFFF \& # ..FFFFgatcGATCgatcGATCgatc\-\-GATCgatcBBBGATCgatcGATC\-atcGATCBgatcGATCgatcGAT\-CgatcGATgatcGATCgatcNNNNGATCFF.. \& # ZZFFFFgatcGATCgatcGATCgatc\-\-GATCgatc........................................................................ \& # ...................AT\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-BG\-\-\-\-\-\-\-GAT\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-tcttttttt..... \& \& my $pretty = $align\->alignment; \& print $pretty,"\en"; \& # dna1 1 ..FFFFgatc GATCgatcGA TCgatc\-\-GA TCgatcG\-B\- ATCgatcGAT C\-atcGATC\- gatcGATCga tcGAT\-Cgat \& # dna2 1 ....FFgatc GATC\-\-\-\-GA TCgatcNNGA TCgatcG\-\-\- ATCgatcGAT CgatcGATC\- gatcGATC\-\- tcGATBCgat \& # dna3 1 ..FFFFgatc GATCgatcGA TCgatc\-\-GA TCgatcBBBG ATCgatcGAT C\-atcGATCB gatcGATCga tcGAT\-Cgat \& # dna4 1 ZZFFFFgatc GATCgatcGA TCgatc\-\-GA TCgatc.... .......... .......... .......... .......... \& # dna5 1 .......... .........A T\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\- \-\-\-\-\-BGGAT \-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\- \& \& # dna1 72 cGATgatcGA TCgatcNNNN GATC.... \& # dna2 67 cGATCatcGA TCgatcNNNN GATCFFFF \& # dna3 75 cGATgatcGA TCgatcNNNN GATCFF.. \& # dna4 35 .......... .......... ........ \& # dna5 8 \-\-\-\-\-\-\-\-\-\- \-\-\-\-tctttt ttt..... .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a utility module for pretty-printing the type of alignment that comes out of gbrowse, namely a multiple alignment in which each target is aligned to a reference genome without explicit pads or other spaces. .PP For speed and ease of use, the module does not use form Bio::SeqI objects, but raw strings and alignment data structures. This may change. .PP This module does \fBnot\fR perform multiple alignments! It merely pretty-prints them! .SS "\s-1METHODS\s0" .IX Subsection "METHODS" This section describes the methods used by this class. .ie n .IP "$aligner = Bio::Graphics::Browser2::PadAlignment\->new(\e@sequences,\e@alignments)" 4 .el .IP "\f(CW$aligner\fR = Bio::Graphics::Browser2::PadAlignment\->new(\e@sequences,\e@alignments)" 4 .IX Item "$aligner = Bio::Graphics::Browser2::PadAlignment->new(@sequences,@alignments)" Create a new aligner. The two arguments are \e@sequences, an array ref to the list of sequences to be aligned, and \e@alignments, an array ref describing how the sequences are to be aligned. .Sp \&\e@sequences should have the following structure: .Sp .Vb 3 \& [ name1 => $sequence1, \& name2 => $sequence2, \& name3 => $sequence3 ] .Ve .Sp The sequences will be displayed in top to bottom order in the order provided. The first sequence in the list is special because it is the reference sequence. All alignments are relative to it. .Sp \&\e@alignments should have the following structure: .Sp .Vb 4 \& [ [ target1, $start1, $end1, $tstart1, $tend1 ], \& [ target1, $start2, $end2, $tstart2, $tend2 ], \& ... \& ] .Ve .Sp Each element of \f(CW@alignments\fR is an arrayref with five elements. The first element is the name of the target sequence, which must be one of the named sequences given in \f(CW@sequences\fR. The second and third elements are the start and stop position of the aligned target segment relative to the reference sequence, \*(L"name1\*(R" in the example given above. The fourth and fifth elements are the start and stop position of the aligned target segment in the coordinate space of the target. .Sp Example: .Sp .Vb 3 \& @dnas = (\*(Aqdna1\*(Aq => \*(Aqccccccaaaaaatttt\*(Aq, \& \*(Aqdna2\*(Aq => \*(Aqaaaaaa\*(Aq); \& @alignment = ( [\*(Aqdna2\*(Aq, 6, 11, 0, 5 ]); .Ve .Sp Positions 0 to 5 of \*(L"dna2\*(R" align to positions 6\-11 of \*(L"dna1\*(R". .Sp Note that sequence positions are zero based. This may change. .ie n .IP "@lines = $aligner\->padded_sequences" 4 .el .IP "\f(CW@lines\fR = \f(CW$aligner\fR\->padded_sequences" 4 .IX Item "@lines = $aligner->padded_sequences" This inserts pads into the sequences and returns them as a list of strings in the order specified in \fInew()\fR. In a scalar context, this method will return a hashref in which the keys are the sequence names and the values are their padded strings. .ie n .IP "$map = $aligner\->gap_map" 4 .el .IP "\f(CW$map\fR = \f(CW$aligner\fR\->gap_map" 4 .IX Item "$map = $aligner->gap_map" This returns an arrayref indicating the position of each base in the gapped reference sequence. The indexes are base positions, and the element values are their positions in the reference sequence as returned by \fIpadded_sequences()\fR. .Sp Note that the gap map only provides coordinate mapping for the reference sequence. For an alternative implementation that provides gap maps for each of the targets (at the cost of speed and memory efficiency) see the section after _\|_END_\|_ in the source file for this module. .ie n .IP "$align_string = $aligner\->alignment(\e%origins [,\e%options])" 4 .el .IP "\f(CW$align_string\fR = \f(CW$aligner\fR\->alignment(\e%origins [,\e%options])" 4 .IX Item "$align_string = $aligner->alignment(%origins [,%options])" This method returns a pretty-printed string of the aligned sequences. You may provide a hashref of sequence origins in order to control the numbers printed next to each line of the alignment. The keys of the \&\f(CW%origins\fR hashref are the names of the sequences, and the values are the coordinate to be assigned to the first base of the sequence. Use a negative number if you wish to indicate that the sequence has been reverse complemented (the negative number should indicate the coordinate of the first base in the provided sequence). .Sp An optional second argument, if present, contains a hash reference to a set of option=>value pairs. Three options are recognized: .Sp .Vb 8 \& show_mismatches 0|1 if true, highlight mismatches in pink \& show_matches 0|1 if true, hightligt matches in yellow \& color_code_proteins 0|1 if true, highlight amino acids thus: \& Acidic amino acids in red \& Basic amino acids in blue \& Hydrophobic amino acids in grey \& Polar amino acids in yellow \& flip 0|1 if true, reverse complement the whole alignment .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Bio::Graphics::Panel, Bio::Graphics::Glyph, Bio::Graphics::Feature, Bio::Graphics::FeatureFile, Bio::Graphics::Browser, Bio::Graphics::Browser2::Plugin .SH "AUTHOR" .IX Header "AUTHOR" Lincoln Stein . .PP Copyright (c) 2002 Cold Spring Harbor Laboratory .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See \s-1DISCLAIMER\s0.txt for disclaimers of warranty.