Skip to content

Commit 5e43442

Browse files
authored
Merge pull request #416 from microbiomedata/update-bulk-submission-template
Update bulk submission template
2 parents 0dbe35a + 4feb70f commit 5e43442

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed
-16 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.

webapp/server/crons/bulkSubmissionMonitor.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const bulkSubmissionMonitor = async () => {
6565
let submission = {};
6666
let dataSource = cols[2] ? cols[2].trim() : 'Uploaded File';
6767
currRow++;
68-
if(cols.length < 6) {
68+
if(cols.length < 5) {
6969
validInput = false;
7070
errMsg += `ERROR: Row ${currRow}: Invalid input.\n`;
7171
continue;
@@ -79,20 +79,20 @@ const bulkSubmissionMonitor = async () => {
7979
submission['proj_desc'] = cols[1];
8080
}
8181
//get Sequencing Platform, default is Illumina
82-
if (cols[6] && cols[6] === 'PacBio') {
82+
if (cols[3] && cols[3] === 'PacBio') {
8383
submission['platform'] = 'PacBio';
8484
submission['shortRead'] = false;
8585
} else {
8686
submission['platform'] = 'Illumina';
8787
submission['shortRead'] = true;
8888
}
8989

90-
if (cols[3] && cols[3].trim()) {
90+
if (cols[4] && cols[4].trim()) {
9191
// validate Interleaved or Single-end Illumina/PacBio fastq and ignore the Illumina Pair-1/paire-2
9292
submission['interleaved'] = true;
9393
let fastqs = [];
9494
let fastqs_display = [];
95-
const fqs = cols[3].split(/,/);
95+
const fqs = cols[4].split(/,/);
9696
for (fq of fqs) {
9797
fq = fq.trim();
9898
if (dataSource === 'HTTP(s) URL') {
@@ -106,14 +106,14 @@ const bulkSubmissionMonitor = async () => {
106106
fastqs_display.push(`sradata/${accession}/${fq}`);
107107
} else {
108108
validInput = false;
109-
errMsg += `ERROR: Row ${currRow}: Interleaved or Single-end Illumina/PacBio FASTQ ${fq} not found.\n`;
109+
errMsg += `ERROR: Row ${currRow}: ${dataSource}: Interleaved or Single-end Illumina/PacBio FASTQ: ${fq} not found.\n`;
110110
}
111111
} else {
112112
// it's uploaded file
113113
const file = await Upload.findOne({ name: { $eq: fq }, status: { $ne: 'delete' } });
114114
if (!file) {
115115
validInput = false;
116-
errMsg += `ERROR: Row ${currRow}: Interleaved or Single-end Illumina/PacBio FASTQ ${fq} not found.\n`;
116+
errMsg += `ERROR: Row ${currRow}: ${dataSource}: Interleaved or Single-end Illumina/PacBio FASTQ: ${fq} not found.\n`;
117117
} else {
118118
fastqs.push(`${config.IO.UPLOADED_FILES_DIR}/${file.code}`);
119119
fastqs_display.push(`uploads/${file.owner}/${fq}`);
@@ -135,11 +135,11 @@ const bulkSubmissionMonitor = async () => {
135135
let fq1s = null;
136136
let fq2s = null;
137137
// validate the Illumina Pair-1/paire-2
138-
if (!(cols[4] && cols[4].trim())) {
138+
if (!(cols[5] && cols[5].trim())) {
139139
validInput = false;
140140
errMsg += `ERROR: Row ${currRow}: Illumina Paired-end R1 required.\n`;
141141
} else {
142-
fq1s = cols[4].split(/,/);
142+
fq1s = cols[5].split(/,/);
143143
for (fq of fq1s) {
144144
fq = fq.trim();
145145
if (dataSource === 'HTTP(s) URL') {
@@ -153,14 +153,14 @@ const bulkSubmissionMonitor = async () => {
153153
pairFq1_display.push(`sradata/${accession}/${fq}`);
154154
} else {
155155
validInput = false;
156-
errMsg += `ERROR: Row ${currRow}: Interleaved or Single-end Illumina/PacBio FASTQ ${fq} not found.\n`;
156+
errMsg += `ERROR: Row ${currRow}: ${dataSource}: Illumina Paired-end R1 FASTQ: ${fq} not found.\n`;
157157
}
158158
} else {
159159
// it's uploaded file
160160
const file = await Upload.findOne({ name: { $eq: fq }, status: { $ne: 'delete' } });
161161
if (!file) {
162162
validInput = false;
163-
errMsg += `ERROR: Row ${currRow}: Illumina Paired-end R1 ${fq} not found.\n`;
163+
errMsg += `ERROR: Row ${currRow}: ${dataSource}: Illumina Paired-end R1 FASTQ: ${fq} not found.\n`;
164164
} else {
165165
pairFq1.push(`${config.IO.UPLOADED_FILES_DIR}/${file.code}`);
166166
pairFq1_display.push(`uploads/${file.owner}/${fq}`);
@@ -169,11 +169,11 @@ const bulkSubmissionMonitor = async () => {
169169
};
170170
}
171171

172-
if (!(cols[5] && cols[5].trim())) {
172+
if (!(cols[6] && cols[6].trim())) {
173173
validInput = false;
174174
errMsg += `ERROR: Row ${currRow}: Illumina Paired-end R2 required.\n`;
175175
} else {
176-
fq2s = cols[5].split(/,/);
176+
fq2s = cols[6].split(/,/);
177177
for (fq of fq2s) {
178178
fq = fq.trim();
179179
if (dataSource === 'HTTP(s) URL') {
@@ -187,14 +187,14 @@ const bulkSubmissionMonitor = async () => {
187187
pairFq2_display.push(`sradata/${accession}/${fq}`);
188188
} else {
189189
validInput = false;
190-
errMsg += `ERROR: Row ${currRow}: Interleaved or Single-end Illumina/PacBio FASTQ ${fq} not found.\n`;
190+
errMsg += `ERROR: Row ${currRow}: ${dataSource}: Illumina Paired-end R2 FASTQ: ${fq} not found.\n`;
191191
}
192192
} else {
193193
// it's uploaded file
194194
const file = await Upload.findOne({ name: { $eq: fq }, status: { $ne: 'delete' } });
195195
if (!file) {
196196
validInput = false;
197-
errMsg += `ERROR: Row ${currRow}: Illumina Paired-end R2 ${fq} not found.\n`;
197+
errMsg += `ERROR: Row ${currRow}: ${dataSource}: Illumina Paired-end R2 FASTQ: ${fq} not found.\n`;
198198
} else {
199199
pairFq2.push(`${config.IO.UPLOADED_FILES_DIR}/${file.code}`);
200200
pairFq2_display.push(`uploads/${file.owner}/${fq}`);
@@ -224,7 +224,7 @@ const bulkSubmissionMonitor = async () => {
224224
// submit projects
225225
const workflowSettings = { ...workflowlist, ...pipelinelist };
226226
let projects = [];
227-
227+
let submission = null;
228228
for (submission of submissions) {
229229
//console.log(submission)
230230
let code = randomize('Aa0', 16);

0 commit comments

Comments
 (0)