Ace::S...reList(3pm)
π Ace::Sequence::FeatureList β Lightweight Access to Features π
okay bestie, so this page is from the Ace::S...reList(3pm) corner of the User Contributed Perl Documentation, and it's literally the cutest little feature-tallying class you've ever met. let's get into it π¦
β¨ NAME β¨
Ace::Sequence::FeatureList β Lightweight Access to Features
like... it's giving "small class, big stats energy." π
πΈ SYNOPSIS πΈ
# get a megabase from the middle of chromosome I
$seq = Ace::Sequence->new(-name => 'CHROMOSOME_I,
-db => $db,
-offset => 3_000_000,
-length => 1_000_000);
# find out what's there
$list = $seq->feature_list;
# Scalar context: count all the features
$feature_count = $list->types;
# Array context: list all the feature types
@feature_types = $list->types;
# Scalar context, 1 argument. Count this type
$gene_cnt = $list->types('Predicted_gene');
print "There are $gene_cnt genes here.\n";
# Array context, 1 argument. Get list of subtypes
@subtypes = $list->types('Predicted_gene');
# Two arguments. Count type & subtype
$genefinder_cnt = $list->types('Predicted_gene','genefinder');
(yes bestie, the quote on 'CHROMOSOME_I, is exactly like that in the original β not me being sloppy, that's canon π)
π DESCRIPTION π
Ace::Sequence::FeatureList is a tiny lil class that hands you statistical information about sequence features. from it you can pull summary counts of the features and their types, all scoped to whatever region you picked out. it's the vibe check for your genome slice π₯
π OBJECT CREATION π
so likeβ¦ you will not ordinarily create an Ace::Sequence::FeatureList object directly. no ma'am. instead, objects get created for you when you call the feature_list() method on an Ace::Sequence object. that's the move. β¨
but if you're feeling like a main character and you do want to build an Ace::Sequence::FeatureList object directly? please consult the source code for the new() method, okay? iykyk π«Ά
π OBJECT METHODS π
there are literally only two methods in Ace::Sequence::FeatureList. short and iconic, we love her.
π« type()
this method has five distinct behaviors, depending on its context and how many parameters you feed it. usage should be intuitive, fr fr.
- scalar context, -none- arguments β total count of features in list
- array context, -none- arguments β list feature types (e.g.
"exon") - scalar context, type argument β count features of this type
- array context, type argument β list subtypes of this type
- -any- context, type,subtype arguments β count features of this type & subtype
for example, this code fragment will count the number of exons present on the list:
$exon_count = $list->type('exon');
this code fragment will count the number of exons found by "genefinder":
$predicted_exon_count = $list->type('exon','genefinder');
and this code fragment will print out all subtypes of "exon" and their counts:
for my $subtype ($list->type('exon')) {
print $subtype,"\t",$list->type('exon',$subtype),"\n";
}
no cap, that loop ate. π
π« asString()
print $list->asString;
this dumps the list out in tab-delimited format. the order of columns is type, subtype, count. clean, simple, obsessed.
π SEE ALSO π
Ace, Ace::Object, Ace::Sequence, Ace::Sequence::Feature, GFF
go read those next bestie, that's the whole homework list π
π AUTHOR π
Lincoln Stein <lstein@w3.org> with extensive help from Jean Thierry-Mieg <mieg@kaa.crbm.cnrs-mop.fr>
Copyright (c) 1999, Lincoln D. Stein
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty.
little reminder bestie: that's real legal text up there, not just vibes. free software, same terms as Perl itself, and DISCLAIMER.txt is where the warranty disclaimers live. don't skip it π«Ά
and that's the whole page, periodt. π β¨
sign-off time: this gorgeous thing is documented for perl v5.42.3, dated 2026-08-19, and the page header/footer call it Ace::S...reList(3pm). go forth and count your features, queen ππΈπ¦
π¦ where this page comes from
- ubuntu stonking: libace-perl 1.92-14build1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms