Skip to content
Snippets Groups Projects
Commit e7e81d53 authored by aliarifki's avatar aliarifki
Browse files

Mise à jour des scripts R

parent a70b5adf
No related branches found
No related tags found
No related merge requests found
#!/bin/Rscript #!/bin/Rscript
# Packages installation # Packages loading
library(ggplot2, quietly = TRUE) library(ggplot2, quietly = TRUE)
library(tidyr, quietly = TRUE) library(tidyr, quietly = TRUE)
library(plyr, quietly = TRUE) library(plyr, quietly = TRUE)
...@@ -60,7 +60,7 @@ palette_complete <- rbind.data.frame(palette_TSS, ...@@ -60,7 +60,7 @@ palette_complete <- rbind.data.frame(palette_TSS,
stringsAsFactors = FALSE) stringsAsFactors = FALSE)
# Load Start_positions_count files: # Load Start_positions_count files:
identified_SP <- read.table(file = opt$SPvariants[1], identified_SP <- read.table(file = opt$SPvariants,
header = TRUE) header = TRUE)
clean_SP <- identified_SP[!duplicated(identified_SP$id),] %>% clean_SP <- identified_SP[!duplicated(identified_SP$id),] %>%
...@@ -108,7 +108,7 @@ ggsave(file = "SP_proportion.png", ...@@ -108,7 +108,7 @@ ggsave(file = "SP_proportion.png",
dpi = 300) dpi = 300)
# TSS not spliced: # TSS not spliced:
classified_reads <- read.table(file = opt$classification[1], classified_reads <- read.table(file = opt$classification,
header = TRUE) header = TRUE)
not_spliced <- classified_reads[!(classified_reads$read_ID %in% clean_SP$id),] not_spliced <- classified_reads[!(classified_reads$read_ID %in% clean_SP$id),]
......
...@@ -12,19 +12,19 @@ library(optparse) ...@@ -12,19 +12,19 @@ library(optparse)
# Load classification per promoter: # Load classification per promoter:
option_list = list( option_list = list(
make_option(c("-c", "--classification"), type="character", default=NULL, make_option(c("-c", "--classification"), type="character", default="./classification.txt",
help="input classification or reads file (.txt)", metavar="character"), help="input classification or reads file (.txt)", metavar="character"),
make_option(c("-j", "--jwr"), type="character", default=NULL, make_option(c("-j", "--jwr"), type="character", default=NULL,
help="input nanosplicer results table (.csv)", metavar="character")) help="input nanosplicer results table (.csv)", metavar="character"))
opt_parser = OptionParser(option_list=option_list) opt_parser = OptionParser(option_list=option_list)
opt = parse_args(opt_parser) opt = parse_args(opt_parser)
reads_pos <- read.table(opt$classification[1], reads_pos <- read.table(opt$classification,
sep = "\t") sep = "\t")
colnames(reads_pos) <- c("id", reads_pos[1,2:length(reads_pos[1,])]) colnames(reads_pos) <- c("id", reads_pos[1,2:length(reads_pos[1,])])
reads_pos <- reads_pos[2:length(reads_pos$id),] reads_pos <- reads_pos[2:length(reads_pos$id),]
# Load Nanosplicer results: # Load Nanosplicer results:
df <- read.csv(opt$jwr[1]) df <- read.csv(opt$jwr)
colnames(df)[1] <- "juncNumber" colnames(df)[1] <- "juncNumber"
# split donor and acceptor positions: # split donor and acceptor positions:
......
#!/bin/Rscript #!/bin/Rscript
# Packages installation # Packages loading
library(dplyr) library(dplyr)
library(ggplot2) library(ggplot2)
library(RColorBrewer) library(RColorBrewer)
...@@ -25,8 +25,8 @@ opt = parse_args(opt_parser) ...@@ -25,8 +25,8 @@ opt = parse_args(opt_parser)
# pattern="*.txt", # pattern="*.txt",
# all.files=FALSE, # all.files=FALSE,
# full.names=FALSE) # full.names=FALSE)
file_to_load <- opt$input[1] file_to_load <- opt$input
splitted <- strsplit(opt$input[1], split = "[/]")[[1]] splitted <- strsplit(opt$input, split = "[/]")[[1]]
filename <- strsplit(splitted[length(splitted)], split = "[.]")[[1]][1] filename <- strsplit(splitted[length(splitted)], split = "[.]")[[1]][1]
sam_bc01 <- read.table(file_to_load, header = F) sam_bc01 <- read.table(file_to_load, header = F)
......
...@@ -11,8 +11,8 @@ process junctions_nanosplicer{ ...@@ -11,8 +11,8 @@ process junctions_nanosplicer{
} }
input: input:
path(txt)
path(csv) path(csv)
path(classification_of_reads_per_RNA)
output: output:
path("Rplots.pdf") path("Rplots.pdf")
...@@ -21,6 +21,6 @@ process junctions_nanosplicer{ ...@@ -21,6 +21,6 @@ process junctions_nanosplicer{
script: script:
""" """
Rscript /Junctions_NanoSplicer/Junctions_NanoSplicer_2.R Rscript Junctions_NanoSplicer.R -c txt -j csv
""" """
} }
\ No newline at end of file
version = "1.0"
container_url = "xgrand/r-scripts:${version}"
params.rna_count_out = ""
process rna_count{
container = "${container_url}"
label "small_mem_mono_cpus"
tag "RNA quantification"
if (params.rna_count_out != "") {
publishDir "results/${params.rna_count_out}", mode: 'copy'
}
input:
path(spvariants)
path(classification)
output:
path("*.csv")
path("*.pdf")
script:
"""
Rscript HBV_RNAs_count.R -s spvariants -c classification
"""
}
...@@ -5,7 +5,7 @@ params.start_position_counts_out = "" ...@@ -5,7 +5,7 @@ params.start_position_counts_out = ""
process start_position_individuals{ process start_position_individuals{
container = "${container_url}" container = "${container_url}"
label "small_mem_mono_cpus" label "small_mem_mono_cpus"
tag "identification de variants d'épissage" tag "start positions"
if (params.start_position_counts_out != "") { if (params.start_position_counts_out != "") {
publishDir "results/${params.start_position_counts_out}", mode: 'copy' publishDir "results/${params.start_position_counts_out}", mode: 'copy'
} }
...@@ -20,6 +20,6 @@ process start_position_individuals{ ...@@ -20,6 +20,6 @@ process start_position_individuals{
script: script:
""" """
Rscript start_positions_individuals.R -i start_position_counts Rscript start_positions.R -i start_position_counts
""" """
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment