SWISS:...lt_prod(3pm)

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

πŸ’– Name πŸ’–

okay bestie, gather round, because this page is SWISS::CCalt_prod.pm β€” yep, that SWISS::CCalt_prod(3pm) situation, the Perl module that handles CC ALTERNATIVE PRODUCTS blocks. she's a whole icon and we're gonna get into it. πŸŽ€


✨ Description ✨

SWISS::CCalt_prod represents a comment on the topic 'ALTERNATIVE PRODUCTS' inside a Swiss-Prot or TrEMBL entry, exactly as laid out in the user manual over at http://www.expasy.org/sprot/userman.html. πŸ“–

Comments on other topics? They live in other types of objects, like SWISS::CC β€” head over to SWISS::CCs if you want the full scoop on that. πŸ¦‹

And collectively, bestie, comments of every type get stored inside a SWISS::CCs container object. one big happy family. πŸ’…

🌸 Code example 🌸

so this next bit is here to show you how a CCalt_prod object is built internally, like under the hood, no filter. but real talk: for most purposes you can and should just use the convenience methods that are provided β€” the add, delete, get and set methods documented further down β€” instead of hand-constructing the section yourself. Using the convenience methods is also the recommended move if you want to keep the structural integrity of the CCalt_prod object intact. don't be out here building it manually and then wondering why it's giving chaos. 😭

 ## Create a new named isoform

 my %thisFormHash;

 ## give this some properties

 # some properties are single data values

 $thisFormHash{"Name"} = "This";

 # some properties are lists of values

 push @{$thisFormHash{"Synonyms"}}, "That";
 push @{$thisFormHash{"Synonyms"}}, "The Other";
 push @{$thisFormHash{"IsoId"}}, "P00000-01";
 push @{$thisFormHash{"IsoId"}}, "P00000-02";
 push @{$thisFormHash{"Sequence"}}, "VSP_000001";
 push @{$thisFormHash{"Sequence"}}, "VSP_000002";
 $thisFormHash{"Notes"} = [ [ "this local note", "ECO:0000269|PubMed:22081402, ECO:0000269|PubMed:23203051" ] ];
 $thisFormHash{"Notes"} = [ [ "another local note without ev", "" ] ];
 $thisFormHash{"Notes"} = [ [ "note block1", "ECO:0000269|PubMed:22081402" ], [ "note block2", "ECO:0000269|PubMed:23203051" ] ];

 ## put this form onto a list of all forms created by one type of event

 my @newFormsList;

 push @newFormsList, \%thisFormHash;

 ## put this list into a hash describing all characteristics of this event

 my %eventHash;
 $eventHash{"FormsList"} = \@newFormsList;

 ## set other values of this event

 $eventHash{"Comment"} = [ [ "This Comment", "ECO:0000269|PubMed:23203051" ] ];

 ## put the description of this event into a hash descrinbing all events

 my %eventsHash;
 $eventsHash{"Alternative splicing"} = \%eventHash;

 ## put a reference to this hash into the CCalt_products object

 my $hashRef;
 $hashRef = \%eventsHash;
 my $newCC = SWISS::CCalt_prod;
 $newCC->setEvents($hashRef);
 $newCC->toString();

More simply β€” and honestly? iconic of you β€” using the convenience methods addComment and addForm: πŸ’–

 @synonyms = ("That", "The other");
 @isoIds = ("P00000-1", "P00000-2");
 @featIds = ("VSP_00001", "VSP_00002");
 my $newCC = SWISS::CCalt_prod;
 $newCC -> addComment("Alternative splicing", "This comment");
 $newCC -> addForm("Alternative splicing",
                   "This",
                   \@synonyms,
                   \@isoIds,
                   \@featIds,
                   [ [ "This local note", "ECO:0000269|PubMed:22081402, ECO:0000269|PubMed:23203051" ] ]);
 print $newCC -> toString();

and the output from both approaches is literally the same, look:

 CC   -!- ALTERNATIVE PRODUCTS:
 CC        Event=Alternative splicing; Named isoforms=1;
 CC          Comment=This comment.
 CC        Name=This; Synonyms=That, The other;
 CC          IsoId=P00000-1, P00000-2; Sequence=VSP_00001, VSP_00002;
 CC          Note=This local note.
 CC          {ECO:0000269|PubMed:22081402, ECO:0000269|PubMed:23203051};

