GO-FILTER-SUBSET(1p)
β¨ GO-FILTER-SUBSET(1p) β¨
okay bestie, so this is a page from the User Contributed Perl Documentation and it's literally called go-filter-subset.pl and I'm obsessed π
πΈ NAME πΈ
go-filter-subset.pl β extracts a subgraph from an ontology file π¦
π SYNOPSIS π
go-filter-subset.pl -id GO:0003767 go.obo
go-filter-subset.pl -id GO:0003767 -to png go.obo | xv -
go-filter-subset.pl -filter_code 'sub{shift->name =~ /transcr/}' go.obo
π DESCRIPTION π
So what it does: it exports a subset of an ontology from a file. And the subset? It can be based on:
- a specified set of IDs (like, here's my list, give me these),
- a preset "subset" filter that's already chillin' inside the ontology file (think a GO "slim" or subset),
- or a user-defined filter that you write yourself. main character energy fr fr π
And the subset can be exported in any format, including a graphical image. not me being able to just... pipe an ontology into an image viewer π iconic
π ARGUMENTS π
-idID β the ID you wanna use as the leaf node in the subgraph. All ancestors of this ID get included in the exported graph β unless-partialis set.
You can pass multiple IDs, no cap:
-id ID1 -id ID2 -id ID3 ....etc
-subsetSUBSET_ID β extracts a named subset from the ontology file. Heads up tho: this only works with obo format files. Like if you want a specific GO slim, this is your girl.
ONLY terms belonging to the subset are exported, and also β surprise β the -partial option is automatically set for you. considerate π«Ά
-namespaceNAMESPACE β only terms in this namespace, that's it, that's the whole vibe.-filter_codeSUBROUTINE β advanced option, bestie. like, advanced advanced.
You give it a subroutine, and the GO::Model::Term object gets tested with it to see if it belongs in the subgraph (and yeah, all ancestors are automatically included too, we love a generous queen).
β οΈ You should have an understanding of the go-perl object model before using this option. fr fr, don't just yolo it π
Example:
go-filter-subset -filter_code 'sub {shift->namespace eq 'molecular_function'}' go.obo
oh and btw β (the same things can be achieved with the -namespace option). so, options, we love that for us β¨
-partialβ if this is set, then only terms that match the user query are included. And parentage gets set to the next recursive parent node in the filter.
For example, with the -subset option: if X and Y belong to the subset, and Z does not, and X is_a Z is_a Y, then the exported graph withh have X is_a Y. (yes, "withh" β that's what the page says, keeping it exactly π
the typo is canon now.)
-use_cacheβ if you specify this switch, then caching mode is turned ON. β‘
With caching mode, the first time you parse a file, an additional file will be exported in a special format that is fast to parse. This file has the same filename as the original file, except it gets the .cache suffix. cute.
The next time you parse the file, this program will automatically check whether the .cache file exists. If it does, and it's more recent than the file you specified, that's what gets parsed instead. If it doesn't exist? It gets rebuilt. slay, self-healing π§
π DOCUMENTATION π
<http://www.godatabase.org/dev>
okay that's the whole page bestie, you're gonna do amazing π
perl v5.36.0 Β· 2023-12-18 Β· GO-FILTER-SUBSET(1p) β that's the version, the date, and the page name, go off πβ¨
π¦ where this page comes from
- debian trixie: libgo-perl 0.15-10 Β· Perl
- ubuntu noble: libgo-perl 0.15-10 Β· Perl
- ubuntu resolute: libgo-perl 0.15-10 Β· Perl
- ubuntu stonking: libgo-perl 0.15-10 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms