Learn R Programming

seqRFLP (version 1.0.1)

raw2Fas: Read and converting raw DNA files to fasta format.

Description

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.

Usage

raw2Fas(dir = NULL, appendix = ".fasta")

Arguments

dir
a character string naming the directory fasta files exist.
appendix
Appendix of raw DNA data files to combine.

Value

Returns the object of class "fasta".

Details

Only the file possesses the the specied appendix will be read and converted.

References

None.

See Also

See Also read.fasta, file.cat for importing "fasta" files from local machine.

Examples

Run this code

#########
######
### 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")

Run the code above in your browser using DataLab