import_association_file {ISAnalytics} | R Documentation

## Import the association file from disk

### Description

Imports the association file and immediately performs a check on the file system starting from the root to assess the alignment between the two.

### Usage

    import_association_file(
      path,
      root = NULL,
      tp_padding = 4,
      dates_format = "ymd",
      separator = "\t",
      filter_for = NULL,
      import_iss = FALSE,
      export_widget_path = NULL,
      convert_tp = TRUE,
      ...
    )

### Arguments

`path` | The path on disk to the association file.
`root` | The path on disk of the root folder of Vispa2 output or NULL. See details.
`tp_padding` | Timepoint padding, indicates the number of digits of the "Timepoint" column once imported. Fills the content with 0s up to the length specified (ex: 1 becomes 0001 with a tp_padding of 4)
`dates_format` | A single string indicating how dates should be parsed. Must be a value in: `date_formats()`
`separator` | The column separator used in the file
`filter_for` | A named list where names represent column names that must be filtered. For example: `list(ProjectID = c("PROJECT1", "PROJECT2))` will filter the association file so that it contains only those rows for which the value of the column "ProjectID" is one of the specified values. If multiple columns are present in the list all filtering conditions are applied as a logical AND.
`import_iss` | Import Vispa2 stats and merge them with the association file?
`export_widget_path` | A path on disk to save produced widgets or NULL if the user doesn't wish to save the html file
`convert_tp` | Should be time points be converted into months and years?
`...` | Additional arguments to pass to `import_Vispa2_stats`

### Details

The import series of functions is designed to work in combination with the use of Vispa2 pipeline, please refer to this article for more details: VISPA2: A Scalable Pipeline for High-Throughput Identification and Annotation of Vector Integration Sites.
The pipeline automatically produces an hierarchical structure in the file system which follows this schema:

- /root_folder

  - Optional intermediate folders

    - ProjectID
      |_bam
      |_bcmuxall
      |_bed
      |_iss
      |_quality
      |_report
      |_quantification
      *|___concatenatePoolIDSeqRun

For each ProjectID there may be several nested PoolIDs. The alignment function only looks for PoolIDs in the quantification folder, since it's the location of the matrices to import. For more details on how to properly use these functions, refer to the vignette - vignette("how_to_import_functions").
If 'NULL' the file system alignment step is skipped.

### Value

A tibble with the contents of the association file plus columns containing the path in the file system for every project and pool if found.

### See Also

`date_formats`

Other Import functions: `import_Vispa2_stats()`, `import_parallel_Vispa2Matrices_auto()`, `import_parallel_Vispa2Matrices_interactive()`, `import_single_Vispa2Matrix()`

### Examples

    op <- options("ISAnalytics.widgets" = FALSE)
    path <- system.file("extdata", "ex_association_file.tsv",
        package = "ISAnalytics"
    )
    root_pth <- system.file("extdata", "fs.zip", package = "ISAnalytics")
    root <- unzip_file_system(root_pth, "fs")
    association_file <- import_association_file(path, root, dates_format = "dmy")
    options(op)

[Package ISAnalytics version 1.2.1 Index]