GO-FILTER-SUBSET(1p)

πŸ“¦
version 0.15 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 🌈

  • -id ID β€” the ID you wanna use as the leaf node in the subgraph. All ancestors of this ID get included in the exported graph β€” unless -partial is set.

You can pass multiple IDs, no cap:

-id ID1 -id ID2 -id ID3 ....etc
  • -subset SUBSET_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 🫢

  • -namespace NAMESPACE β€” only terms in this namespace, that's it, that's the whole vibe.
  • -filter_code SUBROUTINE β€” 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