🧚 Example of adding evidence tags to a synonym 🧚

 $CC -> addEvidenceTag('EP8', "Alternative splicing", "Synonyms", "VI",
 "B");

what that does is add the tag 'EP8' to synonym B of isoform VI, produced by alternative splicing. slay. ✨

πŸ‘‘ Handling mutliple events πŸ‘‘

okay so this part is important. With the release of UniProt 8.0, the format of the CC ALTERNATIVE PRODUCTS blocks changed slightly. In particular? Isoforms are no longer stored according to the events that have generated them. so this:

 CC   -!- ALTERNATIVE PRODUCTS:
 CC        Event=Alternative splicing; Named isoforms=1;
 CC          Comment=This comment.
 CC        Name=This; Synonyms=That, The other;
 CC          IsoId=P00000-1, P00000-2; Sequence=VSP_00001, VSP_00002;
 CC          Note=This local note.
 CC        Event=Alternative initiation;
 CC          Comment=Another comment.

has become this:

 CC   -!- ALTERNATIVE PRODUCTS:
 CC        Event=Alternative splicing, Alternative initation; Named isoforms=1;
 CC          Comment=This comment. Another comment;
 CC        Name=This; Synonyms=That, The other;
 CC          IsoId=P00000-1, P00000-2; Sequence=VSP_00001, VSP_00002;
 CC          Note=Produced by alternative splicing. This local note;

The API is quite event-centric, which reflects the previous file format β€” back when different content was available depending on the event type. To get all isoforms (for whatever events are annotated) under the new format, you do:

 $CC->keyEvent;

which returns an arbitrary event that you can use as a parameter in other methods. 🫢 Any of the annotated events will work as a parameter for retrieving information about associated isoforms β€” it is not necessary to supply the complete list. so don't stress about it, bestie, one event is enough. πŸ’œ


🌈 Inherits from 🌈

SWISS::BaseClass.pm β€” yeah, she's got lineage. πŸ’…

πŸ¦‹ Attributes πŸ¦‹

topic

The topic of this comment is 'ALTERNATIVE PRODUCTS'. slay.


✨ Standard methods ✨

  • new
  • fromText

πŸ’… Reading/Writing methods πŸ’…

addEvent ($eventName)

okay so this one lets you slide "events blocks" into the CCalt_prod object. iconic behavior πŸ’–

addEvidenceTag($tag, $event, $type, $name, $synonym)

