Mercurial > repos > iuc > scpipe
annotate scpipe.R @ 5:a3b3ec00bf8f draft default tip
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit fdf7345541065bceabb72dda6a4ce62967cca2e8"
author | iuc |
---|---|
date | Fri, 26 Feb 2021 22:26:37 +0000 |
parents | 7397e6badc11 |
children |
rev | line source |
---|---|
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
1 err_foo <- function() { |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
2 cat(geterrmessage(), file = stderr()); |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
3 q("no", 1, F) |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
4 } |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
5 options(show.error.messages = F, error = err_foo) |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
6 |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
7 # we need that to not crash galaxy with an UTF8 error on German LC settings. |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
8 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
9 |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
10 suppressPackageStartupMessages({ |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
11 library(scPipe) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
12 library(SingleCellExperiment) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
13 library(optparse) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
14 library(readr) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
15 library(ggplot2) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
16 library(plotly) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
17 library(DT) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
18 library(scater) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
19 library(scran) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
20 library(scales) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
21 library(Rtsne) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
22 }) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
23 |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
24 option_list <- list( |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
25 make_option(c("-bam", "--bam"), type = "character", help = "BAM file"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
26 make_option(c("-fasta", "--fasta"), type = "character", help = "Genome fasta file"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
27 make_option(c("-exons", "--exons"), type = "character", help = "Exon annotation gff3 file"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
28 make_option(c("-organism", "--organism"), type = "character", help = "Organism e.g. hsapiens_gene_ensembl"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
29 make_option(c("-barcodes", "--barcodes"), type = "character", help = "Cell barcodes csv file"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
30 make_option(c("-read1", "--read1"), type = "character", help = "Read 1 fastq.gz"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
31 make_option(c("-read2", "--read2"), type = "character", help = "Read 2 fastq.gz"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
32 make_option(c("-samplename", "--samplename"), type = "character", help = "Name to use for sample"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
33 make_option(c("-bs1", "--bs1"), type = "integer", help = "Barcode start in Read 1"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
34 make_option(c("-bl1", "--bl1"), type = "integer", help = "Barcode length in Read 1"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
35 make_option(c("-bs2", "--bs2"), type = "integer", help = "Barcode start in Read 2"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
36 make_option(c("-bl2", "--bl2"), type = "integer", help = "Barcode length in Read 2"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
37 make_option(c("-us", "--us"), type = "integer", help = "UMI start in Read 2"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
38 make_option(c("-ul", "--ul"), type = "integer", help = "UMI length in Read 2"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
39 make_option(c("-rmlow", "--rmlow"), type = "logical", help = "Remove reads with N in barcode or UMI"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
40 make_option(c("-rmN", "--rmN"), type = "logical", help = "Remove reads with low quality"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
41 make_option(c("-minq", "--minq"), type = "integer", help = "Minimum read quality"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
42 make_option(c("-numbq", "--numbq"), type = "integer", help = "Maximum number of bases below minq"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
43 make_option(c("-stnd", "--stnd"), type = "logical", help = "Perform strand-specific mapping"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
44 make_option(c("-max_mis", "--max_mis"), type = "integer", help = "Maximum mismatch allowed in barcode"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
45 make_option(c("-UMI_cor", "--UMI_cor"), type = "integer", help = "Correct UMI sequence error"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
46 make_option(c("-gene_fl", "--gene_fl"), type = "logical", help = "Remove low abundant genes"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
47 make_option(c("-max_reads", "--max_reads"), type = "integer", help = "Maximum reads processed"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
48 make_option(c("-min_count", "--min_count"), type = "integer", help = "Minimum count to keep"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
49 make_option(c("-metrics_matrix", "--metrics_matrix"), type = "logical", help = "QC metrics matrix"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
50 make_option(c("-keep_outliers", "--keep_outliers"), type = "logical", help = "Keep outlier cells"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
51 make_option(c("-report", "--report"), type = "logical", help = "HTML report of plots"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
52 make_option(c("-rdata", "--rdata"), type = "logical", help = "Output RData file"), |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
53 make_option(c("-nthreads", "--nthreads"), type = "integer", help = "Number of threads") |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
54 ) |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
55 |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
56 parser <- OptionParser(usage = "%prog [options] file", option_list = option_list) |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
57 args <- parse_args(parser) |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
58 |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
59 bam <- args$bam |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
60 fa_fn <- args$fasta |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
61 anno_fn <- args$exons |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
62 fq_r1 <- args$read1 |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
63 fq_r2 <- args$read2 |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
64 read_structure <- list(bs1 = args$bs1, # barcode start position in fq_r1, -1 indicates no barcode |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
65 bl1 = args$bl1, # barcode length in fq_r1, 0 since no barcode present |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
66 bs2 = args$bs2, # barcode start position in fq_r2 |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
67 bl2 = args$bl2, # barcode length in fq_r2 |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
68 us = args$us, # UMI start position in fq_r2 |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
69 ul = args$ul # UMI length |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
70 ) |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
71 |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
72 if (args$us == -1) { |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
73 has_umi <- FALSE |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
74 } else { |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
75 has_umi <- TRUE |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
76 } |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
77 |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
78 filter_settings <- list(rmlow = args$rmlow, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
79 rmN = args$rmN, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
80 minq = args$minq, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
81 numbq = args$numbq) |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
82 |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
83 # Outputs |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
84 out_dir <- "." |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
85 mapped_bam <- file.path(out_dir, "aligned.mapped.bam") |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
86 |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
87 # if input is fastqs |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
88 if (!is.null(fa_fn)) { |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
89 fasta_index <- file.path(out_dir, paste0(fa_fn, ".fasta_index")) |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
90 combined_fastq <- file.path(out_dir, "combined.fastq") |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
91 aligned_bam <- file.path(out_dir, "aligned.bam") |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
92 |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
93 print("Trimming barcodes") |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
94 sc_trim_barcode(combined_fastq, |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
95 fq_r1, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
96 fq_r2, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
97 read_structure = read_structure, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
98 filter_settings = filter_settings) |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
99 |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
100 print("Building genome index") |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
101 Rsubread::buildindex(basename = fasta_index, reference = fa_fn) |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
102 |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
103 print("Aligning reads to genome") |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
104 Rsubread::align(index = fasta_index, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
105 readfile1 = combined_fastq, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
106 output_file = aligned_bam, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
107 nthreads = args$nthreads) |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
108 |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
109 if (!is.null(args$barcodes)) { |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
110 barcode_anno <- args$barcodes |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
111 } else { |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
112 print("Detecting barcodes") |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
113 # detect 10X barcodes and generate sample_index.csv file |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
114 barcode_anno <- "sample_index.csv" |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
115 sc_detect_bc(infq = combined_fastq, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
116 outcsv = barcode_anno, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
117 bc_len = read_structure$bl2, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
118 max_reads = args$max_reads, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
119 min_count = args$min_count, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
120 max_mismatch = args$max_mis |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
121 ) |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
122 } |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
123 } else { |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
124 aligned_bam <- file.path(out_dir, bam) |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
125 barcode_anno <- args$barcodes |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
126 } |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
127 |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
128 print("Assigning reads to exons") |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
129 sc_exon_mapping(aligned_bam, mapped_bam, anno_fn, bc_len = read_structure$bl2, UMI_len = read_structure$ul, stnd = args$stnd) |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
130 |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
131 print("De-multiplexing data") |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
132 sc_demultiplex(mapped_bam, out_dir, barcode_anno, has_UMI = has_umi) |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
133 |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
134 print("Counting genes") |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
135 sc_gene_counting(out_dir, barcode_anno, UMI_cor = args$UMI_cor, gene_fl = args$gene_fl) |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
136 |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
137 print("Performing QC") |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
138 sce <- create_sce_by_dir(out_dir) |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
139 pdf("plots.pdf") |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
140 plot_demultiplex(sce) |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
141 if (has_umi) { |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
142 p <- plot_UMI_dup(sce) |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
143 print(p) |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
144 } |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
145 sce <- calculate_QC_metrics(sce) |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
146 sce <- detect_outlier(sce) |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
147 p <- plot_mapping(sce, percentage = TRUE, dataname = args$samplename) |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
148 print(p) |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
149 p <- plot_QC_pairs(sce) |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
150 print(p) |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
151 dev.off() |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
152 |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
153 print("Removing outliers") |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
154 if (is.null(args$keep_outliers)) { |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
155 sce <- remove_outliers(sce) |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
156 gene_counts <- counts(sce) |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
157 write.table(data.frame("gene_id" = rownames(gene_counts), gene_counts), file = "gene_count.tsv", sep = "\t", quote = FALSE, row.names = FALSE) |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
158 } |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
159 |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
160 if (!is.null(args$metrics_matrix)) { |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
161 metrics <- colData(sce, internal = TRUE) |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
162 write.table(data.frame("cell_id" = rownames(metrics), metrics), file = "metrics_matrix.tsv", sep = "\t", quote = FALSE, row.names = FALSE) |
2
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
163 } |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
164 |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
165 if (!is.null(args$report) & (!is.null(fa_fn))) { |
5c4bca9dd4a2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 60e2a9e9129a22924c55b11b218b39d913c7e686
iuc
parents:
0
diff
changeset
|
166 print("Creating report") |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
167 create_report(sample_name = args$samplename, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
168 outdir = out_dir, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
169 r1 = fq_r1, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
170 r2 = fq_r2, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
171 outfq = combined_fastq, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
172 read_structure = read_structure, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
173 filter_settings = filter_settings, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
174 align_bam = aligned_bam, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
175 genome_index = fasta_index, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
176 map_bam = mapped_bam, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
177 exon_anno = anno_fn, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
178 stnd = args$stnd, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
179 fix_chr = FALSE, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
180 barcode_anno = barcode_anno, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
181 max_mis = args$max_mis, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
182 UMI_cor = args$UMI_cor, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
183 gene_fl = args$gene_fl, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
184 organism = args$organism, |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
185 gene_id_type = "ensembl_gene_id") |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
186 } |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
187 |
3
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
188 if (!is.null(args$rdata)) { |
7397e6badc11
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8007f71281553ddfa45e6f8e1172952d956bb000"
iuc
parents:
2
diff
changeset
|
189 save(sce, file = file.path(out_dir, "scPipe_analysis.RData")) |
0
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
190 } |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
191 |
32e1bfc6b7b2
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scpipe commit 8908da9cdd112ae0943dbf1eccb221e84cd99ca7
iuc
parents:
diff
changeset
|
192 sessionInfo() |