# How to use import functions

Giulia Pais1*

1San Raffaele Telethon Institute for Gene Therapy - SR-Tiget, Via Olgettina 60, 20132 Milano - Italia

* giuliapais1@gmail.com, calabria.andrea@hsr.it

#### 27 October 2020

#### Package

ISAnalytics 1.0.0

# 1 Introduction to `ISAnalytics` import functions family

In this vignette we’re going to explain more in detail how functions of the import family should be used, the most common workflows to follow and more.

## 1.1 How to install ISAnalytics

To install the package run the following code:

    if(!requireNamespace("BiocManager", quietly = TRUE))
        install.packages("BiocManager")
    BiocManager::install("ISAnalytics")

To install from GitHub:

    if (!require(devtools)) {
      install.packages("devtools")
    }
    devtools::install_github("calabrialab/ISAnalytics", build_vignettes = TRUE)

    library(ISAnalytics)

## 1.2 Setting options

`ISAnalytics` has a verbose option that allows some functions to print additional information to the console while they’re executing. To disable this feature do:

    # DISABLE
    options("ISAnalytics.verbose" = FALSE)

    # ENABLE
    options("ISAnalytics.verbose" = TRUE)

Some functions also produce report in a user-friendly HTML format, to set this feature:

    # DISABLE HTML REPORTS
    options("ISAnalytics.widgets" = FALSE)

    # ENABLE HTML REPORTS
    options("ISAnalytics.widgets" = TRUE)

## 1.3 Designed to work with Vispa2 pipeline

The vast majority of the functions included in this package is designed to work in combination with Vispa2 pipeline. If you don’t know what it is, we strongly recommend you to take a look at these links:

- Article: VISPA2: Article
- BitBucket Wiki: VISPA2 Wiki

## 1.4 File system structure generated

Vispa2 produces a standard file system structure starting from a folder you specify as your workbench or root. The structure always follows this schema:

- root/
  - Optional intermediate folders
    - Projects (PROJECTID)
      - bam
      - bcmuxall
      - bed
      - iss
      - quality
      - quantification
        - Pools (concatenatePoolIDSeqRun)
      - report

We’ve included 2 examples of this structure in our package, one correct and the other one including errors or potential problems. They are both in .zip format, so you might want to unzip them if you plan to experiment with them.
An example on how to access them:

    root_correct <- system.file("extdata", "fs.zip", package = "ISAnalytics")
    root_correct <- unzip_file_system(root_correct, "fs")
    fs::dir_tree(root_correct)
    #> /tmp/RtmprqVNjy/fs
    #> ├── PROJECT1100
    #> │   ├── bam
    #> │   ├── bcmuxall
    #> │   ├── bed
    #> │   ├── iss
    #> │   │   ├── stats.sequence_PROJECT1100.ABX-LR-PL5-POOL14-1.tsv
    #> │   │   └── stats.sequence_PROJECT1100.ABX-LR-PL6-POOL15-1.tsv
    #> │   ├── quality
    #> │   ├── quantification
    #> │   │   ├── ABX-LR-PL5-POOL14-1
    #> │   │   │   ├── PROJECT1100_ABX-LR-PL5-POOL14-1_fragmentEstimate_matrix.no0.annotated.tsv.xz
    #> │   │   │   ├── PROJECT1100_ABX-LR-PL5-POOL14-1_fragmentEstimate_matrix.tsv.xz
    #> │   │   │   ├── PROJECT1100_ABX-LR-PL5-POOL14-1_seqCount_matrix.no0.annotated.tsv.xz
    #> │   │   │   └── PROJECT1100_ABX-LR-PL5-POOL14-1_seqCount_matrix.tsv.xz
    #> │   │   └── ABX-LR-PL6-POOL15-1
    #> │   │       ├── PROJECT1100_ABX-LR-PL6-POOL15-1_fragmentEstimate_matrix.no0.annotated.tsv.xz
    #> │   │       ├── PROJECT1100_ABX-LR-PL6-POOL15-1_fragmentEstimate_matrix.tsv.xz
    #> │   │       ├── PROJECT1100_ABX-LR-PL6-POOL15-1_seqCount_matrix.no0.annotated.tsv.xz
    #> │   │       └── PROJECT1100_ABX-LR-PL6-POOL15-1_seqCount_matrix.tsv.xz
    #> │   └── report
    #> ├── PROJECT1101
    #> │   ├── bam
    #> │   ├── bcmuxall
    #> │   ├── bed
    #> │   ├── iss
    #> │   │   └── stats.sequence_PROJECT1101.ABY-LR-PL4-POOL54-2.tsv
    #> │   ├── quality
    #> │   ├── quantification
    #> │   │   └── ABY-LR-PL4-POOL54-2
    #> │   │       ├── PROJECT1101_ABY-LR-PL4-POOL54-2_fragmentEstimate_matrix.no0.annotated.tsv.xz
    #> │   │       ├── PROJECT1101_ABY-LR-PL4-POOL54-2_fragmentEstimate_matrix.tsv.xz
    #> │   │       ├── PROJECT1101_ABY-LR-PL4-POOL54-2_seqCount_matrix.no0.annotated.tsv.xz
    #> │   │       └── PROJECT1101_ABY-LR-PL4-POOL54-2_seqCount_matrix.tsv.xz
    #> │   └── report
    #> └── VA
    #>     └── CLOEXP
    #>         ├── bam
    #>         ├── bcmuxall
    #>         ├── bed
    #>         ├── iss
    #>         │   └── stats.sequence_VA.POOL6-1.tsv
    #>         ├── quality
    #>         ├── quantification
    #>         │   └── POOL6-1
    #>         │       ├── VA-CLOEXP-POOL6-1_fragmentEstimate_matrix.no0.annotated.tsv.xz
    #>         │       ├── VA-CLOEXP-POOL6-1_fragmentEstimate_matrix.tsv.xz
    #>         │       ├── VA-CLOEXP-POOL6-1_seqCount_matrix.no0.annotated.tsv.xz
    #>         │       └── VA-CLOEXP-POOL6-1_seqCount_matrix.tsv.xz
    #>         └── report

# 2 Importing a single integration matrix

If you want to import a single integration matrix you can do so by using the `import_single_Vispa2Matrix` function.
This function reads the .tsv file and converts it into a tidy tibble.
If you’re not familiar with the “tidy” concept, we recommend to take a look at this link to get the basics:

- The importance of tidy data

This package is in fact based on the `tidyverse` and tries to follow its philosophy and guidelines as close as possible.
Vispa2 pipeline and the associated Create Matrix tool produce matrices with a standard structure which we’ll refer to as “messy”, because different experimental data is divided in different columns and there are a lot of NA values.

Table 1: A simple example of messy matrix.
chr | integration_locus | strand | GeneName | GeneStrand | exp_1 | exp_2 | exp_3 | exp_4 | exp_5
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
20 | 39085641 | + | MAFB | - | NA | 94925.98 | NA | NA | 61143.20
7 | 155446768 | + | RBM33 | + | NA | NA | 68981.02 | NA | NA
19 | 12278742 | - | ZNF136 | + | NA | NA | 60410.18 | NA | 68463.19
6 | 1865825 | - | GMDS | - | NA | NA | NA | 46666.04 | NA
7 | 21508806 | + | SP4 | + | NA | NA | NA | NA | NA
17 | 5187666 | + | RABEP1 | + | NA | NA | NA | NA | NA

    example_matrix_path <- system.file("extdata", "ex_annotated_ISMatrix.tsv.xz",
                                       package = "ISAnalytics")
    imported_im <- import_single_Vispa2Matrix(example_matrix_path)

Table 2: Example of tidy integration matrix
chr | integration_locus | strand | GeneName | GeneStrand | CompleteAmplificationID | Value
--- | --- | --- | --- | --- | --- | ---
1 | 8744319 | - | RERE | - | exp_2 | 85050.01
1 | 8744319 | - | RERE | - | exp_3 | 36910.66
1 | 89274341 | + | PKN2 | + | exp_2 | 12566.61
1 | 89274341 | + | PKN2 | + | exp_3 | 61319.67
2 | 33962502 | + | LINC01317 | + | exp_2 | 20246.97
2 | 33962502 | + | LINC01317 | + | exp_3 | 98047.22

