Skip to content

Best way to go from long GO list to GO slim terms? #1250

Answered by kubu4
sr320 asked this question in Q&A
Discussion options

You must be logged in to vote

To address your first question:

awk '{print $2}' steven_GO.txt | tr "," "\n"

That will pull GO terms from input file (steven_GO.txt) and then create a newline-delimited file of all the GO terms.

Then, use GSEAbase in R to map to Biological Process GOslims (note: Requires goslim_generic.obo from http://geneontology.org/docs/go-subset-guide/) :

# Load necessary libraries
library(GSEABase)
library(tidyverse)

# Expects GO terms to be in first column of input file

## Get max number of fields
# Needed to handle reading in file with different number of columns in each row
max_fields <- max(na.omit((count.fields(item, sep = "\t", blank.lines.skip = TRUE))))
  
## Read in tab-delimited GOseq file
#

Replies: 2 comments

Comment options

sr320
Jul 13, 2021
Maintainer Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by sr320
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants