SWISS::CCs(3pm)

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

✨ 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 β†’ object SWISS::CCalt_prod
  • topic RNA EDITING β†’ object SWISS::CCrna_editing
  • topic BIOPHYSICOCHEMICAL PROPERTIES β†’ object SWISS::CCbpc_properties
  • topic INTERACTION β†’ object SWISS::CCinteraction
  • topic COFACTOR β†’ object SWISS::CCcofactor
  • topic DISEASE β†’ object SWISS::CCdisease
  • topic SEQUENCE CAUTION β†’ object SWISS::CCseq_caution
  • topic SUBCELLULAR LOCATION β†’ object SWISS::CCsubcell_location
  • topic Copyright β†’ object SWISS::CCcopyright
  • topic (all other topics) β†’ object SWISS::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 as get, but it returns the results wrapped in a new ListBase object πŸŽ€
  • toString β€” returns a string representation of the CCs object πŸ’–

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