SWISS::CCs(3pm)
β¨ SWISS::CCs β¨
okay bestie, welcome to the SWISS::CCs page from the User Contributed Perl Documentation, manual section 3pm π this one's about CC lines and honestly it's giving container-object realness.
πΈ Name πΈ
SWISS::CCs β literally the whole name, that's it, that's the vibe π
π¦ Description π¦
so. SWISS::CCs represents the CC lines inside a Swiss-Prot or TrEMBL entry, exactly as specified in the user manual at http://www.expasy.org/sprot/userman.html β¨
the CCs object is a container object, and what it does is hold a list β and that list is made up of objects of type SWISS::CC or of derived classes (peep the list below, they're all there) π
π Code example π
here's the whole thing, no edits, no cap:
local $/="\n//\n";
while (<>) {
my $entry = SWISS::Entry-> fromText($_);
my @CCs = $entry -> CCs -> elements();
for my $CC (@CCs) {
if ($CC -> topic eq 'ALTERNATIVE PRODUCTS') {
# now can call methods of CCalt_prod
} elsif ($CC -> topic eq 'Copyright') {
# now can call methods of CCcopyright
} else {
# now can call methods of CC
}
}
}
π Inherits from π
SWISS::ListBase.pm β yeah she gets it from there, family lineage and all that π
π Attributes π
"list"β every single element in this list is an object of one of these classes, and which one you get depends on the type of comment π«
here's the mapping, topic to object, one for one:
- topic
ALTERNATIVE PRODUCTSβ objectSWISS::CCalt_prod - topic
RNA EDITINGβ objectSWISS::CCrna_editing - topic
BIOPHYSICOCHEMICAL PROPERTIESβ objectSWISS::CCbpc_properties - topic
INTERACTIONβ objectSWISS::CCinteraction - topic
COFACTORβ objectSWISS::CCcofactor - topic
DISEASEβ objectSWISS::CCdisease - topic
SEQUENCE CAUTIONβ objectSWISS::CCseq_caution - topic
SUBCELLULAR LOCATIONβ objectSWISS::CCsubcell_location - topic
Copyrightβ objectSWISS::CCcopyright - topic
(all other topics)β objectSWISS::CC
π Methods π
β Standard methods β
newβ the classic, you know her π«ΆfromTextβ turns text into the thing β¨sortβ sorts the CC block according to the order given in the Swiss-Prot annotation note ANN017 πtoTextβ back out to text πupdateβ does the update thing π₯
πΈ Reading/Writing methods πΈ
ccTopic ($topic)β returns true if the entry contains a comment block with the specified topic πcopyrightβ returns a string representation of the copyright text πdel (@patternList)β deletes all comment elements whose topic matches the first element of the pattern list. the second element is the one used to specify a requirement for the comment to match as well ποΈget (@patternList)β an array gets returned, consisting of all comment elements whose topic matches any elements of the pattern list πgetObject (@patternList)β same asget, but it returns the results wrapped in a newListBaseobject πtoStringβ returns a string representation of theCCsobject π
not me ending the page already π everything above is the whole lore, no filler, fr fr.
mwah, that's a wrap on SWISS::CCs from the User Contributed Perl Documentation β this copy is from perl v5.32.1, dated 2021-08-15. go sort some CC blocks bestie, you're gonna slay π
β¨
π¦ where this page comes from
- debian bookworm: libswiss-perl 1.80-1 Β· GPL-2.0-or-later
- debian trixie: libswiss-perl 1.80-1 Β· GPL-2.0-or-later
- ubuntu jammy: libswiss-perl 1.80-1 Β· GPL-2.0-or-later
- ubuntu noble: libswiss-perl 1.80-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms