Skip to content
This repository was archived by the owner on Jan 27, 2020. It is now read-only.

Commit 7eda6b1

Browse files
author
Szilveszter Juhos
authored
Merge pull request #615 from MaxUlysse/installNextflowDoc
Small refactoring
2 parents 4517f57 + c562e33 commit 7eda6b1

6 files changed

Lines changed: 79 additions & 55 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### `Added`
9+
- [#613](https://github.com/SciLifeLab/Sarek/pull/613) - Add Issue Templates (bug report and feature request)
10+
- [#614](https://github.com/SciLifeLab/Sarek/pull/614) - Add PR Template
11+
- [#615](https://github.com/SciLifeLab/Sarek/pull/615) - Add presentation
12+
- [#615](https://github.com/SciLifeLab/Sarek/pull/615) - Update documentation
13+
14+
### `Changed`
15+
- [#608](https://github.com/SciLifeLab/Sarek/pull/608) - Update Nextflow required version
16+
- [#616](https://github.com/SciLifeLab/Sarek/pull/616) - Update CHANGELOG
17+
- [#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
821

922
## [2.1.0] - Ruotes - 2018-08-14
1023

@@ -25,8 +38,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2538
- [#601](https://github.com/SciLifeLab/Sarek/pull/601), [#603](https://github.com/SciLifeLab/Sarek/pull/603) - Container for GATK4
2639
- [#606](https://github.com/SciLifeLab/Sarek/pull/606) - Add test data as a submodule from [`Sarek-data`](https://github.com/SciLifeLab/Sarek-data)
2740
- [#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)
29-
- [#614](https://github.com/SciLifeLab/Sarek/pull/614) - Add PR Template
3041

3142
### `Changed`
3243
- [#557](https://github.com/SciLifeLab/Sarek/pull/557), [#583](https://github.com/SciLifeLab/Sarek/pull/583), [#585](https://github.com/SciLifeLab/Sarek/pull/585), [#588](https://github.com/SciLifeLab/Sarek/pull/588) - Update help
@@ -58,7 +69,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5869

5970
### `Removed`
6071
- [#607](https://github.com/SciLifeLab/Sarek/pull/607) - Remove Mutect1
61-
- [#616](https://github.com/SciLifeLab/Sarek/pull/616) - Remove old Issue Template
6272

6373
## [2.0.0] - 2018-03-23
6474
### `Added`

doc/INSTALL_BIANCA.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,20 @@ For more information about using Singularity with UPPMAX, follow the [Singularit
5050
> mv .nextflow nextflow_v[xx.yy.zz]
5151
> mv bin nextflow_v[xx.yy.zz]/bin
5252

53+
# Establish permission for some files
54+
> chmod 755 nextflow_v[xx.yy.zz]/bin/nextflow
55+
> chmod 660 nextflow_v[xx.yy.zz]/framework/[xx.yy.zz]/nextflow-[xx.yy.zz]-one.jar
56+
57+
# If you want other people to use it
58+
# Be sure that your group has rights to the directory as well
59+
60+
> chown -R .[PROJECT] nextflow_v[xx.yy.zz]
61+
5362
# Clean directory
5463
> rm nextflow_v[xx.yy.zz].tgz
5564

5665
# And everytime you're launching Nextflow, don't forget to export the following ENV variables
66+
# Or add them to your .bashrc file
5767
> export NXF_HOME=/castor/project/proj/nobackup/tools/nextflow/nextflow_v[xx.yy.zz]
5868
> export PATH=${NXF_HOME}/bin:${PATH}
5969
> export NXF_TEMP=$SNIC_TMP
@@ -137,6 +147,10 @@ Wrote Sarek-[snapID].tar.gz
137147
# extract Sarek
138148
> tar xvzf Sarek-[snapID].tgz
139149

150+
# If you want other people to use it
151+
# Be sure that your group has rights to the directory as well
152+
> chown -R .[PROJECT] Sarek-[snapID]
153+
140154
# Make a symbolic link to the extracted repository
141155
> ln -s Sarek-[snapID] default
142156
```
6.64 MB
Binary file not shown.

lib/SarekUtils.groovy

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ class SarekUtils {
88
if (!it.toString().toLowerCase().endsWith(extension.toLowerCase())) exit 1, "File: ${it} has the wrong extension: ${extension} see --help for more information"
99
}
1010

11+
// Check if a row has the expected number of item
12+
static def checkNumberOfItem(row, number) {
13+
if (row.size() != number) exit 1, "Malformed row in TSV file: ${row}, see --help for more information"
14+
return true
15+
}
16+
1117
// Check parameter existence
1218
static def checkParameterExistence(it, list) {
1319
if (!list.contains(it)) {
@@ -143,16 +149,16 @@ class SarekUtils {
143149
// Channeling the TSV file containing BAM.
144150
// Format is: "subject gender status sample bam bai"
145151
static def extractBams(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])
156162

157163
SarekUtils.checkFileExtension(bamFile,".bam")
158164
SarekUtils.checkFileExtension(baiFile,".bai")
@@ -199,12 +205,6 @@ class SarekUtils {
199205
return it
200206
}
201207

202-
// Return TSV if it has the correct number of items in row
203-
static def returnTSV(it, number) {
204-
if (it.size() != number) exit 1, "Malformed row in TSV file: ${it}, see --help for more information"
205-
return it
206-
}
207-
208208
// Sarek ascii art
209209
static def sarek_ascii() {
210210
println " ____ _____ _ "

main.nf

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -547,23 +547,23 @@ def defineStepList() {
547547
def extractFastq(tsvFile) {
548548
// Channeling the TSV file containing FASTQ.
549549
// Format is: "subject gender status sample lane fastq1 fastq2"
550-
Channel
551-
.from(tsvFile.readLines())
552-
.map{line ->
553-
def list = SarekUtils.returnTSV(line.split(),7)
554-
def idPatient = list[0]
555-
def gender = list[1]
556-
def status = SarekUtils.returnStatus(list[2].toInteger())
557-
def idSample = list[3]
558-
def idRun = list[4]
559-
def fastqFile1 = SarekUtils.returnFile(list[5])
560-
def fastqFile2 = SarekUtils.returnFile(list[6])
561-
562-
SarekUtils.checkFileExtension(fastqFile1,".fastq.gz")
563-
SarekUtils.checkFileExtension(fastqFile2,".fastq.gz")
564-
565-
[idPatient, gender, status, idSample, idRun, fastqFile1, fastqFile2]
566-
}
550+
Channel.from(tsvFile)
551+
.splitCsv(sep: '\t')
552+
.map { row ->
553+
SarekUtils.checkNumberOfItem(row, 7)
554+
def idPatient = row[0]
555+
def gender = row[1]
556+
def status = SarekUtils.returnStatus(row[2].toInteger())
557+
def idSample = row[3]
558+
def idRun = row[4]
559+
def fastqFile1 = SarekUtils.returnFile(row[5])
560+
def fastqFile2 = SarekUtils.returnFile(row[6])
561+
562+
SarekUtils.checkFileExtension(fastqFile1,".fastq.gz")
563+
SarekUtils.checkFileExtension(fastqFile2,".fastq.gz")
564+
565+
[idPatient, gender, status, idSample, idRun, fastqFile1, fastqFile2]
566+
}
567567
}
568568

569569
def extractFastqFromDir(pattern) {
@@ -602,24 +602,24 @@ def extractFastqFromDir(pattern) {
602602
def extractRecal(tsvFile) {
603603
// Channeling the TSV file containing Recalibration Tables.
604604
// Format is: "subject gender status sample bam bai recalTables"
605-
Channel
606-
.from(tsvFile.readLines())
607-
.map{line ->
608-
def list = SarekUtils.returnTSV(line.split(),7)
609-
def idPatient = list[0]
610-
def gender = list[1]
611-
def status = SarekUtils.returnStatus(list[2].toInteger())
612-
def idSample = list[3]
613-
def bamFile = SarekUtils.returnFile(list[4])
614-
def baiFile = SarekUtils.returnFile(list[5])
615-
def recalTable = SarekUtils.returnFile(list[6])
616-
617-
SarekUtils.checkFileExtension(bamFile,".bam")
618-
SarekUtils.checkFileExtension(baiFile,".bai")
619-
SarekUtils.checkFileExtension(recalTable,".recal.table")
620-
621-
[ idPatient, gender, status, idSample, bamFile, baiFile, recalTable ]
622-
}
605+
Channel.from(tsvFile)
606+
.splitCsv(sep: '\t')
607+
.map { row ->
608+
SarekUtils.checkNumberOfItem(row, 7)
609+
def idPatient = row[0]
610+
def gender = row[1]
611+
def status = SarekUtils.returnStatus(row[2].toInteger())
612+
def idSample = row[3]
613+
def bamFile = SarekUtils.returnFile(row[4])
614+
def baiFile = SarekUtils.returnFile(row[5])
615+
def recalTable = SarekUtils.returnFile(row[6])
616+
617+
SarekUtils.checkFileExtension(bamFile,".bam")
618+
SarekUtils.checkFileExtension(baiFile,".bai")
619+
SarekUtils.checkFileExtension(recalTable,".recal.table")
620+
621+
[ idPatient, gender, status, idSample, bamFile, baiFile, recalTable ]
622+
}
623623
}
624624

625625
def flowcellLaneFromFastq(path) {

scripts/wrapper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ do
7272
shift # past value
7373
;;
7474
--tag)
75-
tag=$2
75+
TAG=$2
7676
shift # past argument
7777
shift # past value
7878
;;

0 commit comments

Comments
 (0)