Skip to content

Commit

Permalink
Merge pull request #3 from loosolab/hic_dev
Browse files Browse the repository at this point in the history
Hic dev
renewiegandt committed Aug 16, 2018
2 parents c5026d3 + dde6d8c commit 0f6778b
Showing 7 changed files with 205 additions and 111 deletions.
9 changes: 5 additions & 4 deletions RLIB/cis_matrix_body_multi.R
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ require(plyr, quietly = TRUE)
require(RColorBrewer, quietly = TRUE)
require(gridExtra, quietly = TRUE)
require(grid, quietly = TRUE)
require(ggplot2 ,quietly = TRUE)
##require(ggplot2 ,quietly = TRUE)
require(ggpmisc, quietly = TRUE)
if ( !(require("ggbio")) ) {
biocLite("ggbio")
@@ -145,7 +145,7 @@ if(colour_range[2] == 0){
#}

wh <- GenomicRanges::GRanges(region[["chr"]], IRanges::IRanges(as.integer(region[["start"]]),as.integer(region[["end"]])))
tset <- ggbio::autoplot(txdb , which = wh, genome.axis = FALSE, names.expr = "tx_name")
tset <- ggbio::autoplot(txdb , which = wh, genome.axis = FALSE, names.expr = "gene_id")
p2 <- tset@ggplot


@@ -154,15 +154,16 @@ palette <- c(
rgb(0,0,255,maxColorValue=255),
rgb(152,20,18,maxColorValue=255),
rgb(240,48,0,maxColorValue=255),
rgb(255,188,39,maxColorValue=255))
rgb(255,188,39,maxColorValue=255),
rgb(124,252,0,maxColorValue=255))

# triangle plot
message(paste("Constructing plot"))
p <- ggplot2::ggplot()
p <- p + geom_polygon(aes(x=x, y=y, group=group), fill="black", data=rotated_bg)
if(add_borders_to_elements){
p <- p + geom_polygon(aes(x=x, y=y, group=group, fill=signal, colour=signal), data=rotated_data, size=0.2)
p <- p + scale_colour_gradientn(limits=colour_range, colours=palette, na.value = "green")
p <- p + scale_colour_gradientn(limits=colour_range, colours=palette, na.value = "green", guide = "colourbar")
} else {
p <- p + geom_polygon(aes(x=x, y=y, group=group, fill=signal), data=rotated_data)
}
230 changes: 145 additions & 85 deletions TOuCAN.nf

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions bin/xaxis_scaling.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env Rscript
args <- commandArgs(trailingOnly=TRUE)

path <- args[1]
start <- as.numeric(args[2])
end <- as.numeric(args[3])
out <- args[4] #"./out.txt"

tad <- data.table::fread(path, header = TRUE , sep = ' ')
xaxis <- tad[,1]
xmax <- max(xaxis)

newxaxis <- lapply(xaxis, function(x){
new_x <- (((end - start) * x) / xmax) + start
})

tad[,1] <- round(unlist(newxaxis[1]))

data.table::fwrite(tad, file = out, col.names = TRUE, sep = ' ', quote = FALSE)
10 changes: 10 additions & 0 deletions envtoucan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: envtoucan
channels:
- bioconda
- conda-forge
- defaults
dependencies:
- bwa=0.7.15
- samtools=1.3.1
- bedtools=2.27.1
- bowtie2=2.3.3.1
Binary file modified multiplot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 18 additions & 22 deletions nextflow.config
Original file line number Diff line number Diff line change
@@ -1,35 +1,21 @@

//Paths to dependencies
env {
path_bowtie2 = "/mnt/software/x86_64/packages/bowtie2/2.3.3.1/" //Path to bowtie2
path_python = "/mnt/software/x86_64/packages/python/2.7.8-anaconda-5.1.0-stretch/bin" //Path to python
path_bwa = "/mnt/software/x86_64/packages/bwa/0.7.12/bin" //Path to bwa
path_samtools = "/mnt/software/x86_64/packages/samtools/1.3.1/bin" //Path to samtools
path_bedtools = "/mnt/software/x86_64/packages/bedtools/2.27.1/bin" //Path to bedtools
path_R = "/mnt/software/x86_64/packages/r/3.4.4-stretch-local/bin" //Path to R

path_bin = "/mnt/workspace1/rene.wiegandt/NextFlow/script/THCPipe" // Path to T2C analysis scripts
path_working = "/mnt/workspace1/rene.wiegandt/NextFlow/script/THCPipe" //Path to directory where files are stored. If restriction maps are already existing put them in folder 01_restriction_maps inside this working_dir
path_bin = "/mnt/workspace1/rene.wiegandt/NextFlow/script/TOuCAN" // Path to T2C analysis scripts
path_working = "/mnt/workspace1/rene.wiegandt/NextFlow/script/TOuCAN" //Path to directory where files are stored. If restriction maps are already existing put them in folder 01_restriction_maps inside this working_dir

path_genome = "/mnt/workspace1/rene.wiegandt/NextFlow/script/THCPipe/index_bwa/GRCm38.p5.genome_whitelist.fa" // Path to full genome in fasta format + basis name of index [e.g. GRCm38.p5.genome_whitelist.fa]
path_gtf = "/mnt/agnerds/Rene.Wiegandt/fromMario/gencode.vM15.annotation.gtf"

path_T2C_restriction_maps = "${path_working}/01_restriction_maps" //If empty restriction maps are generated [typically: path_working + /01_restriction_maps/]. If empty files are generated
//path_bam_files = "/mnt/workspace1/rene.wiegandt/NextFlow/script/THCPipe/temp/" //Path to alingment files. If empty files are generated

uropa_feature = "" // "String,String,String,..."
uropa_anchor = "" // "String,String,String,..."
uropa_dist_1 = 1000
uropa_dist_2 = 1000
uropa_strand = "" // single argument "String"
uropa_direction = "any_direction" // "String,String,String,..."
uropa_filter_attr = "" // "String,String,String,..."
uropa_attr_value = "" // "String,String,String,..."
uropa_show_attr = "gene_id,gene_type,gene_name,level,transcript_type,transcript_support_level" // "String,String,String,..."

}

params {
sample_extension = "_R[12]_001"//"_R[12]_001" // regex for sample extension [e.g "_R[12]_001" or "_R[12]"]
sample_extension = "_R[12]_001" // regex for sample extension [e.g "_R[12]_001" or "_R[12]"]

// Enzyme Information
// -------------------------------------------
@@ -40,8 +26,8 @@ params {

// Minor fixed parameters for BWA and SAMtools
// -------------------------------------------
bwa_T2C_options = "-t 4" // bwa aln
sort_options = "--threads 4"
bwa_T2C_options = "-t 16" // bwa aln
sort_options = "--threads 16"
library_label = "capture"
platform_label = "ILLUMINA"
center_label = "ECB"
@@ -55,9 +41,19 @@ params {

//Parameter for HiC matrix
//--------------------------------------------
hicBuildMatrix_options = "--threads 4 --inputBufferSize 100000"
bwa_HiC_options = "" // bwa mem
hicBuildMatrix_options = "--threads 16 --inputBufferSize 100000"
bwa_HiC_options = "-t 4" // bwa mem

//Parameter for uropa configuration
uropa_feature = "" // "String,String,String,..."
uropa_anchor = "" // "String,String,String,..."
uropa_dist_1 = 1000
uropa_dist_2 = 1000
uropa_strand = "" // single argument "String"
uropa_direction = "any_direction" // "String,String,String,..."
uropa_filter_attr = "" // "String,String,String,..."
uropa_attr_value = "" // "String,String,String,..."
uropa_show_attr = "gene_id,gene_type,gene_name,level,transcript_type,transcript_support_level" // "String,String,String,..."

}

8 changes: 8 additions & 0 deletions uropa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: uropa

channels:
- bioconda
- conda-forge

dependencies:
- uropa

0 comments on commit 0f6778b

Please sign in to comment.