We will refer to the structure generated by `import_single_Vispa2Matrix` as “integration matrix” for convenience.
To be considered an integration matrix the tibble must contain the mandatory variables, which are “chr” (chromosome), “integration_locus” and “strand”. It might also contain annotation variables if the matrix was annotated during the Vispa2 pipeline run.
You can access these names by using two functions:

    # Displays the mandatory vars, can be called also for manipulation purposes
    # on tibble instead of calling individual variables
    mandatory_IS_vars()
    #> [1] "chr"               "integration_locus" "strand"

    # Displays the annotation variables
    annotation_IS_vars()
    #> [1] "GeneName"   "GeneStrand"

You can of course operate on the integration matrices as you would on any other tibble, but some functions will check the presence of specific columns because they’re needed in that context.

# 3 Importing the association file

While you can import single matrices for brief analysis, what you would like to do most of the times is import multiple matrices at once, based on certain parameters. To do that you must first import the association file, which is the file that holds all associated metadata and information about every project, pool and single experiment.
The function that imports this file does not simply read it into your R environment, but performs an alignment check with your file system, so you have to specify the path to the root folder where your Vispa2 runs produce output (see the previous section). To import the association file do:

    options(ISAnalytics.widgets = FALSE)
    path_as_file <- system.file("extdata", "ex_association_file.tsv",
                                package = "ISAnalytics")
    association_file <- import_association_file(path_as_file, root_correct)

If you have the “widgets” option active, this will produce a visual HTML report of the results of the alignment check, either in Rstudio or in your browser.
If projects or pools are missing you will be notified: until you fix those problems, those elements will be ignored until you re-import the association file.

# 4 Importing multiple matrices in parallel

There are 2 different functions for importing multiple matrices in parallel:

- `import_parallel_Vispa2Matrices_interactive`
- `import_parallel_Vispa2Matrices_auto`

The interactive version will ask you to input your choices directly into the console, the automatic version will not, but has some limitations.
Both functions rely on the association file and some basic parameters, most notably:

- `quantification_type`: this is a string or a vector of characters indicating which quantification types you want the function to look for. The possible values are fragmentEstimate, seqCount, barcodeCount, cellCount, ShsCount
- `matrix_type`: tells the function if it should consider annotated or not annotated matrices. The only possible options are “annotated” and “not_annotated”
- `workers`: indicates the number of parallel workers to instantiate when importing. Keep in mind that the higher is the number, the faster the process is, but also higher is the RAM peak, so you should be aware of this especially if you’re dealing with really big matrices. Set this parameter according to your needs and according to your hardware specifications.

Both the versions will produce several HTML reports after all key steps, such as:

- Report on which files were found, reporting eventual anomalies (missing files or duplicates)
- Report on which files were chosen for import after interactive selection or after automatic filtering
- Report on which files were actually imported, signaling potential errors during the import phase

Both the functions, by default, return a named list which names are the quantification types specified in input and the elements are integration matrices, obtained by binding rows of all imported matrices for the same quantification type. If the parameter `multi_quant_matrix` is set to TRUE, the function will automatically produce a single multi-quantification matrix via `comparison_matrix` (see `?comparison_matrix` for details).

## 4.1 Interactive version

As stated before, with the interactive version you have more control and you can directly choose:

- Which projects to import
- Which pools to import
- If duplicates files are found which ones are to be kept

If you haven’t imported the association file yet, you can directly pass the path to the association file and the path to the root folder into the function: in this way the association file will automatically be imported.

Example:

    matrices <- import_parallel_Vispa2Matrices_interactive(
      association_file = path_as_file,
      root = root_correct,
      quantification_type = c("fragmentEstimate", "seqCount"),
      matrix_type = "annotated",
      workers = 2)

If you’ve already imported the association file you can instead call the function like this:

    matrices <- import_parallel_Vispa2Matrices_interactive(
      association_file = association_file,
      root = NULL,
      quantification_type = c("fragmentEstimate", "seqCount"),
      matrix_type = "annotated",
      workers = 2)

You can simply access the data frames by doing:

    matrices$fragmentEstimate
    matrices$seqCount

## 4.2 Automatic version

If you choose to opt for the automatic version you should keep in mind that the function automatically considers everything included in the association file, so if you want to import only a subset of projects and/or pools you should filter the association file according to your criteria before calling the function:

    library(magrittr)
    refined_af <- association_file %>% dplyr::filter(.data$ProjectID == "CLOEXP")

