Skip to content

Commit

Permalink
Speed improvements on getGAF
Browse files Browse the repository at this point in the history
  • Loading branch information
llrs committed Dec 13, 2023
1 parent 10bd65c commit 05df47b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Expand Up @@ -5,6 +5,7 @@
relations).
* New `dimnames()` and `names()` functions to discover the names of the data in
the slots.
* Minor changes to `getGAF()` to improve speed.

# BaseSet 0.9.0

Expand Down
11 changes: 6 additions & 5 deletions R/obo.R
Expand Up @@ -118,17 +118,18 @@ getGAF <- function(x) {

# Modify if they are GeneOntolgoy
GO <- grepl("^GO:", df$O_ID)
df$Aspect[GO] <- gsub("P", "BP", df$Aspect[GO])
df$Aspect[GO] <- gsub("C", "CC", df$Aspect[GO])
df$Aspect[GO] <- gsub("F", "MF", df$Aspect[GO])
df$Aspect[GO] <- gsub("P", "BP", df$Aspect[GO], fixed = TRUE)
df$Aspect[GO] <- gsub("C", "CC", df$Aspect[GO], fixed = TRUE)
df$Aspect[GO] <- gsub("F", "MF", df$Aspect[GO], fixed = TRUE)

# Classification of the columns according to where do they belong
elements <- c(1, 2, 3, 10, 11, 12, 13, 17)
sets <- c(5, 6, 9, 16)

# Change the name of the columns to be ready to use tidySet.data.frame
colnames(df) <- gsub("O_ID", "sets", colnames(df))
colnames(df) <- gsub("DB_Object_Symbol", "elements", colnames(df))
colnames(df) <- gsub("O_ID", "sets", colnames(df), fixed = TRUE)
colnames(df) <- gsub("DB_Object_Symbol", "elements", colnames(df),
fixed = TRUE)

TS <- tidySet(df)

Expand Down

0 comments on commit 05df47b

Please sign in to comment.