| read.FASTA.entry {altcdfenvs} | R Documentation |
Set of function to work with biological sequences stored in FASTA format.
countskip.FASTA.entries(con, linebreaks = 3000) grep.FASTA.entry(pattern, con, ...) ## S3 method for class 'FASTA': print(x, ...) read.FASTA.entry(con, linebreaks = 3000) read.n.FASTA.entries(con, n, linebreaks = 3000) read.n.FASTA.entries.split(con, n, linebreaks = 3000) read.n.FASTA.headers(con, n, linebreaks = 3000) read.n.FASTA.sequences(con, n, linebreaks = 3000) skip.FASTA.entry(con, skip, linebreaks = 3000) write.FASTA(x, file="data.fasta", append = FALSE)
append |
append to the file (or not) |
con |
a connection |
file |
a file name |
linebreaks |
(to optimize the parsing, probably safe to leave it as it is) |
n |
number of entries to read |
pattern |
a pattern (to be passed to the function grep) |
skip |
number of entries to skip |
x |
a FASTA sequence object |
... |
optional arguments to be forwarded to the function
print or to the function grep |
countskip.FASTA.entries skips the remaining FASTA entries
currently remaining in the connection and return the count.
grep.FASTA.entry returns the next FASTA entry in the connection
that matches a given regular expression.
print.FASTA prints a FASTA object.
read.FASTA.entry reads the next FASTA entry in the connection.
read.n.FASTA.entries reads the n next FASTA entries and
returns a list of FASTA objects.
read.n.FASTA.entries.split reads the n next FASTA
entries and returns a list of two elements: headers and sequences.
read.n.FASTA.headers reads the n next FASTA headers.
read.n.FASTA.sequences reads the n next FASTA sequences.
skip.FASTA.entry skips a given number of FASTA entries.
write.FASTA write a FASTA object into a connection.
The value returned depends on the function. See above.
Laurent Gautier
filename <- system.file("exampleData", "sample.fasta",
package="altcdfenvs")
con <- file(filename, open="r")
fasta.seq <- grep.FASTA.entry("NM_001544\\.2", con)
close(con)
print(fasta.seq)