Bio::Index::Qual(3pm)
π Bio::Index::Qual β the manual, but make it cute π
okay so bestie, welcome to Bio::Index::Qual (3pm), the interface for indexing (multiple) fasta qual files. yes it's a Perl module, yes it's iconic, and yes we're gonna get you through every single line of it together. grab a boba, we're doing this π§β¨
β¨ NAME β¨
Bio::Index::Qual β literally the Interface for indexing (multiple) fasta qual files. that's the whole vibe. periodt. π
πΈ SYNOPSIS πΈ
here's the full code for making an index for several qual files, no cap:
# Complete code for making an index for several
# qual files
use Bio::Index::Qual;
use strict;
my $Index_File_Name = shift;
my $inx = Bio::Index::Qual->new(
'-filename' => $Index_File_Name,
'-write_flag' => 1);
$inx->make_index(@ARGV);
and now the part where you print out several sequences present in the index, in Qual format π¦:
# Print out several sequences present in the index
# in Qual format
use Bio::Index::Qual;
use strict;
my $Index_File_Name = shift;
my $inx = Bio::Index::Qual->new('-filename' => $Index_File_Name);
my $out = Bio::SeqIO->new('-format' => 'qual','-fh' => \*STDOUT);
foreach my $id (@ARGV) {
my $seq = $inx->fetch($id); # Returns Bio::Seq object
$out->write_seq($seq);
}
or, alternatively (the lazy-girl route, we respect it) π:
# or, alternatively
my $id;
my $seq = $inx->get_Seq_by_id($id); #identical to fetch
π DESCRIPTION π
so it inherits functions for managing dbm files from Bio::Index::Abstract.pm, and it provides the basic funtionality for indexing qual files, and retrieving the sequence from them. (yes the original says "funtionality", we are preserving it, it's part of the lore now.) for best results use strict. always. π
Bio::Index::Qual supports the Bio::DB::BioSeqI interface, meaning it can be used as a Sequence database for other parts of bioperl. main character energy tbh π
Additional example code is available in scripts/index. go peek, it's giving tutorial. π
heads up bestie: note that by default the key for the sequence will be the first continuous string after the>in the qual header. if you want to use a specific substring of the qual header you must use theid_parser()method. no shortcuts, okay?
You can also set or customize the unique key used to retrieve by writing your own function and calling the id_parser() method. For example:
$inx->id_parser(\&get_id);
# make the index
$inx->make_index($file_name);
# here is where the retrieval key is specified
sub get_id {
my $line = shift;
$line =~ /^(\d+)/;
$1;
}
see? you write it, you own it. slay. β¨
π¬ FEED_BACK π¬
π Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. so like, pls send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. fr fr π«Ά
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
π Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. (not the DMs bestie, the group chat.) Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. π
π Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
π AUTHOR - James Gilbert, Mark Johnson π
Email - jgrg@sanger.ac.uk, johnsonm-at-gmail-dot-com
(the legends themselves. we stan. π)
π APPENDIX π
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _. so if it starts with an underscore, mind your business, that's internal π
π§ _file_format
- Title β
_file_format - Function β The file format for this package, which is needed by the SeqIO system when reading the sequence.
- Returns β
'qual'
ποΈ _index_file
- Title β
_index_file - Usage β
$index->_index_file( $file_name, $i ) - Function β Specialist function to index QUAL format files. Is provided with a filename and an integer by
make_indexin its SUPER class. - Example β
- Returns β
- Args β
(yeah the Example, Returns and Args are empty in the original too. it's minimalism. it's a vibe. π)
πͺ id_parser
- Title β
id_parser - Usage β
$index->id_parser( CODE ) - Function β Stores or returns the code used by
record_idto parse the ID for record from a string. Useful for (for instance) specifying a different parser for different flavours of Qual file. Returns\&default_id_parser(see below) if not set. If you supply your ownid_parsersubroutine, then it should expect a qual description line. An entry will be added to the index for each string in the list returned. - Example β
$index->id_parser( \&my_id_parser ) - Returns β ref to CODE if called without arguments
- Args β CODE
π default_id_parser
- Title β
default_id_parser - Usage β
$id = default_id_parser( $header ) - Function β The default Qual ID parser for
Qual.pm. Returns$1from applying the regexp/^>\s*(\S+)/to$header. - Returns β ID string
- Args β a qual header line string
and that's the whole page, bestie!! every option, every method, every email, every link, all of it, preserved with love π
this was perl v5.32.1, dated 2021-08-15, and it's the Bio::Index::Qual(3pm) page β thanks for reading my little rewrite, mwah π«Άβ¨
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms