| Title: | Simulation and Visualization of Restriction Enzyme Cutting Pattern from DNA Sequences |
|---|---|
| Description: | Functions for handling DNA sequences, especially for simulating RFLP and TRFLP pattern based on selected restriction enzyme and DNA sequences. Compatibility updates by Renova. |
| Authors: | Qiong Ding [aut, cre], Jinlong Zhang [aut] |
| Maintainer: | Qiong Ding <[email protected]> |
| License: | GPL-2 |
| Version: | 1.0.1.9001 |
| Built: | 2026-11-19 06:37:33 UTC |
| Source: | https://github.com/renova-r/seqRFLP |
This package includes functions for handling DNA sequences, especially for simulating RFLP and TRFLP pattern based on selected restriction enzyme and DNA sequences.
| Package: | seqRFLP |
| Type: | Package |
| Version: | 1.0.1 |
| Date: | 2010-10-13 |
| License: | GPL-2 |
| LazyLoad: | yes |
Qiong Ding [email protected] Jinlong zhang [email protected]
Maintainer: Qiong Ding [email protected]
Saiki RK, Scharf S, Faloona F, Mullis KB, Erlich HA, Arnheim N (1985). Enzymatic amplification of beta-globin genomic sequences and restriction site analysis for diagnosis of sickle cell anemia. Science 230 (4723):1350-4
### Featured examples ### 1. File(s) importing: ### 1.1 importing fasta files. ### read.fasta() example ### cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna1.fas", sep = "\n") sequences <- read.fasta("dna1.fas") unlink("dna1.fas") ### 1.2 Concatenating all fasta files in working directory to fasta data ### raw2Fas() example cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna1.fas", sep = "\n") cat( ">No304", "ATTCGAAAAACACACCCACTACTAAAAATTATCAACCACT", file = "dna2.fas", sep = "\n") cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna3.fas", sep = "\n") raw2Fas(getwd(), appendix = ".fas") unlink("dna1.fas") unlink("dna2.fas") unlink("dna3.fas") ## 1.3 importing phy, nexus, and converting to fasta objects for further analysis. ##### read.nxs() example data(fil.nxs) writeLines(fil.nxs, "example.nxs") nxs <- read.nxs("example.nxs") as.fasta(nxs) unlink("example.nxs") ##### read.phy() example data(fil.phy) writeLines(fil.phy, "example.phy") phy <- read.phy("example.phy") as.fasta(phy) unlink("example.phy") ## 2 Check and visualising cutting patterns of restriction enzymes on sequences. ## 2.1 enzCut() example data(enzdata) enznames <- c("EcoRI", "Acc65I") data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") enzCut(DNAsq = fas[2], enznames = "AluI", enzdata = enzdata) rm(list = ls()) ### 2.2 fragdat() example data(enzdata) data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") frag.dat(fil = fas, enznames = "EcoRI", enzdata = enzdata) ## 2.3 plotenz() example data(enzdata) data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") enznames <- c("EcoRI", "Acc65I", "HinfI") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = TRUE, type = "RFLP") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = FALSE, type = "RFLP") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = TRUE, type = "TRFLP", "T3") ### 3 Sequence selection based on given primers. ### clipprobe() ## 3.1 Specify the forward and backward primer. #clip the sequence between the backword and forward primer. forProbe = ITS1F = 'CTTGGTCATTTAGAGGAAGTAA' # forward primer should be from the 5' to 3' end. bacProbe = ITS4 = 'GCATATCAATAAGCGGAGGA' # backward primer #only sequence with two probes found could be clipped. ### 3.2 reading fasta data. directory <- system.file("extdata", package = "seqRFLP") path <- file.path(directory, "seqs.fasta") fas <- read.fasta(path) ## 3.3 Clipping. Find clipped sequences, this usually takes less than 1 minunite. ## please wait for a moment. clipped <- clipprobe(fas, forProbe, bacProbe, tol = 0, clipped.only = TRUE) ## 3.4 Checking the results. ## There are 368 selected sequences that could be clipped. length(gnames.fas(clipped)) ## ... in 393 original sequences. length(gnames.fas(fas)) ## Sequences that can not be clipped. setdiff(gnames.fas(fas), gnames.fas(clipped))### Featured examples ### 1. File(s) importing: ### 1.1 importing fasta files. ### read.fasta() example ### cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna1.fas", sep = "\n") sequences <- read.fasta("dna1.fas") unlink("dna1.fas") ### 1.2 Concatenating all fasta files in working directory to fasta data ### raw2Fas() example cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna1.fas", sep = "\n") cat( ">No304", "ATTCGAAAAACACACCCACTACTAAAAATTATCAACCACT", file = "dna2.fas", sep = "\n") cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna3.fas", sep = "\n") raw2Fas(getwd(), appendix = ".fas") unlink("dna1.fas") unlink("dna2.fas") unlink("dna3.fas") ## 1.3 importing phy, nexus, and converting to fasta objects for further analysis. ##### read.nxs() example data(fil.nxs) writeLines(fil.nxs, "example.nxs") nxs <- read.nxs("example.nxs") as.fasta(nxs) unlink("example.nxs") ##### read.phy() example data(fil.phy) writeLines(fil.phy, "example.phy") phy <- read.phy("example.phy") as.fasta(phy) unlink("example.phy") ## 2 Check and visualising cutting patterns of restriction enzymes on sequences. ## 2.1 enzCut() example data(enzdata) enznames <- c("EcoRI", "Acc65I") data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") enzCut(DNAsq = fas[2], enznames = "AluI", enzdata = enzdata) rm(list = ls()) ### 2.2 fragdat() example data(enzdata) data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") frag.dat(fil = fas, enznames = "EcoRI", enzdata = enzdata) ## 2.3 plotenz() example data(enzdata) data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") enznames <- c("EcoRI", "Acc65I", "HinfI") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = TRUE, type = "RFLP") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = FALSE, type = "RFLP") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = TRUE, type = "TRFLP", "T3") ### 3 Sequence selection based on given primers. ### clipprobe() ## 3.1 Specify the forward and backward primer. #clip the sequence between the backword and forward primer. forProbe = ITS1F = 'CTTGGTCATTTAGAGGAAGTAA' # forward primer should be from the 5' to 3' end. bacProbe = ITS4 = 'GCATATCAATAAGCGGAGGA' # backward primer #only sequence with two probes found could be clipped. ### 3.2 reading fasta data. directory <- system.file("extdata", package = "seqRFLP") path <- file.path(directory, "seqs.fasta") fas <- read.fasta(path) ## 3.3 Clipping. Find clipped sequences, this usually takes less than 1 minunite. ## please wait for a moment. clipped <- clipprobe(fas, forProbe, bacProbe, tol = 0, clipped.only = TRUE) ## 3.4 Checking the results. ## There are 368 selected sequences that could be clipped. length(gnames.fas(clipped)) ## ... in 393 original sequences. length(gnames.fas(fas)) ## Sequences that can not be clipped. setdiff(gnames.fas(fas), gnames.fas(clipped))
This function could be used to coerce "phy", "nex" to "fasta" format.
as.fasta(x)as.fasta(x)
x |
Objects from |
The input data must be either in class "phy", "nxs", "fasta". This means that it must be the object from read.phy() or read.nxs() etc.
fasta object.
Jinlong Zhang [email protected]
None.
data(fil.nxs) nxs <- as.fasta(fil.nxs) nxs data(fil.phy) phy <- as.fasta(fil.phy) phydata(fil.nxs) nxs <- as.fasta(fil.nxs) nxs data(fil.phy) phy <- as.fasta(fil.phy) phy
Finding the sequences that could be clipped given the forward and backward primers.
clipprobe(fil, forProbe, bacProbe, tol = 3, clipped.only = TRUE)clipprobe(fil, forProbe, bacProbe, tol = 3, clipped.only = TRUE)
fil |
Sequences in fasta format to be analyzed. Must be in |
forProbe |
The forward primer. |
bacProbe |
The backward primer. |
tol |
Mumber of DNA base that can not be matched by the primers. |
clipped.only |
Whether only show the sequences that can be clipped. |
This function can be used for predicting whether the sequences can be obtained by Polymerase chain reaction (PCR) given the forward and backward primers. Users may adjust the precision of DNA sites matching by the given primers on the sequences.
if clipped.only = TRUE, the function will return to the sequence(s) that could be obtained by PCR.
Qiong Ding [email protected]
None.
See Also frag.dat for restriction enzyme clippling pattern.
### clipprobe() example ## Step1 Specify the forward and backward primer. #clip the sequence between the backword and forward primer. forProbe = ITS1F = 'CTTGGTCATTTAGAGGAAGTAA' # forward primer should be from the 5' to 3' end. bacProbe = ITS4 = 'GCATATCAATAAGCGGAGGA' # backward primer #only sequence with two probes found could be clipped. ### Step2 reading sequences from external data in package. directory <- system.file("extdata", package = "seqRFLP") path <- file.path(directory, "seqs.fasta") fas <- read.fasta(path) ## Step3 Clipping. Find clipped sequences, this usually takes less than 1 minute. ## please wait for a moment. clipped <- clipprobe(fas, forProbe, bacProbe, tol = 2, clipped.only = TRUE) ## Step4 Checking the results. ## 368 selected sequences that could be clipped. length(gnames.fas(clipped)) ## 393 original sequences. length(gnames.fas(fas)) ## Sequences that can not be clipped. setdiff(gnames.fas(fas), gnames.fas(clipped))### clipprobe() example ## Step1 Specify the forward and backward primer. #clip the sequence between the backword and forward primer. forProbe = ITS1F = 'CTTGGTCATTTAGAGGAAGTAA' # forward primer should be from the 5' to 3' end. bacProbe = ITS4 = 'GCATATCAATAAGCGGAGGA' # backward primer #only sequence with two probes found could be clipped. ### Step2 reading sequences from external data in package. directory <- system.file("extdata", package = "seqRFLP") path <- file.path(directory, "seqs.fasta") fas <- read.fasta(path) ## Step3 Clipping. Find clipped sequences, this usually takes less than 1 minute. ## please wait for a moment. clipped <- clipprobe(fas, forProbe, bacProbe, tol = 2, clipped.only = TRUE) ## Step4 Checking the results. ## 368 selected sequences that could be clipped. length(gnames.fas(clipped)) ## 393 original sequences. length(gnames.fas(fas)) ## Sequences that can not be clipped. setdiff(gnames.fas(fas), gnames.fas(clipped))
This function could be used to convert raw phy,nex, fas files to fasta format. It is also a internal function called by as.fasta() which is more friendly to use.
ConvFas(fil = NULL, type = c("fas", "nxs", "phy"))ConvFas(fil = NULL, type = c("fas", "nxs", "phy"))
fil |
file that to be converted. |
type |
File types that will be converted. |
Users may have to use readLines() to import the content when dealing with external datasets. Currently, this function could handling the standard phy, nex, fas files, lines between "[]" must be deleted in nex files.
The "fasta" format data.
Qiong Ding [email protected]
None.
See Also as.fasta for converting data types.
data(fil.phy) ConvFas(fil = fil.phy, type = "phy") data(fil.nxs) ConvFas(fil = fil.nxs, type = "nxs")data(fil.phy) ConvFas(fil = fil.phy, type = "phy") data(fil.nxs) ConvFas(fil = fil.nxs, type = "nxs")
This function could be used to convert dataframe to fasta format.
dataframe2fas(x, file = NULL)dataframe2fas(x, file = NULL)
x |
The input dataframe |
file |
A character naming the file to be saved to. |
The input dataframe with the first column the sequences' names, the second column DNA sequences.
Returns data in fasta format.
Jinlong Zhang [email protected]
None.
######## fataframe2fas() example dd <- dataframe2fas(paste("AAACCCTTAAAAAAATTA TTTTCTATTGGTTTCTTGGGGGGGTT", 1:10, sep = "")) dd######## fataframe2fas() example dd <- dataframe2fas(paste("AAACCCTTAAAAAAATTA TTTTCTATTGGTTTCTTGGGGGGGTT", 1:10, sep = "")) dd
Function for calculating Restriction enzyme cutting pattern
enzCut(DNAsq, enznames, enzdata = enzdata)enzCut(DNAsq, enznames, enzdata = enzdata)
DNAsq |
The input fasta data. |
enznames |
A character vector of the restriction enzyme's names, from one to multiple names. |
enzdata |
Dataframe with first column for enzyme names, second column for enzyme cutting patterns. |
Users could add restriction sites manually according to the enzdata styles.
enz |
The selected restriction enzyme. |
RFLP.site |
The sites recognized by enzyme. |
RFLP.frag |
The fragments generated by enzyme cutting. |
TRFLP |
The fragments predicted by TRFLP |
Qiong Ding [email protected]
None.
See Also frag.dat
## enzCut() example data(enzdata) enznames <- c("EcoRI", "Acc65I") data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") enzCut(DNAsq = fas[2], enznames = "AluI", enzdata = enzdata)## enzCut() example data(enzdata) enznames <- c("EcoRI", "Acc65I") data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") enzCut(DNAsq = fas[2], enznames = "AluI", enzdata = enzdata)
The rebase restriction enzyme datasets.
data(enzdata)data(enzdata)
A data frame with 777 restriction enzymes data with first column the names of enzyme, the second column the corresponding cutting pattern.
namNames of restriction enzyme.
siteCutting pattern for each restriction enzyme.
Roberts, R.J., Vincze, T., Posfai, J., Macelis, D. (2010) REBASE–a database for DNA restriction and modification: enzymes, genes and genomes. Nucl. Acids Res. 38: D234-D236. http://rebase.neb.com
None.
data(enzdata) head(enzdata)data(enzdata) head(enzdata)
Internal Fasta format example
data(fil.fas)data(fil.fas)
Class 'fasta' with elements containing ">"indicating sequence names and the DNA sequences in subsequent elements.
From Qiong Ding
None.
data(fil.fas) fil.fasdata(fil.fas) fil.fas
Internal data in class nxs
data(fil.nxs)data(fil.nxs)
Class 'nxs'
Qiong Ding
None.
data(fil.nxs) fil.nxsdata(fil.nxs) fil.nxs
Provide an example of phylip data format.
data(fil.phy)data(fil.phy)
class 'phy'. With each line stored as one element in a character vector.
To be modified later.
Provided by Qiong Ding.
None.
data(fil.phy) fil.phydata(fil.phy) fil.phy
This function could be used to concatenate the files in the given directory.
file.cat(dir = NULL, appendix = ".fas", file = NULL)file.cat(dir = NULL, appendix = ".fas", file = NULL)
dir |
A string name the directory where files to be concatenated exist. |
appendix |
The appendix that files to be concatenated have. |
file |
The file name of the result to be save to. |
Any plain text files that match the appendix could be concatenate or copy to one file.
Copy all the contents of the files having the matched appendix to one file.
Jinlong zhang [email protected] Qiong Ding [email protected]
None.
See Also raw2Fas for copying all different fasta file contents to one.
#### file.cat() example cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna1.fas", sep = "\n") cat( ">No304", "ATTCGAAAAACACACCCACTACTAAAAATTATCAACCACT", file = "dna2.fas", sep = "\n") cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna3.fas", sep = "\n") file.cat(dir = getwd(), appendix = ".fas", file = "total") unlink("dna1.fas") unlink("dna2.fas") unlink("dna3.fas") unlink("total.fas")#### file.cat() example cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna1.fas", sep = "\n") cat( ">No304", "ATTCGAAAAACACACCCACTACTAAAAATTATCAACCACT", file = "dna2.fas", sep = "\n") cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna3.fas", sep = "\n") file.cat(dir = getwd(), appendix = ".fas", file = "total") unlink("dna1.fas") unlink("dna2.fas") unlink("dna3.fas") unlink("total.fas")
This function could be used to search probes (primer) matching sites. Users may lower the tol value to get more precise match result.
findprobe(dna, probe, tol = 3)findprobe(dna, probe, tol = 3)
dna |
The input DNA sequence. |
probe |
The probe(primer) to match the DNA sequence. |
tol |
The number of sites that do not match |
dna should be a character string. tol is used to adjust the matching precision and should be integer. The smaller the number, the more precise the matching results. This function is called by clipprobe()
for searching the sequences that could be used in PCR.
Returns a vector containing the matched sites.
To be added.
Qiong Ding [email protected]
None.
See Also clipprobe
### findprobe() example data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") findprobe(dna = fas[2], probe = "TATTTAAC", tol = 1)### findprobe() example data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") findprobe(dna = fas[2], probe = "TATTTAAC", tol = 1)
Generating reports of simulated RFLP cutting patterns.
frag.dat(fil, enznames, enzdata)frag.dat(fil, enznames, enzdata)
fil |
sequence data in class fasta. |
enznames |
selected enzyme name from enzdata. |
enzdata |
a dataframe contained enzyme information. |
Given the name of restriction enzyme, the function will give the simulated RFLP pattern. The input sequences must be a fasta format object, which means it must be first converted to class "fasta". Users are encouraged to use read.fasta, read.phy, read.nxs to read files from local machine, and converted the data to class fasta using as.fasta.
This function returns to a dataframe which including the following columns. with rownames the sequence name.
enznames |
enzyme name |
recogSite |
The recognition site of the specified enzyme. |
cutting_Site |
The cutting site number on the sequence from 5' to 3'. |
fragment_Length |
The length of each fragments from 5' to 3' |
T5 |
Length of the 5' terminal fragment from the original sequence. |
T3 |
Length of the 3' terminal fragment from the original sequence. |
To be added.
Qiong Ding [email protected]
None.
### fragdat() example data(enzdata) data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") frag.dat(fil = fas, enznames = "EcoRI", enzdata = enzdata)### fragdat() example data(enzdata) data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") frag.dat(fil = fas, enznames = "EcoRI", enzdata = enzdata)
This function could be used to obtain the names of DNA sequences from fasta objects.
gnames.fas(x = NULL)gnames.fas(x = NULL)
x |
Object with class |
To be added.
Returns the names of sequences stored in a vector of character strings.
To be added
Jinlong zhang [email protected]
None.
See Also rename.fas for renaming the names of the DNA sequences.
### gnames.fas() example data(fil.fas) gnames.fas(fil.fas)### gnames.fas() example data(fil.fas) gnames.fas(fil.fas)
Plotting the simulated RFLP or TRFLP pattern using selected restriction enzymes.
plotenz(sequences, enznames, enzdata, side = TRUE, type = c("RFLP", "TRFLP"), Terminal = c("T5", "T3"))plotenz(sequences, enznames, enzdata, side = TRUE, type = c("RFLP", "TRFLP"), Terminal = c("T5", "T3"))
sequences |
The input data in class |
enznames |
The speciefied restriction enzyme names to be applied in RFLP or TRFLP analysis. |
enzdata |
The dataframe contained enzyme data. |
side |
Whether to plot the markers for each sequence. Default is TURE which means to plot the marker only once. |
type |
Pattern type to be specified, should be either |
Terminal |
Terminal noted in |
If type = "TRFLP" (The "TRFLP" were selected), the Terminal must also been provided by the user, it's value is either "T3" or "T5".
Returns the plot of simulated RFLP or TRFLP.
Qiong Ding [email protected]
None.
See Also frag.dat for the summary of RFLP results.
## plotenz() example data(enzdata) data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") enznames <- c("EcoRI", "Acc65I", "HinfI") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = TRUE, type = "RFLP") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = FALSE, type = "RFLP") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = TRUE, type = "TRFLP", "T3")## plotenz() example data(enzdata) data(fil.phy) fas <- ConvFas(fil = fil.phy, type = "phy") enznames <- c("EcoRI", "Acc65I", "HinfI") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = TRUE, type = "RFLP") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = FALSE, type = "RFLP") plotenz(sequences = fas, enznames = enznames, enzdata = enzdata, side = TRUE, type = "TRFLP", "T3")
Given the specified directory, this function could read and convert raw DNA files to fasta format. It is an alternative to read.fasta as the later read only one fasta file. The advantage of using raw2Fas when dealing with fasta files rather than using file.cat is that this function would convert the fasta files to the fasta in a robost way.
raw2Fas(dir = NULL, appendix = ".fasta")raw2Fas(dir = NULL, appendix = ".fasta")
dir |
a character string naming the directory fasta files exist. |
appendix |
Appendix of raw DNA data files to combine. |
Only the file possesses the the specied appendix will be read and converted.
Returns the object of class "fasta".
Jinlong zhang [email protected] Qiong Ding [email protected]
None.
See Also read.fasta, file.cat for importing "fasta" files from local machine.
######### ###### ### raw2Fas() example cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna1.fas", sep = "\n") cat( ">No304", "ATTCGAAAAACACACCCACTACTAAAAATTATCAACCACT", file = "dna2.fas", sep = "\n") cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna3.fas", sep = "\n") raw2Fas(getwd(), appendix = ".fas") unlink("dna1.fas") unlink("dna2.fas") unlink("dna3.fas")######### ###### ### raw2Fas() example cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna1.fas", sep = "\n") cat( ">No304", "ATTCGAAAAACACACCCACTACTAAAAATTATCAACCACT", file = "dna2.fas", sep = "\n") cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna3.fas", sep = "\n") raw2Fas(getwd(), appendix = ".fas") unlink("dna1.fas") unlink("dna2.fas") unlink("dna3.fas")
Read fasta file from a specified file path or URL.
read.fasta(file = NULL)read.fasta(file = NULL)
file |
A character string naming the file path. |
Read fasta file from a specified file path (usually local machine) or URL.
Returns a fasta object stored as a vector of character strings.
To add.
Jinlong zhang [email protected]
None.
See Also read.phy, read.nxs for importing data from other data types.
### read.fasta() example ### cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna1.fas", sep = "\n") sequences <- read.fasta("dna1.fas") unlink("dna1.fas")### read.fasta() example ### cat( ">No305", "NTTCGAAAAACACACCCACTACTAAAANTTATCAGTCACT", file = "dna1.fas", sep = "\n") sequences <- read.fasta("dna1.fas") unlink("dna1.fas")
Function to read nexus file.
read.nxs(fil = NULL)read.nxs(fil = NULL)
fil |
A character string naming the file path. |
Read nexus file from a specified file path (usually local machine) or URL.
Returns a nexus "nxs" object stored as a vector of character strings.
To add.
Jinlong zhang [email protected]
None
See Also read.phy, read.fasta for importing data from other data types.
##### ##### read.nxs() example data(fil.nxs) writeLines(fil.nxs, "example.nxs") nxs <- read.nxs("example.nxs") as.fasta(nxs) unlink("example.nxs")##### ##### read.nxs() example data(fil.nxs) writeLines(fil.nxs, "example.nxs") nxs <- read.nxs("example.nxs") as.fasta(nxs) unlink("example.nxs")
Function to read phylip file.
read.phy(fil = NULL)read.phy(fil = NULL)
fil |
A character string naming the file path. |
Read phylip file from a specified file path (usually local machine) or URL.
Returns a nexus "nxs" object stored as a vector of character strings.
To be added.
Jinlong zhang [email protected]
None.
See Also read.nxs, read.fasta for importing data from other data types.
##### read.phy() example data(fil.phy) writeLines(fil.phy, "example.phy") phy <- read.phy("example.phy") as.fasta(phy) unlink("example.phy")##### read.phy() example data(fil.phy) writeLines(fil.phy, "example.phy") phy <- read.phy("example.phy") as.fasta(phy) unlink("example.phy")
This function could be used to change the names of the DNA squences according to given names. If no names provided by names, the function will return the original sequences.
rename.fas(x, names = NULL)rename.fas(x, names = NULL)
x |
fasta object to be renamed. |
names |
A vector of character strings indicating the names.. |
The number of names provided by the user must be equal to the number of sequences, otherwise the function will stop.
A fasta object with all the sequences with new names.
To be added.
Jinlong zhang [email protected]
None.
See Also gnames.fas, for obtaining the names of sequences from fasta objects.
### rename.fas() example data(fil.fas) rename.fas(fil.fas, name = paste("Sequence", as.character(1:19), sep = ""))### rename.fas() example data(fil.fas) rename.fas(fil.fas, name = paste("Sequence", as.character(1:19), sep = ""))
Given an segment of DNA sequence, this function will give the reverse complement sequence.
revComp(dna)revComp(dna)
dna |
A character string containing the input DNA sequence. |
Imcompletely specified base in DNA sequences must use the standard abbreviations:
R |
= G or A
|
Y |
= C or T
|
M |
= A or C
|
K |
= G or T
|
S |
= G or C
|
W |
= A or T
|
B |
= not A (C or G or T)
|
D |
= not C (A or G or T)
|
H |
= not G (A or C or T)
|
V |
= not T (A or C or G)
|
N |
= A or C or G or T
|
Returns to the reverse complement sequence.
None.
Qiong Ding [email protected]
None.
### revComp() example revComp("TTGAACC")### revComp() example revComp("TTGAACC")
Function for selecting restriction enzyme.
selEnz(names, enzdata = enzdata)selEnz(names, enzdata = enzdata)
names |
A character string indicating the restriction enzyme name. |
enzdata |
A dataframe including enzyme data. |
enzdata must be a dataframe with the first column enzyme name, the second column the restriction clipping sites.
Returns to a dataframe with only the selected enzyme information.
To be added.
Jinlong zhang [email protected] Qiong Ding [email protected]
None.
## selEnz() example data(enzdata) selEnz(enzdata = enzdata, names = "EcoRI")## selEnz() example data(enzdata) selEnz(enzdata = enzdata, names = "EcoRI")
To save the fasta format object to speciefied file.
write.fasta(sequences, file = NULL)write.fasta(sequences, file = NULL)
sequences |
The fasta object to be saved. |
file |
A character string naming the file to be saved to. |
sequences must be an object of class fasta.
Saved fasta file.
Jinlong Zhang [email protected]
None.
See Also read.fasta
data(fil.fas) write.fasta(fil.fas, "example.fasta") ## Remove the file. unlink("example.fasta")data(fil.fas) write.fasta(fil.fas, "example.fasta") ## Remove the file. unlink("example.fasta")