<commit_before>(** FASTQ data. *)


type item = {
  name: string;
  sequence: string;
  comment: string;
  qualities: string;
}
with sexp
(** Type of FASTQ items. *)


(** Errors. All errors generated by any function in the [Fastq] module
    are defined here.

    - [`sequence_and_qualities_do_not_match (position, sequence,
    qualities)] - given [sequence] and [qualities] at given [position]
    are of different lengths.

    - [`wrong_name_line x] - name line [x] does not start with '@'

    - [`wrong_comment_line _] - comment line does not start with '+'

    - [`incomplete_input (position, lines, s)] - the input ended
    prematurely. Trailing contents, which cannot be used to fully
    construct an item, are provided: [lines] is any complete lines
    parsed and [s] is any final string not ending in a newline.
*)
module Error : sig

  type t =
      [ `sequence_and_qualities_do_not_match of Biocaml_pos.t * string * string
      | `wrong_comment_line of Biocaml_pos.t * string
      | `wrong_name_line of Biocaml_pos.t * string
      | `incomplete_input of Biocaml_pos.t * string list * string option
      ]
  with sexp

  val t_to_string : t -> string
    (** Transform error to a human-readable string. *)

end

val in_channel_to_item_stream : ?buffer_size:int -> ?filename:string -> in_channel ->
  (item, Error.t) Core.Result.t Stream.t

module Exceptionful : sig
  exception Error of Error.t

  val in_channel_to_item_stream : ?buffer_size:int -> ?filename:string -> in_channel ->
    item Stream.t

end

module Transform: sig
  val string_to_item:
    ?filename:string -> unit ->
    (string, (item, [> Error.t]) Core.Result.t) Biocaml_transform.t
(** Create a full {i stoppable} [Biocaml_transform.t] from arbitrary strings to
    [item] values.*)

  val item_to_string: unit -> (item, string) Biocaml_transform.t
(** Create a full {i stoppable} [Biocaml_transform.t] from [item]
    values to strings. *)

  val trim:
    [ `beginning of int | `ending of int ] ->
    (item, (item, [> `invalid_size of int]) Core.Result.t) Biocaml_transform.t
(** Create a full {i stoppable} [Biocaml_transform.t] that trims FASTQ
    items. *)
end



<commit_msg>Fastq: fix API documentation<commit_after>(** FASTQ data. *)


type item = {
  name: string;
  sequence: string;
  comment: string;
  qualities: string;
}
(** Type of FASTQ items. *)

val item_of_sexp : Sexplib.Sexp.t -> item
val sexp_of_item : item -> Sexplib.Sexp.t

module Error : sig
  (** All errors generated by any function in the [Fastq] module
      are defined here.

    - [`sequence_and_qualities_do_not_match (position, sequence,
    qualities)] - given [sequence] and [qualities] at given [position]
    are of different lengths.

    - [`wrong_name_line x] - name line [x] does not start with '@'

    - [`wrong_comment_line _] - comment line does not start with '+'

    - [`incomplete_input (position, lines, s)] - the input ended
    prematurely. Trailing contents, which cannot be used to fully
    construct an item, are provided: [lines] is any complete lines
    parsed and [s] is any final string not ending in a newline.
  *)

  type t =
      [ `sequence_and_qualities_do_not_match of Biocaml_pos.t * string * string
      | `wrong_comment_line of Biocaml_pos.t * string
      | `wrong_name_line of Biocaml_pos.t * string
      | `incomplete_input of Biocaml_pos.t * string list * string option
      ]
  (** All possible errors. *)

  val t_of_sexp : Sexplib.Sexp.t -> t
  val t_of_sexp__ : Sexplib.Sexp.t -> t
  val sexp_of_t : t -> Sexplib.Sexp.t

  val t_to_string : t -> string
(** Transform error to a human-readable string. *)

end

val in_channel_to_item_stream : ?buffer_size:int -> ?filename:string -> in_channel ->
  (item, [> Error.t]) Core.Result.t Stream.t

module Exceptionful : sig
  exception Error of Error.t

  val in_channel_to_item_stream : ?buffer_size:int -> ?filename:string -> in_channel ->
    item Stream.t

end

module Transform: sig
  (** Lower-lever transforms. *)

  val string_to_item:
    ?filename:string -> unit ->
    (string, (item, [> Error.t]) Core.Result.t) Biocaml_transform.t
  (** Create a full {i stoppable} [Biocaml_transform.t] from arbitrary strings to
      [item] values.*)

  val item_to_string: unit -> (item, string) Biocaml_transform.t
  (** Create a full {i stoppable} [Biocaml_transform.t] from [item]
      values to strings. *)

  val trim:
    [ `beginning of int | `ending of int ] ->
    (item, (item, [> `invalid_size of int]) Core.Result.t) Biocaml_transform.t
  (** Create a full {i stoppable} [Biocaml_transform.t] that trims FASTQ
      items. *)
end




{'fraction_non_alphanumeric': 0.11103896103896103, 'fraction_numerical': 0.0, 'mean_word_length': 3.3186915887850468, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3796870', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1526, 'n_words': 487}