NOTE: do not drop any columns when filtering the association file or the file will be flagged as malformed

In automatic version there is no way of discriminating duplicates, so there is the possibility to specify additional patterns to look for in file names to mitigate this problem. However, if after matching of the additional patterns duplicates are still found they’re simply discarded.

There are 2 additional parameters to set:

- `patterns`: a string or a character vector containing regular expressions to be matched on file names. If you’re not familiar with regular expressions, I suggest you to start from here stringr cheatsheet
- `matching_opt`: a single string that tells the function how to match the patterns. The possible values for this parameter are ANY, ALL, OPTIONAL:
  - ANY : looks for files that match at least one of the patterns specified in `patterns`
  - ALL: looks for files that match all the patterns specified in `patterns`
  - OPTIONAL: looks for files that preferentially match all the patterns, if none are found looks for files that match any of the patterns and finally if none are found simply looks for files present that match the quantification type.

You can call the function with `patterns` set to NULL if you don’t wish to match anything:

    matrices_auto <- import_parallel_Vispa2Matrices_auto(
      association_file = refined_af,
      root = NULL,
      quantification_type = c("fragmentEstimate","seqCount"),
      matrix_type = "annotated",
      workers = 2,
      patterns = NULL,
      matching_opt = "ANY" # Same if you choose "ALL" or "OPTIONAL"
    )
    matrices_auto
    #> $fragmentEstimate
    #> # A tibble: 1,476 x 7
    #>    chr   integration_locus strand GeneName GeneStrand CompleteAmplificationID                                      Value
    #>    <chr>             <int> <chr>  <chr>    <chr>      <chr>                                                        <dbl>
    #>  1 1             100903226 +      CDC14A   +          CLOEXP_POOL6_LTR30LC30_VA2020-mix11_VA2020-mix11_lenti_737.…  1.00
    #>  2 1             101724095 -      S1PR1    +          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…  2.00
    #>  3 1             108208779 +      VAV3     -          CLOEXP_POOL6_LTR32LC32_VA2020-mix13_VA2020-mix13_lenti_737.…  1.00
    #>  4 1             108412817 -      VAV3     -          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…  1.00
    #>  5 1             108412817 -      VAV3     -          CLOEXP_POOL6_LTR12LC12_VA2020-mix12_VA2020-mix12_lenti_737.…  1.00
    #>  6 1             108511440 +      VAV3-AS1 +          CLOEXP_POOL6_LTR49LC49_VA2020-mix11_VA2020-mix11_lenti_737.…  1.00
    #>  7 1             109689050 +      KIAA1324 +          CLOEXP_POOL6_LTR29LC29_VA2020-mix10_VA2020-mix10_lenti_737.…  1.00
    #>  8 1             111411778 +      CD53     +          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…  1.00
    #>  9 1             111411778 +      CD53     +          CLOEXP_POOL6_LTR32LC32_VA2020-mix13_VA2020-mix13_lenti_737.…  1.00
    #> 10 1             111466980 -      LRIF1    -          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…  1.00
    #> # … with 1,466 more rows
    #>
    #> $seqCount
    #> # A tibble: 1,476 x 7
    #>    chr   integration_locus strand GeneName GeneStrand CompleteAmplificationID                                      Value
    #>    <chr>             <int> <chr>  <chr>    <chr>      <chr>                                                        <int>
    #>  1 1             100903226 +      CDC14A   +          CLOEXP_POOL6_LTR30LC30_VA2020-mix11_VA2020-mix11_lenti_737.…     1
    #>  2 1             101724095 -      S1PR1    +          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…     2
    #>  3 1             108208779 +      VAV3     -          CLOEXP_POOL6_LTR32LC32_VA2020-mix13_VA2020-mix13_lenti_737.…     1
    #>  4 1             108412817 -      VAV3     -          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…     1
    #>  5 1             108412817 -      VAV3     -          CLOEXP_POOL6_LTR12LC12_VA2020-mix12_VA2020-mix12_lenti_737.…     1
    #>  6 1             108511440 +      VAV3-AS1 +          CLOEXP_POOL6_LTR49LC49_VA2020-mix11_VA2020-mix11_lenti_737.…     1
    #>  7 1             109689050 +      KIAA1324 +          CLOEXP_POOL6_LTR29LC29_VA2020-mix10_VA2020-mix10_lenti_737.…     1
    #>  8 1             111411778 +      CD53     +          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…     1
    #>  9 1             111411778 +      CD53     +          CLOEXP_POOL6_LTR32LC32_VA2020-mix13_VA2020-mix13_lenti_737.…     1
    #> 10 1             111466980 -      LRIF1    -          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…     1
    #> # … with 1,466 more rows

