.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::Seq::PrimedSeq 3pm" .TH Bio::Seq::PrimedSeq 3pm "2020-10-28" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::Seq::PrimedSeq \- A sequence and a pair of primers matching on it .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Bio::Seq; \& use Bio::Seq::PrimedSeq; \& \& my $template = Bio::Seq\->new( \-seq => \*(AqAGCTTTTCATTCTGACTGCAAC\*(Aq ); \& my $left = Bio::Seq\->new( \-seq => \*(AqAGCT\*(Aq ); \& my $right = Bio::Seq\->new( \-seq => \*(AqGTTGC\*(Aq ); \& \& 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 objects \& my @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 \*(AqGot amplicon sequence: \*(Aq.$amplicon_seq\->seq."\en"; \& # Amplicon should be: agctTTTCATTCTGACTgcaac .Ve .SH "DESCRIPTION" .IX Header "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. .PP 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 \s-1PCR\s0 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. .PP Note that this module does not simulate \s-1PCR.\s0 It assumes that the primers will match in a single location on the target sequence and does not understand degenerate primers. .IP "\(bu" 4 Providing primers as sequence objects .Sp 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 \fBget_primer()\fR method. .IP "\(bu" 4 Providing primers as primer objects .Sp 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. .PP Bio::Seq::PrimedSeq was initially started by Chad Matsalla, and later improved on by Rob Edwards. .SH "RECIPES" .IX Header "RECIPES" .IP "1." 4 Run Primer3 to get PrimedSeq objects: .Sp .Vb 2 \& use Bio::SeqIO; \& use Bio::Tools::Run::Primer3; \& \& # Read a target sequences from a FASTA file \& my $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 primers \& my $primer3 = Bio::Tools::Run::Primer3\->new(\-seq => $seq); \& my $results = $primer3\->run; # default parameters \& \& # Write all the results in a Genbank file \& my $seqout = Bio::SeqIO\->new(\-file => ">primed_sequence.gbk", \& \-format => \*(Aqgenbank\*(Aq); \& while (my $primedseq = $results\->next_primer) { \& $seqout\->write_seq( $primedseq\->annotated_seq ); \& } .Ve .IP "2." 4 Create a genbank file for a sequence and its cognate primers: .Sp .Vb 2 \& use Bio::SeqIO; \& use Bio::Seq::PrimedSeq; \& \& # Read a FASTA file that contains the target sequence and its two primers \& my $file = shift || die "$0 "; \& my $seqin = Bio::SeqIO\->new(\-file => $file); \& my ($template, $leftprimer, $rightprimer) = \& ($seqin\->next_seq, $seqin\->next_seq, $seqin\->next_seq); \& \& # Set up a PrimedSeq object \& my $primedseq = Bio::Seq::PrimedSeq\->new(\-seq => $template, \& \-left_primer => $leftprimer, \& \-right_primer => $rightprimer); \& \& # Write the sequences in an output Genbank file \& my $seqout = Bio::SeqIO\->new(\-file => ">primed_sequence.gbk", \& \-format => \*(Aqgenbank\*(Aq); \& $seqout\->write_seq($primedseq\->annotated_sequence); .Ve .SH "FEEDBACK" .IX Header "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. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP 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. .SS "Reporting Bugs" .IX Subsection "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: .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHOR" .IX Header "AUTHOR" Rob Edwards, redwards@utmem.edu .PP Based on a module written by Chad Matsalla, bioinformatics1@dieselwurks.com .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SS "new" .IX Subsection "new" .Vb 11 \& 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 object \& Args : \-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 to \& construct a Bio::SeqFeature::Primer that you can retrieve with the \& L method. \& \& Many other parameters can be included including all of the output \& parameters from the primer3 program (see L). At \& the moment these parameters will simply be stored and do anything. .Ve .SS "get_primer" .IX Subsection "get_primer" .Vb 9 \& Title : get_primer(); \& Usage : my @primers = $primedseq\->get_primer(); \& or \& my $primer = $primedseq\->get_primer(\*(Aq\-left_primer\*(Aq); \& Function: Get the primers associated with the PrimedSeq object. \& Returns : A Bio::SeqFeature::Primer object \& Args : For the left primer, use: l, left, left_primer or \-left_primer \& For the right primer, use: r, right, right_primer or \-right_primer \& For both primers [default], use: b, both, both_primers or \-both_primers .Ve .SS "annotated_sequence" .IX Subsection "annotated_sequence" .Vb 8 \& Title : annotated_sequence \& Usage : my $annotated_sequence_object = $primedseq\->annotate_sequence(); \& Function: Get an annotated sequence object containing the left and right \& primers \& Returns : An annotated sequence object or 0 if not defined. \& Args : \& Note : Use this method to return a sequence object that you can write \& out (e.g. in GenBank format). See the example above. .Ve .SS "amplicon" .IX Subsection "amplicon" .Vb 8 \& Title : amplicon \& Usage : my $amplicon = $primedseq\->amplicon(); \& Function: Retrieve the amplicon as a sequence object. The amplicon sequnce is \& only the section of the target sequence between the primer matches \& (primers included). \& Returns : A Bio::Seq object. To get the sequence use $amplicon\->seq \& Args : None \& Note : .Ve .SS "seq" .IX Subsection "seq" .Vb 6 \& Title : seq \& Usage : my $seqobj = $primedseq\->seq(); \& Function: Retrieve the target sequence as a sequence object \& Returns : A seq object. To get the sequence use $seqobj\->seq \& Args : None \& Note : .Ve .SS "_place_primers" .IX Subsection "_place_primers" .Vb 7 \& Title : _place_primers \& Usage : $self\->_place_primers(); \& Function: An internal method to place the primers on the sequence and \& set up the ranges of the sequences \& Returns : Nothing \& Args : None \& Note : Internal use only .Ve