filterByTerm: Filter data frame by term

Description Usage Arguments Value See Also Examples

View source: R/filterByTerm.R

Description

Filter a data frame using full-text search within the data frame. If filter_columns are not specified, search will be performed within the whole data frame. If filter_columns are provided, search will only be limited to these columns. Full-text search works akin to searching within web search engines like Google. You can find out more about it here: https://www.sqlite.org/fts3.html (fts3 is used for consistency with fts search within the SRAdb database).

Usage

1
filterByTerm(df, query, filter_columns = NULL)

Arguments

df

Data frame

query

Character string for fts search

filter_columns

Character vector with column names

Value

A data frame subset according to query conditions

See Also

Other Workflow functions: addMissingSamples(), convertAccession(), filterByTermByAccessionLevel(), searchForAccession()

Other Manipulation functions: filterByTermByAccessionLevel(), orderDFAccessions()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
startSpiderSeqRDemo()
df <- searchForAccession("SRP026280")

# Filter by 'TRIMKD' anywhere within df
df <- filterByTerm(df, "TRIMKD")
# NOTE: here (as is often the case), the study-level columns
# contain information pertaining to all samples and make finding relevant
# samples impossible

# Filter by 'TRIMKD' only within SRA_experiment_title column
df <- filterByTerm(df, "SRA_experiment_title: TRIMKD")
# NOTE: you can explore further possibilities by filtering by columns
# corresponding to different accession levels, 
# see \code{\link{filterByTermByAccessionLevel}}

# For ease of viewing results
df_view <- selectColumns_Overview(df) 

ss-lab-cancerunit/SpiderSeqR documentation built on Nov. 2, 2020, 12:18 a.m.