1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
use clap::Subcommand;
use ggetrs_ensembl::{DataType, ENSEMBL_RELEASE_STR};
#[derive(Subcommand)]
pub enum ModEnsembl {
/// Searches through descriptions on ENSEMBL
Search {
/// Search terms to query
#[clap(value_parser, required = true)]
search_terms: Vec<String>,
/// Ensembl database to perform search in
#[clap(short, long)]
database: Option<String>,
/// species used in database
#[clap(short, long, default_value = "homo_sapiens")]
species: String,
/// database type specied by Ensembl
#[clap(short = 't', long, default_value = "core")]
db_type: String,
/// release number to use for database
#[clap(short, long, default_value=ENSEMBL_RELEASE_STR)]
release: usize,
/// assembly to use for species
#[clap(short, long, default_value = "38")]
assembly: String,
/// optional filepath to write output to [default=stdout]
#[clap(short, long)]
output: Option<String>,
},
/// Prints all available databases on Ensembl's SQL database
Database {
/// Provides a substring filter to only return databases which contain the substring
#[clap(short, long)]
filter: Option<String>,
/// optional filepath to write output to [default=stdout]
#[clap(short, long)]
output: Option<String>,
},
/// Lookup information for genes/transcripts providing ensembl ids
LookupId {
/// Ensembl IDS to query
#[clap(value_parser, required = true)]
ensembl_ids: Vec<String>,
/// Return a minimal output of only the found gene names
#[clap(short, long)]
names: bool,
/// optional filepath to write output to [default=stdout]
#[clap(short, long)]
output: Option<String>,
},
/// Lookup information for genes/transcripts providing symbols and species
LookupSymbol {
/// Gene symbols to query
#[clap(value_parser, required = true)]
symbols: Vec<String>,
/// Species/alias to specify
#[clap(short, long, default_value = "homo_sapiens")]
species: String,
/// Return a minimal output of only the found Ensembl IDs
#[clap(short, long)]
ids: bool,
/// optional filepath to write output to [default=stdout]
#[clap(short, long)]
output: Option<String>,
},
/// Retrieves the latest ensembl release version
Release,
/// Retrieves reference files from Ensembl FTP site
Ref {
/// Species to query data for
#[clap(short, long, default_value = "homo_sapiens")]
species: String,
/// Release to use - will default to latest release
#[clap(short, long, default_value=ENSEMBL_RELEASE_STR)]
release: usize,
/// Datatype to query for, provided as a comma-separated list (example: cdna,dna,gtf)
#[clap(
short,
long,
value_enum,
value_parser,
value_delimiter = ',',
required = true
)]
datatype: Vec<DataType>,
/// Download all files to current directory
#[clap(short = 'D', long, value_parser)]
download: bool,
/// Optional filepath to write output to [default=stdout]
#[clap(short, long)]
output: Option<String>,
},
/// Retrieves the list of species from ENSEMBL FTP site
Species {
/// Release to use - will default to latest release
#[clap(short, long, default_value=ENSEMBL_RELEASE_STR)]
release: usize,
/// Optional filepath to write output to [default=stdout]
#[clap(short, long)]
output: Option<String>,
/// Datatype to query species list
#[clap(short, long, value_enum, default_value = "dna")]
datatype: DataType,
},
}