view minfi_dmr.xml @ 71:1334312dc198 draft

Uploaded
author kpbioteam
date Fri, 10 May 2019 06:42:23 -0400
parents 2ee6ac5227f1
children 9c6fbb7d5a2a
line wrap: on
line source

<tool id="minfi_dmr" name="Minfi DMR" version="@MINFI_VERSION@">
    <description>to find differentially methylated regions</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code">
    <![CDATA[
     Rscript '$minfi_dmr_script'
    ]]>
    </command>
    <configfiles>
    <configfile name="minfi_dmr_script">
    <![CDATA[ 
require("minfi", quietly = TRUE)
options(warn = -1)

GRSet <- get(load('$grset'))

pheno <- read.table('$phenotype_table',skip = 1)

group <- pheno\$V2

pair <- factor(pheno\$V3)

design.matrix <- model.matrix(~ group + pair)

maxGap <- as.numeric('$maxgap_size')

  if(is.null(GRSet\$cluster)){
  cluster = NULL
  maxGap = maxGap
} else {
  cluster = GRSet\$cluster
  maxGap = NULL
}

cutoff <- as.numeric('$cutoff_size')
B <- as.numeric('$number_of_resamples')
nullMethod <- '$null_method'
coef <- 2

dmrs <- bumphunter(GRSet,
        design = design.matrix, 
        cluster = cluster,
        maxGap = maxGap,
        cutoff = cutoff, 
        nullMethod = nullMethod,
        B = B)

dmrGR <- dmrs\$table[,c(1,2,3)] 
colnames(dmrGR) <- c("chr","start","end")

write.table(dmrGR, file= '$dmr', quote = FALSE,col.names = TRUE, row.names = FALSE, sep = "\t")
 ]]>
    </configfile>
    </configfiles>
    <inputs>
        <param type="data" name="grset" format="rdata" label="Data Mapped To The Genome" help="This class (GenomicRatioSet) holds preprocessed data for Illumina methylation microarrays, mapped to a genomic
location." />
        <param type="data" name="phenotype_table" format="tabular" label="Phenotype Table"
            help="Phenotype Table must include the following information: sampleID, phenotype and paird or unpaired samples column"/>
        <param name="maxgap_size" type="integer" value="250" label="maxGap Size"
            help="If cluster is not provided this maximum location gap will be used to define cluster"/>
        <param name="cutoff_size" type="float" value="0.1" label="Cutoff Size"
            help="A numeric value. Values of the estimate of the genomic profile above the cutoff or below the negative of the cutoff will be used as candidate regions. It is possible to give two separate values (upper and lower bounds). If one value is given, the lower bound is minus the value."/> 
        <param name="number_of_resamples" type="integer" value="0" label="Number of Resamples"
            help="An integer denoting the number of resamples to use when computing null distributions. This defaults to 0. If permutations is supplied that defines the number of permutations/bootstraps and B is ignored."/>
        <param name="null_method" type="select" label="null Method" help="Method used to generate null candidate regions.">
            <option value="permutation" selected="True">permutation</option>
            <option value="bootstrap">bootstrap</option>
         </param>
    </inputs>
    <outputs>
        <data name="dmr" format="interval" label="Differentially Methylated Regions"/> 
    </outputs>
    <tests>
        <test>
            <param name="grset" value="GRSet_without_SNPs.rdata"/>
            <param name="phenotype_table" value="phenotypeTable.txt"/>
            <param name="maxgap_size" value="250"/>
            <param name="cutoff_size" value="0.1"/>
            <param name="number_of_resamples" value="0"/>
            <param name="null_method" value="permutation"/>
            <output name="dmr" file="Differentially_Methylated_Regions.interval"/>
        </test>
    </tests>
    <help><![CDATA[
Genomic Ratio Set should contain 450k arrays reads for each sample listed in Phenotype Table: sampleID phenotype paired e.g. GSM1588708 sensitive 1 

This tool is a version of the bump hunting algorithm (Andrew E Jaffe et al. 2012) adapted to the 450k array finding find differentially methylated regions DMR.

The output is an interval file with the following columns:

    - chr
    - start
    - end

    ]]></help>
    <expand macro="citations" />
</tool>