Let’s do an example with a file system where there are issues, such as duplicates:

    root_err <- system.file("extdata", "fserr.zip", package = "ISAnalytics")
    root_err <- unzip_file_system(root_err, "fserr")
    fs::dir_tree(root_err)
    #> /tmp/RtmprqVNjy/fserr
    #> ├── PROJECT1100
    #> │   ├── bam
    #> │   ├── bcmuxall
    #> │   ├── bed
    #> │   ├── iss
    #> │   │   └── stats.sequence_PROJECT1100.ABX-LR-PL5-POOL14-1.tsv
    #> │   ├── quality
    #> │   ├── quantification
    #> │   │   ├── ABX-LR-PL5-POOL14-1
    #> │   │   │   ├── PROJECT1100_ABX-LR-PL5-POOL14-1_fragmentEstimate_matrix-NoMate.no0.annotated.tsv.xz
    #> │   │   │   ├── PROJECT1100_ABX-LR-PL5-POOL14-1_fragmentEstimate_matrix-NoMate2.no0.annotated.tsv.xz
    #> │   │   │   ├── PROJECT1100_ABX-LR-PL5-POOL14-1_fragmentEstimate_matrix.no0.annotated.tsv.xz
    #> │   │   │   └── PROJECT1100_ABX-LR-PL5-POOL14-1_seqCount_matrix.no0.annotated.tsv.xz
    #> │   │   └── ABX-LR-PL6-POOL15-1
    #> │   │       ├── PROJECT1100_ABX-LR-PL6-POOL15-1_fragmentEstimate_matrix.no0.annotated.tsv.xz
    #> │   │       └── PROJECT1100_ABX-LR-PL6-POOL15-1_seqCount_matrix.no0.annotated.tsv.xz
    #> │   └── report
    #> └── VA
    #>     └── CLOEXP
    #>         ├── bam
    #>         ├── bcmuxall
    #>         ├── bed
    #>         ├── iss
    #>         │   └── stats.sequence_VA.POOL6-1.tsv
    #>         ├── quality
    #>         ├── quantification
    #>         │   └── POOL6-1
    #>         │       ├── VA-CLOEXP-POOL6-1_fragmentEstimate_matrix-NoMate.no0.annotated.tsv.xz
    #>         │       ├── VA-CLOEXP-POOL6-1_fragmentEstimate_matrix.no0.annotated.tsv.xz
    #>         │       ├── VA-CLOEXP-POOL6-1_fragmentEstimate_matrix.tsv.xz
    #>         │       ├── VA-CLOEXP-POOL6-1_seqCount_matrix-NoMate.no0.annotated.tsv.xz
    #>         │       ├── VA-CLOEXP-POOL6-1_seqCount_matrix.no0.annotated.tsv.xz
    #>         │       └── VA-CLOEXP-POOL6-1_seqCount_matrix.tsv.xz
    #>         └── report
    association_file_fserr <- import_association_file(path_as_file, root_err)
    #> Warning: One or more projects were not found in the filesystem starting from /tmp/RtmprqVNjy/fserr, please check
    #> yourassociation file for errors and/or your file system.Until you re-import the association file these missing files
    #> will be ignored.
    refined_af_err <- association_file_fserr %>%
      dplyr::filter(.data$ProjectID == "CLOEXP")
    matrices_auto2 <- import_parallel_Vispa2Matrices_auto(
      association_file = refined_af_err,
      root = NULL,
      quantification_type = c("fragmentEstimate","seqCount"),
      matrix_type = "annotated",
      workers = 2,
      patterns = "NoMate",
      matching_opt = "ANY" # Same if you choose "ALL" or "OPTIONAL"
    )
    matrices_auto
    #> $fragmentEstimate
    #> # A tibble: 1,476 x 7
    #>    chr   integration_locus strand GeneName GeneStrand CompleteAmplificationID                                      Value
    #>    <chr>             <int> <chr>  <chr>    <chr>      <chr>                                                        <dbl>
    #>  1 1             100903226 +      CDC14A   +          CLOEXP_POOL6_LTR30LC30_VA2020-mix11_VA2020-mix11_lenti_737.…  1.00
    #>  2 1             101724095 -      S1PR1    +          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…  2.00
    #>  3 1             108208779 +      VAV3     -          CLOEXP_POOL6_LTR32LC32_VA2020-mix13_VA2020-mix13_lenti_737.…  1.00
    #>  4 1             108412817 -      VAV3     -          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…  1.00
    #>  5 1             108412817 -      VAV3     -          CLOEXP_POOL6_LTR12LC12_VA2020-mix12_VA2020-mix12_lenti_737.…  1.00
    #>  6 1             108511440 +      VAV3-AS1 +          CLOEXP_POOL6_LTR49LC49_VA2020-mix11_VA2020-mix11_lenti_737.…  1.00
    #>  7 1             109689050 +      KIAA1324 +          CLOEXP_POOL6_LTR29LC29_VA2020-mix10_VA2020-mix10_lenti_737.…  1.00
    #>  8 1             111411778 +      CD53     +          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…  1.00
    #>  9 1             111411778 +      CD53     +          CLOEXP_POOL6_LTR32LC32_VA2020-mix13_VA2020-mix13_lenti_737.…  1.00
    #> 10 1             111466980 -      LRIF1    -          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…  1.00
    #> # … with 1,466 more rows
    #>
    #> $seqCount
    #> # A tibble: 1,476 x 7
    #>    chr   integration_locus strand GeneName GeneStrand CompleteAmplificationID                                      Value
    #>    <chr>             <int> <chr>  <chr>    <chr>      <chr>                                                        <int>
    #>  1 1             100903226 +      CDC14A   +          CLOEXP_POOL6_LTR30LC30_VA2020-mix11_VA2020-mix11_lenti_737.…     1
    #>  2 1             101724095 -      S1PR1    +          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…     2
    #>  3 1             108208779 +      VAV3     -          CLOEXP_POOL6_LTR32LC32_VA2020-mix13_VA2020-mix13_lenti_737.…     1
    #>  4 1             108412817 -      VAV3     -          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…     1
    #>  5 1             108412817 -      VAV3     -          CLOEXP_POOL6_LTR12LC12_VA2020-mix12_VA2020-mix12_lenti_737.…     1
    #>  6 1             108511440 +      VAV3-AS1 +          CLOEXP_POOL6_LTR49LC49_VA2020-mix11_VA2020-mix11_lenti_737.…     1
    #>  7 1             109689050 +      KIAA1324 +          CLOEXP_POOL6_LTR29LC29_VA2020-mix10_VA2020-mix10_lenti_737.…     1
    #>  8 1             111411778 +      CD53     +          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…     1
    #>  9 1             111411778 +      CD53     +          CLOEXP_POOL6_LTR32LC32_VA2020-mix13_VA2020-mix13_lenti_737.…     1
    #> 10 1             111466980 -      LRIF1    -          CLOEXP_POOL6_LTR10LC10_VA2020-mix10_VA2020-mix10_lenti_737.…     1
    #> # … with 1,466 more rows

