Skip to content

Commit 1604fd0

Browse files
authored
Merge pull request #66 from bcbio/fix_63_58_rnaseq
Fix 63 58 rnaseq
2 parents 958a2bb + dc69aa5 commit 1604fd0

File tree

6 files changed

+33
-29
lines changed

6 files changed

+33
-29
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches: [main, master]
5+
branches: [main, master, devel]
66
pull_request:
7-
branches: [main, master]
7+
branches: [main, master, devel]
88

99
name: R-CMD-check
1010

inst/templates/rnaseq/00_libs/FA.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ library(clusterProfiler)
33
source <- "https://github.com/bcbio/resources/raw/refs/heads/main/gene_sets/gene_sets/20240904"
44
get_databases_v2=function(sps="human"){
55
gmt.files=list(human=c("h.all.v2024.1.Hs.entrez.gmt",
6-
"c5.go.v2024.1.Hs.entrez.gmt",
6+
#"c5.go.v2024.1.Hs.entrez.gmt",
77
"c5.go.mf.v2024.1.Hs.entrez.gmt",
88
"c5.go.cc.v2024.1.Hs.entrez.gmt",
99
"c5.go.bp.v2024.1.Hs.entrez.gmt",
1010
"c2.cp.reactome.v2024.1.Hs.entrez.gmt",
1111
"c2.cp.kegg_legacy.v2024.1.Hs.entrez.gmt"),
1212
mouse=c("mh.all.v2024.1.Mm.entrez.gmt",
13-
"m5.go.v2024.1.Mm.entrez.gmt",
13+
#"m5.go.v2024.1.Mm.entrez.gmt",
1414
"m5.go.mf.v2024.1.Mm.entrez.gmt",
1515
"m5.go.cc.v2024.1.Mm.entrez.gmt",
1616
"m5.go.bp.v2024.1.Mm.entrez.gmt",

inst/templates/rnaseq/00_libs/load_data.R

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ load_metrics <- function(se_object, multiqc_data_dir, gtf_fn, counts){
4444

4545
# Sometimes we don't have rRNA due to mismatch annotation, We skip this if is the case
4646
gtf <- NULL
47+
biotype <- NULL
48+
4749
if (genome =="other"){
4850
gtf <- gtf_fn
4951
}else{
@@ -59,22 +61,21 @@ load_metrics <- function(se_object, multiqc_data_dir, gtf_fn, counts){
5961
package="bcbioR")
6062
}
6163
if (is.null(gtf)) {
62-
print("No genome provided! Please add it at the top of this Rmd")
63-
}
64-
65-
gtf=rtracklayer::import(gtf)
66-
67-
68-
one=grep("gene_type", colnames(as.data.frame(gtf)), value = TRUE)
69-
another=grep("gene_biotype", colnames(as.data.frame(gtf)), value = TRUE)
70-
biotype=NULL
71-
if(length(one)==1){
72-
biotype=one
73-
}else if(length(another)==1){
74-
biotype=another
64+
warning("No genome provided! Please add it at the top of this Rmd")
7565
}else{
76-
warning("No gene biotype founded")
66+
gtf=rtracklayer::import(gtf)
67+
68+
one=grep("gene_type", colnames(as.data.frame(gtf)), value = TRUE)
69+
another=grep("gene_biotype", colnames(as.data.frame(gtf)), value = TRUE)
70+
if(length(one)==1){
71+
biotype=one
72+
}else if(length(another)==1){
73+
biotype=another
74+
}else{
75+
warning("No gene biotype founded")
76+
}
7777
}
78+
7879
metrics$sample <- make.names(metrics$sample)
7980
if (!is.null(biotype)){
8081
annotation=as.data.frame(gtf) %>% .[,c("gene_id", biotype)]

inst/templates/rnaseq/01_quality_assesment/QC.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ metrics %>%
344344

345345
There should be little bias, i.e. the values should be close to 1, or at least consistent among samples
346346

347-
```{r plot_53_bias}
347+
```{r plot_53_bias, eval=!all(is.na((metrics['r_and_t_rna_rate'])))}
348348
metrics %>%
349349
ggplot(aes(x = factor(sample, level = order),
350350
y = x5_3_bias,

inst/templates/rnaseq/01_quality_assesment/params_qc.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
# Your data
44
# This is the file used to run nf-core or compatible to that
5-
coldata_fn='/Path/to/metadata/meta.csv'
5+
coldata_fn <- '/Path/to/metadata/meta.csv'
66
# This file is inside star_salmon/ folder
7-
counts_fn='/path/to/nf-core/output/star_salmon/salmon.merged.gene_counts.tsv'
7+
counts_fn <- '/path/to/nf-core/output/star_salmon/salmon.merged.gene_counts.tsv'
88
# This folder called "multiqc_report_data" is inside the output directory star_salmon inside multiqc folder
9-
multiqc_data_dir='/path/to/nf-core/output/multiqc/star_salmon/multiqc_report_data'
9+
multiqc_data_dir <- '/path/to/nf-core/output/multiqc/star_salmon/multiqc_report_data'
1010
# This file is inside the genome folder in the output directory, use this only for non-model organism
1111
# gtf_fn='/path/to/nf-core/output/genome/hg38.filtered.gtf'
12-
se_object = NA
12+
gtf_fn <- NULL
13+
se_object <- NA

inst/templates/rnaseq/02_differential_expression/DEG.Rmd

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -682,12 +682,15 @@ if (!is.null(subset_value) & !is.null(subset_value)){
682682
} else {
683683
filenames = "full"
684684
}
685+
686+
filename = paste0(filenames)
687+
name_expression_fn=file.path(
688+
basedir,
689+
str_interp("${filename}_expression.csv"))
690+
write_csv(counts_norm, name_expression_fn)
691+
685692
for (contrast in names(contrasts)){
686-
filename = paste0(filenames, "_", contrast)
687-
name_expression_fn=file.path(
688-
basedir,
689-
str_interp("${filename}_expression.csv"))
690-
693+
691694
name_deg_fn=file.path(
692695
basedir,
693696
str_interp("${filename}_deg.csv"))
@@ -708,7 +711,6 @@ for (contrast in names(contrasts)){
708711
pathways_for_writing <- fa_list[[contrast]][["all"]] %>%
709712
mutate(comparison = contrast)
710713
711-
write_csv(counts_norm, name_expression_fn)
712714
write_csv(res_for_writing, name_deg_fn)
713715
write_csv(pathways_for_writing, name_pathways_fn)
714716
}

0 commit comments

Comments
 (0)