SWISS::GNs(3pm)
π 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 aSWISS::GeneGroupobject. 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
newfromTexttoText
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 theGNs::andandGNs::ordelimiters to their lower case values. lowercase era, we remember her. πuppercase(deprecated, for old format only) β sets theGNs::andandGNs::ordelimiters 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:$targetis a string. π¦isPresent($target)β returns1if$targetis present in the GN line. ($targetis a string, obviously.) a little vibe check, if you will. β¨needsReCasing($target)β if$targetis 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". π ($targetis a string.)replace($newName, $target, $evidenceTag)β replaces the first GN object in the GN line whose text attribute is$targetwith a new GN object whose text attribute is set to$newNameand whoseevidenceTagsattribute is set using values set by splitting$evidenceTagon/, /(as name is not being changed, programs should keep the old tag and add the new tag). does nothing if$targetis 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, andevidenceTagsattribute set to($evidenceTag)), as a synonym to the first gene group in which$targetis a gene name. does nothing if$targetis 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 newGeneGroupobject, comprising 1 GN object (with text attribute set to the new$newName, andevidenceTagsattribute 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$targetwith$newGeneGroup. creating the$newGeneGroupcorrectly 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
- 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