Bio::S...rePair(3pm)

πŸ“¦
version 1.7.8 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Bio::SeqFeature::FeaturePair β€” the Bio::S...rePair(3pm) page, but make it cute

okay bestie, gather round, because this one is genuinely iconic. it's the Bio::SeqFeature::FeaturePair module, and it does exactly one thing but does it so well: it holds pair feature information, like, for example, blast hits. two features, one little container, main character energy. πŸŽ€


✨ SYNOPSIS ✨

my $feat  = Bio::SeqFeature::FeaturePair->new(
    -feature1 => $f1,
    -feature2 => $f2,
);

# Bio::SeqFeatureI methods can be used

my $start = $feat->start;
my $end   = $feat->end;

# Bio::FeaturePair methods can be used
my $hstart = $feat->hstart;
my $hend   = $feat->hend;

my $feature1 = $feat->feature1;  # returns feature1 object

like. look at it. it's giving effortless. πŸ¦‹


🌸 DESCRIPTION 🌸

so here's the vibe: this is a sequence feature object where the feature is itself a feature on another sequence. think of a blast hit β€” residues 1-40 of a protein sequence SW:HBA_HUMAN have hit to bases 100 - 220 on a genomic sequence HS120G22. πŸ’«

the way that works is: the genomic sequence coordinates get used to create one sequence feature $f1, and the protein coordinates get used to create feature $f2. then you just... make a FeaturePair object out of both of them. obsessed.

my $fp = Bio::SeqFeature::FeaturePair->new(
    -feature1 => $f1,   # genomic
    -feature2 => $f2,   # protein
);

this object can be used as a standard Bio::SeqFeatureI, in which case:

my $gstart = $fp->start  # returns start coord on feature1 - genomic seq.
my $gend   = $fp->end    # returns end coord on feature1.

in general, standard Bio::SeqFeatureI method calls return information in feature1. 🫢

data in the feature 2 object are generally obtained using the standard methods prefixed by h (for hit! β€” yes, that's the whole reason, it's so good):

my $pstart = $fp->hstart # returns start coord on feature2 = protein seq.
my $pend   = $fp->hend   # returns end coord on feature2.

if you wish to swap feature1 and feature2 around:

$feat->invert

so...

$feat->start # etc. returns data in $feature2 object
⚠️ no sub_SeqFeatures or tags can be stored in this object directly, bestie. any features or tags are expected to be stored in the contained objects feature1 and feature2. periodt. πŸ’…

πŸ’Œ CONTACT πŸ’Œ

Ewan Birney <birney@sanger.ac.uk>


πŸ“– APPENDIX πŸ“–

the rest of the documentation details each of the object methods. internal methods are usually preceded with a _ (iykyk). 🌈

🧚 new

  • Title : new
  • Usage :
  • Function : Constructor for this module. Accepts the following parameters:
    • -feature1 β€” Bio::SeqFeatureI-compliant object
    • -feature2 β€” Bio::SeqFeatureI-compliant object
    • -feature_factory β€” Bio::Factory::ObjectFactoryI compliant object to be used when feature1 and/or feature2 are accessed without explicitly set before. This is mostly useful for derived classes who want to set their preferred class for feature objects.
  • Example :
  • Returns :
  • Args : see above

πŸ’œ feature1

  • Title : feature1
  • Usage :
$f = $featpair->feature1
$featpair->feature1($feature)
  • Function : Get/set for the query feature
  • Returns : Bio::SeqFeatureI
  • Args : Bio::SeqFeatureI

πŸ’œ feature2

  • Title : feature2
  • Usage :
$f = $featpair->feature2
$featpair->feature2($feature)
  • Function : Get/set for the hit feature
  • Returns : Bio::SeqFeatureI
  • Args : Bio::SeqFeatureI

✨ start

  • Title : start
  • Usage :
$start = $featpair->start
$featpair->start(20)
  • Function : Get/set on the start coordinate of feature1
  • Returns : integer
  • Args : [optional] beginning of feature

✨ end

  • Title : end
  • Usage :
$end = $featpair->end
$featpair->end($end)
  • Function : get/set on the end coordinate of feature1
  • Returns : integer
  • Args : [optional] ending point of feature

πŸŽ€ strand

  • Title : strand
  • Usage :
$strand = $feat->strand()
$feat->strand($strand)
  • Function : get/set on strand information, being 1,-1 or 0
  • Returns : -1,1 or 0
  • Args : [optional] strand information to set

