Split Chromosome 'Fasta' File

Chromosome files in the 'Fasta' format usually contain large sequences like human genome. Sometimes users have to split these chromosomes into different files according to their chromosome number. The 'chromseq' can help to handle this. So the selected chromosome sequence can be used for downstream analysis like motif finding. Howard Y. Chang(2019) .


chromseq

Some fasta files contain all chromosomes from one genome,sometimes users have to split these chromosomes into different files according to their number label.The msqchr can help to handle this, so that the specific chromosome fasta file can be used for downstream analysis.

Installation

devtools::install_github("MSQ-123/chromseq")

Usage

Replace tedious chromosome identifier into simple format. So that the subtracted ids are easy to manipulate.

data("id")
simpleID<- replaceText(type = "text",input = id)

Subtract chromosome ids from a fasta file

data("text")
text<- replaceText(type = "text",input = text)
id <- subFasID(text = text)

Transform the large character object into special list:

fil <- tempfile(fileext = ".data")
write(text,file = fil)
con0 <- file(fil, "r")
tex <- readToList(id,text = text,con = con0)

Sort the chromosome list according to their number. Note: the “single” and “double” chromosome should be sort separately. Note: This data is already sorted, this is just for expository purposes.

tex2<- sortList(id=id,tex = tex,chrsig = "single")
tex3 <- sortList(id=id,tex = tex,chrsig = "double")

Now we can split the chromosome fasta file into different files according to their number.

outdir <- tempdir()
splitChr(tex = tex2,chr=seq(1,9),sex = TRUE,outdir = outdir)
#chromosome X or Y is "single",so the tex should be a
#"single" chromosome list.
#In the below case, sex should be F.
splitChr(tex = tex3,chr=seq(10,22),sex = FALSE,outdir = outdir)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("chromseq")

0.1.3 by Shaoqian Ma, 6 years ago


https://github.com/MSQ-123/chromseq


Report a bug at https://github.com/MSQ-123/chromseq/issues


Browse source code at https://github.com/cran/chromseq


Authors: Shaoqian Ma [aut, cre]


Documentation:   PDF Manual  


Artistic-2.0 license


Imports utils, base


See at CRAN