NAME

CracTools::SAMReader - An easy to use tool to read files in SAM format.

VERSION

version 1.031

SYNOPSIS

use CracTools::SAMReader;

# Creating the reader
my $sam_reader = CracTools::SAMreader->new($sam,'CRAC');

# Get an iterator to go through the SAM file in a linear way
my $it = $sam_reader->iterator();

# Iterate on lines and explore CRAC special fields of SAM
while(my $line = $it->()) {
  if(defined $line->events('Junction') && $line->isClassified('normal')) {
    my @junctions = @{$line->events('Junction')};
    foreach my $junction (@junctions) {
      print "Foud Junction : [type : $junction->{type}, loc : $junction->{loc}, gap : $junction->{gap}]\n";
    } 
  }
}

DESCRIPTION

Reader for SAM format, including CRAC special fields.

METHODS

new

Arg [1] : String - SAM file
Arg [2] : (Optional) String - SAM type
          - CRAC
          - CRAC_EMT

Example     : $reader = CracTools::SAMreader->new('file.sam','CRAC');
Description : Create a new reader obect
ReturnType  : CracTools::SAMreader
Exceptions  : none

iterator

Example     : my $it = $sam_reader->iterator();
              while(my $line = $it->()) {
                print $line->seq,"\n";
              }
Description : Create an iterator to go throud each lines of the file
ReturnType  : Iterator on CracTools::SAMline
Exceptions  : none

iteratorFile

Arg [1] : (Optional) String - options (IGNORE_HEADERS,..)

Example     : my $it_f = $sam_reader->iteratorFile();
              while(my ($line,$line_number) = $it->()) {
                print $line,"\n";
              }
Description : Create an iterator to go throud each lines of the file
ReturnType  : Iterator on Array (String,Int) where the <String> is the
              line, and <Int> the line number.
Exceptions  : none

GETTERS AND SETTERS

Description : Getter/setter for attribute header
ReturnType  : none
Exceptions  : none

refSeqLength

Description : Return the length of the reference sequence given in argument
ReturnType  : Integer

commandLine

Description : Return crac command line defined in SAM's header
ReturnType  : String

getCracArgumentValue

Description : Retrun the value of the specified argument in crac command line

hasCracOption

Description : Return true if crac command line has specified a certain option

PRIVATE METHODS

init (private)

Description : Initialization method
ReturnType  : none
Exceptions  : none

AUTHORS

  • Nicolas PHILIPPE <nicolas.philippe@inserm.fr>

  • Jérôme AUDOUX <jaudoux@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2014 by IRB/INSERM (Institut de Recherche en Biothérapie / Institut National de la Santé et de la Recherche Médicale).

This is free software, licensed under:

CeCILL FREE SOFTWARE LICENSE AGREEMENT, Version 2.1 dated 2013-06-21