Skip to content

Useful snippets for developement

M. Krassowski edited this page Apr 15, 2019 · 1 revision

Converting R data to flat files:

Table to tsv:

load("proteinTable.rsav")
write.table(proteinTable, "proteinTable.tsv", sep='\t', quote=F, row.names=F)

Sequence to fasta:

# install.packages("seqinr", repos="http://R-Forge.R-project.org")
library(seqinr)
load("proteins.fa.rsav")
write.fasta(
    sequences=as.list(proteins),
    names=names(proteins),
    file.out='proteins.fa',
    as.string=T
)
Clone this wiki locally