Add $tag to the tag list that's vibing with the specified component of a CCalt_prod object. You always gotta specify the event and the type β€” the type is the item you're adding the tag to, so like "Comment", "Name", "Note", or "Synonyms". Unless the type is "Comment", you also need the name (aka the contents of the Name field for the isoform you're attaching the tag to). And if the type is "Synonyms", you gotta give the name of the synonym you're attaching the tag to as well.

n.b. now Comment and Note are "multi block" ( [ [ blocktext, blockevs ]... ] , so here the ev tag will be added on last the 'block'; it would be better to directly manipulate this [ [ blocktxt, blockevs ] ... ] structure obtained via getComment/Note

addForm ($eventName, $formName, \@synonyms, \@isoIds, \@featIds, $note)

Lets you add a form into a given event block. Peep the code example (above) for more deets 🫢

deleteComment ($eventName)

Deletes the comment associated with this event. bye bestie πŸ‘‹

deleteEvent ($eventName)

Deletes an event from this CCalt_prod objects. (yes, "objects" is exactly what the source says, no cap πŸ’€)

deleteEvidenceTag($tag, $event, $type, $name, $synonym)

Deletes $tag from the tag list associated with the specified component of a CCalt_prod object. You always gotta specify the event and the type β€” the type is the item you're deleting the tag from, i.e. "Comment", "Name", "Note", or "Synonyms". Unless the type is "Comment", you also need the name (the contents of the Name field for the isoform you're deleting the tag from). And if the type is "Synonyms", you gotta give the name of the synonym you're deleting the tag from too.

deleteForm ($eventName, $formName)

Deletes a form associated with a given event.

keyEvent ()

Extracts one of the events annotated in this entry, which you can then use to retrieve data associated with this event.

getComment($eventName)

Returns the comment for this event.

getEventNames

Returns a list of all event names for this CCalt_prod object.

getEvidenceTags($event, $type, $name, $synonym)

Returns a list of the tags attached to the specified component of a CCalt_prod object. You always gotta specify the event and the type (the item the tag is attached to, i.e. "Comment", "Name", "Note", or "Synonyms"). Unless the type is "Comment", you also need the name (the contents of the Name field for the isoform whose tags you're fetching). And if the type is "Synonyms", you gotta give the name of the synonym whose tags you're fetching too.

n.b. now Comment and Note are "multi block" ( [ [ blocktext, blockevs ]... ] , so here all the evidences from all the block are pooled together

getEvidenceTagsString($event, $type, $name, $synonym)

Returns the tags attached to the specified component of a CCalt_prod object as a string literal. You always gotta specify the event and the type (the item the tag is attached to, i.e. "Comment", "Name", "Note", or "Synonyms"). Unless the type is "Comment", you also need the name (the contents of the Name field for the isoform whose tags you're fetching). And if the type is "Synonyms", you gotta give the name of the synonym whose tags you're fetching too.

n.b. now Comment and Note are "multi block" ( [ [ blocktext, blockevs ]... ] , so here all the evidences from all the block are pooled together

getFeatIds ($eventName, $formName)

Returns a list of all feature IDs associated with this form produced by this event.

getFormNames ($eventName)

Returns a list of all form names for this form produced by this event.

getIsoIds ($eventName, $formName)

Returns a list of all IsoIds for this form produced by this event.

getNamedFormCount($eventName)

Returns the number of named and identified forms for this event.

getNote ($eventName, $formName)

Returns the local note of this form produced by this event.

getSynonyms ($eventName, $formName)

Returns a list of all synonyms of this form produced by this event.

hasEvidenceTag ($tag, $event, $type, $name, $synonym)

Returns 1 if the specified component of a CCalt_prod object has the specified tag. You always gotta specify the event and the type (the item the tag is attached to, i.e. "Comment", "Name", "Note", or "Synonyms"). Unless the type is "Comment", you also need the name (the contents of the Name field for the isoform whose tags you're fetching). And if the type is "Synonyms", you gotta give the name of the synonym whose tags you're fetching too.

setComment ($eventName, $comment)

Lets you add a global comment for a particular event.

setEvidenceTags(\@tags, $event, $type, $name, $synonym)

Sets the evidence tags of the specified component of a CCalt_prod object to the array pointed to by \@tags. You always gotta specify the event and the type (the item you're adding the tags to, i.e. "Comment", "Name", "Note", or "Synonyms"). Unless the type is "Comment", you also need the name (the contents of the Name field for the isoform you're attaching tags to). And if the type is "Synonyms", you gotta give the name of the synonym you're attaching tags to too.

n.b. now Comment and Note are "multi block" ( [ [ blocktext, blockevs ]... ] , so here the ev tag will be set on last the 'block'; it would be better to directly manipulate this [ [ blocktxt, blockevs ] ... ] structure obtained via getComment/Note

setEvent (%eventHash)

Can be used to manually insert a hash representing one event. Use of this method is not recommeded, see code examples for how to use the convenience methods to create a CCalt_prod object. (yes, "recommeded" β€” we don't make the typos, we just report them πŸ’€)

setFeatIds($eventName, $oldName, \@featIds)

Sets the feature Ids for the named form (associated with the specified event) to the supplied list.

setFormName($eventName, $oldName, $newName)

Changes the name of the formed named $OldName, associated with this event, to the $newName.

setIsoIds($eventName, $oldName, \@isoIds)

Sets the Isoform Ids for the named form (associated with the specified event) to the supplied list.

setNote($eventName, $name, $note)

Sets the local note for the named form (associated with the specified event).

setSynonyms($eventName, $name, \@synonyms)

Sets the synonyms for the named form (associated with the specified event) to the supplied list.

toString

Returns a string representation of this comment.


🫠 POD ERRORS 🫠

Hey! The above document had some coding errors, which are explained below:

Around line 1524:
    =back doesn't take any parameters, but you said =back  =head1
    Methods

mwah πŸ’‹ this page was perl v5.32.1, dated 2021-08-15, from SWISS:...lt_prod(3pm) β€” catch u next time bestie 🫢✨

πŸ“¦ where this page comes from