You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 27, 2020. It is now read-only.
-[#615](https://github.com/SciLifeLab/Sarek/pull/615) - Use `splitCsv` instead of `readlines`
18
+
19
+
### `Removed`
20
+
-[#616](https://github.com/SciLifeLab/Sarek/pull/616) - Remove old Issue Template
8
21
9
22
## [2.1.0] - Ruotes - 2018-08-14
10
23
@@ -25,8 +38,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
25
38
-[#601](https://github.com/SciLifeLab/Sarek/pull/601), [#603](https://github.com/SciLifeLab/Sarek/pull/603) - Container for GATK4
26
39
-[#606](https://github.com/SciLifeLab/Sarek/pull/606) - Add test data as a submodule from [`Sarek-data`](https://github.com/SciLifeLab/Sarek-data)
27
40
-[#608](https://github.com/SciLifeLab/Sarek/pull/608) - Add documentation on how to install Nextflow on `bianca`
28
-
-[#613](https://github.com/SciLifeLab/Sarek/pull/613) - Add Issue Templates (bug report and feature request)
Copy file name to clipboardExpand all lines: lib/SarekUtils.groovy
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,12 @@ class SarekUtils {
8
8
if (!it.toString().toLowerCase().endsWith(extension.toLowerCase())) exit 1, "File: ${it} has the wrong extension: ${extension} see --help for more information"
9
9
}
10
10
11
+
// Check if a row has the expected number of item
12
+
staticdefcheckNumberOfItem(row, number) {
13
+
if (row.size() != number) exit 1, "Malformed row in TSV file: ${row}, see --help for more information"
14
+
returntrue
15
+
}
16
+
11
17
// Check parameter existence
12
18
staticdefcheckParameterExistence(it, list) {
13
19
if (!list.contains(it)) {
@@ -143,16 +149,16 @@ class SarekUtils {
143
149
// Channeling the TSV file containing BAM.
144
150
// Format is: "subject gender status sample bam bai"
145
151
staticdefextractBams(tsvFile, mode) {
146
-
Channel
147
-
.from(tsvFile.readLines())
148
-
.map{line->
149
-
def list =SarekUtils.returnTSV(line.split(),6)
150
-
def idPatient =list[0]
151
-
def gender =list[1]
152
-
def status =SarekUtils.returnStatus(list[2].toInteger())
153
-
def idSample =list[3]
154
-
def bamFile =SarekUtils.returnFile(list[4])
155
-
def baiFile =SarekUtils.returnFile(list[5])
152
+
Channel.from(tsvFile)
153
+
.splitCsv(sep: '\t')
154
+
.map { row->
155
+
SarekUtils.checkNumberOfItem(row, 6)
156
+
def idPatient =row[0]
157
+
def gender =row[1]
158
+
def status =SarekUtils.returnStatus(row[2].toInteger())
159
+
def idSample =row[3]
160
+
def bamFile =SarekUtils.returnFile(row[4])
161
+
def baiFile =SarekUtils.returnFile(row[5])
156
162
157
163
SarekUtils.checkFileExtension(bamFile,".bam")
158
164
SarekUtils.checkFileExtension(baiFile,".bai")
@@ -199,12 +205,6 @@ class SarekUtils {
199
205
return it
200
206
}
201
207
202
-
// Return TSV if it has the correct number of items in row
203
-
staticdefreturnTSV(it, number) {
204
-
if (it.size() != number) exit 1, "Malformed row in TSV file: ${it}, see --help for more information"
0 commit comments