As you can see, in the file system with issues we have more than one file for quantification type, duplicates have “NoMate” suffix in their file name. By specifying this pattern in the function, we’re only going to import those files.

As for the interactive version, you can call the function with path to the association file and root if you want to simply import everything without filtering.

# 5 Reproducibility

The ISAnalytics package (calabrialab, 2020) was made possible thanks to:

- R (R Core Team, 2020)
- BiocStyle (Oleś, Morgan, and Huber, 2020)
- knitcitations (Boettiger, 2019)
- knitr (Xie, 2020)
- rmarkdown (Allaire, Xie, McPherson, Luraschi, et al., 2020)
- sessioninfo (Csárdi, core, Wickham, Chang, et al., 2018)
- testthat (Wickham, 2011)

This package was developed using biocthis.

`R` session information.

    #> ─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
    #>  setting  value
    #>  version  R version 4.0.3 (2020-10-10)
    #>  os       Ubuntu 18.04.5 LTS
    #>  system   x86_64, linux-gnu
    #>  ui       X11
    #>  language (EN)
    #>  collate  C
    #>  ctype    en_US.UTF-8
    #>  tz       America/New_York
    #>  date     2020-10-27
    #>
    #> ─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
    #>  package       * version date       lib source
    #>  assertthat      0.2.1   2019-03-21 [2] CRAN (R 4.0.3)
    #>  bibtex          0.4.2.3 2020-09-19 [2] CRAN (R 4.0.3)
    #>  BiocManager     1.30.10 2019-11-16 [2] CRAN (R 4.0.3)
    #>  BiocParallel    1.24.0  2020-10-27 [2] Bioconductor
    #>  BiocStyle     * 2.18.0  2020-10-27 [2] Bioconductor
    #>  bookdown        0.21    2020-10-13 [2] CRAN (R 4.0.3)
    #>  cli             2.1.0   2020-10-12 [2] CRAN (R 4.0.3)
    #>  colorspace      1.4-1   2019-03-18 [2] CRAN (R 4.0.3)
    #>  crayon          1.3.4   2017-09-16 [2] CRAN (R 4.0.3)
    #>  digest          0.6.27  2020-10-24 [2] CRAN (R 4.0.3)
    #>  dplyr           1.0.2   2020-08-18 [2] CRAN (R 4.0.3)
    #>  ellipsis        0.3.1   2020-05-15 [2] CRAN (R 4.0.3)
    #>  evaluate        0.14    2019-05-28 [2] CRAN (R 4.0.3)
    #>  fansi           0.4.1   2020-01-08 [2] CRAN (R 4.0.3)
    #>  forcats         0.5.0   2020-03-01 [2] CRAN (R 4.0.3)
    #>  fs              1.5.0   2020-07-31 [2] CRAN (R 4.0.3)
    #>  generics        0.0.2   2018-11-29 [2] CRAN (R 4.0.3)
    #>  ggplot2         3.3.2   2020-06-19 [2] CRAN (R 4.0.3)
    #>  ggrepel         0.8.2   2020-03-08 [2] CRAN (R 4.0.3)
    #>  glue            1.4.2   2020-08-27 [2] CRAN (R 4.0.3)
    #>  gtable          0.3.0   2019-03-25 [2] CRAN (R 4.0.3)
    #>  highr           0.8     2019-03-20 [2] CRAN (R 4.0.3)
    #>  hms             0.5.3   2020-01-08 [2] CRAN (R 4.0.3)
    #>  htmltools       0.5.0   2020-06-16 [2] CRAN (R 4.0.3)
    #>  htmlwidgets     1.5.2   2020-10-03 [2] CRAN (R 4.0.3)
    #>  httr            1.4.2   2020-07-20 [2] CRAN (R 4.0.3)
    #>  ISAnalytics   * 1.0.0   2020-10-27 [1] Bioconductor
    #>  jsonlite        1.7.1   2020-09-07 [2] CRAN (R 4.0.3)
    #>  knitcitations * 1.0.10  2019-09-15 [2] CRAN (R 4.0.3)
    #>  knitr           1.30    2020-09-22 [2] CRAN (R 4.0.3)
    #>  lattice         0.20-41 2020-04-02 [2] CRAN (R 4.0.3)
    #>  lifecycle       0.2.0   2020-03-06 [2] CRAN (R 4.0.3)
    #>  lubridate       1.7.9   2020-06-08 [2] CRAN (R 4.0.3)
    #>  magrittr      * 1.5     2014-11-22 [2] CRAN (R 4.0.3)
    #>  mnormt          2.0.2   2020-09-01 [2] CRAN (R 4.0.3)
    #>  munsell         0.5.0   2018-06-12 [2] CRAN (R 4.0.3)
    #>  nlme            3.1-150 2020-10-24 [2] CRAN (R 4.0.3)
    #>  pillar          1.4.6   2020-07-10 [2] CRAN (R 4.0.3)
    #>  pkgconfig       2.0.3   2019-09-22 [2] CRAN (R 4.0.3)
    #>  plyr            1.8.6   2020-03-03 [2] CRAN (R 4.0.3)
    #>  psych           2.0.9   2020-10-05 [2] CRAN (R 4.0.3)
    #>  purrr           0.3.4   2020-04-17 [2] CRAN (R 4.0.3)
    #>  R6              2.4.1   2019-11-12 [2] CRAN (R 4.0.3)
    #>  Rcpp            1.0.5   2020-07-06 [2] CRAN (R 4.0.3)
    #>  reactable       0.2.3   2020-10-04 [2] CRAN (R 4.0.3)
    #>  readr           1.4.0   2020-10-05 [2] CRAN (R 4.0.3)
    #>  RefManageR      1.2.12  2019-04-03 [2] CRAN (R 4.0.3)
    #>  rlang           0.4.8   2020-10-08 [2] CRAN (R 4.0.3)
    #>  rmarkdown       2.5     2020-10-21 [2] CRAN (R 4.0.3)
    #>  scales          1.1.1   2020-05-11 [2] CRAN (R 4.0.3)
    #>  sessioninfo   * 1.1.1   2018-11-05 [2] CRAN (R 4.0.3)
    #>  stringi         1.5.3   2020-09-09 [2] CRAN (R 4.0.3)
    #>  stringr         1.4.0   2019-02-10 [2] CRAN (R 4.0.3)
    #>  tibble          3.0.4   2020-10-12 [2] CRAN (R 4.0.3)
    #>  tidyr           1.1.2   2020-08-27 [2] CRAN (R 4.0.3)
    #>  tidyselect      1.1.0   2020-05-11 [2] CRAN (R 4.0.3)
    #>  tmvnsim         1.0-2   2016-12-15 [2] CRAN (R 4.0.3)
    #>  utf8            1.1.4   2018-05-24 [2] CRAN (R 4.0.3)
    #>  vctrs           0.3.4   2020-08-29 [2] CRAN (R 4.0.3)
    #>  withr           2.3.0   2020-09-22 [2] CRAN (R 4.0.3)
    #>  xfun            0.18    2020-09-29 [2] CRAN (R 4.0.3)
    #>  xml2            1.3.2   2020-04-23 [2] CRAN (R 4.0.3)
    #>  yaml            2.2.1   2020-02-01 [2] CRAN (R 4.0.3)
    #>  zip             2.1.1   2020-08-27 [2] CRAN (R 4.0.3)
    #>
    #> [1] /tmp/Rtmpqdg3Jr/Rinst3413112d5c7f
    #> [2] /home/biocbuild/bbs-3.12-bioc/R/library

