Bio::D...::Query(3pm)
π NAME π
Bio::DB::Bam::Query β it's the whole object representing the query portion of a BAM/SAM alignment bestie, like this manual page is Bio::D...::Query(3pm) from the User Contributed Perl Documentation, and it's lowkey iconic β¨
π¦ SYNOPSIS π¦
okay so picture this: you've got an alignment you pulled out of a Bio::DB::Sam database, right? and then you do:
my $query = $alignment->query;
my $name = $query->display_name;
my $start = $query->start;
my $end = $query->end;
my $dna = $query->dna; # dna string
my $seq = $query->seq; # Bio::PrimarySeq object
my @scores = $query->qscore; # quality score
that's it. that's the vibe. no cap π
πΈ DESCRIPTION πΈ
so this is a simple Bio::SeqFeatureI object and it represents the query part of a SAM alignment. that's the whole thing. she's simple, she's focused, she knows her lane π
π«Ά Methods
$seqid = $query->seq_idβ the name of the read. that's it, that's her name π$name = $query->nameβ the read name (which is the same asseq_idin this case, okurrr).$name = $query->display_nameβ the readdisplay_name, and yeah, also the same asseq_idin this case. three names, one girl π$tag = $query->primary_tagβ the string"match". that's literally all it says.$tag = $query->source_tagβ the string"sam/bam". yeah, she tells you where she came from π$start = $query->startβ the start of the match in read coordinates.$end = $query->endβ the end of the match in read coordinates.$len = $query->lengthβ the length of the read β¨$seq = $query->seqβ aBio::PrimarySeqrepresenting the read sequence in REFERENCE orientation. not the other orientation. the REFERENCE one. important π¨$scores = $query->qscoreβ the read quality scores π watch the context tho, because it changes EVERYTHING:- in a list context: a list of integers equal in length to the read sequence length
- in a scalar context: an array ref
- and either way, girl, the qscores are in REFERENCE sequence orientation.
$dna = $query->dnaβ the DNA string, in reference sequence orientation π§¬$strand = $query->strandβ so if the query was reversed to align it, you get-1. otherwise you get+1. that's the whole tea π$seq = $query->subseq($start,$end)β returns aBio::PrimarySeqobject representing the requested subsequence on the read. give her a start and an end and she gives you a seq π
π SEE ALSO π
go read these too bestie, they're the friend group: Bio::Perl, Bio::DB::Sam, Bio::DB::Bam::Alignment, Bio::DB::Bam::Constants π
π AUTHOR π
Lincoln Stein <lincoln.stein@oicr.on.ca>. <lincoln.stein@bmail.com>
Copyright (c) 2009-2015 Ontario Institute for Cancer Research.
This package and its accompanying libraries are free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0, the Apache 2.0 License, or the GNU General Public License (version 1 or higher). Refer to LICENSE for the full license text. π«Ά
and that's the whole page bestie, no crumbs left π this wasperl v5.42.3, dated2026-08-19, and it slayed fr fr πβ¨π
π¦ where this page comes from
- ubuntu stonking: libbio-samtools-perl 1.43-5build2 Β· GPL-1.0-or-later OR Artistic-2.0 OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms