knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

bstringr

Travis build status Coverage status

The goal of bstringr is to ...

Installation

# library(devtools)
devtools::install_github("t-arae/bstringr")

Usage

library(bstringr)

bstr-class object

# bstr object
(temp <- bstr(letters[1:5]))

class(temp)

# dstr-class
dstr("ATGC")

# dstr("E")
# Error in dstr("E") : input contains NOT DNA character

FASTA file IO

inf <- system.file("extdata", package = "bstringr") %>% list.files(full.names = T)
readLines(inf)

# Read fasta file
(test_fa <- read_fasta(inf))

# Write fasta file
test_fa %>% write_fasta(width = 5) %>% paste(collapse = "\n") %>% cat

Functions for bstr

# Degapping
test_fa %>% bstr_remove_gap(gap_chr = " ")

Interface to the Biostrings::BStringSet-class

# bstr-class -> BioStringSet-class
test_fa %>% bstr2BioString()

# BioStringSet -> bstr-class
test_fa %>% bstr2BioString() %>% Bio2bstr()
# ### 関数対応状況
# 
# 第一引数は文字列ベクトル型のオブジェクト。複数の文字列に対応
# bstr(), dstr(), astr()
# as_bstr(), as_dstr(), as_astr()
# 
# 第一引数は任意のオブジェクト。
# is_bstr(), is_dstr(), is_astr()
# 
# 
# ### IO
# 
# 
# ### bstr-class
# calculate property
# * bstr_length() [OK] 文字数をカウント
# * bstr_composition | base_composition | residue_composition
# * bstr_info
# * bstr_detect() detect pattern from strings
# * bstr_count() count pattern from strings
# * bstr_locate() locate pattern from strings
# * bstr_extract() extract pattern from strings
# 
# transform
# * bstr_to_lower [OK] 小文字に変換
# * bstr_to_upper [OK] 大文字に変換
# * bstr_switch_case [OK] 大文字を小文字に,小文字を大文字に変換
# * bstr_reverse [OK] 逆順
# 
# remove / replace
# * bstr_remove [OK] 文字列から任意の文字(列)を除く
# * bstr_remove_num [OK] 文字列から数字を除く
# * bstr_remove_notalpha [OK] 文字列からアルファベット以外を除く
# * bstr_remove_gap [OK] gap文字を除く
# * replace [OK] 文字列内の文字(列)を置換する
# * trim_left
# * trim_right
# 
# subsequence
# * sub
# * sub_truepos
# 
# * bstr_sort() sort bstr strings
# 
# * align
# * calc_identity
# * calc_conservation
# * calc_consensus | calc_PSSM
# * calc_occupancy
# 
# * bstr2BString
# * BString2bstr
# 
# ### dstr-class
# * to_rna
# * to_dna
# 
# * dstr_complement [OK]
# * dstr_complement_fast [OK]
# * dstr_rev_comp [OK]
# * dstr_remove_stop [OK]
# * dstr_translate [OK]
# 
# * detect_orf
# * count_orf
# * locate_orf
# * extract_orf
# 
# * calc_molweight
# * calc_Tm
# 
# * restriction_map
# * digest
# * ligate
# 
# * pcr
# * calc_gcper
# * primer_check
# * topo
# * lr
# * topo_lr
# 
# ### astr-class
# * calc_molweight


t-arae/bstringr documentation built on March 18, 2021, 3:08 a.m.