diff --git a/CHANGELOG.md b/CHANGELOG.md index 3697325be5..70477de9cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### `Added` +- [#613](https://github.com/SciLifeLab/Sarek/pull/613) - Add Issue Templates (bug report and feature request) +- [#614](https://github.com/SciLifeLab/Sarek/pull/614) - Add PR Template +- [#615](https://github.com/SciLifeLab/Sarek/pull/615) - Add presentation +- [#615](https://github.com/SciLifeLab/Sarek/pull/615) - Update documentation + +### `Changed` +- [#608](https://github.com/SciLifeLab/Sarek/pull/608) - Update Nextflow required version +- [#616](https://github.com/SciLifeLab/Sarek/pull/616) - Update CHANGELOG +- [#615](https://github.com/SciLifeLab/Sarek/pull/615) - Use `splitCsv` instead of `readlines` + +### `Removed` +- [#616](https://github.com/SciLifeLab/Sarek/pull/616) - Remove old Issue Template ## [2.1.0] - Ruotes - 2018-08-14 @@ -25,8 +38,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - [#601](https://github.com/SciLifeLab/Sarek/pull/601), [#603](https://github.com/SciLifeLab/Sarek/pull/603) - Container for GATK4 - [#606](https://github.com/SciLifeLab/Sarek/pull/606) - Add test data as a submodule from [`Sarek-data`](https://github.com/SciLifeLab/Sarek-data) - [#608](https://github.com/SciLifeLab/Sarek/pull/608) - Add documentation on how to install Nextflow on `bianca` -- [#613](https://github.com/SciLifeLab/Sarek/pull/613) - Add Issue Templates (bug report and feature request) -- [#614](https://github.com/SciLifeLab/Sarek/pull/614) - Add PR Template ### `Changed` - [#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. ### `Removed` - [#607](https://github.com/SciLifeLab/Sarek/pull/607) - Remove Mutect1 -- [#616](https://github.com/SciLifeLab/Sarek/pull/616) - Remove old Issue Template ## [2.0.0] - 2018-03-23 ### `Added` diff --git a/doc/INSTALL_BIANCA.md b/doc/INSTALL_BIANCA.md index 520665c14d..127d7cde2d 100644 --- a/doc/INSTALL_BIANCA.md +++ b/doc/INSTALL_BIANCA.md @@ -50,10 +50,20 @@ For more information about using Singularity with UPPMAX, follow the [Singularit > mv .nextflow nextflow_v[xx.yy.zz] > mv bin nextflow_v[xx.yy.zz]/bin +# Establish permission for some files +> chmod 755 nextflow_v[xx.yy.zz]/bin/nextflow +> chmod 660 nextflow_v[xx.yy.zz]/framework/[xx.yy.zz]/nextflow-[xx.yy.zz]-one.jar + +# If you want other people to use it +# Be sure that your group has rights to the directory as well + +> chown -R .[PROJECT] nextflow_v[xx.yy.zz] + # Clean directory > rm nextflow_v[xx.yy.zz].tgz # And everytime you're launching Nextflow, don't forget to export the following ENV variables +# Or add them to your .bashrc file > export NXF_HOME=/castor/project/proj/nobackup/tools/nextflow/nextflow_v[xx.yy.zz] > export PATH=${NXF_HOME}/bin:${PATH} > export NXF_TEMP=$SNIC_TMP @@ -137,6 +147,10 @@ Wrote Sarek-[snapID].tar.gz # extract Sarek > tar xvzf Sarek-[snapID].tgz +# If you want other people to use it +# Be sure that your group has rights to the directory as well +> chown -R .[PROJECT] Sarek-[snapID] + # Make a symbolic link to the extracted repository > ln -s Sarek-[snapID] default ``` diff --git a/doc/Presentations/2018-07-04-MGarcia-JOBIM.pdf b/doc/Presentations/2018-07-04-MGarcia-JOBIM.pdf new file mode 100644 index 0000000000..2eb1bfa061 Binary files /dev/null and b/doc/Presentations/2018-07-04-MGarcia-JOBIM.pdf differ diff --git a/lib/SarekUtils.groovy b/lib/SarekUtils.groovy index 43287f0388..2fa31868dd 100644 --- a/lib/SarekUtils.groovy +++ b/lib/SarekUtils.groovy @@ -8,6 +8,12 @@ class SarekUtils { if (!it.toString().toLowerCase().endsWith(extension.toLowerCase())) exit 1, "File: ${it} has the wrong extension: ${extension} see --help for more information" } + // Check if a row has the expected number of item + static def checkNumberOfItem(row, number) { + if (row.size() != number) exit 1, "Malformed row in TSV file: ${row}, see --help for more information" + return true + } + // Check parameter existence static def checkParameterExistence(it, list) { if (!list.contains(it)) { @@ -143,16 +149,16 @@ class SarekUtils { // Channeling the TSV file containing BAM. // Format is: "subject gender status sample bam bai" static def extractBams(tsvFile, mode) { - Channel - .from(tsvFile.readLines()) - .map{line -> - def list = SarekUtils.returnTSV(line.split(),6) - def idPatient = list[0] - def gender = list[1] - def status = SarekUtils.returnStatus(list[2].toInteger()) - def idSample = list[3] - def bamFile = SarekUtils.returnFile(list[4]) - def baiFile = SarekUtils.returnFile(list[5]) + Channel.from(tsvFile) + .splitCsv(sep: '\t') + .map { row -> + SarekUtils.checkNumberOfItem(row, 6) + def idPatient = row[0] + def gender = row[1] + def status = SarekUtils.returnStatus(row[2].toInteger()) + def idSample = row[3] + def bamFile = SarekUtils.returnFile(row[4]) + def baiFile = SarekUtils.returnFile(row[5]) SarekUtils.checkFileExtension(bamFile,".bam") SarekUtils.checkFileExtension(baiFile,".bai") @@ -199,12 +205,6 @@ class SarekUtils { return it } - // Return TSV if it has the correct number of items in row - static def returnTSV(it, number) { - if (it.size() != number) exit 1, "Malformed row in TSV file: ${it}, see --help for more information" - return it - } - // Sarek ascii art static def sarek_ascii() { println " ____ _____ _ " diff --git a/main.nf b/main.nf index ecd26d3461..66a0db4e5d 100644 --- a/main.nf +++ b/main.nf @@ -547,23 +547,23 @@ def defineStepList() { def extractFastq(tsvFile) { // Channeling the TSV file containing FASTQ. // Format is: "subject gender status sample lane fastq1 fastq2" - Channel - .from(tsvFile.readLines()) - .map{line -> - def list = SarekUtils.returnTSV(line.split(),7) - def idPatient = list[0] - def gender = list[1] - def status = SarekUtils.returnStatus(list[2].toInteger()) - def idSample = list[3] - def idRun = list[4] - def fastqFile1 = SarekUtils.returnFile(list[5]) - def fastqFile2 = SarekUtils.returnFile(list[6]) - - SarekUtils.checkFileExtension(fastqFile1,".fastq.gz") - SarekUtils.checkFileExtension(fastqFile2,".fastq.gz") - - [idPatient, gender, status, idSample, idRun, fastqFile1, fastqFile2] - } + Channel.from(tsvFile) + .splitCsv(sep: '\t') + .map { row -> + SarekUtils.checkNumberOfItem(row, 7) + def idPatient = row[0] + def gender = row[1] + def status = SarekUtils.returnStatus(row[2].toInteger()) + def idSample = row[3] + def idRun = row[4] + def fastqFile1 = SarekUtils.returnFile(row[5]) + def fastqFile2 = SarekUtils.returnFile(row[6]) + + SarekUtils.checkFileExtension(fastqFile1,".fastq.gz") + SarekUtils.checkFileExtension(fastqFile2,".fastq.gz") + + [idPatient, gender, status, idSample, idRun, fastqFile1, fastqFile2] + } } def extractFastqFromDir(pattern) { @@ -602,24 +602,24 @@ def extractFastqFromDir(pattern) { def extractRecal(tsvFile) { // Channeling the TSV file containing Recalibration Tables. // Format is: "subject gender status sample bam bai recalTables" - Channel - .from(tsvFile.readLines()) - .map{line -> - def list = SarekUtils.returnTSV(line.split(),7) - def idPatient = list[0] - def gender = list[1] - def status = SarekUtils.returnStatus(list[2].toInteger()) - def idSample = list[3] - def bamFile = SarekUtils.returnFile(list[4]) - def baiFile = SarekUtils.returnFile(list[5]) - def recalTable = SarekUtils.returnFile(list[6]) - - SarekUtils.checkFileExtension(bamFile,".bam") - SarekUtils.checkFileExtension(baiFile,".bai") - SarekUtils.checkFileExtension(recalTable,".recal.table") - - [ idPatient, gender, status, idSample, bamFile, baiFile, recalTable ] - } + Channel.from(tsvFile) + .splitCsv(sep: '\t') + .map { row -> + SarekUtils.checkNumberOfItem(row, 7) + def idPatient = row[0] + def gender = row[1] + def status = SarekUtils.returnStatus(row[2].toInteger()) + def idSample = row[3] + def bamFile = SarekUtils.returnFile(row[4]) + def baiFile = SarekUtils.returnFile(row[5]) + def recalTable = SarekUtils.returnFile(row[6]) + + SarekUtils.checkFileExtension(bamFile,".bam") + SarekUtils.checkFileExtension(baiFile,".bai") + SarekUtils.checkFileExtension(recalTable,".recal.table") + + [ idPatient, gender, status, idSample, bamFile, baiFile, recalTable ] + } } def flowcellLaneFromFastq(path) { diff --git a/scripts/wrapper.sh b/scripts/wrapper.sh index 4daee1e2fe..b96b63024b 100755 --- a/scripts/wrapper.sh +++ b/scripts/wrapper.sh @@ -72,7 +72,7 @@ do shift # past value ;; --tag) - tag=$2 + TAG=$2 shift # past argument shift # past value ;;