rm_dups: Remove Duplicate Gene Entries The purpose. of this function...

rm_dupsR Documentation

Remove Duplicate Gene Entries The purpose. of this function is to pull info from a synapse table into a dataframe. Removal can be of all entries with a lower score in a given column or entries which lack the desired ensg

Description

Remove Duplicate Gene Entries The purpose. of this function is to pull info from a synapse table into a dataframe. Removal can be of all entries with a lower score in a given column or entries which lack the desired ensg

Usage

rm_dups(df, feature_col, feature, type, type_spec, ensg_keep = NULL)

Arguments

df

the data frame of gene names

feature_col

the column of the feature to treat as rows ie.'GName'

feature

the values of the feature to pull ie. NPC1

type

highest value or ensg ie 'value' or 'ensg'

type_spec

column name of type ie 'ENSG' or 'Overall'

ensg_keep

the ensg to retain if method is ensg default = NULL

Value

a dataframe object

Examples

## Not run: 
 syn <- log_into_synapse()
 omics_scores <- dplyr::left_join(
  table_pull(
    syn_id ='syn25575156',
    feature_name = 'GeneName',
    features = names(igraph::V(net)),
    column_names = c('ENSG', 'OmicsScore', 'GeneticsScore', 'Logsdon'),
    synap_import = syn$synapse
  ), 
  table_pull(
    syn_id ='syn22758536',
    feature_name = 'GName',
    features = names(igraph::V(net)),
    column_names = c('ENSG', 'GName', 'RNA_TE', 'Pro_TE'),
    synap_import = syn$synapse
  ), 
  by = 'ENSG'
 )
 colnames(omics_scores)[ colnames(omics_scores) == 'Logsdon' ] <- 'Overall'
 omics_scores <- rm_dups(
   df = omics_scores,
   feature_col = 'GName',
   feature = 'POLR2J3',
   type = 'value',
   type_spec = 'Overall' ,
   ensg_keep = NULL
 )
 omics_scores <- rm_dups(
    df = omics_scores,
    feature_col = 'GName',
    feature = "FCGBP",
    type = 'ensg',
    type_spec = 'ENSG' ,
    ensg_keep = 'ENSG00000281123'
 )

## End(Not run)

jgockley62/igraphNetworkExpansion documentation built on April 15, 2022, 12:14 a.m.