NAME
Bio::Seq::PrimedSeq - A sequence and a pair of primers matching on it
SYNOPSIS
use Bio::Seq;use Bio::Seq::PrimedSeq;my $template = Bio::Seq->new( -seq => 'AGCTTTTCATTCTGACTGCAAC' );my $left = Bio::Seq->new( -seq => 'AGCT' );my $right = Bio::Seq->new( -seq => 'GTTGC' );my $primedseq = Bio::Seq::PrimedSeq->new(-seq => $template, # sequence object-left_primer => $left, # sequence or primer object-right_primer => $right # sequence or primer object);# Get the primers as Bio::SeqFeature::Primer objectsmy @primer_objects = $primedseq->get_primer();# Sequence object representing the PCR product, i.e. the section of the target# sequence contained between the primers (primers included)my $amplicon_seq = $primedseq->amplicon();print 'Got amplicon sequence: '.$amplicon_seq->seq."\n";# Amplicon should be: agctTTTCATTCTGACTgcaac
DESCRIPTION
This module was created to address the fact that a primer is more than a SeqFeature and that there is a need to represent the primer-sequence complex and the attributes that are associated with the complex.
A PrimedSeq object is initialized with a target sequence and two primers. The location of the primers on the target sequence is calculated if needed so that one can then get the PCR product, or amplicon sequence. From the PrimedSeq object you can also retrieve information about melting temperatures and what not on each of the primers and the amplicon. The Bio::Tools::Primer3 module uses PrimedSeq objects extensively.
Note that this module does not simulate PCR. It assumes that the primers will match in a single location on the target sequence and does not understand degenerate primers.
- •
-
Providing primers as sequence objects
If the primers are specified as sequence objects, e.g. Bio::PrimarySeq or Bio::Seq, they are first converted to Bio::SeqFeature::Primer objects. Their location on the target sequence is then calculated and added to the Bio::SeqFeature::Primer objects, which you can retrieve using the get_primer() method.
- •
-
Providing primers as primer objects
Because of the limitations of specifying primers as sequence objects, the recommended method is to provide Bio::SeqFeature::Primer objects. If you did not record the location of the primers in the primer object, it will be calculated.
Bio::Seq::PrimedSeq was initially started by Chad Matsalla, and later improved on by Rob Edwards.
RECIPES
- 1.
-
Run Primer3 to get PrimedSeq objects:
use Bio::SeqIO;use Bio::Tools::Run::Primer3;# Read a target sequences from a FASTA filemy $file = shift || die "Need a file to read";my $seqin = Bio::SeqIO->new(-file => $file);my $seq = $seqin->next_seq;# Use Primer3 to design some primersmy $primer3 = Bio::Tools::Run::Primer3->new(-seq => $seq);my $results = $primer3->run; # default parameters# Write all the results in a Genbank filemy $seqout = Bio::SeqIO->new(-file => ">primed_sequence.gbk",-format => 'genbank');while (my $primedseq = $results->next_primer) {$seqout->write_seq( $primedseq->annotated_seq );}
- 2.
-
Create a genbank file for a sequence and its cognate primers:
use Bio::SeqIO;use Bio::Seq::PrimedSeq;# Read a FASTA file that contains the target sequence and its two primersmy $file = shift || die "$0 <file>";my $seqin = Bio::SeqIO->new(-file => $file);my ($template, $leftprimer, $rightprimer) =($seqin->next_seq, $seqin->next_seq, $seqin->next_seq);# Set up a PrimedSeq objectmy $primedseq = Bio::Seq::PrimedSeq->new(-seq => $template,-left_primer => $leftprimer,-right_primer => $rightprimer);# Write the sequences in an output Genbank filemy $seqout = Bio::SeqIO->new(-file => ">primed_sequence.gbk",-format => 'genbank');$seqout->write_seq($primedseq->annotated_sequence);
FEEDBACK
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
AUTHOR
Rob Edwards, [email protected]
Based on a module written by Chad Matsalla, [email protected]
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : new()Usage : my $primedseq = Bio::SeqFeature::Primer->new(-seq => $sequence,-left_primer => $left_primer,-right_primer => $right_primer);Function: Construct a primed sequence.Returns : A Bio::Seq::PrimedSeq objectArgs : -seq => a Bio::Seq object (required)-left_primer => a Bio::SeqFeature::Primer or sequence object (required)-right_primer => a Bio::SeqFeature::Primer or sequence object (required)If you pass a sequence object to specify a primer, it will be used toconstruct a Bio::SeqFeature::Primer that you can retrieve with theL<get_primer> method.Many other parameters can be included including all of the outputparameters from the primer3 program (see L<Bio::Tools::Primer3>). Atthe moment these parameters will simply be stored and do anything.
get_primer
Title : get_primer();Usage : my @primers = $primedseq->get_primer();ormy $primer = $primedseq->get_primer('-left_primer');Function: Get the primers associated with the PrimedSeq object.Returns : A Bio::SeqFeature::Primer objectArgs : For the left primer, use: l, left, left_primer or -left_primerFor the right primer, use: r, right, right_primer or -right_primerFor both primers [default], use: b, both, both_primers or -both_primers
annotated_sequence
Title : annotated_sequenceUsage : my $annotated_sequence_object = $primedseq->annotate_sequence();Function: Get an annotated sequence object containing the left and rightprimersReturns : An annotated sequence object or 0 if not defined.Args :Note : Use this method to return a sequence object that you can writeout (e.g. in GenBank format). See the example above.
amplicon
Title : ampliconUsage : my $amplicon = $primedseq->amplicon();Function: Retrieve the amplicon as a sequence object. The amplicon sequnce isonly the section of the target sequence between the primer matches(primers included).Returns : A Bio::Seq object. To get the sequence use $amplicon->seqArgs : NoneNote :
seq
Title : seqUsage : my $seqobj = $primedseq->seq();Function: Retrieve the target sequence as a sequence objectReturns : A seq object. To get the sequence use $seqobj->seqArgs : NoneNote :
_place_primers
Title : _place_primersUsage : $self->_place_primers();Function: An internal method to place the primers on the sequence andset up the ranges of the sequencesReturns : NothingArgs : NoneNote : Internal use only