CracTools::SAMReader - An easy to use tool to read files in SAM format.
version 1.251
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"; } } }
Reader for SAM format, including CRAC special fields.
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 object ReturnType : CracTools::SAMreader Exceptions : none
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
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
Description : Getter/setter for attribute header ReturnType : none Exceptions : none
Description : Return the length of the reference sequence given in argument ReturnType : Integer
Return a hashref with all reference sequence names and length.
my $refseq_lengths = $sam_reader->allRefSeqLength();
The return value is :
{ refseq_name => length, refseq_name => lenght, ... }
Description : Return crac command line defined in SAM's header ReturnType : String
Description : Retrun the value of the specified argument in crac command line
Description : Return true if crac command line has specified a certain option
Description : Return CRAC version number
Description : Initialization method ReturnType : none Exceptions : none
Nicolas PHILIPPE <nphilippe.research@gmail.com>
Jérôme AUDOUX <jaudoux@cpan.org>
Sacha BEAUMEUNIER <sacha.beaumeunier@gmail.com>
This software is Copyright (c) 2017 by IRMB/INSERM (Institute for Regenerative Medecine and Biotherapy / Institut National de la Santé et de la Recherche Médicale) and AxLR/SATT (Lanquedoc Roussilon / Societe d'Acceleration de Transfert de Technologie).
This is free software, licensed under:
The GNU Affero General Public License, Version 3, November 2007
To install CracTools, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CracTools
CPAN shell
perl -MCPAN -e shell install CracTools
For more information on module installation, please visit the detailed CPAN module installation guide.