The repLoad function loads repertoire files into R workspace in the immunarch format where you can immediately use them for the analysis. repLoad automatically detects the right format for your files, so all you need is simply provide the path to your files.

See "Details" for more information on supported formats. See "Examples" for diving right into it.

repLoad(.path, .format = NA)

Arguments

.path

A character string specifying the path to the input data. Input data can be one of the following:

- a single repertoire file. In this case repLoad returns an R data.frame;

- a vector of paths to repertoire files. In this case repLoad returns a list of R data.frames;

- a path to the folder with repertoire files and, if available, metadata file. If the metadata file is not presented, then the repLoad returns a list of R data.frames. If the metadata file if presented, then the repLoad returns a list with two elements "data" and "meta". "data" is an another list with repertoire R data.frames. "meta" is a data frame with the metadata.

.format

A character string specifying what format to use. See "Details" for more information on supported formats.

Leave NA (which is default) if you want `immunarch` to detect formats automatically.

Details

You can load the data either from a single file or from a folder with repertoire files. In the second case you may want to provide a metadata file. In this case you should locate it in the folder. It is necessary to name it exactly "metadata.txt". If metadata is provided, repLoad will create a list in with 2 elements your environment, namely "data" and "meta". Otherwise repLoad will create a list with the number of elements matching the number of your files.

The metadata has to be a tab delimited file with first column named "Sample". It can have any number of additional columns with arbitrary names. The first column should contain base names of files without extensions in your folder. Example:

SampleSexAge
Statusimmunoseq_1M
1Cimmunoseq_2
M2C
immunoseq_3F3A

repLoad has the ".format" argument that sets the format for input repertoire files. Do not pass it if you want immunarch to detect the formats and parse files automatically! In case you want to force the package to parse the data in a specific format, you can choose one of the several options for the argument:

- "immunoseq" - ImmunoSEQ of any version. http://www.adaptivebiotech.com/immunoseq

- "mitcr" - MiTCR. https://github.com/milaboratory/mitcr

- "mixcr" - MiXCR of any version. https://github.com/milaboratory/mixcr

- "migec" - MiGEC. http://migec.readthedocs.io/en/latest/

- "migmap" - For parsing IgBLAST results postprocessed with MigMap. https://github.com/mikessh/migmap

- "tcr" - tcR, our previous package. https://imminfo.github.io/tcr/

- "vdjtools" - VDJtools of any version. http://vdjtools-doc.readthedocs.io/en/latest/

- "imgt" - IMGT HighV-QUEST. http://www.imgt.org/HighV-QUEST/

- "airr" - adaptive immune receptor repertoire (AIRR) data format. http://docs.airr-community.org/en/latest/datarep/overview.html

- "10x" - 10XGenomics clonotype annotations tables. https://support.10xgenomics.com/single-cell-vdj/software/pipelines/latest/output/annotation

See also

immunr_data_format for immunarch data format; repSave for file saving; repOverlap, geneUsage and repDiversity for starting with immune repertoires basic statistics.

Examples

# NOT RUN {
# To load the data from a single file without specifying the data format:
immdata <- repLoad("path/to/your/folder/immunoseq_1.txt")
# To load the data from a single ImmunoSEQ file, go with:
immdata <- repLoad("path/to/your/folder/immunoseq_1.txt", .format = "immunoseq")

# Suppose you have a following structure in your folder:
# >_ ls
# immunoseq1.txt
# immunoseq2.txt
# immunoseq3.txt
# metadata.txt

# To load the whole folder with every file in it type:
immdata <- repLoad("path/to/your/folder/")

# We recommend creating a metadata file named exactly "metadata.txt" in the folder.

# In that case, when you load your data you will see:
# > immdata <- repLoad("path/to/your/folder/")
# > names(immdata)
# [1] "data" "meta"

# If you do not have "metadata.txt", you will see:
# > immdata <- repLoad("path/to/your/folder/")
# > names(immdata)
# [1] "immunoseq_1" "immunoseq_2" "immunoseq_3"
# }