% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/create_riboclass.R
\name{new_riboclass}
\alias{new_riboclass}
\title{Create a RiboClass from count files and metadata.}
\usage{
new_riboclass(
  count_path,
  metadata = NULL,
  count_sep = "\\t",
  metadata_sep = ",",
  count_header = FALSE,
  count_value = 3,
  count_rnaid = 1,
  count_pos = 2,
  metadata_key = "filename",
  metadata_id = NULL
)
}
\arguments{
\item{count_path}{(required) path to the data folder containing count files.}

\item{metadata}{Data frame or path to a CSV file containing metadata.}

\item{count_sep}{Delimiter used for the CSV files.}

\item{metadata_sep}{Delimiter used in metadata (if imported from file).}

\item{count_header}{Boolean, specify if count files have a header or not.}

\item{count_value}{Name or index of the column containing count values.}

\item{count_rnaid}{Name or index of the column containing the name of the RNA in count data.}

\item{count_pos}{Name or index of the column containing the site's position in count data.}

\item{metadata_key}{(required when metadata not null) Name or index of the column containing the samples' filename.}

\item{metadata_id}{Name or index of the column containing the sample name.}
}
\value{
A RiboClass.
}
\description{
Read ribomethseq count files and their associated metadata and merge them into a RiboClass.
\strong{This is the constructor of the RiboClass S3 class.} All other functions use the RiboClass as an input.

The constructor cannot be called directly. To create a RiboClass, please use \code{\link{load_ribodata}}.
}
\details{
The RiboClass object is a S3 Class with three elements :

\strong{data} : a list of dataframe, each corresponding to a sample.
Each dataframe starts with the following columns :
\itemize{
\item rna : the name of the RNA for a given position.
\item rnapos : the position \strong{on the current RNA}.
\item count : the number of read starting (5'end) or ending (3'end) at this position.
\item site : the name of the site, which will be empty after the RiboClass creation. To fill this column, use \code{\link{annotate_site}}.
}

\strong{metadata} : a dataframe containing all information related to each sample.
This is particularly useful for technical biases correction (with \code{\link{adjust_bias}}) and plot functions (for coloring or add an extra layer of informations).
If no metadata are given, an empty one will be generated.

\strong{rna_names} : a dataframe containing original and current rna names.
The name of RNAs can be renamed for the sake of clarity on plots (with \code{\link{rename_rna}}), but the original ones can contain important information, like NCBI ID.

the path given in \strong{count_path} should contains only necessary CSV files (one per sample).
While the directory structure is not important, make sure each sample has an unique filename.

The path to the csv file or the dataframe given in \strong{metadata} must contains a filename column, as this will serve to link metadata with the dataframes in data during the RiboClass creation.
}
