NAME

Bio::ViennaNGS::Fasta - Moose wrapper for Bio::DB::Fasta

SYNOPSIS

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);

DESCRIPTION

Bio::ViennaNGS::Fasta provides a Moose interface to Bio::DB::Fasta, spiced up with a few convenience methods for easy sequence data retrieval.

ATTRIBUTES

fasta (required)

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.

fastaids (auto-computed)

Arrary reference to the Fasta IDs found in the input file

primaryseqH (auto-computed)

Hash reference to Bio::PrimarySeq::Fasta objects whose keys are the Fasta IDs found in the input file

METHODS

stranded_subsequence

Title : stranded_subsequence

Usage : $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.

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.

Returns : A string.

has_sequid

Title : has_sequid

Usage : $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.

DEPENDENCIES

Bio::Perl >= 1.00690001
Bio::DB::Fasta
Moose
Carp
namespace::autoclean

SEE ALSO

Bio::ViennaNGS
Bio::DB::Fasta

AUTHOR

Michael T. Wolfinger, <michael@wolfinger.eu>

COPYRIGHT AND LICENSE

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.