Commit 5d9caef2 authored by Andreas Tille's avatar Andreas Tille
Browse files

New upstream version 3.4.0

parent 9856de0a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7,5 +7,6 @@ cmake_install.cmake
# misc
flexbar
.DS_Store
wget-log
include
local
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ cmake_minimum_required( VERSION 2.8.2 )

project( FLEXBAR )

set( SEQAN_APP_VERSION "3.2.0" )
set( SEQAN_APP_VERSION "3.4.0" )

include_directories( ${FLEXBAR_SOURCE_DIR}/include )
# link_directories( ${FLEXBAR_SOURCE_DIR}/lib )
+40 −18
Original line number Diff line number Diff line
@@ -4,48 +4,50 @@ The program Flexbar preprocesses high-throughput sequencing data efficiently. It

Refer to the [manual](https://github.com/seqan/flexbar/wiki) or contact [Johannes Roehr](https://github.com/jtroehr) for support with this application.

![Flexbar logo](https://github.com/seqan/flexbar/wiki/images/flexbar-logo.png)


### References

Johannes T. Roehr, Christoph Dieterich, Knut Reinert: Flexbar 3.0 – SIMD and multicore parallelization. Bioinformatics 2017.
Johannes T. Roehr, Christoph Dieterich, Knut Reinert:  
Flexbar 3.0 – SIMD and multicore parallelization. Bioinformatics 2017.

See article on [PubMed](https://www.ncbi.nlm.nih.gov/pubmed/28541403)

Matthias Dodt, Johannes T. Roehr, Rina Ahmed, Christoph Dieterich: Flexbar – flexible barcode and adapter processing for next-generation sequencing platforms. Biology 2012.
Matthias Dodt, Johannes T. Roehr, Rina Ahmed, Christoph Dieterich:  
Flexbar – flexible barcode and adapter processing for next-generation sequencing platforms. Biology 2012.

See article on [PubMed](https://www.ncbi.nlm.nih.gov/pubmed/24832523)

![Flexbar logo](https://github.com/seqan/flexbar/wiki/images/flexbar-logo.png)


### Download

Flexbar source code as well as binaries for Linux and Mac OS can be downloaded on the [release](https://github.com/seqan/flexbar/releases) page. Please follow instructions for building or setup of binaries below. Additionally, Flexbar is available via package manager on Debian systems. Versions before 2.4 can be found on the [old](https://sourceforge.net/projects/flexbar) page.
Flexbar source code as well as binaries for Linux and Mac OS can be downloaded on the [release](https://github.com/seqan/flexbar/releases) page. Please follow instructions for building or setup of binaries below. Additionally, Flexbar is available via package manager on Debian systems and in Conda. Versions before 2.4 can be found on the [old](https://sourceforge.net/projects/flexbar) page.


### Building from source

Make sure that `cmake` is available, as well as development and runtime files of the TBB library 4.0 or later (Intel Threading Building Blocks). For example on Debian systems, install the packages `libtbb-dev` and `libtbb2`. Furthermore, the SeqAn library and a compiler that supports C++14 is required:

* Get SeqAn library version 2.2.0 [here](https://github.com/seqan/seqan/releases/download/seqan-v2.2.0/seqan-library-2.2.0.tar.xz)
* Download Flexbar 3.2 source code [release](https://github.com/seqan/flexbar/releases)
* Get SeqAn library version 2.4.0 [here](https://github.com/seqan/seqan/releases/download/seqan-v2.4.0/seqan-library-2.4.0.tar.xz)
* Download Flexbar 3.4 source code [release](https://github.com/seqan/flexbar/releases)

Decompress both files:

	tar xzf flexbar-3.2.0.tar.gz
	tar xJf seqan-library-2.2.0.tar.xz
	tar xzf flexbar-3.4.0.tar.gz
	tar xJf seqan-library-2.4.0.tar.xz

Move SeqAn include folder to Flexbar:

	mv seqan-library-2.2.0/include flexbar-3.2.0
	mv seqan-library-2.4.0/include flexbar-3.4.0

Use these commands for building:

	cd flexbar-3.2.0
	cd flexbar-3.4.0
	cmake .
	make

Flexbar version 2.7 requires SeqAn 2.1.1 instead. Releases prior to 2.7 use the SeqAn 1.4.2 library.
Flexbar versions from 3.0 up to 3.2 require SeqAn 2.2.0 instead. Flexbar version 2.7 uses SeqAn 2.1.1 and releases prior to 2.7 use the SeqAn 1.4.2 library.


### Binaries
@@ -69,17 +71,37 @@ Flexbar needs at least one file with sequencing reads in fasta or fastq format a

	flexbar -r reads [-b barcodes] [-a adapters] [options]

Refer to the help screen `flexbar -h` or [manual](https://github.com/seqan/flexbar/wiki) for more information. Although default parameters of Flexbar are optimized to deliver good results in many scenarios, the adjustment of parameters might improve results, e.g. `--adapter-min-overlap`. To run tests, make sure `flexbar` is reachable via the path variable and run `flexbar_test.sh` within the test folder.
Refer to the help screen `flexbar -h` or [manual](https://github.com/seqan/flexbar/wiki) for more information. Although default parameters of Flexbar are optimized to deliver good results in many scenarios, the adjustment of parameters like `--adapter-min-overlap` might improve results. For tests, run `flexbar_test.sh` within the test folder if `flexbar` is reachable via the path variable.

#### Quality-based trimming

In this example, reads in fastq format are trimmed based on their quality scores in Illumina version 1.8 format. The TAIL method trims the right end of reads until a quality score equal or higher than the threshold is reached, default 20. Trimmed reads are written to `target.fastq` in same format as the input.

	flexbar -r reads.fq -t target -q TAIL -qf i1.8

#### Demultiplexing with barcodes

Reads that are barcoded on the left end are demultiplexed by specifying a file with barcodes in fasta format. Reads that can be assigned are written to separate files using file names that are based on the names of barcodes in the fasta file.

	flexbar -r reads.fq -b barcodes.fa -bt LTAIL

#### Adapter removal single-end

To remove adapter sequences from single-end reads, specify a file with adapters in fasta format. These are removed from the right side of reads per default, if they do not align before the read start. The left side of reads is kept if long enough. The overlap of an adapter and read must have at least length 3 with at most 10% errors in default settings.

	flexbar -r reads.fq -a adapters.fa -ao 3 -ae 0.1

#### Adapter removal paired-end

#### Examples
For paired-end libraries, specify both files with paired reads and a fasta file with adapters for removal. Given adapters are trimmed in right mode per default. It is recommended to activate the pair overlap detection in case of standard paired reads. This increases the sensitivity by removing very short parts of adapters if an overlap is detected for a pair.

In this example, reads that are barcoded on left side are demultiplexed by specifying a file with barcodes in fasta format. After separation of reads, given adapters are removed from the right side if they do not align before read start. The left side of reads is kept if long enough. Remaining reads are written to the file `target.fastq` in same format as the input.
	flexbar -r r1.fq -p r2.fq -a adapters.fa -ap ON

	flexbar -r reads.fq -t target -b brc.fa -be LTAIL -a adp.fa
#### Adapter removal presets

The second example shows how to trim compressed reads based on their quality scores in illumina version 1.8 format. Afterwards, provided adapters are removed in right trim-end mode, only if the overlap of adapter and read has at least length 5 with at most 20% errors.
Several adapter presets for Illumina libraries are included in Flexbar. For example, select the `TruSeq` preset for standard TruSeq adapters and specify two read files for paired reads. If a preset is chosen, a separate file with adapters is not needed for removal. It is recommended to turn on the pair overlap detection for standard paired-end libraries.

	flexbar -r reads.fq.gz -q TAIL -qf i1.8 -a adp.fa -ao 5 -at 0.2
	flexbar -r r1.fq -p r2.fq -aa TruSeq -ap ON

For further examples visit the [manual](https://github.com/seqan/flexbar/wiki) page.
+4 −4
Original line number Diff line number Diff line
@@ -2,11 +2,11 @@
   
   Flexbar - flexible barcode and adapter removal
   
   Version 3.2.0
   Version 3.4.0
   
   BSD 3-Clause License
   
   uses SeqAn library release 2.2.0
   uses SeqAn library release 2.4.0
   and TBB library 4.0 or later
   
   
@@ -29,8 +29,8 @@ int main(int argc, const char* argv[]){
	using namespace std;
	using namespace seqan;
	
	const string version = "3.2";
	const string date    = "May 2018";
	const string version = "3.4.0";
	const string date    = "June 2018";
	
	ArgumentParser parser("flexbar");
	
+61 −45
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include "Options.h"
#include "FlexbarIO.h"
#include "LoadFasta.h"
#include "LoadAdapters.h"
#include "SeqInput.h"
#include "PairedInput.h"
#include "PairedOutput.h"
@@ -72,6 +73,18 @@ void loadAdapters(Options &o, const bool secondSet, const bool useAdapterFile){
	using namespace std;
	using namespace flexbar;
	
	if(o.aPreset != APOFF){
		LoadAdapters<TSeqStr, TString> la(o);
		
		la.loadSequences(secondSet);
		
		if(secondSet) o.adapters2 = la.getAdapters();
		else          o.adapters  = la.getAdapters();
		
		if(secondSet) la.printAdapters("Adapter2");
		else          la.printAdapters("Adapter");
	}
	else{
		LoadFasta<TSeqStr, TString> lf(o, true);
		
		if(useAdapterFile){
@@ -119,6 +132,7 @@ void loadAdapters(Options &o, const bool secondSet, const bool useAdapterFile){
		if(secondSet) lf.printBars("Adapter2");
		else          lf.printBars("Adapter");
	}
}


template <typename TSeqStr, typename TString>
@@ -196,9 +210,9 @@ void printMessage(Options &o){
	if(o.barDetect == WITHIN_READ_REMOVAL)                            s += " removal within reads";
	if(o.barDetect == WITHIN_READ)                                    s += " detection within reads";
	if(o.barDetect == BARCODE_READ)                                   s += " detection with separate reads";
	if(o.barDetect != BOFF && o.adapRm != AOFF)  s += " and ";
	if(o.barDetect == BOFF && o.adapRm == AOFF)  s += "basic processing";
	if(o.adapRm    != AOFF)                      s += "adapter removal";
	if(o.barDetect != BOFF && (o.adapRm != AOFF || o.poMode != POFF)) s += " and ";
	if(o.barDetect == BOFF &&  o.adapRm == AOFF && o.poMode == POFF)  s += "basic processing";
	if(o.adapRm    != AOFF ||  o.poMode != POFF)                      s += "adapter removal";
	
	*o.out << s << ".\n" << endl;
	
@@ -246,6 +260,8 @@ void startProcessing(Options &o){
	
	if(o.writeLengthDist) outputFilter.writeLengthDist();
	
	if(o.poMode != POFF) alignFilter.printPairOverlapStats();
	
	if(o.adapRm != AOFF){
		outputFilter.printAdapterRemovalStats();
		alignFilter.printAdapterOverlapStats();
@@ -296,7 +312,7 @@ void startProcessing(Options &o){
	if(o.barDetect != BOFF && ! o.writeUnassigned)
	*out << "  skipped unassigned reads        " << alignValue(len, alignFilter.getNrUnassignedReads()) << endl;
	
	if(o.adapRm != AOFF)
	if(o.adapRm != AOFF || o.poMode != POFF)
	*out << "  short prior to adapter removal  " << alignValue(len, alignFilter.getNrPreShortReads()) << endl;
	
	if(o.qTrim != QOFF && o.qtrimPostRm)
Loading