create_mutation_catalogue_from_df {YAPSA} | R Documentation

## Create a Mutational Catalogue from a data frame

### Description

This function creates a mutational catalogue from a data frame. It is a wrapper function for `create_mutation_catalogue_from_VR`: it first creates a VRanges object from the data frame by `makeVRangesFromDataFrame` and then passes this object on to the above mentioned custom function.

### Usage

    create_mutation_catalogue_from_df(
      this_df,
      this_refGenome_Seqinfo = NULL,
      this_seqnames.field = "X.CHROM",
      this_start.field = "POS",
      this_end.field = "POS",
      this_PID.field = "PID",
      this_subgroup.field = "subgroup",
      this_refGenome,
      this_wordLength,
      this_verbose = 1,
      this_rownames = c(),
      this_adapt_rownames = 1
    )

### Arguments

`this_df` | A data frame constructed from a vcf-like file of a whole cohort. The first columns are those of a standard vcf file, followed by an arbitrary number of custom or used defined columns. One of these can carry a PID (patient or sample identifyier) and one can carry subgroup information.
`this_refGenome_Seqinfo` | A seqInfo object, referring to the reference genome used. Argument passed on to `makeGRangesFromDataFrame` and thus indirectly to `makeGRangesFromDataFrame`.
`this_seqnames.field` | Indicates the name of the column in which the chromosome is encoded
`this_start.field` | Indicates the name of the column in which the start coordinate is encoded
`this_end.field` | Indicates the name of the column in which the end coordinate is encoded
`this_PID.field` | Indicates the name of the column in which the PID (patient or sample identifier) is encoded
`this_subgroup.field` | Indicates the name of the column in which the subgroup information is encoded
`this_refGenome` | The reference genome handed over to `create_mutation_catalogue_from_VR` and indirectly to `mutationContext` and used to extract the motif context of the variants in `in_vr`.
`this_wordLength` | The size of the motifs to be extracted by `mutationContext`
`this_verbose` | Verbose if `this_verbose=1`
`this_rownames` | Optional parameter to specify rownames of the mutational catalogue `V` i.e. the names of the features.
`this_adapt_rownames` | Rownames of the output `matrix` will be adapted if `this_adapt_rownames=1`

### Value

A list with entries `matrix` and `frame` obtained from `create_mutation_catalogue_from_VR`:

- `matrix`: The mutational catalogue `V`

- `frame`: Additional and meta information on rownames (features), colnames (PIDs) and subgroup attribution.

### See Also

`makeVRangesFromDataFrame`

`create_mutation_catalogue_from_VR`

### Examples

     library(BSgenome.Hsapiens.UCSC.hg19)
     data(lymphoma_test)
     word_length <- 3
     temp_list <- create_mutation_catalogue_from_df(
       lymphoma_test_df,this_seqnames.field = "CHROM",
       this_start.field = "POS",this_end.field = "POS",
       this_PID.field = "PID",this_subgroup.field = "SUBGROUP",
       this_refGenome = BSgenome.Hsapiens.UCSC.hg19,
       this_wordLength = word_length)
       dim(temp_list$matrix)
       head(temp_list$matrix)

[Package YAPSA version 1.16.0 Index]