go-filter-subset.pl - extracts a subgraph from an ontology file
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
Exports a subset of an ontology from a file. The subset can be based on a specified set of IDs, a preset "subset" filter in the ontology file (eg a GO "slim" or subset), or a user-defined filter.
The subset can be exported in any format, including a graphical image
ID to use as leaf node in subgraph. All ancestors of this ID are included in the exported graph (unless -partial is set)
Multiple IDs can be passed
-id ID1 -id ID2 -id ID3 ....etc
Extracts a named subset from the ontology file. (only works with obo format files). For example, a specific GO slim
ONLY terms belonging to the subset are exported - the -partial option is automatically set
only terms in this namespace
advanced option
A subroutine with which the GO::Model::Term object is tested for inclusion in the subgraph (all ancestors are automatically included)
You should have an understanding of the go-perl object model before using this option
Example:
go-filter-subset -filter_code 'sub {shift->namespace eq 'molecular_function'}' go.obo
(the same things can be achieved with the -namespace option)
If this is set, then only terms that match the user query are included. Parentage is 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
If this switch is specified, then caching mode is turned on.
With caching mode, the first time you parse a file, then an additional file will be exported in a special format that is fast to parse. This file will have the same filename as the original file, except it will have the ".cache" suffix.
The next time you parse the file, this program will automatically check for the existence of the ".cache" file. If it exists, and is more recent than the file you specified, this is parsed instead. If it does not exist, it is rebuilt.
http://www.godatabase.org/dev
To install GO::Utils, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GO::Utils
CPAN shell
perl -MCPAN -e shell install GO::Utils
For more information on module installation, please visit the detailed CPAN module installation guide.