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

Commit

Permalink
Merge pull request #615 from MaxUlysse/installNextflowDoc
Browse files Browse the repository at this point in the history
Small refactoring
  • Loading branch information
Szilveszter Juhos authored Aug 16, 2018
2 parents 4517f57 + c562e33 commit 7eda6b1
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 55 deletions.
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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`
Expand Down
14 changes: 14 additions & 0 deletions doc/INSTALL_BIANCA.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```
Expand Down
Binary file added doc/Presentations/2018-07-04-MGarcia-JOBIM.pdf
Binary file not shown.
32 changes: 16 additions & 16 deletions lib/SarekUtils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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 " ____ _____ _ "
Expand Down
70 changes: 35 additions & 35 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ do
shift # past value
;;
--tag)
tag=$2
TAG=$2
shift # past argument
shift # past value
;;
Expand Down

0 comments on commit 7eda6b1

Please sign in to comment.