πŸŽ€ location

  • Title : location
  • Usage :
$location = $featpair->location
$featpair->location($location)
  • Function : Get/set location object (using feature1)
  • Returns : Bio::LocationI object
  • Args : [optional] LocationI to store

πŸ¦‹ score

  • Title : score
  • Usage :
$score = $feat->score()
$feat->score($score)
  • Function : get/set on score information
  • Returns : float
  • Args : none if get, the new value if set

πŸ¦‹ frame

  • Title : frame
  • Usage :
$frame = $feat->frame()
$feat->frame($frame)
  • Function : get/set on frame information
  • Returns : 0,1,2
  • Args : none if get, the new value if set

🌸 primary_tag

  • Title : primary_tag
  • Usage :
$ptag = $featpair->primary_tag
  • Function : get/set on the primary_tag of feature1
  • Returns : 0,1,2
  • Args : none if get, the new value if set

🌸 source_tag

  • Title : source_tag
  • Usage :
$tag = $feat->source_tag()
$feat->source_tag('genscan');
  • Function : Returns the source tag for a feature, eg, 'genscan'
  • Returns : a string
  • Args : none

🌈 seqname

  • Title : seqname
  • Usage :
$obj->seq_id($newval)
  • Function : There are many cases when you make a feature that you do know the sequence name, but do not know its actual sequence. This is an attribute such that you can store the seqname.

This attribute should *not* be used in GFF dumping, as that should come from the collection in which the seq feature was found.

  • Returns : value of seqname
  • Args : newvalue (optional)

🌈 hseqname

  • Title : hseqname
  • Usage :
$featpair->hseqname($newval)
  • Function : Get/set method for the name of feature2.
  • Returns : value of $feature2->seq_id
  • Args : newvalue (optional)

πŸ’… hstart

  • Title : hstart
  • Usage :
$start = $featpair->hstart
$featpair->hstart(20)
  • Function : Get/set on the start coordinate of feature2
  • Returns : integer
  • Args : none

πŸ’… hend

  • Title : hend
  • Usage :
$end = $featpair->hend
$featpair->hend($end)
  • Function : get/set on the end coordinate of feature2
  • Returns : integer
  • Args : none

🫢 hstrand

  • Title : hstrand
  • Usage :
$strand = $feat->strand()
$feat->strand($strand)
  • Function : get/set on strand information, being 1,-1 or 0
  • Returns : -1,1 or 0
  • Args : none

🫢 hscore

  • Title : hscore
  • Usage :
$score = $feat->score()
$feat->score($score)
  • Function : get/set on score information
  • Returns : float
  • Args : none if get, the new value if set

πŸ‘‘ hframe

  • Title : hframe
  • Usage :
$frame = $feat->frame()
$feat->frame($frame)
  • Function : get/set on frame information
  • Returns : 0,1,2
  • Args : none if get, the new value if set

πŸ‘‘ hprimary_tag

  • Title : hprimary_tag
  • Usage :
$ptag = $featpair->hprimary_tag
  • Function : Get/set on the primary_tag of feature2
  • Returns : 0,1,2
  • Args : none if get, the new value if set

⭐ hsource_tag

  • Title : hsource_tag
  • Usage :
$tag = $feat->hsource_tag()
$feat->source_tag('genscan');
  • Function : Returns the source tag for a feature, eg, 'genscan'
  • Returns : a string
  • Args : none

πŸ”₯ invert

  • Title : invert
  • Usage :
$tag = $feat->invert
  • Function : Swaps feature1 and feature2 around
  • Returns : Nothing
  • Args : none

πŸ’– feature_factory

  • Title : feature_factory
  • Usage :
$obj->feature_factory($newval)
  • Function : Get/set the feature object factory for this feature pair.

The feature object factory will be used to create a feature object if feature1() or feature2() is called in get mode without having been set before.

The default is an instance of Bio::Factory::ObjectFactory and hence allows the type to be changed dynamically at any time.

  • Example :
  • Returns : The feature object factory in use (a Bio::Factory::ObjectFactoryI compliant object)
  • Args : on set, a Bio::Factory::ObjectFactoryI compliant object

and that's the whole page, bestie, no notes. πŸ’€βœ¨

this lil doc lives in the User Contributed Perl Documentation collection, and it's running on perl v5.32.1, dated 2021-08-15 β€” that's the Bio::S...rePair(3pm) footer energy right there. go forth and pair your features. πŸ¦‹πŸ’–πŸŽ€

πŸ“¦ where this page comes from