Skip to content

Commit

Permalink
test r...
Browse files Browse the repository at this point in the history
  • Loading branch information
mspodda committed May 23, 2024
1 parent e3bf712 commit 5a99a6c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
1 change: 1 addition & 0 deletions config/config_final.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ conda:
STAR: $envsdir/STAR.yml
stringtie: $envsdir/stringtie.yml
salmon: $envsdir/salmon.yml
r: $envsdir/R.yml

# reference files, genome indices and data
reference:
Expand Down
13 changes: 2 additions & 11 deletions workflow/R/R_custom.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
### Create and load vector of packages
#setwd(final_output)
source("workflow/R/config_all.R")
new.packages <- my_packages_cran[!(my_packages_cran %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)
# Load BiocManager
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
# Check and install missing packages
missing_packages <- my_packages_bioconductor[!(my_packages_bioconductor %in% installed.packages()[,"Package"])]
if (length(missing_packages))
BiocManager::install(missing_packages)
lapply(my_packages_cran, require, character.only = TRUE)
lapply(mmy_packages_bioconductor, require, character.only = TRUE)
lapply(my_packages, require, character.only = TRUE)

### Create a list with all txt files containing the samples for each tissues
### Extract all samples from the txt list files for each tissues
setwd(txt_files_dir)
Expand Down
5 changes: 2 additions & 3 deletions workflow/R/config_all.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ BRAF_ids <- c("ENST00000288602.11","ENST00000469930.2","ENST00000479537.6","ENST
"ENST00000647434.1")

## libraries
my_packages_cran <- c("dplyr","ggplot2","tidyr","ggsignif","ggpubr","patchwork","stringr","ggrepel","tibble")
my_packages_bioconductor <- c("GenomicAlignments","tximport","tximeta")
my_packages_github <- c("bedtoolsr")
my_packages <- c("dplyr","ggplot2","tidyr","ggsignif","ggpubr","patchwork","stringr",
"ggrepel","GenomicAlignments","bedtoolsr","tximport","tximeta","tibble")

## Sample typologies
samples_typologies <- c("Lung")
Expand Down
11 changes: 11 additions & 0 deletions workflow/envs/R.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: my_r_env
channels:
- conda-forge
- bioconda
- nodefaults ## block user/system channels
dependencies:
- r-base=4.2 ## always specify the R version (faster solve; more stable)
- r-essentials
- bioconductor-GenomicAlignments
- bioconductor-tximport
- bioconductor-tibble
6 changes: 6 additions & 0 deletions workflow/snakefile_final.smk
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ rule polyA_r_script:
output:
polyA_204 = config['datadirs']['r'] + "polyA_filtered_3UTR204.csv",
polyA_220 = config['datadirs']['r'] + "polyA_filtered_3UTR220.csv"
conda:
config['conda']['r']
shell:
"Rscript {params.r_polya}"

Expand All @@ -412,6 +414,8 @@ rule custom_r_script:
r_custom = config['scripts']['r_custom']
output:
boxplot_custom = config['datadirs']['r'] + "ratio_BRAF.pdf"
conda:
config['conda']['r']
shell:
"Rscript {params.r_custom}"

Expand All @@ -424,5 +428,7 @@ rule salmon_r_script:
boxplot_salmon = config['datadirs']['r'] + "ratio_salmon.pdf",
piecharts_salmon = config['datadirs']['r'] + "pie_charts.pdf",
total_salmon = config['datadirs']['r'] + "total_salmon.pdf"
conda:
config['conda']['r']
shell:
"Rscript {params.r_salmon}"

0 comments on commit 5a99a6c

Please sign in to comment.