The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

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

Jerome AUDOUX <jerome.audoux@etud.univ-montp2.fr>.

COPYRIGHT AND LICENSE

Copyright (C) 2012-2013 -- IRB/INSERM (Institut de Recherche en Biothérapie / Institut National de la Santé et de la Recherche Médicale) LIRMM/UM2 (Laboratoire d'Informatique, de Robotique et de Microélectronique de Montpellier / Université de Montpellier 2)

FRENCH

Ce fichier fait partie du Pipeline de traitement de données NGS de la plateforme ATGC labélisée par le GiS IBiSA.

Ce logiciel est régi par la licence CeCILL soumise au droit français et respectant les principes de diffusion des logiciels libres. Vous pouvez utiliser, modifier et/ou redistribuer ce programme sous les conditions de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA sur le site "http://www.cecill.info".

ENGLISH

This File is part of the NGS data processing Pipeline of the ATGC accredited by the IBiSA GiS.

This software is governed by the CeCILL license under French law and abiding by the rules of distribution of free software. You can use, modify and/ or redistribute the software under the terms of the CeCILL license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".