Library
Module
Module type
Parameter
Class
Class type
A record type for FASTA files.
If you have a fasta file something like this:
>s1 apple pie
ACTG
actg
Then you would get a record
something like this:
Fasta_record.id record (* "s1" *) Fasta_record.desc record
(* Some "apple pie" *) Fasta_record.seq record
(* "ACTGactg" *)
If you have a fasta file something like this:
>s1
ACTG
actg
Then you would get a record
something like this:
Fasta_record.id record (* "s1" *) Fasta_record.desc record (* None *)
Fasta_record.seq record
(* "ACTGactg" *)
To change a part of the Fasta_record
use the with_*
functions. E.g.,
Fasta_record.with_id "apple" record
would change give you a t
with the id
set to "apple"
.
include Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
val sexp_of_t : t -> Sexplib0.Sexp.t
val create : id:string -> desc:string option -> seq:string -> t
create ~id ~desc ~seq
creates a new t
. Shouldn't raise as literally any values of the correct type are accepted.
val of_header_exn : string -> t
of_header_exn header
returns a t
from a FASTA header. May raise exceptions. Used internally for parsing FASTA files, but the code consuming the bio_io
module probably won't need to use this function.
val of_header : string -> t Core_kernel.Or_error.t
of_header header
is like of_header_exn header
except that it returns Or_error.t
rather than raising exceptions.
val to_string : t -> string
to_string t
returns a string representation of t
ready to print to a FASTA output file.
val serialize : t -> string
serialize t
returns the Sexp
of t
as a string.
val id : t -> string
id t
returns the id
of the t
.
val desc : t -> string option
desc t
returns the desc
(description) of the t
.
val seq : t -> string
seq t
returns the seq
of the t
.
with_seq new_seq t
returns a t
with new_seq
instead of the original seq
.