summaryrefslogtreecommitdiff
path: root/python-atlas-metadata-validator.spec
blob: 11d8146c8c08625c946f82c7302d92034e953265 (plain)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
%global _empty_manifest_terminate_build 0
Name:		python-atlas-metadata-validator
Version:	1.6.1
Release:	1
Summary:	A MAGE-TAB validator for Expression Atlas and Single Cell Expression Atlas
License:	Apache Software License
URL:		https://github.com/ebi-gene-expression-group/atlas-metadata-validator
Source0:	https://mirrors.aliyun.com/pypi/web/packages/b0/e3/8d4a2722974027820963bc3f48b5ea111029142f1357616a10a8654f6b27/atlas-metadata-validator-1.6.1.tar.gz
BuildArch:	noarch

Requires:	python3-requests
Requires:	python3-GitPython

%description
# Expression Atlas metadata validator

This is a Python module to parse a set of MAGE-TAB files and check for compatibility with the Expression Atlas and Single Cell Expression Atlas analysis pipelines. The main validation script automatically detects the experiment type from the MAGE-TAB and runs the respective tests. Currently general checks (for bulk and single-cell experiment) as well as Single Cell Expression Atlas specific checks are supported. The controlled vocabulary for the checks are stored in the [metadata-validation-config](https://github.com/ebi-gene-expression-group/metadata-validation-config) repository. 

## Requirements

Python 3.6, requests (tested with version 2.20.1), and GitPython (tested with version 3.1.7)


## Install

Install with pip:
```
pip install atlas-metadata-validator
```

Set environment variables to fetch the validation configuration for controlled vocabulary terms:

```bash
export VALIDATION_CONFIG_REPO='https://github.com/ebi-gene-expression-group/metadata-validation-config'
export VALIDATION_CONFIG_FILE='atlas_validation_config.json'
```
(if not specified the above values are used as default)

Set local path where to store the validation config files, default is working dir when calling the script
```bash
export VALIDATION_CONFIG_LOCAL_PATH='/path/to/your/local/copy/'
```


## Single-cell MAGE-TAB validator

A MAGE-TAB pre-validation module for running checks that guarantee the experiment can be processed for [Single Cell Expression Atlas](https://www.ebi.ac.uk/gxa/sc/home). The checks are mainly covering the pre-validation by https://github.com/ebi-gene-expression-group/scxa-control-workflow/blob/master/bin/sdrfToNfConf.R in order to guarantee correct processing. It reads metadata directly from the MAGE-TAB and generates a log file in the directory of the IDF file.

The checks can be invoked using the atlas_validation script with an IDF file path as input:
```
atlas_validation.py path/to/test.idf.txt 
```

### Options
- The SDRF file is expected in the same directory as the IDF file. If this is not the case, the location of the SDRF and other data files can be specified with `-d PATH_TO_DATA` option.
- The script guesses the experiment type (sequencing, microarray or single-cell) from the MAGE-TAB. If this was unsuccessful the experiment type can be set by specifying the respective argument `-seq`, `-ma` or `-sc`. 
- The URI checks may take long time. Hence there is an option to skip these checks with `-x`.
- Verbose logging can be activated with `-v`.
- Special validation rules for HCA-imported experiments can be invoked with `-hca` option. The validator will otherwise guess if the experiment is an HCA import based on the HCAD accession code in the ExpressionAtlasAccession field. 




%package -n python3-atlas-metadata-validator
Summary:	A MAGE-TAB validator for Expression Atlas and Single Cell Expression Atlas
Provides:	python-atlas-metadata-validator
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-atlas-metadata-validator
# Expression Atlas metadata validator

This is a Python module to parse a set of MAGE-TAB files and check for compatibility with the Expression Atlas and Single Cell Expression Atlas analysis pipelines. The main validation script automatically detects the experiment type from the MAGE-TAB and runs the respective tests. Currently general checks (for bulk and single-cell experiment) as well as Single Cell Expression Atlas specific checks are supported. The controlled vocabulary for the checks are stored in the [metadata-validation-config](https://github.com/ebi-gene-expression-group/metadata-validation-config) repository. 

## Requirements

Python 3.6, requests (tested with version 2.20.1), and GitPython (tested with version 3.1.7)


## Install

Install with pip:
```
pip install atlas-metadata-validator
```

Set environment variables to fetch the validation configuration for controlled vocabulary terms:

```bash
export VALIDATION_CONFIG_REPO='https://github.com/ebi-gene-expression-group/metadata-validation-config'
export VALIDATION_CONFIG_FILE='atlas_validation_config.json'
```
(if not specified the above values are used as default)

Set local path where to store the validation config files, default is working dir when calling the script
```bash
export VALIDATION_CONFIG_LOCAL_PATH='/path/to/your/local/copy/'
```


## Single-cell MAGE-TAB validator

A MAGE-TAB pre-validation module for running checks that guarantee the experiment can be processed for [Single Cell Expression Atlas](https://www.ebi.ac.uk/gxa/sc/home). The checks are mainly covering the pre-validation by https://github.com/ebi-gene-expression-group/scxa-control-workflow/blob/master/bin/sdrfToNfConf.R in order to guarantee correct processing. It reads metadata directly from the MAGE-TAB and generates a log file in the directory of the IDF file.

The checks can be invoked using the atlas_validation script with an IDF file path as input:
```
atlas_validation.py path/to/test.idf.txt 
```

### Options
- The SDRF file is expected in the same directory as the IDF file. If this is not the case, the location of the SDRF and other data files can be specified with `-d PATH_TO_DATA` option.
- The script guesses the experiment type (sequencing, microarray or single-cell) from the MAGE-TAB. If this was unsuccessful the experiment type can be set by specifying the respective argument `-seq`, `-ma` or `-sc`. 
- The URI checks may take long time. Hence there is an option to skip these checks with `-x`.
- Verbose logging can be activated with `-v`.
- Special validation rules for HCA-imported experiments can be invoked with `-hca` option. The validator will otherwise guess if the experiment is an HCA import based on the HCAD accession code in the ExpressionAtlasAccession field. 




%package help
Summary:	Development documents and examples for atlas-metadata-validator
Provides:	python3-atlas-metadata-validator-doc
%description help
# Expression Atlas metadata validator

This is a Python module to parse a set of MAGE-TAB files and check for compatibility with the Expression Atlas and Single Cell Expression Atlas analysis pipelines. The main validation script automatically detects the experiment type from the MAGE-TAB and runs the respective tests. Currently general checks (for bulk and single-cell experiment) as well as Single Cell Expression Atlas specific checks are supported. The controlled vocabulary for the checks are stored in the [metadata-validation-config](https://github.com/ebi-gene-expression-group/metadata-validation-config) repository. 

## Requirements

Python 3.6, requests (tested with version 2.20.1), and GitPython (tested with version 3.1.7)


## Install

Install with pip:
```
pip install atlas-metadata-validator
```

Set environment variables to fetch the validation configuration for controlled vocabulary terms:

```bash
export VALIDATION_CONFIG_REPO='https://github.com/ebi-gene-expression-group/metadata-validation-config'
export VALIDATION_CONFIG_FILE='atlas_validation_config.json'
```
(if not specified the above values are used as default)

Set local path where to store the validation config files, default is working dir when calling the script
```bash
export VALIDATION_CONFIG_LOCAL_PATH='/path/to/your/local/copy/'
```


## Single-cell MAGE-TAB validator

A MAGE-TAB pre-validation module for running checks that guarantee the experiment can be processed for [Single Cell Expression Atlas](https://www.ebi.ac.uk/gxa/sc/home). The checks are mainly covering the pre-validation by https://github.com/ebi-gene-expression-group/scxa-control-workflow/blob/master/bin/sdrfToNfConf.R in order to guarantee correct processing. It reads metadata directly from the MAGE-TAB and generates a log file in the directory of the IDF file.

The checks can be invoked using the atlas_validation script with an IDF file path as input:
```
atlas_validation.py path/to/test.idf.txt 
```

### Options
- The SDRF file is expected in the same directory as the IDF file. If this is not the case, the location of the SDRF and other data files can be specified with `-d PATH_TO_DATA` option.
- The script guesses the experiment type (sequencing, microarray or single-cell) from the MAGE-TAB. If this was unsuccessful the experiment type can be set by specifying the respective argument `-seq`, `-ma` or `-sc`. 
- The URI checks may take long time. Hence there is an option to skip these checks with `-x`.
- Verbose logging can be activated with `-v`.
- Special validation rules for HCA-imported experiments can be invoked with `-hca` option. The validator will otherwise guess if the experiment is an HCA import based on the HCAD accession code in the ExpressionAtlasAccession field. 




%prep
%autosetup -n atlas-metadata-validator-1.6.1

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-atlas-metadata-validator -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 1.6.1-1
- Package Spec generated