Bio::ClusterIO(3pm)

πŸ“¦
version 1.7.3 Β· 2 versions
  • 1.7.3 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.7.3 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Bio::ClusterIO πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation and it's all about Bio::ClusterIO β€” your girl for cluster formats 🧬✨


✨ NAME ✨

Bio::ClusterIO β€” Handler for Cluster Formats πŸŽ€


🌸 SYNOPSIS 🌸

#NB: This example is unigene specific

use Bio::ClusterIO;

$stream  = Bio::ClusterIO->new('-file' => "Hs.data",
                               '-format' => "unigene");
# note: we quote -format to keep older perl's from complaining.

while ( my $in = $stream->next_cluster() ) {
    print $in->unigene_id() . "\n";
    while ( my $sequence = $in->next_seq() ) {
        print $sequence->accession_number() . "\n";
    }
}
# Parsing errors are printed to STDERR.

no cap, that comment is telling you the truth: parsing errors get printed to STDERR πŸ‘€


πŸ¦‹ DESCRIPTION πŸ¦‹

So ClusterIO links up with the ClusterIO format module and they read all kinds of cluster formats together β€” like NCBI UniGene and friends. it's giving dynamic duo energy fr fr πŸ’…


πŸ‘‘ CONSTRUCTORS πŸ‘‘

πŸ’œ Bio::ClusterIO->new()

$str = Bio::ClusterIO->new(-file => 'filename',
                           -format=>$format);

The new() class method is the one that makes you a brand new Bio::ClusterIO object ✨ and once you've got it, you can use it to pull out cluster objects or print them. new() is taking these parameters, bestie:

  • -file β€” a file path that's gonna be opened for reading πŸ“‚
  • -format β€” you tell it the format of the file here. supported formats include:
unigene              *.data  UniGene build files.
dbsnp                *.xml   dbSNP XML files

If you don't specify a format but you do give a filename, the module will try to deduce it from the filename πŸ” and if that doesn't work out? it just assumes the main UniGene build format. lowkey forgiving, we love that πŸ™ˆ

The format name is case insensitive. 'UNIGENE', 'UniGene' and 'unigene' all work, and so do dbSNP, dbsnp, and DBSNP β€” yes bestie, all of them, periodt πŸ’…


🌈 OBJECT METHODS 🌈

Detailed summaries are down below, but here's the main character lineup:

⭐ $cluster = $str->next_cluster()

Grabs the next cluster from the stream. that's it, that's the job 🫢

⭐ TIEHANDLE(), READLINE(), PRINT()

okay so these ones are still hanging around in here because they were in the SeqIO module β€” feedback appreciated, fr fr. Over there they provide the tie interface. peep perltie if you want the whole lore πŸ‘€


πŸ’Œ FEEDBACK πŸ’Œ

πŸŽ€ Mailing Lists

User feedback is, like, integral to how this and every other Bioperl module grows and evolves 🌱 so send your comments and suggestions, preferably to one of the Bioperl mailing lists. your participation is much appreciated bestie!!

bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

🩷 Support

Please send usage questions and support issues to the mailing list:

bioperl-l@bioperl.org

β€” rather than sliding into the module maintainer's DMs directly πŸ™ˆ so many experienced and responsive experts will be able to look at your problem and fix it fast. and 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 so we can keep track of the bugs and their resolutions. Bug reports can be submitted via the web:

https://github.com/bioperl/bioperl-live/issues

πŸ’« AUTHOR - Andrew Macgregor πŸ’«

Email andrew@anatomy.otago.ac.nz πŸ“§


πŸ“– APPENDIX πŸ“–

the rest of this doc spills the details on each object method. heads up: internal methods usually start with a _ πŸ‘‘

πŸ”₯ new

Title   : new
Usage   : Bio::ClusterIO->new(-file => $filename, -format => 'format')
Function: Returns a new cluster stream
Returns : A Bio::ClusterIO::Handler initialised with the appropriate format
Args    : -file => $filename
          -format => format

πŸ”₯ format

Title   : format
Usage   : $format = $stream->format()
Function: Get the cluster format
Returns : cluster format
Args    : none

πŸ”₯ next_cluster

Title   : next_cluster
Usage   : $cluster = $stream->next_cluster()
Function: Reads the next cluster object from the stream and returns it.
Returns : a L<Bio::ClusterI> compliant object
Args    : none

πŸ”₯ cluster_factory

Title   : cluster_factory
Usage   : $obj->cluster_factory($newval)
Function: Get/set the object factory to use for creating the cluster
          objects.
Example :
Returns : a L<Bio::Factory::ObjectFactoryI> compliant object
Args    : on set, new value (a L<Bio::Factory::ObjectFactoryI>
          compliant object or undef, optional)

πŸ”₯ object_factory

Title   : object_factory
Usage   : $obj->object_factory($newval)
Function: This is an alias to cluster_factory with a more generic name.
Example :
Returns : a L<Bio::Factory::ObjectFactoryI> compliant object
Args    : on set, new value (a L<Bio::Factory::ObjectFactoryI>
          compliant object or undef, optional)

πŸ”₯ _load_format_module

Title   : _load_format_module
Usage   : *INTERNAL ClusterIO stuff*
Function: Loads up (like use) a module at run time on demand
Example :
Returns :
Args    :

πŸ”₯ _guess_format

Title   : _guess_format
Usage   : $obj->_guess_format($filename)
Function: guess format based on file suffix
Example :
Returns : guessed format of filename (lower case)
Args    :
Notes   : formats that _filehandle() will guess include unigene and dbsnp

and that's a wrap, bestie!! πŸŽ€ this whole page is running on perl v5.34.0 and it was dated 2022-03-27, so go forth and parse those clusters, you absolute icon πŸ‘‘πŸ’–

πŸ“¦ where this page comes from