# 6 Bibliography

This vignette was generated using BiocStyle (Oleś, Morgan, and Huber, 2020) with knitr (Xie, 2020) and rmarkdown (Allaire, Xie, McPherson, Luraschi, et al., 2020) running behind the scenes.

Citations made with knitcitations (Boettiger, 2019).

[1] J. Allaire, Y. Xie, J. McPherson, J. Luraschi, et al. rmarkdown: Dynamic Documents for R. R package version 2.5. 2020. <URL: https://github.com/rstudio/rmarkdown>.

[2] C. Boettiger. knitcitations: Citations for ‘Knitr’ Markdown Files. R package version 1.0.10. 2019. <URL: https://CRAN.R-project.org/package=knitcitations>.

[3] G. Csárdi, R. core, H. Wickham, W. Chang, et al. sessioninfo: R Session Information. R package version 1.1.1. 2018. <URL: https://CRAN.R-project.org/package=sessioninfo>.

[4] A. Oleś, M. Morgan, and W. Huber. BiocStyle: Standard styles for vignettes and other Bioconductor documents. R package version 2.18.0. 2020. <URL: https://github.com/Bioconductor/BiocStyle>.

[5] R Core Team. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing. Vienna, Austria, 2020. <URL: https://www.R-project.org/>.

[6] H. Wickham. “testthat: Get Started with Testing”. In: The R Journal 3 (2011), pp. 5-10. <URL: https://journal.r-project.org/archive/2011-1/RJournal_2011-1_Wickham.pdf>.

[7] Y. Xie. knitr: A General-Purpose Package for Dynamic Report Generation in R. R package version 1.30. 2020. <URL: https://yihui.org/knitr/>.

[8] calabrialab. Analyze gene therapy vector insertion sites data identified from genomics next generation sequencing reads for clonal tracking studies. https://github.com/calabrialab/ISAnalytics - R package version 1.0.0. 2020. DOI: 10.18129/B9.bioc.ISAnalytics. <URL: http://www.bioconductor.org/packages/ISAnalytics>.