1
|
1
|
deleted file mode 100644
|
...
|
...
|
@@ -1,70 +0,0 @@
|
1
|
|
-% Generated by roxygen2: do not edit by hand
|
2
|
|
-% Please edit documentation in R/importOtherSegmentations.R
|
3
|
|
-\name{importChromHMMsegmentation}
|
4
|
|
-\alias{importChromHMMsegmentation}
|
5
|
|
-\title{Import ChromHMM segmentation}
|
6
|
|
-\usage{
|
7
|
|
-importChromHMMsegmentation(inputfolder, outputfolder, assembly, binsize,
|
8
|
|
- experiment.table, chrom.lengths = NULL, chromosomes = NULL,
|
9
|
|
- chromosome.format = "UCSC")
|
10
|
|
-}
|
11
|
|
-\arguments{
|
12
|
|
-\item{inputfolder}{Folder with ChromHMM output files (segmentation, emission and transition probabilities).}
|
13
|
|
-
|
14
|
|
-\item{outputfolder}{Output folder for the converted \code{\link{chromstaR-objects}}.}
|
15
|
|
-
|
16
|
|
-\item{assembly}{An assembly from which the chromosome lengths are determined. Please see \code{\link[GenomeInfoDb]{fetchExtendedChromInfoFromUCSC}} for available assemblies. Alternatively a data.frame generated by \code{\link[GenomeInfoDb]{fetchExtendedChromInfoFromUCSC}}.}
|
17
|
|
-
|
18
|
|
-\item{binsize}{The bin size in base pairs used in ChromHMM.}
|
19
|
|
-
|
20
|
|
-\item{experiment.table}{A \code{data.frame} or tab-separated text file with the structure of the experiment. See \code{\link{experiment.table}} for an example.}
|
21
|
|
-
|
22
|
|
-\item{chrom.lengths}{A named character vector with chromosome lengths. Names correspond to chromosomes.}
|
23
|
|
-
|
24
|
|
-\item{chromosomes}{A subset of chromosomes for which the bins are generated.}
|
25
|
|
-
|
26
|
|
-\item{chromosome.format}{A character specifying the format of the chromosomes if \code{assembly} is specified. Either 'NCBI' for (1,2,3 ...) or 'UCSC' for (chr1,chr2,chr3 ...).}
|
27
|
|
-}
|
28
|
|
-\value{
|
29
|
|
-A \code{\link{combinedMultiHMM}} object. Intermediate \code{\link{multiHMM}} objects are saved to \code{outputfolder}.
|
30
|
|
-}
|
31
|
|
-\description{
|
32
|
|
-Import a chromatin state segmentation produced by ChromHMM as \code{\link{chromstaR-objects}}. This is useful to perform comparative analyses or simply use chromstaR plotting or enrichment functions on a ChromHMM segmentation.
|
33
|
|
-}
|
34
|
|
-\details{
|
35
|
|
-The function takes the *segments.bed files, emissions_*.txt and transitions_*.txt files in \code{inputfolder}, and converts them into \code{\link{multiHMM}} objects for each condition that was specified in the \code{experiment.table}. All \code{\link{multiHMM}} objects are then combined into a \code{\link{combinedMultiHMM}} object and returned.
|
36
|
|
-}
|
37
|
|
-\examples{
|
38
|
|
-inputfolder <- "differential_CD4_numstates_16_binsize_1000bp"
|
39
|
|
-outputfolder <- "testconvertChromHMM2chromstar"
|
40
|
|
-assembly <- "mm9"
|
41
|
|
-binsize <- 1000
|
42
|
|
-chrom.lengths <- NULL
|
43
|
|
-chromosomes <- paste0("chr", c(1:19, "X"))
|
44
|
|
-chromosome.format <- "UCSC"
|
45
|
|
-experiment.table <- "differential_CD4_numstates_16_binsize_1000bp/experiment_table_differential_CD4.tsv"
|
46
|
|
-model <- importChromHMMsegmentation(inputfolder, outputfolder, assembly, binsize, experiment.table, chrom.lengths, chromosomes, chromosome.format)
|
47
|
|
-
|
48
|
|
-### Plot transition and emission probabilities of ChromHMM model ###
|
49
|
|
-heatmapTransitionProbs(reorder.states=FALSE, transitionProbs=model$transitionProbs)
|
50
|
|
-heatmapCombinations(emissionProbs = model$emissionProbs)
|
51
|
|
-
|
52
|
|
-### Use plotEnrichment function on imported ChromHMM segmentation ###
|
53
|
|
-library(biomaRt)
|
54
|
|
-ensembl <- useMart('ENSEMBL_MART_ENSEMBL', host='may2012.archive.ensembl.org',
|
55
|
|
- dataset='mmusculus_gene_ensembl')
|
56
|
|
-genes <- getBM(attributes=c('ensembl_gene_id', 'chromosome_name', 'start_position',
|
57
|
|
- 'end_position', 'strand', 'external_gene_id',
|
58
|
|
- 'gene_biotype'),
|
59
|
|
- mart=ensembl)
|
60
|
|
-# Transform to GRanges for easier handling
|
61
|
|
-genes <- GRanges(seqnames=paste0('chr',genes$chromosome_name),
|
62
|
|
- ranges=IRanges(start=genes$start, end=genes$end),
|
63
|
|
- strand=genes$strand,
|
64
|
|
- name=genes$external_gene_id, biotype=genes$gene_biotype)
|
65
|
|
-print(genes)
|
66
|
|
-
|
67
|
|
-ggplts <- plotEnrichment(model, annotation=genes)
|
68
|
|
-ggplts[[1]] + facet_wrap(~combination)
|
69
|
|
-
|
70
|
|
-}
|