| 1 |
|
| 2 |
=head1 LICENSE |
| 3 |
|
| 4 |
Copyright [2015-2024] EMBL-European Bioinformatics Institute |
| 5 |
|
| 6 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 |
you may not use this file except in compliance with the License. |
| 8 |
You may obtain a copy of the License at |
| 9 |
|
| 10 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 11 |
|
| 12 |
Unless required by applicable law or agreed to in writing, software |
| 13 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 14 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 |
See the License for the specific language governing permissions and |
| 16 |
limitations under the License. |
| 17 |
|
| 18 |
=head1 NAME |
| 19 |
|
| 20 |
Bio::DB::HTS::Pileup -- Object passed to pileup() callback |
| 21 |
|
| 22 |
=head1 SYNOPSIS |
| 23 |
|
| 24 |
See L<Bio::DB::HTS/The generic fetch() and pileup() methods> for how |
| 25 |
this object is passed to pileup callbacks. |
| 26 |
|
| 27 |
=head1 DESCRIPTION |
| 28 |
|
| 29 |
A Bio::DB::HTS::Pileup object (or a Bio::DB::HTS::PileupWrapper |
| 30 |
object) is passed to the callback passed to the Bio::DB::HTS->pileup() |
| 31 |
method for each column in a sequence alignment. The only difference |
| 32 |
between the two is that the latter returns the more convenient |
| 33 |
Bio::DB::HTS::AlignWrapper objects in response to the alignment() |
| 34 |
method, at the cost of some performance loss. |
| 35 |
|
| 36 |
=head2 Methods |
| 37 |
|
| 38 |
=over 4 |
| 39 |
|
| 40 |
=item $alignment = $pileup->alignment |
| 41 |
|
| 42 |
Return the Bio::DB::HTS::Alignment or Bio::DB::HTS::AlignWrapper |
| 43 |
object representing the aligned read. |
| 44 |
|
| 45 |
=item $alignment = $pileup->b |
| 46 |
|
| 47 |
This method is an alias for alignment(). It is available for |
| 48 |
compatibility with the C API. |
| 49 |
|
| 50 |
=item $qpos = $pileup->qpos |
| 51 |
|
| 52 |
Return the position of this aligned column in read coordinates, using |
| 53 |
zero-based coordinates. |
| 54 |
|
| 55 |
=item $pos = $pileup->pos |
| 56 |
|
| 57 |
Return the position of this aligned column in read coordinates, using |
| 58 |
1-based coordinates. |
| 59 |
|
| 60 |
=item $indel = $pileup->indel |
| 61 |
|
| 62 |
If this column is an indel, return a positive integer for an insertion |
| 63 |
relative to the reference, a negative integer for a deletion relative |
| 64 |
to the reference, or 0 for no indel at this column. |
| 65 |
|
| 66 |
=item $is_del = $pileup->is_del |
| 67 |
|
| 68 |
True if the base on the padded read is a deletion. |
| 69 |
|
| 70 |
=item $level = $pileup->level |
| 71 |
|
| 72 |
If pileup() or fast_pileup() was invoked with the "keep_level" flag, |
| 73 |
then this method will return a positive integer indicating the level |
| 74 |
of the read in a printed multiple alignment. |
| 75 |
|
| 76 |
=item $pileup->is_head |
| 77 |
|
| 78 |
=item $pileup->is_tail |
| 79 |
|
| 80 |
These fields are defined in bam.h but their interpretation is obscure. |
| 81 |
|
| 82 |
=back |
| 83 |
|
| 84 |
=head1 AUTHOR |
| 85 |
|
| 86 |
Rishi Nag E<lt>[email protected]<gt> |
| 87 |
|
| 88 |
|
| 89 |
=head1 SEE ALSO |
| 90 |
|
| 91 |
L<Bio::Perl>, L<Bio::DB::HTS>, L<Bio::DB::HTS::Alignment>, L<Bio::DB::HTS::Constants> |
| 92 |
|
| 93 |
=cut |
| 94 |
|
| 95 |
# documentation only |
| 96 |
|
| 97 |
package Bio::DB::HTS::Pileup; |
| 98 |
|
| 99 |
use strict; |
| 100 |
use warnings; |
| 101 |
|
| 102 |
$Bio::DB::HTS::Pileup::VERSION = '3.02'; |
| 103 |
|
| 104 |
1; |