annotate celltypist_CLI.py @ 1:df005630100e draft default tip

planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 4dd95e3e6c059cc9df47f5d08e4f3f8b618830f1-dirty
author ebi-gxa
date Wed, 19 Feb 2025 12:10:17 +0000
parents a7d6985ba791
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
1 import argparse
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
2 import os
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
3 import pickle
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
4 import sys
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
5 import textwrap
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
6
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
7 import celltypist
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
8 import scanpy as sc
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
9
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
10
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
11 def train(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
12 input_path,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
13 labels,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
14 genes,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
15 model_name,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
16 output_path,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
17 transpose_input,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
18 normalize,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
19 raw_counts_layer,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
20 gene_symbols_field,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
21 epochs,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
22 max_iter,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
23 C,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
24 n_jobs,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
25 use_SGD,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
26 alpha,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
27 use_GPU,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
28 mini_batch,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
29 batch_number,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
30 batch_size,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
31 balance_cell_type,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
32 feature_selection,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
33 top_genes,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
34 ):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
35 """
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
36 Method used to train a CellTypist model and output the model to a desired
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
37 location. Please refer to the CLI help to gain a better understanding of
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
38 the required and optional parameters.
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
39 """
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
40 if input_path.endswith(".h5ad"):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
41 print("Detected an AnnData object as input.")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
42 data = sc.read_h5ad(input_path)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
43 elif input_path.endswith(".mtx"):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
44 print("Detected .mtx file as input.")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
45 data = input_path
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
46 else:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
47 raise ValueError("Invalid input file type detected.")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
48 if input_path.endswith(".mtx") and genes is None:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
49 raise ValueError("Missing a gene file for the provided data.")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
50 if (
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
51 raw_counts_layer
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
52 and input_path.endswith(".h5ad")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
53 and raw_counts_layer in data.layers.keys()
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
54 and raw_counts_layer != "X"
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
55 ):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
56 print(f"Using raw counts layer: {raw_counts_layer}")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
57 data.X = data.layers[raw_counts_layer]
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
58 elif raw_counts_layer and input_path.endswith(".h5ad"):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
59 raise ValueError(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
60 f"Raw counts layer {raw_counts_layer} \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
61 should be either different to 'X' or an \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
62 existing layer in AnnData"
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
63 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
64 elif raw_counts_layer:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
65 raise ValueError(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
66 f"Raw counts layer {raw_counts_layer} provided but \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
67 the data format provided is .mtx. Please provide an \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
68 AnnData object."
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
69 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
70 if (
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
71 gene_symbols_field
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
72 and input_path.endswith(".h5ad")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
73 and gene_symbols_field in data.var.columns
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
74 ):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
75 data.var["old_index"] = data.var.index
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
76 data.var.set_index(gene_symbols_field, inplace=True)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
77 if normalize:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
78 sc.pp.normalize_total(data, target_sum=1e4)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
79 sc.pp.log1p(data)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
80
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
81 model = celltypist.train(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
82 data,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
83 labels=labels,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
84 genes=genes,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
85 transpose_input=transpose_input,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
86 C=C,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
87 epochs=epochs,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
88 max_iter=max_iter,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
89 n_jobs=n_jobs,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
90 use_SGD=use_SGD,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
91 alpha=alpha,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
92 use_GPU=use_GPU,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
93 mini_batch=mini_batch,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
94 batch_number=batch_number,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
95 batch_size=batch_size,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
96 balance_cell_type=balance_cell_type,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
97 feature_selection=feature_selection,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
98 top_genes=top_genes,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
99 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
100
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
101 model_save_location = output_path + "/" + model_name + ".pkl"
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
102
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
103 return pickle.dump(model, open(model_save_location, "wb"))
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
104
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
105
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
106 def predict(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
107 input_path,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
108 model,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
109 output_path,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
110 gene_file,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
111 cell_file,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
112 raw_counts_layer,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
113 gene_symbols_field,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
114 normalize,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
115 transpose_input,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
116 mode,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
117 p_thres,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
118 majority_voting,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
119 over_clustering,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
120 use_GPU,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
121 ):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
122 """
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
123 Method used to obtain cell type prediction on a new dataset using an \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
124 existing CellTypist model.
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
125 Please refer to the CLI help to gain a better understanding of the \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
126 required and optional
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
127 parameters.
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
128 """
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
129 if input_path.endswith(".h5ad"):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
130 print("Detected an AnnData object as input.")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
131 data = sc.read_h5ad(input_path)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
132 elif input_path.endswith(".mtx"):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
133 print("Detected .mtx file as input.")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
134 data = input_path
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
135 else:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
136 raise ValueError("Invalid input file type detected.")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
137 if input_path.endswith(".mtx") and gene_file is None:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
138 raise ValueError("Missing a gene file for the provided .mtx data.")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
139 if input_path.endswith(".mtx") and cell_file is None:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
140 raise ValueError("Missing a cell file for the provided .mtx data.")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
141 if (
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
142 raw_counts_layer
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
143 and input_path.endswith(".h5ad")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
144 and raw_counts_layer in data.layers.keys()
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
145 and raw_counts_layer != "X"
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
146 ):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
147 print(f"Using raw counts layer: {raw_counts_layer}")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
148 data.X = data.layers[raw_counts_layer]
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
149 elif raw_counts_layer and input_path.endswith(".h5ad"):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
150 raise ValueError(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
151 f"Raw counts layer {raw_counts_layer} should be \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
152 either different to 'X' or an existing layer in \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
153 AnnData"
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
154 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
155 elif raw_counts_layer:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
156 raise ValueError(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
157 f"Raw counts layer {raw_counts_layer} provided but \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
158 the data format is .mtx. Please provide an AnnData \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
159 object."
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
160 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
161 if (
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
162 gene_symbols_field
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
163 and input_path.endswith(".h5ad")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
164 and gene_symbols_field in data.var.columns
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
165 ):
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
166 data.var["old_index"] = data.var.index
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
167 data.var.set_index(gene_symbols_field, inplace=True)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
168 if normalize:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
169 sc.pp.normalize_total(data, target_sum=1e4)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
170 sc.pp.log1p(data)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
171 if mode:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
172 mode = mode.replace("_", " ")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
173 if majority_voting:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
174 if over_clustering:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
175 over_clustering = over_clustering
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
176 else:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
177 over_clustering = None
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
178
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
179 predictions = celltypist.annotate(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
180 data,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
181 model,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
182 gene_file=gene_file,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
183 cell_file=cell_file,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
184 mode=mode,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
185 p_thres=p_thres,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
186 transpose_input=transpose_input,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
187 majority_voting=majority_voting,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
188 over_clustering=over_clustering,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
189 use_GPU=use_GPU,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
190 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
191
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
192 return predictions.predicted_labels.to_csv(output_path, sep="\t")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
193
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
194
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
195 def main():
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
196 parser = argparse.ArgumentParser(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
197 add_help=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
198 description=textwrap.dedent(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
199 """
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
200 CellTypist for automatic cell type annotation.
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
201 ----------------------------------------------
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
202 Welcome to the ODS CLI tool for cell type
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
203 annotation using CellTypist.
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
204 The CLI provides the user with the opportunity
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
205 to train a new model or predict using an
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
206 existing model.
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
207 Either of the methods can be activated by
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
208 providing the appropriate action variable.
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
209 For details of required/optional parameters
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
210 for each method, please refer to the
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
211 appropriate help function (-h).
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
212 """
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
213 ),
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
214 formatter_class=argparse.RawTextHelpFormatter,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
215 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
216
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
217 choices_to = {
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
218 "train": "⚖️ Train a CellTypist model using a reference \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
219 dataset.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
220 "predict": "🖋️ Use an existing CellTypist model to predict \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
221 on a new dataset.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
222 }
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
223
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
224 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
225 "--action",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
226 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
227 help="\n".join(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
228 "{}: {}".format(key, value) for key, value in choices_to.items()
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
229 ),
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
230 choices=choices_to,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
231 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
232
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
233 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
234 "--help",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
235 action="store_true",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
236 help="List available options.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
237 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
238 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
239
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
240 args, sub_args = parser.parse_known_args()
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
241 if args.help:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
242 if args.action is None:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
243 print(parser.format_help())
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
244 sys.exit(1)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
245 sub_args.append("--help")
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
246
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
247 action = "predict" if args.action is None else args.action
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
248
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
249 parser = argparse.ArgumentParser(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
250 prog="%s %s" % (os.path.basename(sys.argv[0]), action)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
251 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
252
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
253 if action == "predict":
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
254 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
255 "--input_path",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
256 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
257 help="Path to the input file. \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
258 Can be an AnnData object or a .mtx file.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
259 required=True,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
260 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
261
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
262 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
263 "--output_path",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
264 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
265 help="Path to output file.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
266 required=True,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
267 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
268
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
269 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
270 "--model",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
271 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
272 help="Path to model file, stored in .pkl format.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
273 required=True,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
274 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
275
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
276 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
277 "--gene_file",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
278 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
279 help=(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
280 "Path to the file which stores each gene \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
281 per line corresponding to the genes used \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
282 in the provided .mtx file."
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
283 ),
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
284 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
285 default=None,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
286 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
287
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
288 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
289 "--cell_file",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
290 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
291 help="Path to the file which stores each cell \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
292 per line corresponding to the cells used \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
293 in the provided .mtx file.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
294 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
295 default=None,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
296 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
297
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
298 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
299 "--raw_counts_layer",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
300 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
301 help="The name of the layer that stores the raw \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
302 counts. Uses default matrix if not present.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
303 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
304 default=None,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
305 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
306
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
307 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
308 "--gene_symbols_field",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
309 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
310 help="The field in AnnData where the gene symbols \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
311 are stored, if not in index.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
312 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
313 default=None,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
314 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
315
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
316 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
317 "--normalize",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
318 action="store_true",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
319 help="If raw counts are provided in the AnnData \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
320 object, they need to be normalized.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
321 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
322 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
323
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
324 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
325 "--transpose_input",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
326 action="store_true",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
327 help="If the provided matrix is in the \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
328 gene-by-cell format, please transpose the \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
329 input to cell-by-gene format",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
330 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
331 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
332
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
333 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
334 "--mode",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
335 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
336 choices=["best_match", "prob_match"],
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
337 help="Choose the cell type with the largest score/probability \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
338 as the final prediction (`best_match`), or enable a \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
339 multi-label classification (`prob_match`), which assigns \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
340 0 (i.e., unassigned), 1, or >=2 cell type labels to each \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
341 query cell. [default: best_match]",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
342 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
343 default="best_match",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
344 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
345
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
346 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
347 "--p_thres",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
348 type=float,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
349 help="Probability threshold for assigning a cell \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
350 type in a multiclass problem, defaults \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
351 to 0.5.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
352 default=0.5,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
353 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
354 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
355
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
356 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
357 "--majority_voting",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
358 action="store_true",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
359 help="Refine the predicted labels by running the \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
360 majority voting classifier after \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
361 over-clustering.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
362 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
363 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
364
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
365 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
366 "--over_clustering",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
367 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
368 help="If majority voting is set to True, specify \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
369 the type of over clustering that is to be \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
370 performend. This can be specified in the \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
371 AnnData or an input file specifying the \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
372 over-clustering per cell. If not present, \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
373 then the default heuristic over-clustring \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
374 based on input data will be used.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
375 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
376 default=None,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
377 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
378
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
379 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
380 "--use_GPU",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
381 action="store_true",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
382 help="Whether to use GPU for over clustering \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
383 on the basis of `rapids-singlecell`.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
384 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
385 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
386
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
387 args = parser.parse_args(sub_args)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
388
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
389 predict(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
390 args.input_path,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
391 args.model,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
392 args.output_path,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
393 args.gene_file,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
394 args.cell_file,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
395 args.raw_counts_layer,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
396 args.gene_symbols_field,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
397 args.normalize,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
398 args.transpose_input,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
399 args.mode,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
400 args.p_thres,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
401 args.majority_voting,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
402 args.over_clustering,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
403 args.use_GPU,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
404 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
405 else:
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
406 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
407 "--input_path",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
408 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
409 help="Path to the input file. Can be an\
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
410 AnnData object or a .mtx file.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
411 required=True,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
412 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
413
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
414 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
415 "--labels",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
416 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
417 help="Path to the file that stores the per cell types\
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
418 or the layer in the AnnData object where the\
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
419 cell types are held.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
420 required=True,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
421 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
422
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
423 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
424 "--genes",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
425 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
426 help="Path to the file containing one gene per line corresponding \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
427 to the genes in X, required for .mtx data.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
428 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
429 default=None,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
430 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
431
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
432 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
433 "--model_name",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
434 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
435 help="The name of the trained model, used for saving.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
436 required=True,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
437 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
438
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
439 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
440 "--output_path",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
441 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
442 help="The location to where the trained model should be saved.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
443 required=True,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
444 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
445
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
446 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
447 "--transpose_input",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
448 action="store_true",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
449 help="If the provided matrix is in the gene-by-cell format, \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
450 please transpose the input to cell-by-gene format.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
451 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
452 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
453
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
454 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
455 "--normalize",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
456 action="store_true",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
457 help="If raw counts are provided in the AnnData object, \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
458 they need to be normalized.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
459 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
460 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
461
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
462 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
463 "--gene_symbols_field",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
464 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
465 help="The field in AnnData where the gene symbols are stored, \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
466 if not in index.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
467 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
468 default=None,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
469 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
470
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
471 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
472 "--raw_counts_layer",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
473 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
474 help="The name of the layer that stores the raw counts. \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
475 Uses default matrix if not present",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
476 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
477 default=None,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
478 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
479
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
480 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
481 "--epochs",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
482 type=int,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
483 help="The number of epochs for which the model \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
484 needs to be trained.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
485 required=True,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
486 default=10,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
487 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
488
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
489 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
490 "--solver",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
491 type=str,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
492 help="Algorithm to use in the optimization problem for \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
493 traditional logistic classifier. Default is based \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
494 on the size of the input data.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
495 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
496 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
497
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
498 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
499 "--max_iter",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
500 type=int,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
501 help="Maximum number of iterations before reaching \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
502 the minimum of the cost function.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
503 required=True,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
504 default=100,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
505 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
506
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
507 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
508 "--C",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
509 type=float,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
510 help="Inverse of L2 regularization strength for \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
511 traditional logistic classifier.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
512 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
513 default=1.0,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
514 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
515
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
516 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
517 "--n_jobs",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
518 type=int,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
519 help="Number of CPUs used.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
520 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
521 default=1,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
522 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
523
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
524 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
525 "--use_SGD",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
526 type=bool,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
527 help="Whether to implement SGD learning \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
528 for the logistic classifier.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
529 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
530 default=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
531 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
532
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
533 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
534 "--alpha",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
535 type=float,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
536 help="L2 regularization strength for SGD logistic classifier.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
537 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
538 default=0.0001,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
539 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
540
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
541 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
542 "--use_GPU",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
543 type=bool,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
544 help="Whether to use GPU for logistic classifier.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
545 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
546 default=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
547 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
548
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
549 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
550 "--mini_batch",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
551 type=bool,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
552 help="Whether to implement mini-batch training \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
553 for the SGD logistic classifier.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
554 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
555 default=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
556 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
557
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
558 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
559 "--batch_number",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
560 type=int,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
561 help="The number of batches used for training in each epoch. \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
562 Each batch contains batch_size cells.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
563 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
564 default=100,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
565 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
566
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
567 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
568 "--batch_size",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
569 type=int,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
570 help="The number of cells within each batch.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
571 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
572 default=1000,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
573 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
574
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
575 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
576 "--balance_cell_type",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
577 type=bool,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
578 help="Whether to balance the cell type frequencies \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
579 in mini-batches during each epoch.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
580 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
581 default=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
582 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
583
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
584 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
585 "--feature_selection",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
586 type=bool,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
587 help="Whether to perform two-pass data training where \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
588 the first round is used for selecting important \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
589 features/genes using SGD learning.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
590 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
591 default=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
592 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
593
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
594 parser.add_argument(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
595 "--top_genes",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
596 type=int,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
597 help="The number of top genes selected from each \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
598 class/cell-type based on their absolute \
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
599 regression coefficients.",
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
600 required=False,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
601 default=300,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
602 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
603
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
604 args = parser.parse_args(sub_args)
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
605
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
606 train(
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
607 args.input_path,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
608 args.labels,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
609 args.genes,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
610 args.model_name,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
611 args.output_path,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
612 args.transpose_input,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
613 args.normalize,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
614 args.raw_counts_layer,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
615 args.gene_symbols_field,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
616 args.epochs,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
617 args.max_iter,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
618 args.C,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
619 args.n_jobs,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
620 args.use_SGD,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
621 args.alpha,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
622 args.use_GPU,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
623 args.mini_batch,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
624 args.batch_number,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
625 args.batch_size,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
626 args.balance_cell_type,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
627 args.feature_selection,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
628 args.top_genes,
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
629 )
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
630
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
631
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
632 if __name__ == "__main__":
a7d6985ba791 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 53651c0be9daeebb0921f3b5e542323304dfdc98-dirty
ebi-gxa
parents:
diff changeset
633 main()