Skip to content

Commit 146a6ad

Browse files
committed
version 3.0
1 parent 5ef44b6 commit 146a6ad

File tree

8 files changed

+41
-17
lines changed

8 files changed

+41
-17
lines changed

JGA_metadata.xlsx

66 Bytes
Binary file not shown.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## 日本語
44

55
* 生命情報・DDBJ センター
6-
* 公開日: 2024-07-04
7-
* version: v2.9.1
6+
* 公開日: 2024-07-05
7+
* version: v3.0
88

99
[Bioinformation and DDBJ Center](https://www.ddbj.nig.ac.jp/index-e.html) のデータベースに登録するためのメタデータ XML を生成、チェックするツール。
1010
* [DDBJ Sequence Read Archive (DRA)](https://www.ddbj.nig.ac.jp/dra/submission.html): Submission、Experiment、Run と Analysis (任意) XML を生成・チェックするためのエクセルとスクリプト
@@ -13,6 +13,7 @@
1313

1414
## 履歴
1515

16+
* 2024-07-05: v3.0 シート名に DB prefix を付加
1617
* 2024-07-04: v2.9.1 Sample 属性を全て ATTRIBUTE に格納
1718
* 2024-06-14: v2.9 Sample 属性追加、及び、公開指定の削除
1819
* 2024-05-28: v2.8.1 file bug fix
@@ -336,6 +337,7 @@ These files are Excel, container images and tools for generation and validation
336337

337338
## History
338339

340+
* 2024-07-05: v3.0 DB prefix added to sheet name
339341
* 2024-07-04: v2.9.1 Store all sample attributes in SAMPLE_ATTRIBUTE
340342
* 2024-06-14: v2.9 Sample attributes added and hold/release removed
341343
* 2024-05-28: v2.8.1 file bug fix
64 Bytes
Binary file not shown.
-64 Bytes
Binary file not shown.
207 Bytes
Binary file not shown.

exe/excel2xml_dra

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ require 'date'
1818
# 2023-09-04 version 2.0 Analysis support
1919
# 2023-11-21 version 2.1 Analysis reference to Run
2020
# 2023-12-21 version 2.2 center name changes
21+
# 2024-07-05 version 3.0 new sheet names with DB prefixes
2122
#
2223

2324
# Options
2425
account = ""
2526
submission_no = ""
2627
bioproject_accession = ""
2728
center_name = ""
29+
sheet_without_prefix = false
2830
OptionParser.new{|opt|
2931

3032
opt.on('-a [VALUE]', 'D-way account ID'){|v|
@@ -51,6 +53,11 @@ OptionParser.new{|opt|
5153
puts "Center name: #{v}"
5254
}
5355

56+
opt.on('-r', 'sheet name without prefix'){|v|
57+
sheet_without_prefix = true
58+
puts "Previous sheet name without prefix"
59+
}
60+
5461
begin
5562
opt.parse!
5663
rescue
@@ -91,7 +98,11 @@ rescue
9198
end
9299

93100
# metadata sheets
94-
meta_object = ['Submission', 'Experiment', 'Run', 'Run-file', 'Analysis']
101+
if sheet_without_prefix
102+
meta_object = ['Submission', 'Experiment', 'Run', 'Run-file', 'Analysis']
103+
else
104+
meta_object = ['DRA_Submission', 'DRA_Experiment', 'DRA_Run', 'DRA_Run-file', 'DRA_Analysis']
105+
end
95106

96107
# array for metadata objects
97108
submission_a = Array.new
@@ -109,15 +120,15 @@ for meta in meta_object
109120

110121
case meta
111122

112-
when "Submission" then
123+
when /Submission$/ then
113124
submission_a.push([i, line])
114-
when "Experiment" then
125+
when /Experiment$/ then
115126
experiment_a.push([i, line])
116-
when "Run" then
127+
when /Run$/ then
117128
run_a.push([i, line])
118-
when "Run-file" then
129+
when /Run-file$/ then
119130
run_file_a.push([i, line])
120-
when "Analysis" then
131+
when /Analysis$/ then
121132
analysis_a.push([i, line])
122133
end
123134

exe/excel2xml_jga

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ require 'optparse'
1111
#
1212

1313
# Update history
14+
# 2024-07-05 DB prefix added to sheet name
1415
# 2024-07-04 Record all sample attributes in the sample attribute elements
1516
# 2024-05-17 Change the way of describing Sample attributes
1617
# 2022-12-23 Change handling of submission date
@@ -23,6 +24,7 @@ submission_no = ""
2324
submission_id = ""
2425
study_accession = ""
2526
previous_sample_attrs_flag = false
27+
sheet_without_prefix = false
2628
OptionParser.new{|opt|
2729

2830
opt.on('-j [JSUB ID]', 'JSUB/ASUB submission ID'){|v|
@@ -42,6 +44,11 @@ OptionParser.new{|opt|
4244
puts "Previous added Sample attributes format: #{previous_sample_attrs_flag}"
4345
}
4446

47+
opt.on('-p', 'sheet without prefix'){
48+
sheet_without_prefix = true
49+
puts "Previous sheet name without DB prefix"
50+
}
51+
4552
begin
4653
opt.parse!
4754
rescue
@@ -75,7 +82,11 @@ rescue
7582
end
7683

7784
# sheets
78-
meta_object = ['Submission', 'Study', 'Sample', 'Experiment', 'Data', 'Analysis', 'Dataset', 'File']
85+
if sheet_without_prefix
86+
meta_object = ['Submission', 'Study', 'Sample', 'Experiment', 'Data', 'Analysis', 'Dataset', 'File']
87+
else
88+
meta_object = ['JGA_Submission', 'JGA_Study', 'JGA_Sample', 'JGA_Experiment', 'JGA_Data', 'JGA_Analysis', 'JGA_Dataset', 'JGA_File']
89+
end
7990

8091
# array for metadata objects
8192
submission_a = Array.new
@@ -97,21 +108,21 @@ for meta in meta_object
97108

98109
case meta
99110

100-
when "Submission" then
111+
when /Submission$/ then
101112
submission_a.push([i, line])
102-
when "Study" then
113+
when /Study$/ then
103114
study_a.push([i, line])
104-
when "Sample" then
115+
when /Sample$/ then
105116
sample_a.push([i, line.map(&:to_s)])
106-
when "Experiment" then
117+
when /Experiment$/ then
107118
experiment_a.push([i, line])
108-
when "Data" then
119+
when /Data$/ then
109120
data_a.push([i, line])
110-
when "Analysis" then
121+
when /Analysis$/ then
111122
analysis_a.push([i, line])
112-
when "Dataset" then
123+
when /Dataset$/ then
113124
dataset_a.push([i, line])
114-
when "File" then
125+
when /File$/ then
115126
file_a.push([i, line])
116127
end
117128

metadata_dra.xlsx

1 Byte
Binary file not shown.

0 commit comments

Comments
 (0)