Bio::ViennaNGS::Fasta - Moose wrapper for Bio::DB::Fasta
use Bio::ViennaNGS::Fasta; my $f = Bio::ViennaNGS::Fasta->new(fasta => "data/foo.fa", ); # get all FASTA IDs my @ids = $f->fastaids; # get a reference to a hash of Bio::PrimarySeq::Fasta objects whose # keys are the Fasta IDs seen in the input file my $ps = $f->primaryseqH; # get the strand-specific genomic sequence for a certain Fasta ID my $id = "chr1"; my $start = 287; my $end = 1289; my $strand = "+"; my $seq = $f->stranded_subsequence($id,$start,$end,$strand);
Bio::ViennaNGS::Fasta provides a Moose interface to Bio::DB::Fasta, spiced up with a few convenience methods for easy sequence data retrieval.
Upcon object construction, this attribute expects an input fasta file, which is transparently coerced into a Bio::DB::Fasta object and hitherto available via the fasta attribute.
fasta
Arrary reference to the Fasta IDs found in the input file
Hash reference to Bio::PrimarySeq::Fasta objects whose keys are the Fasta IDs found in the input file
Title : stranded_subsequence
Usage : $obj->stranded_subsequence($id,$start,$end,$strand)
$obj->stranded_subsequence($id,$start,$end,$strand)
Function : Returns the DNA/RNA sequence for ID $id from $start to $end. Internally, sequence data is retrieved from $self->$primaryseqH HashRef to Bio::PrimarySeqI/Bio::PrimarySeq::Fasta objects.
$id
$start
$end
$self->$primaryseqH
Args : $id is the Fasta ID to retrieve sequence data from, $start and $end are (1-based) start and end coordinates of the requested interval, where $start must be <= $end, and $strand is 1 or -1 for [+] or [-] strand, respectively.
$strand
Returns : A string.
Title : has_sequid
Usage : $obj->has_seqid($id)
$obj->has_seqid($id)
Function : Checks whether the current object contains Fasta ID $id.
Args : $id if the Fasta ID to check for.
Returns : 1 if ID $id was found, 0 else.
Michael T. Wolfinger, <michael@wolfinger.eu>
Copyright (C) 2014-2017 by Michael T. Wolfinger
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
This software 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.
To install Bio::ViennaNGS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::ViennaNGS
CPAN shell
perl -MCPAN -e shell install Bio::ViennaNGS
For more information on module installation, please visit the detailed CPAN module installation guide.