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