Skip to content

Commit

Permalink
Handling non-HGNC sources
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemSokolov committed May 20, 2019
1 parent b0d73d8 commit 1a9577d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/indra.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ queryEdges <- function( indra_query )

## Retrieve HGNC IDs of the subject and object in each statement
ag <- purrr::map( s, ~.x$agent_list() )
ag1 <- purrr::map_chr( ag, purrr::pluck, 1, "db_refs", "HGNC" )
ag1 <- purrr::map( ag, purrr::pluck, 1, "db_refs", "HGNC" )
ag2 <- purrr::map( ag, purrr::pluck, 2, "db_refs", "HGNC" )

## Put everything into a common data frame
## Convert HGNC IDs to gene symbols
tibble::tibble( Hash = h, Activity = cls, Src = ag1, Trgt = ag2, EvCnt = nev ) %>%
dplyr::filter( !purrr::map_lgl(Trgt, is.null) ) %>% tidyr::unnest() %>%
dplyr::filter( !purrr::map_lgl(Src, is.null), !purrr::map_lgl(Trgt, is.null) ) %>%
tidyr::unnest() %>%
dplyr::mutate_at( c("Src","Trgt"), purrr::map_chr, hgnc$get_hgnc_name )
}

Expand Down

0 comments on commit 1a9577d

Please sign in to comment.