SWISS::GNs(3pm)

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

πŸ’– SWISS::GNs πŸ’–

okay bestie, gather round, because we're about to get into SWISS::GNs.pm and honestly? she's giving container-object realness. πŸŽ€


✨ NAME ✨

SWISS::GNs β€” the whole module, no notes, we're starting here.


🌸 DESCRIPTION 🌸

so SWISS::GNs represents the GN lines inside an SWISS-PROT + TrEMBL entry, exactly as specified in the user manual at http://www.expasy.org/sprot/userman.html. periodt. πŸ’…

and like, the GNs object isn't out here doing the most β€” she's a container object 🫢 whose entire job is holding a list of SWISS::GeneGroup objects. main character energy but make it delegation. iykyk.


πŸ¦‹ INHERITS FROM πŸ¦‹

  • SWISS::ListBase.pm β€” yeah she inherited the whole vibe from here, we love a legacy. ✨

πŸ‘‘ ATTRIBUTES πŸ‘‘

  • list β€” every element in this list is a SWISS::GeneGroup object. that's the whole tea. πŸ“
  • and (deprecated, for old format only) β€” the delimiter used between genes. defaults to " AND ". it's giving legacy, but we respect her. πŸ™ˆ
  • or (deprecated, for old format only) β€” the delimiter used between gene names. defaults to " OR ". same energy. πŸ’€

πŸ’œ METHODS πŸ’œ

🌈 Standard methods

  • new
  • fromText
  • toText

like, the classics. the holy trinity of just existing. no cap. ✨

🧚 Reading/Writing methods

  • text [($newText)] β€” sets the text of the GN line to the parameter if it's actually there, and returns the (unwrapped) text of the line. she also sets the 'and' and 'or' delimiters to the first occurrences of the words "OR" and "AND" in the line, conserving the case. so like, she's paying attention to your capitalization, she's not gonna fix it for you bestie. πŸ’…
  • lowercase (deprecated, for old format only) β€” sets the GNs::and and GNs::or delimiters to their lower case values. lowercase era, we remember her. πŸŽ€
  • uppercase (deprecated, for old format only) β€” sets the GNs::and and GNs::or delimiters to their upper case values. SHOUTING ERA, iconic honestly. πŸ”₯
  • getFirst() β€” returns the first gene name in the gene line. first place, the winner, the it-girl. πŸ‘‘
  • getTags($target) β€” returns the evidence tags associated with $target. just so we're clear: $target is a string. πŸ¦‹
  • isPresent($target) β€” returns 1 if $target is present in the GN line. ($target is a string, obviously.) a little vibe check, if you will. ✨
  • needsReCasing($target) β€” if $target is present in the GN line but wrongly cased, this method returns the matching name in its current case. so she's telling you "yeah she's here, but her outfit is wrong". 😭 ($target is a string.)
  • replace($newName, $target, $evidenceTag) β€” replaces the first GN object in the GN line whose text attribute is $target with a new GN object whose text attribute is set to $newName and whose evidenceTags attribute is set using values set by splitting $evidenceTag on /, / (as name is not being changed, programs should keep the old tag and add the new tag). does nothing if $target is not found. πŸ’…
  • delete($target) β€” removes the synonym/single-member gene group matching $target. note that if a "Name" gets deleted, the first "Synonym" will be promoted to "Name". it's giving succession planning, honestly. πŸ‘‘
  • addAsNewSynonym($newName, $target, $evidenceTag, $location) β€” adds a new GN object (with text attribute set to the new $newName, and evidenceTags attribute set to ($evidenceTag)), as a synonym to the first gene group in which $target is a gene name. does nothing if $target is not found. will not add a duplicate gene name. 🚫

$location determines where in the gene group the new object is added:

  • if $location == 1, 2, 3, ..., the new object is added in the 1st, 2nd, 3rd, ... position
  • if $location == 0, the new object is added before $target
  • if $location == -1, the new object is added after $target (default)
  • if $location == -2, the new object is added at the end of the gene group

note that if the new synonym is inserted in the first position, it will become the "Name" and the previous "Name" will be downgraded to first "Synonym". glow-up and glow-down in the same breath, wow. 😭

  • addAsNewGeneGroup($newName, $target, $evidenceTag, $location) β€” adds a new GeneGroup object, comprising 1 GN object (with text attribute set to the new $newName, and evidenceTags attribute set to ($evidenceTag)). will not add a duplicate gene name. πŸ’–

$location and $target determine where in the GNs line the new group is added:

  • if $location == 1, 2, 3, ..., the new object is added in the 1st, 2nd, 3rd, ... position
  • if $location == 0, the new object is added before $target
  • if $location == -1, the new object is added after $target (default)
  • if $location == -2, the new object is added at the end of the GNs line

does nothing if $target is not found and $location == 0 or -1; otherwise $target does not need to be set. slay, optionality. ✨

  • replaceGeneGroup($newGeneGroup, $target) β€” replaces the first gene group containing $target with $newGeneGroup. creating the $newGeneGroup correctly is the user's responsibility. yeah bestie, that one's on you. 🫢
  • getGeneGroup($target) β€” returns the first gene group that contains $target. 🌸
  • setToOr() β€” returns a new GNs object, but with all GNs objects in a single gene group. needed when adding 'C' to 'A and B', when the relationship of 'C' to 'A' and 'B' is unknown: the universal use of ' or ' is the default delimiter for TrEMBL entries. the "we don't know the relationship so we're just gonna say or" move. iconic honestly. πŸ’…

πŸ”₯ TRANSITION πŸ”₯

bestie, sit down. the format of the GN line will change in 2004 from:

GN   (CYSA1 OR CYSA OR RV3117 OR MT3199 OR MTCY164.27) AND (CYSA2 OR
GN   RV0815C OR MT0837 OR MTV043.07C).

to:

GN   Name=CysA1; Synonyms=CysA; OrderedLocusNames=Rv3117, MT3199;
GN   ORFNames=MtCY164.27;
GN   and
GN   Name=CysA2; OrderedLocusNames=Rv0815c, MT0837; ORFNames=MTV043.07c;

this module supports both formats. to convert an entry from the old to the new format, do:

$entry->GNs->is_old_format(0);

and that's the transition, babes. she's bilingual. 🌈


also like... several of these methods are marked deprecated, for old format only. they still exist, they still work, but they're the old-format girlies. don't be surprised when they're gone, we've been warned. πŸ’€

and that's the whole page, bestie!! πŸŽ€ this was SWISS::GNs(3pm) from the User Contributed Perl Documentation, brought to you by perl v5.32.1 on 2021-08-15. love her, respect her, go read your GN lines responsibly. mwah πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from