Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A parser for files in the SAM format created by the STAR aligner
Perl Perl6
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.



GenOO framework extension to read SAM files created by the STAR aligner. Include it in your script and ask GenOO SAM parser to use it.


The GenOO framework SAM parser avoids code that is unique to specific programs and makes no assumptions for the optional fields in a SAM file. This module is a plugin for the GenOO framework and provides the functionality for reading SAM files generated from the STAR aligner. The module has been created on top of the generic GenOO SAM parser and to use it just include it in your scripts and ask GenOO SAM parser to use it.


# Create a parser
my $file_parser = GenOO::Data::File::SAM->new(
    file          => 'file.sam',
    records_class => 'GenOOx::Data::File::SAMstar::Record'

# Loop on the records of the file
while (my $record = $file_parser->next_record) {
    # $record is now an instance of GenOOx::Data::File::SAMstar::Record.
    print $record->cigar."\n"; # name
    print $record->flag."\n"; # flag
    print $record->number_of_mappings."\n"; # new stuff not present by default in GenOO


  • Using CPAN - Easier
    1. If you have cpanm installed. cpanm GenOOx::Data::File::SAMstar.
    2. If you do not have cpanm. See here.
  • Using Git - Preferred so you may contribute
    1. Install git (directions).
    2. Install dependencies (listed below) from CPAN. How to install CPAN modules.
    3. Clone the GenOO repository on your machine git clone
    4. To verify that everything works cd path/to/your/clone/; prove -l t/*.t;.
    5. In the beginning of your perl script write the following use lib 'path/to/your/clone/lib/'.

Dependencies (maybe not exhaustive)

  • GenOO
  • Modern::Perl
  • Moose


Copyright (c) 2013 Emmanouil Maragkakis and Panagiotis Alexiou.


This library is free software and may be distributed under the same terms as perl itself.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of merchantability or fitness for a particular purpose.

Something went wrong with that request. Please try again.