subset_bstringset: Get records from BStringset

Description Usage Arguments Value Examples

Description

an object of class BStringset stores sequences and headers from FASTA or FASTQ files. See Biostrings::readBStringSet(). This function helps users to filter sequences by headers with full or partial match.

Usage

1
subset_bstringset(x, y, partial_match = TRUE)

Arguments

x

character vector of query ids

y

an object of class BStringset from which sequences to be filtered

partial_match

logical (default TRUE).

  1. TRUE : return sequences if element of x matches anywhere in the headers of y.

  2. FALSE : return sequences only of exact match occur between element of x and headers of y.

Value

an object of class BStringset

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
x <- c("EIT75269.1",
  "TGO19408.1",
  "KAF2153260.1",
  "OAA41719.1",
  "OSS52177.1",
  "XP_018252424.1",
  "XP_008598593.1",
  "KXN65110.1",
  "XP_018147989.1",
  "XP_022493698.1",
  "RII05464.1",
  "XP_018703519.1",
  "RZR67285.1",
  "OLY78428.1",
  "XP_007819064.1",
  "PQK17331.1",
  "KXN66278.1",
  "CRK21695.1",
  "CVK85925.1",
  "KID81639.1")
y_file <- system.file("extdata" ,"blast_output_01.fasta" , package = "phyloR")
y <- Biostrings::readBStringSet(y_file)
## subset fasta by partial match
sub <- phyloR::subset_bstringset(x = x , y = y ,partial_match = T)
subset_bstringset(x , y,  partial_match  = TRUE)

## End(Not run)

cparsania/phyloR documentation built on Aug. 6, 2020, 7:28 a.m.