pax_global_header 0000666 0000000 0000000 00000000064 13503706164 0014517 g ustar 00root root 0000000 0000000 52 comment=b0234647d9429328afa5393caf22e0d95ae3326e
adapterremoval-2.3.1/ 0000775 0000000 0000000 00000000000 13503706164 0014530 5 ustar 00root root 0000000 0000000 adapterremoval-2.3.1/.gitignore 0000664 0000000 0000000 00000000045 13503706164 0016517 0 ustar 00root root 0000000 0000000 .vscode
build
googletest-release*
*~
adapterremoval-2.3.1/.travis.yml 0000664 0000000 0000000 00000001244 13503706164 0016642 0 ustar 00root root 0000000 0000000 language: cpp
dist: trusty
compiler:
- clang
- gcc
os:
- linux
- osx
addons:
apt:
packages:
- zlib1g-dev
- libbz2-dev
- python3
- python3-pip
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then python3 -m pip install --user cpp-coveralls; fi
install: true
script:
- make
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make test COVERAGE=yes; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make test COVERAGE=no; fi
- make regression
- PATH=$PATH:$PWD/build/ make -C examples
after_success:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then python3 -m coveralls --exclude tests --gcov-options '\-lp'; fi
adapterremoval-2.3.1/AdapterRemoval.1 0000664 0000000 0000000 00000043673 13503706164 0017535 0 ustar 00root root 0000000 0000000 .\" Man page generated from reStructuredText.
.
.TH "ADAPTERREMOVAL" "1" "Jun 23, 2019" "2.3.0" "AdapterRemoval"
.SH NAME
AdapterRemoval \- Fast short-read adapter trimming and processing
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBAdapterRemoval\fP [\fIoptions\fP…] –file1 <\fIfilenames\fP> [–file2 <\fIfilenames\fP>]
.SH DESCRIPTION
.sp
\fBAdapterRemoval\fP removes residual adapter sequences from single\-end (SE) or paired\-end (PE) FASTQ reads, optionally trimming Ns and low qualities bases and/or collapsing overlapping paired\-end mates into one read. Low quality reads are filtered based on the resulting length and the number of ambigious nucleotides (‘N’) present following trimming. These operations may be combined with simultaneous demultiplexing using 5’ barcode sequences. Alternatively, \fBAdapterRemoval\fP may attempt to reconstruct a consensus adapter sequences from paired\-end data, in order to allow the identification of the adapter sequences originally used.
.sp
If you use this program, please cite the paper:
.INDENT 0.0
.INDENT 3.5
Schubert, Lindgreen, and Orlando (2016). AdapterRemoval v2: rapid adapter trimming, identification, and read merging. BMC Research Notes, 12;9(1):88
.sp
\fI\%http://bmcresnotes.biomedcentral.com/articles/10.1186/s13104\-016\-1900\-2\fP
.UNINDENT
.UNINDENT
.sp
For detailed documentation, please see
.INDENT 0.0
.INDENT 3.5
\fI\%http://adapterremoval.readthedocs.io/en/v2.2.3/\fP
.UNINDENT
.UNINDENT
.SH OPTIONS
.INDENT 0.0
.TP
.B \-\-help
Display summary of command\-line options.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-version
Print the version string.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-file1 filename [filenames...]
Read FASTQ reads from one or more files, either uncompressed, bzip2 compressed, or gzip compressed. This contains either the single\-end (SE) reads or, if paired\-end, the mate 1 reads. If running in paired\-end mode, both \fB\-\-file1\fP and \fB\-\-file2\fP must be set. See the primary documentation for a list of supported formats.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-file2 filename [filenames...]
Read one or more FASTQ files containing mate 2 reads for a paired\-end run. If specified, \fB\-\-file1\fP must also be set.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-identify\-adapters
Attempt to build a consensus adapter sequence from fully overlapping pairs of paired\-end reads. The minimum overlap is controlled by \fB\-\-minalignmentlength\fP\&. The result will be compared with the values set using \fB\-\-adapter1\fP and \fB\-\-adapter2\fP\&. No trimming is performed in this mode. Default is off.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-threads n
Maximum number of threads. Defaults to 1.
.UNINDENT
.SS FASTQ options
.INDENT 0.0
.TP
.B \-\-qualitybase base
The Phred quality scores encoding used in input reads \- either ‘64’ for Phred+64 (Illumina 1.3+ and 1.5+) or ‘33’ for Phred+33 (Illumina 1.8+). In addition, the value ‘solexa’ may be used to specify reads with Solexa encoded scores. Default is 33.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-qualitybase\-output base
The base of the quality score for reads written by AdapterRemoval \- either ‘64’ for Phred+64 (i.e., Illumina 1.3+ and 1.5+) or ‘33’ for Phred+33 (Illumina 1.8+). In addition, the value ‘solexa’ may be used to specify reads with Solexa encoded scores. However, note that quality scores are represented using Phred scores internally, and conversion to and from Solexa scores therefore result in a loss of information. The default corresponds to the value given for \fB\-\-qualitybase\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-qualitymax base
Specifies the maximum Phred score expected in input files, and used when writing output files. Possible values are 0 to 93 for Phred+33 encoded files, and 0 to 62 for Phred+64 encoded files. Defaults to 41.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-mate\-separator separator
Character separating the mate number (1 or 2) from the read name in FASTQ records. Defaults to ‘/’.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-interleaved
Enables \fB\-\-interleaved\-input\fP and \fB\-\-interleaved\-output\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-interleaved\-input
If set, input is expected to be a interleaved FASTQ files specified using \fB\-\-file1\fP, in which pairs of reads are written one after the other (e.g. read1/1, read1/2, read2/1, read2/2, etc.).
.UNINDENT
.INDENT 0.0
.TP
.B \-\-interleaved\-ouput
Write paired\-end reads to a single file, interleaving mate 1 and mate 2 reads. By default, this file is named \fBbasename.paired.truncated\fP, but this may be changed using the \fB\-\-output1\fP option.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-combined\-output
Write all reads into the files specified by \fB\-\-output1\fP and \fB\-\-output2\fP\&. The sequences of reads discarded due to quality filters or read merging are replaced with a single ‘N’ with Phred score 0. This option can be combined with \fB\-\-interleaved\-output\fP to write PE reads to a single output file specified with \fB\-\-output1\fP\&.
.UNINDENT
.SS Output file options
.INDENT 0.0
.TP
.B \-\-basename filename
Prefix used for the naming output files, unless these names have been overridden using the corresponding command\-line option (see below).
.UNINDENT
.INDENT 0.0
.TP
.B \-\-settings file
Output file containing information on the parameters used in the run as well as overall statistics on the reads after trimming. Default filename is ‘basename.settings’.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-output1 file
Output file containing trimmed mate1 reads. Default filename is ‘basename.pair1.truncated’ for paired\-end reads, ‘basename.truncated’ for single\-end reads, and ‘basename.paired.truncated’ for interleaved paired\-end reads.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-output2 file
Output file containing trimmed mate 2 reads when \fB\-\-interleaved\-output\fP is not enabled. Default filename is ‘basename.pair2.truncated’ in paired\-end mode.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-singleton file
Output file to which containing paired reads for which the mate has been discarded. Default filename is ‘basename.singleton.truncated’.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-outputcollapsed file
If –collapsed is set, contains overlapping mate\-pairs which have been merged into a single read (PE mode) or reads for which the adapter was identified by a minimum overlap, indicating that the entire template molecule is present. This does not include which have subsequently been trimmed due to low\-quality or ambiguous nucleotides. Default filename is ‘basename.collapsed’
.UNINDENT
.INDENT 0.0
.TP
.B \-\-outputcollapsedtruncated file
Collapsed reads (see –outputcollapsed) which were trimmed due the presence of low\-quality or ambiguous nucleotides. Default filename is ‘basename.collapsed.truncated’.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-discarded file
Contains reads discarded due to the –minlength, –maxlength or –maxns options. Default filename is ‘basename.discarded’.
.UNINDENT
.SS Output compression options
.INDENT 0.0
.TP
.B \-\-gzip
If set, all FASTQ files written by AdapterRemoval will be gzip compressed using the compression level specified using \fB\-\-gzip\-level\fP\&. The extension “.gz” is added to files for which no filename was given on the command\-line. Defaults to off.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-gzip\-level level
Determines the compression level used when gzip’ing FASTQ files. Must be a value in the range 0 to 9, with 0 disabling compression and 9 being the best compression. Defaults to 6.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-bzip2
If set, all FASTQ files written by AdapterRemoval will be bzip2 compressed using the compression level specified using \fB\-\-bzip2\-level\fP\&. The extension “.bz2” is added to files for which no filename was given on the command\-line. Defaults to off.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-bzip2\-level level
Determines the compression level used when bzip2’ing FASTQ files. Must be a value in the range 1 to 9, with 9 being the best compression. Defaults to 9.
.UNINDENT
.SS FASTQ trimming options
.INDENT 0.0
.TP
.B \-\-adapter1 adapter
Adapter sequence expected to be found in mate 1 reads, specified in read direction. For a detailed description of how to provide the appropriate adapter sequences, see the “Adapters” section of the online documentation. Default is AGATCGGAAGAGCACACGTCTGAACTCCAGTCACNNNNNNATCTCGTATGCCGTCTTCTGCTTG.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-adapter2 adapter
Adapter sequence expected to be found in mate 2 reads, specified in read direction. For a detailed description of how to provide the appropriate adapter sequences, see the “Adapters” section of the online documentation. Default is AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-adapter\-list filename
Read one or more adapter sequences from a table. The first two columns (separated by whitespace) of each line in the file are expected to correspond to values passed to –adapter1 and –adapter2. In single\-end mode, only column one is required. Lines starting with ‘#’ are ignored. When multiple rows are found in the table, AdapterRemoval will try each adapter (pair), and select the best aligning adapters for each FASTQ read processed.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-minadapteroverlap length
In single\-end mode, reads are only trimmed if the overlap between read and the adapter is at least X bases long, not counting ambiguous nucleotides (N); this is independent of the \fB\-\-minalignmentlength\fP when using \fB\-\-collapse\fP, allowing a conservative selection of putative complete inserts in single\-end mode, while ensuring that all possible adapter contamination is trimmed. The default is 0.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-mm mismatchrate
The allowed fraction of mismatches allowed in the aligned region. If the value is less than 1, then the value is used directly. If \fB\(ga\-\-mismatchrate\fP is greater than 1, the rate is set to 1 / \fB\-\-mismatchrate\fP\&. The default setting is 3 when trimming adapters, corresponding to a maximum mismatch rate of 1/3, and 10 when using \fB\-\-identify\-adapters\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-shift n
To allow for missing bases in the 5’ end of the read, the program can let the alignment slip \fB\-\-shift\fP bases in the 5’ end. This corresponds to starting the alignment maximum \fB\-\-shift\fP nucleotides into read2 (for paired\-end) or the adapter (for single\-end). The default is 2.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-trim5p n [n]
Trim the 5’ of reads by a fixed amount after removing adapters, but before carrying out quality based trimming. Specify one value to trim mate 1 and mate 2 reads the same amount, or two values separated by a space to trim each mate different amounts. Off by default.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-trim3p n [n]
Trim the 3’ of reads by a fixed amount. See \fB\-\-trim5p\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-trimns
Trim consecutive Ns from the 5’ and 3’ termini. If quality trimming is also enabled (\fB\-\-trimqualities\fP), then stretches of mixed low\-quality bases and/or Ns are trimmed.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-maxns n
Discard reads containing more than \fB\-\-max\fP ambiguous bases (‘N’) after trimming. Default is 1000.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-trimqualities
Trim consecutive stretches of low quality bases (threshold set by \fB\-\-minquality\fP) from the 5’ and 3’ termini. If trimming of Ns is also enabled (\fB\-\-trimns\fP), then stretches of mixed low\-quality bases and Ns are trimmed.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-trimwindows window_size
Trim low quality bases using a sliding window based approach inspired by \fBsickle\fP with the given window size. See the “Window based quality trimming” section of the manual page for a description of this algorithm.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-minquality minimum
Set the threshold for trimming low quality bases using \fB\-\-trimqualities\fP and \fB\-\-trimwindows\fP\&. Default is 2.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-preserve5p
If set, bases at the 5p will not be trimmed by \fB\-\-trimns\fP, \fB\-\-trimqualities\fP, and \fB\-\-trimwindows\fP\&. Collapsed reads will not be quality trimmed when this option is enabled.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-minlength length
Reads shorter than this length are discarded following trimming. Defaults to 15.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-maxlength length
Reads longer than this length are discarded following trimming. Defaults to 4294967295.
.UNINDENT
.SS FASTQ merging options
.INDENT 0.0
.TP
.B \-\-collapse
In paired\-end mode, merge overlapping mates into a single and recalculate the quality scores. In single\-end mode, attempt to identify templates for which the entire sequence is available. In both cases, complete “collapsed” reads are written with a ‘M_’ name prefix, and “collapsed” reads which are trimmed due to quality settings are written with a ‘MT_’ name prefix. The overlap needs to be at least \fB\-\-minalignmentlength\fP nucleotides, with a maximum number of mismatches determined by \fB\-\-mm\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-minalignmentlength length
The minimum overlap between mate 1 and mate 2 before the reads are collapsed into one, when collapsing paired\-end reads, or when attempting to identify complete template sequences in single\-end mode. Default is 11.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-seed seed
When collaping reads at positions where the two reads differ, and the quality of the bases are identical, AdapterRemoval will select a random base. This option specifies the seed used for the random number generator used by AdapterRemoval. This value is also written to the settings file. Note that setting the seed is not reliable in multithreaded mode, since the order of operations is non\-deterministic.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-deterministic
Enable deterministic mode; currently only affects –collapse, different overlapping bases with equal quality are set to N quality 0, instead of being randomly sampled.
.UNINDENT
.SS FASTQ demultiplexing options
.INDENT 0.0
.TP
.B \-\-barcode\-list filename
Perform demultiplxing using table of one or two fixed\-length barcodes for SE or PE reads. The table is expected to contain 2 or 3 columns, the first of which represent the name of a given sample, and the second and third of which represent the mate 1 and (optionally) the mate 2 barcode sequence. For a detailed description, see the “Demultiplexing” section of the online documentation.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-barcode\-mm n
.TP
.B Maximum number of mismatches allowed when counting mismatches in both the mate 1 and the mate 2 barcode for paired reads.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-barcode\-mm\-r1 n
Maximum number of mismatches allowed for the mate 1 barcode; if not set, this value is equal to the \fB\-\-barcode\-mm\fP value; cannot be higher than the \fB\-\-barcode\-mm\fP value.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-barcode\-mm\-r2 n
Maximum number of mismatches allowed for the mate 2 barcode; if not set, this value is equal to the \fB\-\-barcode\-mm\fP value; cannot be higher than the \fB\-\-barcode\-mm\fP value.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-demultiplex\-only
Only carry out demultiplexing using the list of barcodes supplied with –barcode\-list. No other processing is done.
.UNINDENT
.SH WINDOW BASED QUALITY TRIMMING
.sp
As of v2.2.2, AdapterRemoval implements sliding window based approach to quality based base\-trimming inspired by \fBsickle\fP\&. If \fBwindow_size\fP is greater than or equal to 1, that number is used as the window size for all reads. If \fBwindow_size\fP is a number greater than or equal to 0 and less than 1, then that number is multiplied by the length of individual reads to determine the window size. If the window length is zero or is greater than the current read length, then the read length is used instead.
.sp
Reads are trimmed as follows for a given window size:
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP 1. 3
The new 5’ is determined by locating the first window where both the average quality and the quality of the first base in the window is greater than \fB\-\-minquality\fP\&.
.IP 2. 3
The new 3’ is located by sliding the first window right, until the average quality becomes less than or equal to \fB\-\-minquality\fP\&. The new 3’ is placed at the last base in that window where the quality is greater than or equal to \fB\-\-minquality\fP\&.
.IP 3. 3
If no 5’ position could be determined, the read is discarded.
.UNINDENT
.UNINDENT
.UNINDENT
.SH EXIT STATUS
.sp
AdapterRemoval exists with status 0 if the program ran succesfully, and with a non\-zero exit code if any errors were encountered. Do not use the output from AdapterRemoval if the program returned a non\-zero exit code!
.SH REPORTING BUGS
.sp
Please report any bugs using the AdapterRemoval issue\-tracker:
.sp
\fI\%https://github.com/MikkelSchubert/adapterremoval/issues\fP
.SH LICENSE
.sp
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
at your option any later version.
.sp
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.sp
You should have received a copy of the GNU General Public License
along with this program. If not, see <\fI\%http://www.gnu.org/licenses/\fP>.
.SH AUTHOR
Mikkel Schubert; Stinus Lindgreen
.SH COPYRIGHT
2017, Mikkel Schubert; Stinus Lindgreen
.\" Generated by docutils manpage writer.
.
adapterremoval-2.3.1/CHANGES.md 0000664 0000000 0000000 00000044304 13503706164 0016127 0 ustar 00root root 0000000 0000000 ### Version 2.3.1 - 2019-06-23
* Added --preserve5p option. This option prevents AdapterRemoval from trimming
the 5p of reads when the --trimqualities, --trimns, and --trimwindows options
are used. Neither end of collapsed reads are trimmed when this option is used.
* Fixed Ns being miscounted as As when constructing consensus adapter sequences
using --identify-adapters.
### Version 2.3.0 - 2019-03-12
* Fixed --collapse producing slightly different result on 32 bit and 64 bit
architectures. Courtesy of Andreas Tille.
* Added support for output files without a basename; to create such output
files, use an empty basename (--basename "") or a basename ending with a
slash (--basename path/).
* Added support for managing file handles to allow AdapterRemoval to run
when the the number of output files exceeds the number of file handles, e.g.
when demultiplexing large numbers of samples.
* Reworked demultiplexing to improve performance for many paired barcodes.
### Version 2.2.4 - 2019-02-10
* Fixed bug in --trim5p N which would AdapterRemoval to abort if N was greater
than the pre-trimmed read length.
* Fixed --identify-adapters not respecting the --mate-separator option.
### Version 2.2.3 - 2019-01-22
* Added support for trimming reads by a fixed amount: --trim5p N --trim3p N.
Different values may be given for each mate: --trim5p N1 N2. Trimming is
carried out after adapters have been removed and reads have been collapsed,
if enabled, but before quality trimming (Ns and low qualities).
* Added option for determistic read merging (--collapse-deterministic). In
this mode AdapterRemoval will set a merged base to 'N' with quality 0 if
the corresponding bases on the two mates differ, and if both have the same
quality score. The default behavior is to select one of the two bases at
random.
* Fixed reporting of line numbers in error messages.
* Added conda installation instructions, courtesy of Maxime Borry (maxibor).
* Fixed reading mate 2 adapters specified via --adapter-list. Adapters would
be used in the reverse orientation compared to --adapter2. Courtesy of
Karolis (KarolisM).
* Fixed various typos and improved help/error messages.
### Version 2.2.2 - 2017-07-17
* Made gzip and bzip2 support mandatory.
* Added support for Intel compilers, courtesy of Kevin Murray (kdmurray91).
### Version 2.2.1a - 2017-05-17
* Fixed compilation on OSX.
### Version 2.2.1 - 2017-05-15
* Numerous spelling errors fixed courtesy of Andreas Tille.
* Added support for specifying multiple filenames after --file1 and --file2,
in which case the files are treated as if they were concatenated. This is
supported for all operations. Special thanks to Stephen Clayton.
* Added additional run-time checks to catch race-conditions.
* Progress messages written to STDERR no longer cause subsequent error
messages to be written to the same line.
* Implemented quality trimming using a sliding window approach inspired by
sickle (https://github.com/najoshi/sickle). Special thanks to Kevin Murray.
* Fixed miscounting of the total number of retained nucleotides, where mate 1
reads were being counted twice instead of counting both mate 1 and mate 2.
### Version 2.2.0 - 2016-10-27
* AdapterRemoval now requires a C++11 compliant compiler; furthermore,
multithreading is no longer an optional feature, as this is now
implemented using the C++11 instead of directly calling pthreads.
* Add explicit message not to use the results after failed runs.
* Minor changes to .settings: Adapter numbers now 1-based; the 'Number of
reads with adapters' is changed to 'Number of read pairs with adapters'
when trimming PE reads; the 'Average read length of trimmed reads' is
changed to 'Average read length of retained reads' for clarity.
* Dropped the undocumented 'poor' classification for alignments; for
statistical purposes, reads are either counted as aligned or not aligned.
This ony changes how results are presented in the .settings files.
* Rework selection of nucleotides at overlapping positions with the same
quality, in order to prevent potential data-races during tie-breaking,
when running in multi-threaded mode.
* Added support for reading FASTQ files using Windows-style newlines (\r\n).
* AdapterRemoval will not print a warning to STDERR if the same command-line
option is specified multiple times.
* Reworked handling of barcodes to avoid unnecessary memory allocations,
which would cause problems when using long barcodes.
* Added support for combining output files; this is enabled using the
--combined-output option, and ensures that all reads are written to the
same file, or pair of files (for non-interleaved PE reads). The sequence
of reads that fail are replaced with a single 'N' with quality score 0.
* Fixed bug in the counting of singleton reads used in '.settings' files.
* Fixed mis-placement of underscore when pretty printing adapter sequences
that included barcodes.
* Fixed misprinting of mate 2 adapter sequences in the .settings file;
these would be printed in the reverse complemented orientation, relative
to how they were specified on the command-line.
### Version 2.1.7 - 2016-03-11
* The mate number is now stripped from collapsed reads, where previously this
would always be '\1' (if set). However, if meta-data is present in the
reads, that found in the mate 1 read is retained.
* The value used for --mate-separator is now written to the 'settings' file.
* Improved 'make install'. This command now makes use of a PREFIX value to
determine the installation destination (defaults to /usr/local), and
includes the 'README.md' file and 'examples' folder in the installation.
* Improved 'make test'. This command now attempts to download the required
testing library automatically, using either wget or curl if available.
### Version 2.1.6 - 2016-03-03
* Added support for reading / writing interleaved FASTQ files; this is
enabled by the options --interleaved-input and --interleaved-output,
respectively, or by setting --interleaved option which implies both of
the former options. See the README for an example.
* Fixed bug in a sanity check meant to detect if the mate 1 and mate 2 files
were of unequal length. This is now correctly detected in all cases.
* Expanded README with information about reading / writing FASTQ files with
different PHRED encodings / maximum quality scores.
### Version 2.1.5 - 2016-02-19
* Added the --mate-separator option, which specifies the character separating
the mate number; by default this is '/', and AdapterRemoval will therefore
identify mate numbers if read-names end with "/1" or "/2".
* Fixed race condition which could result in premature termination when using
--gzip or --bzip2 together with the --threads options.
* Improved checks during compression and sanity checks following processing.
### Version 2.1.4 - 2016-02-09
* Fixed bug which could occasionally result in failure when bzip2 compression
was enabled, by attempting to compress empty buffer.
* The following was contributed by Hannes Pétur Eggertsson:
* Wrapped code in 'ar' namespace, and made it possible to compile
AdapterRemoval as a static library (via the command 'make static'),
allowing it to be used as part of other projects.
* Updated instructions for installing GTest library using new repository.
* Fixed typos.
### Version 2.1.3 - 2015-12-25
* Added option --minadapteroverlap, which sets a minimum alignment length
when carrying out trimming of single-end reads. The default (0) may result
in an excess of false postiives around (1 - 2 bp long), which may be
mitigated by running AdapterRemoval with '--minadapteroverlap 3'.
* Greatly expanded README.md, adding several examples with test data included
in the 'examples' folder, demonstrating common usage of the program.
* Updated man-page with missing information and rewrote several parts.
* Updated the help-text for several command-line options.
* Avoid writing information to stdout, so that (SE) trimming can be piped.
This can be accomplished by using the option --output1 /dev/stdout.
* Fixed the --seed option, which was not properly applied during runtime.
### Version 2.1.2 - 2015-10-08
* Changed the way "full-length" and "truncated collapsed" reads are counted
in the .settings file; previously, all collapsed reads were counted, even
if these were subsequently discarded (due to the length). Now only retained
reads are counted, matching the behavior of AdapterRemoval v1.x.
* Added setup instructions when running 'make test' for the first time.
### Version 2.1.1 - 2015-09-14
* Fixed broken assert preventing the use of --adapter-list.
* Fixed bug using --qualitybase-output for both input and output.
### Version 2.1.0 - 2015-09-08
Major changes:
* Support for (transparently) reading and writing bzip2 files.
* Parallelization of adapter trimming and identification using pthreads; the
number of threads used is specified using --threads. Note that only one
thread is allowed to perform IO (reads / writes) at a time, to prevent
clobbering the disk, but compression (if enabled) is performed in parallel.
* Support for combined demultiplexing and adapter-removal using the
--barcode-list command-line option; when demultiplexing, the barcodes
identified for a given read is added to the adapter sequence, in ordre to
ensure correct trimming of the reads.
* Features depending on external libraries (gzip, bzip2, and threading
support) can be disabled in the Makefile on systems lacking these
libraries.
Other changes / bug-fixes:
* Display currently specified --adapter1 / adapter2 sequences for comparison
when attempting to infer adapter sequences. Only the first pair is used, if
multiple adapter pairs are specified.
* Sites with no majority-base during adapter-identification are set to N.
* Fixed failure to read of barcode sequences (--5prime / --5prime-list).
* Progress report now shows total number of reads processes, for both single
ended and pair ended analyses.
* FASTQ reads with Solexa scores are now output as Solexa scores by default,
rather than Phred+64. Note that the program represents quality scores using
Phred scores internally, resulting in a lossy conversion. It is therefore
recommended to convert to Phred scores rather than use Solexa scores.
### Version 2.0.0 - 2014-03-10
Version 2.0.0 of AdapterRemoval is a near complete rewrite, with the goal of
improved safety, increased speed, fixing a number of minor issues with
previous versions of AdapterRemoval, and adding a few new features:
Compatibility changes:
* Command-line arguments --pcr1 and --pcr2 have been deprecated in favor of
--adapter1 and --adapter2. While --pcr1 and --adapter1 are equivalent,
--adapter2 expects the adapter sequence which may be observed in raw
mate 2 reads, unlike --pcr2 which expected the sequence which could be
observed in the reverse complement of mate 2 reads (cf. the README).
* The use of --file1 and (optionally) --file2 is now required; reads will not
be read from STDIN, nor written to STDOUT by default. To approximate the
previous behavior, the following command may be used:
$ AdapterRemoval --file1 /dev/stdin --output1 /dev/stdout
* Per-read statistics of adapter / low-quality base trimming using --stats is
no longer supported.
Major changes:
* Strict validation of input FASTQ records, to ensure that records are well
formed, that quality scores fall within the expected range given the
specified format/offset, and more.
* Limited support for Solexa quality scores; these are converted to and
saved as Phred+33 or Phred+64 encoded scores.
* Improved handling of asymmetric read-pairs, in which the length of the
mate 1 read differs from the length of the mate 2 read.
* Significant improvements in performance, resulting in a ~5x increase in the
rate of adapter trimming in basic version, and a ~20x increase in the rate
of adapter trimming in the SSE enabled version (the default).
* Support for multiple adapter sequences as well as multiple barcode
sequences; AdapterRemoval will favor the highest scoring alignment,
favoring longer alignments over shorter alignments with the same score,
and favoring alignments with the fewest ambiguous bases (N) involved if
the score and length is identical.
* If --collapse is set in single-ended mode, "collapsed" reads will be
identified using the same criteria as for paired-ended mode, i.e. requiring
that at least --minalignmentlen bases overlap, and written to .collapsed
and .collapsed.truncated. This allows for the identification of reads
that are complete inserts.
* Added the ability to identify adapter sequences for paired-ended reads, by
identifying reads which extends past the ends of the template sequence, and
extracting the adapters from these.
* Added support for reading / writing gzipped compressed FASTQ files; if
enabled (using the --gzip flag), the ".gz" extension is added to filenames,
unless the filenames are explicitly specified by the user.
* Length distributions are now calculated per read-type post-trimming
(mate 1, mate 2, collapsed, etc.) and written to the .settings file.
Other improvements / bug-fixes:
* Barcodes may now contain Ns.
* Fixed underestimation of error-probabilities during sequence collapse.
* Fixed (futher) underestimation of error-probabilities of bases during
collapsing, for conflicting base-calls with the same Phred score.
* Fixed the maximum number of mismatches for alignments in the range of
6 .. 9 bases always being 1, even if --mm was set to 0.
* Fixed the maximum number of mismatches for alignments being calculated
based on the length of the alignment including ambiguous bases (N),
thereby inflating the number of mismatches allowed for poor alignments.
* Replaced use of lower bits of rand() calls with random(), as the former
generates low entropy bits in that range on some (non-Linux) platforms.
* Fixed well-aligned reads being discarded due to the minimum-length
requirement after trimming not being counted as well-aligned, resulting
in the total number of alignments not matching the total number of reads.
* Fixed bug in shifts for PE reads, which was causing some alignments to be
missed for adapter-only (i.e. no insert sequence) sequences.
* Improved input validation and sanity checks for command-line parameters.
* It is now possible to explicitly specify the RNG seed, to allow individual
runs to be reproduced; the seed is also written to the .settings file.
* Seed is now initialized using a mix of seconds and microseconds, instead of
the current time in seconds, to reduce the risk of multiple instances
spawed within a short timespan from using the same seed.
* An (optional) progress report is printed during usage, incidating the
run-time and number of reads processed.
### Version 1.5.4 - 2014-04-23
* Fixed bug in which collapsed reads would not be considered truncated if
bases were trimmed from the 5' end.
* Fixed bug in which the quality bases used for mate 2 during collapsing of
overlapping read pairs made use of quality scores with a wrong orientation.
* Reduced the amount of IO operations during trimming.
### Version 1.5.2 - 2013-10-22
Two changes to the program:
* I have added a reference to the paper to both the man page and the help
text.
* I fixed a minor bug in the collapse code where two very low quality bases
might give rise to a third low quality base being called. For example, a C
with quality " and a T with quality ! would result in an A with quality #.
This has been fixed so that the the result is now C with quality ".
### Version 1.5.0 - 2013-04-29
Small update: Due to user feedback, the program now outputs collapsed pairs in
two files: One contains full-length collapsed pairs constituting the full
insert, the other contains collapsed pairs that have been truncated due to low
qualities or Ns in the reads.
### Version 1.4.0 - 2013-03-24
I have made some fixes to the program:
* The program can now handle the use of '.' instead of 'N' to encode
undefined nucleotides.
* There was a typo in the adapter sequence used for PCR2!
* Some minor changes to output etc.
### Version 1.3.0 - 2013-02-10
I have updated AdapterRemoval and released version 1.3. These changes are based
on feedback from users of the program that had some very specific and well-
founded suggestions. Some of these changes are minor, others will have more
dramatic effects on the use of the program so please read these notes
carefully:
Minor changes:
* I fixed an occasional segmentation fault.
* Collapsed reads are now names "@M_...".
* Collapsed reads are put in a separate file with extension ".collapsed".
Important changes:
* The sequences PCR1 and PCR2 are now used as-is without reverse-
complementation. You have to make sure that the sequences you search for
are correct.
* The default PCR1 and PCR2 sequences are now:
PCR1: AGATCGGAAGAGCACACGTCTGAACTCCAGTCACNNNNNNATCTCGTATGCCGTCTTCTGCTTG
PCR2: AATGATACGGCGACCACCGAGATCACACTCTTTCCCTACACGACGCTCTTCCGATCT
* I have changed the way PCR1 and PCR2 are used to make the program
consistent. Now, you always search for the sequence PCR1 in READ1 (whether
single end or paired end), and you search for PCR2 in READ2. In single end
mode, this corresponds to having an empty READ2 and ignore PCR2 as
illustrated below:
* For paired end data, PCR2-READ1 aligned to READ2-PCR1.
* For single end data, READ1 aligned to PCR1.
As always, please contact me with any questions or comments.
Stinus
### Version 1.1.0 - 2012-05-01
* It is now possible to look for adapter in the 5' end of reads using the
--5prime parameter.
* Updated trimming of qualities.
* Added option for discarding reads with too many gaps using --maxns max.
* The programs handles lower vs upper case issues by translating all
sequences to upper case.
* The program now checks for inconsistent parameters.
* Fixed some typographical issues with output.
adapterremoval-2.3.1/LICENSE 0000664 0000000 0000000 00000104513 13503706164 0015541 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
adapterremoval-2.3.1/Makefile 0000664 0000000 0000000 00000015545 13503706164 0016202 0 ustar 00root root 0000000 0000000 ###############################################################################
# Makefile options: Edit / comment / uncomment to change build behavior
#
# Installation destinations
PREFIX := /usr/local
# Default compilation flags
CXXFLAGS := ${CXXFLAGS} -std=c++11 -O3
## Optional features; comment out or set to value other than 'yes' to disable
# Hide individual commands during build; only shows summaries instead.
QUIET_BUILD := yes
# Use of colored output during build
COLOR_BUILD := yes
# Debug build; adds warnings and debugging symbols
DEBUG_BUILD := no
# Include coverage instrumentation in build
COVERAGE := no
###############################################################################
# Makefile internals. Normally you do not need to touch these.
# Libraries required by AdapterRemoval
LIBRARIES := -pthread -lz -lbz2
# Build directory; modified depending on build options
BDIR := build/main
ifeq ($(strip ${QUIET_BUILD}),yes)
QUIET := @
endif
ifeq ($(strip ${COLOR_BUILD}),yes)
COLOR_YELLOW := "\033[0;33m"
COLOR_GREEN := "\033[0;32m"
COLOR_CYAN := "\033[0;36m"
COLOR_END := "\033[0m"
endif
ifeq ($(strip ${COVERAGE}), yes)
$(info Building AdapterRemoval with coverage instrumentation: yes)
CXXFLAGS := ${CXXFLAGS} --coverage
DEBUG_BUILD := yes
else
$(info Building AdapterRemoval with coverage instrumentation: no)
endif
ifeq ($(strip ${DEBUG_BUILD}), yes)
$(info Building AdapterRemoval with debug information: yes)
CXXFLAGS := ${CXXFLAGS} -g -pedantic -Wall -Wextra -Wcast-align -Wcast-qual \
-Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self \
-Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wsign-promo \
-Wstrict-overflow=2 -Wswitch-default -Wundef -Weffc++ -Wdeprecated
else
$(info Building AdapterRemoval with debug information: no)
endif
PROG := AdapterRemoval
LIBNAME := libadapterremoval
LIBOBJS := $(BDIR)/adapterset.o \
$(BDIR)/alignment.o \
$(BDIR)/alignment_tables.o \
$(BDIR)/argparse.o \
$(BDIR)/barcode_table.o \
$(BDIR)/debug.o \
$(BDIR)/demultiplex.o \
$(BDIR)/fastq.o \
$(BDIR)/fastq_enc.o \
$(BDIR)/fastq_io.o \
$(BDIR)/linereader.o \
$(BDIR)/linereader_joined.o \
$(BDIR)/main_adapter_id.o \
$(BDIR)/main_adapter_rm.o \
$(BDIR)/main_demultiplex.o \
$(BDIR)/managed_writer.o \
$(BDIR)/scheduler.o \
$(BDIR)/strutils.o \
$(BDIR)/threads.o \
$(BDIR)/timer.o \
$(BDIR)/trimmed_reads.o \
$(BDIR)/userconfig.o
OBJS := ${LIBOBJS} $(BDIR)/main.o
DFILES := $(OBJS:.o=.deps)
.PHONY: all install clean test clean_tests static regression docs
all: build/$(PROG)
everything: all static test regression docs
# Clean
clean: clean_tests clean_docs
@echo $(COLOR_GREEN)"Cleaning ..."$(COLOR_END)
$(QUIET) rm -f build/$(PROG) build/$(LIBNAME).a
$(QUIET) rm -rvf build/regression
$(QUIET) rm -rvf $(BDIR)
# Install
install: build/$(PROG)
@echo $(COLOR_GREEN)"Installing AdapterRemoval .."$(COLOR_END)
@echo $(COLOR_GREEN)" .. binary into ${PREFIX}/bin/"$(COLOR_END)
$(QUIET) mkdir -p ${PREFIX}/bin/
$(QUIET) mv -f build/$(PROG) ${PREFIX}/bin/
$(QUIET) chmod a+x ${PREFIX}/bin/$(PROG)
@echo $(COLOR_GREEN)" .. man-page into ${PREFIX}/share/man/man1/"$(COLOR_END)
$(QUIET) mkdir -p ${PREFIX}/share/man/man1/
$(QUIET) cp -a $(PROG).1 ${PREFIX}/share/man/man1/
$(QUIET) chmod a+r ${PREFIX}/share/man/man1/$(PROG).1
@echo $(COLOR_GREEN)" .. README into ${PREFIX}/share/adapterremoval/"$(COLOR_END)
$(QUIET) mkdir -p ${PREFIX}/share/adapterremoval/
$(QUIET) cp -a README.md ${PREFIX}/share/adapterremoval/
$(QUIET) chmod a+r ${PREFIX}/share/adapterremoval/README.md
@echo $(COLOR_GREEN)" .. examples into ${PREFIX}/share/adapterremoval/examples/"$(COLOR_END)
$(QUIET) mkdir -p ${PREFIX}/share/adapterremoval/examples/
$(QUIET) cp -a examples/*.* ${PREFIX}/share/adapterremoval/examples/
$(QUIET) chmod a+r ${PREFIX}/share/adapterremoval/examples/*.*
static: build/$(LIBNAME).a
# Object files
$(BDIR)/%.o: src/%.cpp
@echo $(COLOR_CYAN)"Building $@ from $<"$(COLOR_END)
$(QUIET) mkdir -p $(BDIR)
$(QUIET) $(CXX) $(CXXFLAGS) -pthread -c -o $@ $<
$(QUIET) $(CXX) $(CXXFLAGS) -w -MM -MT $@ -MF $(@:.o=.deps) $<
# Executable
build/$(PROG): $(OBJS)
@echo $(COLOR_GREEN)"Linking executable $@"$(COLOR_END)
$(QUIET) $(CXX) $(CXXFLAGS) ${LDFLAGS} $^ ${LIBRARIES} -o $@
# Static library
build/$(LIBNAME).a: $(LIBOBJS)
@echo $(COLOR_GREEN)"Linking static library $@"$(COLOR_END)
$(AR) rcs build/$(LIBNAME).a $(LIBOBJS)
# Automatic header depencencies
-include $(DFILES)
#
# Unit testing
#
TEST_DIR := build/tests
TEST_OBJS := $(TEST_DIR)/main_test.o \
$(TEST_DIR)/debug.o \
$(TEST_DIR)/alignment.o \
$(TEST_DIR)/alignment_tables.o \
$(TEST_DIR)/alignment_test.o \
$(TEST_DIR)/argparse.o \
$(TEST_DIR)/argparse_test.o \
$(TEST_DIR)/barcodes_test.o \
$(TEST_DIR)/barcode_table.o \
$(TEST_DIR)/fastq.o \
$(TEST_DIR)/fastq_test.o \
$(TEST_DIR)/fastq_enc.o \
$(TEST_DIR)/fastq_enc_test.o \
$(TEST_DIR)/strutils.o \
$(TEST_DIR)/strutils_test.o
TEST_DEPS := $(TEST_OBJS:.o=.deps)
TEST_CXXFLAGS := -Isrc -DAR_TEST_BUILD -g
test: $(TEST_DIR)/main
@echo $(COLOR_GREEN)"Running unit tests"$(COLOR_END)
$(QUIET) $(TEST_DIR)/main
clean_tests:
@echo $(COLOR_GREEN)"Cleaning tests ..."$(COLOR_END)
$(QUIET) rm -rvf $(TEST_DIR)
$(TEST_DIR)/main: $(TEST_OBJS)
@echo $(COLOR_GREEN)"Linking executable $@"$(COLOR_END)
$(QUIET) $(CXX) $(CXXFLAGS) ${LIBRARIES} $^ -o $@
$(TEST_DIR)/%.o: tests/unit/%.cpp
@echo $(COLOR_CYAN)"Building $@ from $<"$(COLOR_END)
$(QUIET) mkdir -p $(TEST_DIR)
$(QUIET) $(CXX) $(CXXFLAGS) $(TEST_CXXFLAGS) -c -o $@ $<
$(QUIET) $(CXX) $(CXXFLAGS) $(TEST_CXXFLAGS) -w -MM -MT $@ -MF $(@:.o=.deps) $<
$(TEST_DIR)/%.o: src/%.cpp
@echo $(COLOR_CYAN)"Building $@ from $<"$(COLOR_END)
$(QUIET) mkdir -p $(TEST_DIR)
$(QUIET) $(CXX) $(CXXFLAGS) $(TEST_CXXFLAGS) -c -o $@ $<
$(QUIET) $(CXX) $(CXXFLAGS) $(TEST_CXXFLAGS) -w -MM -MT $@ -MF $(@:.o=.deps) $<
#
# Validation
#
VALIDATION_BDIR=./build/regression
VALIDATION_SDIR=./tests/regression
regression: build/$(PROG)
@echo $(COLOR_GREEN)"Running regression tests"$(COLOR_END)
@mkdir -p $(VALIDATION_BDIR)
@$(VALIDATION_SDIR)/run $(VALIDATION_BDIR) $(VALIDATION_SDIR)
# Automatic header dependencies for tests
-include $(TEST_DEPS)
#
# Documentation
#
SPHINXOPTS = -n -q
SPHINXBUILD = sphinx-build
docs:
$(QUIET) @$(SPHINXBUILD) -M html docs build/docs $(SPHINXOPTS)
$(QUIET) @$(SPHINXBUILD) -M man docs build/docs $(SPHINXOPTS)
$(QUIET) cp -v "build/docs/man/AdapterRemoval.1" .
clean_docs:
@echo $(COLOR_GREEN)"Cleaning documentation ..."$(COLOR_END)
$(QUIET) rm -rvf build/docs
adapterremoval-2.3.1/README.md 0000664 0000000 0000000 00000050030 13503706164 0016005 0 ustar 00root root 0000000 0000000 # AdapterRemoval [](https://travis-ci.org/MikkelSchubert/adapterremoval) [](https://coveralls.io/github/MikkelSchubert/adapterremoval)
This program searches for and removes remnant adapter sequences from High-Throughput Sequencing (HTS) data and (optionally) trims low quality bases from the 3' end of reads following adapter removal. AdapterRemoval can analyze both single end and paired end data, and can be used to merge overlapping paired-ended reads into (longer) consensus sequences. Additionally, the AdapterRemoval may be used to recover a consensus adapter sequence for paired-ended data, for which this information is not available.
For comments, suggestions and feedback please contact Mikkel Schubert (MikkelSch@gmail.com) and Stinus Lindgreen (stinus@binf.ku.dk). If you use AdapterRemoval v2, then please cite the paper:
Schubert, Lindgreen, and Orlando (2016). AdapterRemoval v2: rapid adapter trimming, identification, and read merging. BMC Research Notes, 12;9(1):88
http://bmcresnotes.biomedcentral.com/articles/10.1186/s13104-016-1900-2
AdapterRemoval was originally published in Lindgreen 2012:
Lindgreen (2012): AdapterRemoval: Easy Cleaning of Next Generation Sequencing Reads, BMC Research Notes, 5:337
http://www.biomedcentral.com/1756-0500/5/337/
## Overview of major features
- Trimming of adapters sequences from single-end and paired-end FASTQ reads.
- Trimming of multiple, different adapters or adapter pairs.
- Demultiplexing of single or double indexed reads, with or without trimming
of adapter sequences.
- Reconstruction of adapter sequences from paired-end reads, by the pairwise
alignment of reads in the absence of a known adapter sequence.
- Merging of overlapping read-pairs into higher-quality consensus sequences.
- Multi-threading of all operations for increased throughput.
- Reading and writing of gzip and bzip2 compressed files.
- Reading and writing of interleaved FASTQ files.
## Installation
### Installation with [Conda](https://conda.io/docs/)
If you have Conda [installed on your system](https://conda.io/miniconda.html):
```
conda install -c bioconda adapterremoval
```
### Manual installation
To install, first download and unpack the newest release from GitHub:
$ wget -O adapterremoval-2.1.7.tar.gz https://github.com/MikkelSchubert/adapterremoval/archive/v2.1.7.tar.gz
$ tar xvzf adapterremoval-2.1.7.tar.gz
$ cd adapterremoval-2.1.7
or
$ git clone https://github.com/MikkelSchubert/adapterremoval.git
$ cd adapterremoval
To compile, run
$ make
The resulting binary and man page is located in the "build" folder.
To install, run
$ sudo make install
It is also possible to compile AdapterRemoval as a static library:
$ sudo make static
Note that AdapterRemoval requires that the zlib library and headers (www.zlib.net) are installed, that the bzlib2 library and headers are installed, and that the compiler used supports c++11. Please refer to your operating system documentation for installation instructions.
## Documentation
For detailed program usage, please refer to the manual page.
If AdapterRemoval has been installed, this may be accessed using the command "man AdapterRemoval". If AdapterRemoval has not been installed, the manual page may be read using the command "man build/AdapterRemoval.1" in the source folder once "make" has been run. Alternatively, the manual may be read online:
https://github.com/MikkelSchubert/adapterremoval/blob/master/AdapterRemoval.pod
## Examples
The following examples make use of the data included in the 'examples' folder:
### Trimming single-end reads
The following command removes adapters from the file 'reads\_1.fq' trims both Ns and low quality bases from the reads, and gzip compresses the resulting files. The --basename option is used to specify the prefix for output files.
$ AdapterRemoval --file1 reads_1.fq --basename output_single --trimns --trimqualities --gzip
Since --gzip and --basename is specified, the trimmed FASTQ reads are written to 'output_single.truncated.gz', the discarded FASTQ reads are written to 'output_single.discarded.gz', and settings and summary statistics are written to 'output_single.settings'.
Note that by default, AdapterRemoval does not require a minimum number of bases overlapping with the adapter sequence, before reads are trimmed. This may result in an excess of very short (1 - 3 bp) 3' fragments being falsely identified as adapter sequences, and trimmed. This behavior may be changed using the --minadapteroverlap option, which allows the specification of a minimum number of bases (excluding Ns) that must be aligned to carry trimming. For example, use --minadapteroverlap 3 to require an overlap of at least 3 bp.
### Trimming paired-end reads
The following command removes adapters from a paired-end reads, where the mate 1 and mate 2 reads are kept in files 'reads\_1.fq' and 'reads\_2.fq', respectively. The reads are trimmed for both Ns and low quality bases, and overlapping reads (at least 11 nucleotides, per default) are merged (collapsed):
$ AdapterRemoval --file1 reads_1.fq --file2 reads_2.fq --basename output_paired --trimns --trimqualities --collapse
This command generates the files 'output_paired.pair1.truncated' and 'output_paired.pair2.truncated', which contain trimmed pairs of reads which were not collapsed, 'output_paired.singleton.truncated' containing reads where one mate was discarded, 'output_paired.collapsed' containing merged reads, and 'output_paired.collapsed.truncated' containing merged reads that have been trimmed due to the --trimns or --trimqualities options. Finally, the 'output_paired.discarded' and 'output_paired.settings' files correspond to those of the single-end run.
### Multiple input FASTQ files
More than one input file may be specified for mate 1 and mate 2 reads. This is accomplished simply by listing more than one file after the --file1 and the --file2 options.
For single-end reads:
$ AdapterRemoval --file1 reads_1a.fq reads_1b.fq reads_1c.fq
And for paired-end reads:
$ AdapterRemoval --file1 reads_1a.fq reads_1b.fq reads_1c.fq --file2 reads_2a.fq reads_2b.fq reads_2c.fq
AdapterRemoval will process these files as if they had been concatenated into a single file or pair of files prior to invoking AdapterRemoval. For paired reads, the files must be specified in the same order for --file1 and --file2.
### Interleaved FASTQ reads
AdapterRemoval is able to read and write paired-end reads stored in a single, so-called interleaved FASTQ file (one pair at a time, first mate 1, then mate 2). This is accomplished by specifying the location of the file using --file1 and *also* setting the --interleaved command-line option:
$ AdapterRemoval --interleaved --file1 interleaved.fq --basename output_interleaved
Other than taking just a single input file, this mode operates almost exactly like paired end trimming (as described above); the mode differs only in that paired reads are not written to a 'pair1' and a 'pair2' file, but instead these are instead written to a single, interleaved file, named 'paired'. The location of this file is controlled using the --output1 option. Enabling either reading or writing of interleaved FASTQ files, both not both, can be accomplished by specifying the either of the --interleaved-input and --interleaved-output options, both of which are enabled by the --interleaved option.
### Combining FASTQ output
By default, AdapterRemoval will create one output file for each mate, one file for discarded reads, and (in PE mode) one file paired reads where one mate has been discarded, and (optionally) two files for collapsed reads. Alternatively, these files may be combined using the --combined-output, in which case all output is directed to the mate 1 and (in PE mode) to the mate 2 file. In cases where reads are discarded due to trimming to due to being collapsed into a single sequence, the sequence and quality scores of the discarded read is replaced with a single 'N' with base-quality 0. This option may be combined with --interleaved / --interleaved-output, to write a single, interleaved file in paired-end mode.
### Different quality score encodings
By default, AdapterRemoval expects the quality scores in FASTQ reads to be Phred+33 encoded, meaning that the error probabilities are encoded as (char)('!' - 10 * log10(p)). Most data will be encoded using Phred+33, but Phred+64 and 'Solexa' encoded quality scores are also supported. These are selected by specifying the --qualitybase command-line option (specifying either '33', '64', or 'solexa'):
$ AdapterRemoval --qualitybase 64 --file1 reads_q64.fq --basename output_phred_64
By default, reads are written using the *same* encoding as the input. If a different encoding is desired, this may be accomplished using the --qualitybase-output option::
$ AdapterRemoval --qualitybase 64 --qualitybase-output 33 --file1 reads_q64.fq --basename output_phred_33
Note furthermore that AdapterRemoval by default only expects quality scores in the range 0 - 41 (or -5 to 41 in the case of Solexa encoded scores). If input data using a different maximum quality score is to be processed, or if the desired maximum quality score of collapsed reads is greater than 41, then this limit may be increased using the --qualitymax option::
$ AdapterRemoval --qualitymax 50 --file1 reads_1.fq --file2 reads_2.fq --collapse --basename output_collapsed_q50
For a detailed overview of Phred encoding schemes currently and previously in use, see e.g. the Wikipedia article on the subject:
https://en.wikipedia.org/wiki/FASTQ_format#Encoding
### Trimming paired-end reads with multiple adapter pairs
It is possible to trim data that contains multiple adapter pairs, by providing a one or two-column table containing possible adapter combinations (for single-end and paired-end trimming, respectively; see e.g. examples/adapters.txt):
$ cat adapters.txt
AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT
AAACTTGCTCTGTGCCCGCTCCGTATGTCACAACAGTGCGTGTATCACCTCAATGCAGGACTCA GATCGGGAGTAATTTGGAGGCAGTAGTTCGTCGAAACTCGGAGCGTCTTTAGCAGGAG
CTAATTTGCCGTAGCGACGTACTTCAGCCTCCAGGAATTGGACCCTTACGCACACGCATTCATG TACCGTGAAAGGTGCGCTTAGTGGCATATGCGTTAAGAGCTAGGTAACGGTCTGGAGG
GTTCATACGACGACGACCAATGGCACACTTATCCGGTACTTGCGTTTCAATGCGCATGCCCCAT TAAGAAACTCGGAGTTTGGCCTGCGAGGTAGCTTGGGTGTTATGAAGAACGGCATGCG
CCATGCCCCGAAGATTCCTATACCCTTAAGGTCGCAATTGTTCGAGTAAGCTGTACGCGCCCAT GTTGCATTGACCCGAAGGGCTCGATGTTTAGGGAGGTCAGAAGTTGAGCGGGTTCAAA
This table is then specified using the --adapter-list option:
$ AdapterRemoval --file1 reads_1.fq --file2 reads_2.fq --basename output_multi --trimns --trimqualities --collapse --adapter-list adapters.txt
The resulting .summary file contains an overview of how frequently each adapter (pair) was used.
Note that in the case of paired-end adapters, AdapterRemoval considers only the combinations of adapters specified in the table, one combination per row. For single-end trimming, only the first column of the table file is required, and the list may therefore take the form of a file containing one sequence per line.
### Identifying adapter sequences from paired-ended reads
If we did not know the adapter sequences for the 'reads\_*.fq' files, AdapterRemoval may be used to generate a consensus adapter sequence based on fragments identified as belonging to the adapters through pairwise alignments of the reads, provided that the data set contains only a single adapter sequence (not counting differences in index sequences).
In the following example, the identified adapters corresponds to the default adapter sequences with a poly-A tail resulting from sequencing past the end of the insert + templates. It is not necessary to specify this tail when using the --adapter1 or --adapter2 command-line options. The characters shown under each of the consensus sequences represent the Phred-encoded fraction of bases that differ from the consensus base, such that a high Phred score indicates a strong consensus. In the examples below, adapter 1 is observed to contain the index CACCTA:
$ AdapterRemoval --identify-adapters --file1 reads_1.fq --file2 reads_2.fq
Attemping to identify adapter sequences ...
Processed a total of 1,000 reads in 0.0s; 129,000 reads per second on average ...
Found 394 overlapping pairs ...
Of which 119 contained adapter sequence(s) ...
Printing adapter sequences, including poly-A tails:
--adapter1: AGATCGGAAGAGCACACGTCTGAACTCCAGTCACNNNNNNATCTCGTATGCCGTCTTCTGCTTG
||||||||||||||||||||||||||||||||||******||||||||||||||||||||||||
Consensus: AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTGAAAAAAAAAAAAAAAAAAAAAAAA
Quality: 55200522544444/4411330333330222222/1.1.1.1111100-00000///..+....--*-)),,+++++++**(('%%%$
Top 5 most common 9-bp 5'-kmers:
1: AGATCGGAA = 96.00% (96)
2: AGATGGGAA = 1.00% (1)
3: AGCTCGGAA = 1.00% (1)
4: AGAGCGAAA = 1.00% (1)
5: AGATCGGGA = 1.00% (1)
--adapter2: AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Consensus: AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Quality: 525555555144141441430333303.2/22-2/-1..11111110--00000///..+....--*-),,,+++++++**(%'%%%$
Top 5 most common 9-bp 5'-kmers:
1: AGATCGGAA = 100.00% (100)
No files are generated from running the adapter identification step.
The consensus sequences inferred are compared to those specified using the --adapter1 and --adapter2 command-line options, or with the default values for these if no values have been given (as in this case). Pipes (|) indicate matches between the provided sequences and the consensus sequence, and "*" indicate the presence of unspecified bases (Ns).
### Demultiplexing and adapter-trimming
As of version 2.1, AdapterRemoval supports simultaneous demultiplexing and adapter trimming; demultiplexing is carried out using a simple comparison between the specified barcode (a sequence of A, C, G, and T) and the first N bases of the mate 1 read, where N is the length of the barcode. Demultiplexing of double-indexed sequences is also supported, in which case two barcodes must be specified for each sample. The first barcode is then compared to first N_1 bases of the mate 1 read, and the second barcode is compared to the first N_2 bases of the mate 2 read. By default, this comparison requires a perfect match. Reads identified as containing a specific barcode(s) are then trimmed using adapter sequences including the barcode(s) as necessary. Reads for which no (pair of) barcodes matched are written to a separate file or pair of files (for paired end reads).
Demultiplexing is enabled by creating a table of barcodes, the first column of which species the sample name (using characters [a-zA-Z0-9_]) and the second and (optional) third columns specifies the barcode sequences expected at the 5' termini of mate 1 and mate 2 reads, respectively.
For example, a table of barcodes from a double-indexed run might be as follows (see examples/barcodes.txt):
$ cat barcodes.txt
sample_1 ATGCGGA TGAATCT
sample_2 ATGGATT ATAGTGA
sample_7 CAAAACT TCGCTGC
In the case of single-read reads, only the first two columns are required. AdapterRemoval is invoked with the --barcode-list option, specifying the path to this table:
$ AdapterRemoval --file1 demux_1.fq --file2 demux_2.fq --basename output_demux --barcode-list barcodes.txt
This generates a set of output files for each sample specified in the barcode table, using the basename (--basename) as the prefix, followed by a dot and the sample name, followed by a dot and the default name for a given file type. For example, the output files for sample_2 would be
output_demux.sample_2.discarded
output_demux.sample_2.pair1.truncated
output_demux.sample_2.pair2.truncated
output_demux.sample_2.settings
output_demux.sample_2.singleton.truncated
The settings files generated for each sample summarizes the reads for that sample only; in addition, a basename.settings file is generated which summarizes the number and proportion of reads identified as belonging to each sample.
The maximum number of mismatches allowed when comparing barocdes is controlled using the options --barcode-mm, --barcode-mm-r1, and --barcode-mm-r2, which specify the maximum number of mismatches total, and the maximum number of mismatches for the mate 1 and mate 2 barcodes respectively. Thus, if mm_1(i) and mm_2(i) represents the number of mismatches observed for barcode-pair i for a given pair of reads, these options require that
1. mm_1(i) <= --barcode-mm-r1
2. mm_2(i) <= --barcode-mm-r2
3. mm_1(i) + mm_2(i) <= --barcode-mm
### Demultiplexing mode
As of version 2.2, AdapterRemoval can furthermore be used to demultiplex reads, without carrying out other forms of adapter trimming. This is accomplished by specifying the --demultiplex-only option:
$ AdapterRemoval --file1 demux_1.fq --file2 demux_2.fq --basename output_only_demux --barcode-list barcodes.txt --demultiplex-only
Options listed under "TRIMMING SETTINGS" (see 'AdapterRemoval --help') do not apply to this mode, but compression (--gzip, --bzip2), multi-threading (--threads), interleaving (--interleaved, etc.) and other such options may be used in conjunction with --demultiplex-only.
AdapterRemoval will generate a '.settings' file for each sample listed in the --barcode-list file, along with the adapter-sequences that should be used when trimming reads for a given sample. These adapters correspond to the adapters that were specified when running AdapterRemoval in demultiplexing mode, with the barcode prefixed as appropriate. An underscore is used to demarcate the location at which the barcode ends and the adapter beings.
It is important to use these, updated, adapter sequences when trimming the demultiplexed reads, to avoid the inclusion of barcode sequences in reads extending past the 3' termini of the DNA template sequence.
## A note on specifying adapter sequences
Please note that the --pcr1 and --pcr2 options used with AdapterRemoval v1.x have been deprecated in favor of options --adapter1 and --adapter2. For both --adapter1 and --adapter2 the adapter sequence are expected to be observed in the raw mate 1 and mate 2 reads respectively, exactly as specified on the command-line, which corresponds to the behavior of most adapter trimming programs.
Default adapter #1: AGATCGGAAGAGCACACGTCTGAACTCCAGTCACNNNNNNATCTCGTATGCCGTCTTCTGCTTG
Default adapter #2: AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT
Assuming these were the adapters used to generate our data, we should therefore see these in the FASTQ files (assuming that the read lengths are sufficiently long and that insert sizes are sufficently short), typically followed by a low-quality A-tail, when ignoring any difference in case and treating Ns as wildcards:
$ grep -i "AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC......ATCTCGTATGCCGTCTTCTGCTTG" file1.fq
AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCGATGAATCTCGTATGCCGTCTTCTGCTTGAAAAAAAAACAAGAAT
CTGGAGTTCAGATCGGAAGAGCACACGTCTGAACTCCAGTCACCGATGAATCTCGTATGCCGTCTTCTGCTTGAAAAAAA
GGAGATCGGAAGAGCACACGTCTGAACTCCAGTCACCGATGAATCTCGTATGCCGTCTTCTGCTTGCAAATTGAAAACAC
...
$ grep -i "AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT" file2.fq
CAGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATTCAAAAAAAGAAAAACATCTTG
GAACTCCAGAGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATTCAAAAAAAATAGA
GAACTAGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATTCAAAAACATAAGACCTA
...
The options --pcr1 and --adapter1 are functionally equivalent, while the option --pcr2 expects the reverse complement of the --adapter2 sequence. Thus, the default for --pcr2 is AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT, the reverse complement of the default for --adapter2.
adapterremoval-2.3.1/benchmark/ 0000775 0000000 0000000 00000000000 13503706164 0016462 5 ustar 00root root 0000000 0000000 adapterremoval-2.3.1/benchmark/README.md 0000664 0000000 0000000 00000005016 13503706164 0017743 0 ustar 00root root 0000000 0000000 ===========================
AdapterRemoval - Benchmarks
===========================
Running the 'benchmark.sh' script from the 'benchmarks' folder will execute one
or more sets of analyses, after checking that all required software is
available in the ./bin/ folder.
The following software is expected:
- AdapterRemoval v1.5.4, located at 'bin/AdapterRemoval-1.5.4'
- AdapterRemoval v2.1.0, located at 'bin/AdapterRemoval-2.1.0'
Source: https://github.com/MikkelSchubert/adapterremoval
- leeHom rev. dfca9e6, located at 'bin/leeHom_patched'
Source: https://github.com/grenaud/leeHom
Apply patches/leeHom.patch
- Skewer v0.1.127, located at 'bin/skewer'
Source: https://github.com/relipmoc/skewer
- AlienTrimmer v0.4.0, located at 'bin/AlienTrimmer'
Source: ftp://ftp.pasteur.fr/pub/GenSoft/projects/AlienTrimmer/
Note: Compile AlienTrimmer using GCJ!
- Scythe 0.991, located at 'bin/scythe'
Source: https://github.com/vsbuffalo/scythe
- Cutadapt 1.8.3, located at 'bin/cutadapt'
Source: https://code.google.com/p/cutadapt/
- FASTQ-MCF v1.1.2, located at 'bin/fastq-mcf'
Source: https://code.google.com/p/ea-utils/
- Flexbar v2.5, located at 'bin/flexbar'
Source: http://sourceforge.net/projects/flexbar/
- pIRS v1.1.1, located at 'bin/pirs_patched'
Source: ftp://ftp.genomics.org.cn/pub/pIRS/
Apply patches/pIRS_111.patch
- Trimmomatic v0.33, located at 'bin/trimmomatic-0.33.jar'
Source: http://www.usadellab.org/cms/?page=trimmomatic
- PEAT rev. 4e9ebf3, located at './bin/PEAT'
Source: https://github.com/jhhung/PEAT
- PEAR 0.9.6, located at 'bin/pear_patched'
Source: http://sco.h-its.org/exelixis/web/software/pear/
Apply patches/pear.patch
- Minion (from Kraken), located at 'bin/minion'
Source: http://www.ebi.ac.uk/research/enright/software/kraken
Additionally, the script expects a Java JRE ('bin/java') and the GNU 'time'
command (located in PATH).
As noted above, patches are supplied for the following programs:
- leeHom: Disable gzip-compression and mark merged reads with "M_",
to simplify analysis.
- PEAR: Marks merged reads with "M_", to simplify processing.
- pIRS: Adds support for user supplied adapter sequences and barcodes, allow
zero length inserts.
To process results generated by 'benchmark.sh', use the following scripts:
- scripts/tabulate.py, call with arguments 'basic' or 'throughput' on the
tables written to 'results/', for MCC and other statistics, and for data-
processing throughput, respectively.
adapterremoval-2.3.1/benchmark/adapters/ 0000775 0000000 0000000 00000000000 13503706164 0020265 5 ustar 00root root 0000000 0000000 adapterremoval-2.3.1/benchmark/adapters/adapter_1.fasta 0000664 0000000 0000000 00000000120 13503706164 0023136 0 ustar 00root root 0000000 0000000 >mate1_adapter
AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG
adapterremoval-2.3.1/benchmark/adapters/adapter_1.pairs 0000664 0000000 0000000 00000000103 13503706164 0023157 0 ustar 00root root 0000000 0000000 N AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG
adapterremoval-2.3.1/benchmark/adapters/adapter_1.txt 0000664 0000000 0000000 00000000101 13503706164 0022656 0 ustar 00root root 0000000 0000000 AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG
adapterremoval-2.3.1/benchmark/adapters/adapter_2.fasta 0000664 0000000 0000000 00000000111 13503706164 0023137 0 ustar 00root root 0000000 0000000 >mate2_adapter
AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT adapterremoval-2.3.1/benchmark/adapters/adapter_2.txt 0000664 0000000 0000000 00000000073 13503706164 0022667 0 ustar 00root root 0000000 0000000 AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT
adapterremoval-2.3.1/benchmark/adapters/adapters.fasta 0000664 0000000 0000000 00000000222 13503706164 0023104 0 ustar 00root root 0000000 0000000 >adapter/1
AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG
>adapter/2
AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT
adapterremoval-2.3.1/benchmark/adapters/mixed.fasta 0000664 0000000 0000000 00000001424 13503706164 0022414 0 ustar 00root root 0000000 0000000 >adapter_orig/1
AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG
>adapter_orig/2
AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT
>adapter_rng_1/1
AAACTTGCTCTGTGCCCGCTCCGTATGTCACAACAGTGCGTGTATCACCTCAATGCAGGACTCA
>adapter_rng_1/2
GATCGGGAGTAATTTGGAGGCAGTAGTTCGTCGAAACTCGGAGCGTCTTTAGCAGGAG
>adapter_rng_2/1
CTAATTTGCCGTAGCGACGTACTTCAGCCTCCAGGAATTGGACCCTTACGCACACGCATTCATG
>adapter_rng_2/2
TACCGTGAAAGGTGCGCTTAGTGGCATATGCGTTAAGAGCTAGGTAACGGTCTGGAGG
>adapter_rng_3/1
GTTCATACGACGACGACCAATGGCACACTTATCCGGTACTTGCGTTTCAATGCGCATGCCCCAT
>adapter_rng_3/2
TAAGAAACTCGGAGTTTGGCCTGCGAGGTAGCTTGGGTGTTATGAAGAACGGCATGCG
>adapter_rng_4/1
CCATGCCCCGAAGATTCCTATACCCTTAAGGTCGCAATTGTTCGAGTAAGCTGTACGCGCCCAT
>adapter_rng_4/2
GTTGCATTGACCCGAAGGGCTCGATGTTTAGGGAGGTCAGAAGTTGAGCGGGTTCAAA
adapterremoval-2.3.1/benchmark/adapters/mixed.table 0000664 0000000 0000000 00000001154 13503706164 0022405 0 ustar 00root root 0000000 0000000 AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT
AAACTTGCTCTGTGCCCGCTCCGTATGTCACAACAGTGCGTGTATCACCTCAATGCAGGACTCA GATCGGGAGTAATTTGGAGGCAGTAGTTCGTCGAAACTCGGAGCGTCTTTAGCAGGAG
CTAATTTGCCGTAGCGACGTACTTCAGCCTCCAGGAATTGGACCCTTACGCACACGCATTCATG TACCGTGAAAGGTGCGCTTAGTGGCATATGCGTTAAGAGCTAGGTAACGGTCTGGAGG
GTTCATACGACGACGACCAATGGCACACTTATCCGGTACTTGCGTTTCAATGCGCATGCCCCAT TAAGAAACTCGGAGTTTGGCCTGCGAGGTAGCTTGGGTGTTATGAAGAACGGCATGCG
CCATGCCCCGAAGATTCCTATACCCTTAAGGTCGCAATTGTTCGAGTAAGCTGTACGCGCCCAT GTTGCATTGACCCGAAGGGCTCGATGTTTAGGGAGGTCAGAAGTTGAGCGGGTTCAAA
adapterremoval-2.3.1/benchmark/adapters/mixed_1.fasta 0000664 0000000 0000000 00000000631 13503706164 0022633 0 ustar 00root root 0000000 0000000 >adapter_orig/1
AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG
>adapter_rng_1/1
AAACTTGCTCTGTGCCCGCTCCGTATGTCACAACAGTGCGTGTATCACCTCAATGCAGGACTCA
>adapter_rng_2/1
CTAATTTGCCGTAGCGACGTACTTCAGCCTCCAGGAATTGGACCCTTACGCACACGCATTCATG
>adapter_rng_3/1
GTTCATACGACGACGACCAATGGCACACTTATCCGGTACTTGCGTTTCAATGCGCATGCCCCAT
>adapter_rng_4/1
CCATGCCCCGAAGATTCCTATACCCTTAAGGTCGCAATTGTTCGAGTAAGCTGTACGCGCCCAT
adapterremoval-2.3.1/benchmark/adapters/mixed_1.txt 0000664 0000000 0000000 00000000505 13503706164 0022354 0 ustar 00root root 0000000 0000000 AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG
AAACTTGCTCTGTGCCCGCTCCGTATGTCACAACAGTGCGTGTATCACCTCAATGCAGGACTCA
CTAATTTGCCGTAGCGACGTACTTCAGCCTCCAGGAATTGGACCCTTACGCACACGCATTCATG
GTTCATACGACGACGACCAATGGCACACTTATCCGGTACTTGCGTTTCAATGCGCATGCCCCAT
CCATGCCCCGAAGATTCCTATACCCTTAAGGTCGCAATTGTTCGAGTAAGCTGTACGCGCCCAT
adapterremoval-2.3.1/benchmark/adapters/mixed_2.txt 0000664 0000000 0000000 00000000447 13503706164 0022362 0 ustar 00root root 0000000 0000000 AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT
GATCGGGAGTAATTTGGAGGCAGTAGTTCGTCGAAACTCGGAGCGTCTTTAGCAGGAG
TACCGTGAAAGGTGCGCTTAGTGGCATATGCGTTAAGAGCTAGGTAACGGTCTGGAGG
TAAGAAACTCGGAGTTTGGCCTGCGAGGTAGCTTGGGTGTTATGAAGAACGGCATGCG
GTTGCATTGACCCGAAGGGCTCGATGTTTAGGGAGGTCAGAAGTTGAGCGGGTTCAAA
adapterremoval-2.3.1/benchmark/benchmark.sh 0000664 0000000 0000000 00000114164 13503706164 0020757 0 ustar 00root root 0000000 0000000 #!/bin/bash
#
# Copyright (c) 2015 Mikkel Schubert
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
set -o nounset # Fail on unset variables
set -o errexit # Fail on uncaught non-zero returncodes
set -o pipefail # Fail is a command in a chain of pipes fails
###############################################################################
## BENCHMARK PARAMETERS
# Number of replicates per test
NUM_REPLICATES=10
# Read lengths to examine
# Lengths > 100 use an interpolated profile, and should therefore not be used
# to estimate anything other than runtime (see 'simulate_reads').
READ_LENGTHS=(100 200)
# Insert sizes of reads to simulate for adapter ID
ADAPTER_ID_INSERT_SIZES=($(seq 250 5 350))
# Maximum number of threads to use (testing 1 .. max) where supported
MAX_THREADS=4
# Number of read (pairs) to simulate using pIRS for each replicate
SIMULATED_NREADS=1000000
REFSEQ="results/reference.fasta"
SIMULATED_PREFIX="results/simulated/reads"
SIMULATED_MIXED_PREFIX="results/simulated/mixed"
SIMULATED_ADAPTER_ID_PREFIX="results/simulated/adapter_id"
###############################################################################
## PRE-BENCHMARK CHECKS
function check_for_executable()
{
echo -n "Checking for $1 executable '$2': " > /dev/stderr
if [ -x "$2" ];
then
echo -e "OK" > /dev/stderr
elif which "$2" &> /dev/null;
then
echo -e "'$(which "$2" | head -n1)'" > /dev/stderr
else
echo -e "ERROR, NOT FOUND!" > /dev/stderr
exit 1;
fi
}
function check_for_jar()
{
echo -n "Checking for $1 jar at '$2': " > /dev/stderr
if [ -e "$2" ];
then
echo -e "OK" > /dev/stderr
else
echo -e "ERROR, NOT FOUND!" > /dev/stderr
exit 1;
fi
}
EXEC_ADAPTERREMOVAL1x="bin/AdapterRemoval-1.5.4"
check_for_executable "AdapterRemoval v1.x" "${EXEC_ADAPTERREMOVAL1x}"
# https://github.com/slindgreen/AdapterRemoval/raw/master/AdapterRemoval-1.5.4.tar.gz
EXEC_ADAPTERREMOVAL2x="bin/AdapterRemoval-2.1.3"
check_for_executable "AdapterRemoval v2.x" "${EXEC_ADAPTERREMOVAL2x}"
# https://github.com/MikkelSchubert/adapterremoval
EXEC_LEEHOM="bin/leeHom_patched"
check_for_executable "leeHom" "${EXEC_LEEHOM}"
# https://github.com/grenaud/leeHom
# -- Apply patches/leeHom.patch
EXEC_SKEWER="bin/skewer"
check_for_executable "Skewer" "${EXEC_SKEWER}"
# https://github.com/relipmoc/skewer
EXEC_ALIENTRIMMER="bin/AlienTrimmer"
check_for_executable "AlienTrimmer" "${EXEC_ALIENTRIMMER}"
# ftp://ftp.pasteur.fr/pub/GenSoft/projects/AlienTrimmer/
EXEC_SCYTHE="bin/scythe"
check_for_executable "Scythe" "${EXEC_SCYTHE}"
# https://github.com/vsbuffalo/scythe
EXEC_CUTADAPT="bin/cutadapt"
check_for_executable "Cutadapt" "${EXEC_CUTADAPT}"
# https://code.google.com/p/cutadapt/
EXEC_FLEXBAR="bin/flexbar"
check_for_executable "Flexbar" "${EXEC_FLEXBAR}"
# http://sourceforge.net/projects/flexbar/
EXEC_PIRS="bin/pirs_patched"
check_for_executable "pIRS (with adapters)" "${EXEC_PIRS}"
# ftp://ftp.genomics.org.cn/pub/pIRS/
# -- Apply patches/pirs.patch
JAR_TRIMMOMATIC="bin/trimmomatic-0.33.jar"
check_for_jar "Trimmomatic" ${JAR_TRIMMOMATIC}
# http://www.usadellab.org/cms/?page=trimmomatic
EXEC_PEAT="./bin/PEAT"
check_for_executable "PEAT" ${EXEC_PEAT}
# https://github.com/jhhung/PEAT
EXEC_PEAR="bin/pear_patched"
check_for_executable "PEAR" ${EXEC_PEAR}
# http://sco.h-its.org/exelixis/web/software/pear/
# -- Apply patches/pear.patch
EXEC_MINION="bin/minion"
check_for_executable "minion (kraken)" ${EXEC_MINION}
# http://www.ebi.ac.uk/research/enright/software/kraken
EXEC_FASTQ_MCF="bin/fastq-mcf"
check_for_executable "fastq-mcf" ${EXEC_FASTQ_MCF}
# https://code.google.com/p/ea-utils/
EXEC_TIME=/usr/bin/time
check_for_executable "GNU time" ${EXEC_TIME}
# Needed for time / RAM usage
EXEC_JAVA="bin/java"
check_for_executable "Java JRE" ${EXEC_JAVA}
# Needed for Trimmomatic
# Script for evaluating trimming / collapsing RESULTS
SCRIPT_EVALUATE="./scripts/evaluate.py"
check_for_executable "Evaluation script for read trimming / merging" ${SCRIPT_EVALUATE}
# Script for evaluating trimming / collapsing RESULTS
SCRIPT_EVALUATE_ID="./scripts/evaluate_id.py"
check_for_executable "Evaluation script for adapter identification" ${SCRIPT_EVALUATE_ID}
# Script for merging tables generated by ${SCRIPT_EVALUATE}
SCRIPT_MERGE="./scripts/merge_tables.py"
check_for_executable "Table merging script" ${SCRIPT_MERGE}
###############################################################################
function shuffle_and_run()
{
echo > /dev/stderr
echo "Shuffling batch ..." > /dev/stderr
python -c "import sys, random
lines = sys.stdin.readlines()
random.shuffle(lines)
sys.stdout.write(''.join(lines))" |
while read command;
do
${command};
done
}
function do_run_piped()
{
DST=$1
DST_TIME=$2
DST_STDOUT=$3
DST_STDERR=$4
shift 4
if [ -e "${DST}.table" ];
then
echo "Skipping ${DST}.table" > /dev/stderr
else
echo "Building ${DST}.table" > /dev/stderr
rm -rf "${DST:?}/"
mkdir -p "${DST}/"
if ! ${EXEC_TIME} --verbose --output "${DST_TIME}" "$@" \
> "${DST_STDOUT}" 2> "${DST_STDERR}";
then
echo "Error running command!" > /dev/stderr
exit 1
fi
fi
}
function do_run()
{
DST=$1
shift 1
do_run_piped "${DST}" "${DST}/time" "${DST}/stdout.txt" "${DST}/stderr.txt" "$@"
}
function do_evaluate()
{
DST=$1
if [ ! -e "${DST}.table" ];
then
${SCRIPT_EVALUATE} "$@"
fi
}
###############################################################################
function fetch_reference()
{
echo "------------------------------------------------------------" > /dev/stderr
echo "Fetching reference sequence ..." > /dev/stderr
if [ -e "results/reference.fasta" ];
then
echo "Reference sequence found; skipping ..." > /dev/stderr
echo "" > /dev/stderr
else
echo "" > /dev/stderr
wget -O results/reference.fasta.gz http://hgdownload.soe.ucsc.edu/goldenPath/hg38/chromosomes/chr1.fa.gz
gunzip results/reference.fasta.gz
fi
}
function simulate_reads()
{
echo "------------------------------------------------------------" > /dev/stderr
echo "Simulating reads ..." > /dev/stderr
echo "" > /dev/stderr
for readlen in ${READ_LENGTHS[*]};
do
INSERT_MEAN=$(((${readlen} * 3) / 2))
INSERT_SD=$((${INSERT_MEAN} / 2))
if [ "${readlen}" -gt 100 ];
then
# Use fake profiles, built using scripts/extend_profile.py
PROFILE_CLI="-b profiles/phixv2.InDel.matrix -s profiles/humNew.PE100.matrix.gz"
else
PROFILE_CLI=
fi
for run_n in ${REPLICATES};
do
DST="${SIMULATED_PREFIX}_${run_n}_${readlen}"
if [ -e "${DST}.read.info" ];
then
echo " Skipping ${DST}.*" > /dev/stderr
else
echo " Simulating reads run=${run_n}, l=${readlen}, m=${INSERT_MEAN}, v=${INSERT_SD} ..." > /dev/stderr
rm -rf "${DST:?}/"
mkdir -p "${DST}/"
# -c 0 = uncompressed output
if ! ${EXEC_PIRS} simulate ${PROFILE_CLI} -x "${SIMULATED_NREADS}" -l "${readlen}" -i "${REFSEQ}" -c 0 -m "${INSERT_MEAN}" -v "${INSERT_SD}" -Q 33 -o "${DST}/reads" \
> "${DST}/reads.stdout" 2> "${DST}/reads.stderr";
then
echo "Error simulated reads ..." > /dev/stderr
exit 1
fi
gunzip "${DST}/reads_${readlen}_${INSERT_MEAN}.read.info.gz"
ln -sf "$(basename "${DST}")/reads_${readlen}_${INSERT_MEAN}_1.fq" "${DST}_1.fq"
ln -sf "$(basename "${DST}")/reads_${readlen}_${INSERT_MEAN}_2.fq" "${DST}_2.fq"
ln -sf "$(basename "${DST}")/reads_${readlen}_${INSERT_MEAN}.read.info" "${DST}.read.info"
fi
done
done
echo > /dev/stderr
}
function simulate_mixed_reads()
{
# Random adapter pairs generated as follows:
#
# $ scripts/shuffle_fasta.py adapters/adapter_1.fasta
# Seed = 209548449294681565
# Seq = AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG
# New = AAACTTGCTCTGTGCCCGCTCCGTATGTCACAACAGTGCGTGTATCACCTCAATGCAGGACTCA
# New = CTAATTTGCCGTAGCGACGTACTTCAGCCTCCAGGAATTGGACCCTTACGCACACGCATTCATG
# New = GTTCATACGACGACGACCAATGGCACACTTATCCGGTACTTGCGTTTCAATGCGCATGCCCCAT
# New = CCATGCCCCGAAGATTCCTATACCCTTAAGGTCGCAATTGTTCGAGTAAGCTGTACGCGCCCAT
#
# $ scripts/shuffle_fasta.py adapters/adapter_2.fasta
# Seed = 1852992042931739018
# Seq = AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT
# New = GATCGGGAGTAATTTGGAGGCAGTAGTTCGTCGAAACTCGGAGCGTCTTTAGCAGGAG
# New = TACCGTGAAAGGTGCGCTTAGTGGCATATGCGTTAAGAGCTAGGTAACGGTCTGGAGG
# New = TAAGAAACTCGGAGTTTGGCCTGCGAGGTAGCTTGGGTGTTATGAAGAACGGCATGCG
# New = GTTGCATTGACCCGAAGGGCTCGATGTTTAGGGAGGTCAGAAGTTGAGCGGGTTCAAA
echo "------------------------------------------------------------" > /dev/stderr
echo "Simulating mixed reads ..." > /dev/stderr
echo "" > /dev/stderr
for readlen in ${READ_LENGTHS[*]};
do
INSERT_MEAN=$(((${readlen} * 3) / 2))
INSERT_SD=$((${INSERT_MEAN} / 2))
if [ "${readlen}" -gt 100 ];
then
# Use fake profiles, built using scripts/extend_profile.py
PROFILE_CLI="-b profiles/phixv2.InDel.matrix -s profiles/humNew.PE100.matrix.gz"
else
PROFILE_CLI=
fi
for run_n in ${REPLICATES};
do
DST="${SIMULATED_MIXED_PREFIX}_${run_n}_${readlen}"
if [ -e "${DST}.read.info" ];
then
echo " Skipping ${DST}.*" > /dev/stderr
else
echo " Simulating mixed reads run=${run_n}, l=${readlen}, m=${INSERT_MEAN}, v=${INSERT_SD} ..." > /dev/stderr
rm -rf "${DST:?}/"
mkdir -p "${DST}/"
# -c 0 = uncompressed output
# -x ${NREADS}
if ! ${EXEC_PIRS} simulate ${PROFILE_CLI} \
-x "${SIMULATED_NREADS}" -l "${readlen}" -i "${REFSEQ}" \
-c 0 -m "${INSERT_MEAN}" -v "${INSERT_SD}" -Q 33 \
-o "${DST}/reads" \
-1 AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG \
-1 AAACTTGCTCTGTGCCCGCTCCGTATGTCACAACAGTGCGTGTATCACCTCAATGCAGGACTCA \
-1 CTAATTTGCCGTAGCGACGTACTTCAGCCTCCAGGAATTGGACCCTTACGCACACGCATTCATG \
-1 GTTCATACGACGACGACCAATGGCACACTTATCCGGTACTTGCGTTTCAATGCGCATGCCCCAT \
-1 CCATGCCCCGAAGATTCCTATACCCTTAAGGTCGCAATTGTTCGAGTAAGCTGTACGCGCCCAT \
-2 AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT \
-2 GATCGGGAGTAATTTGGAGGCAGTAGTTCGTCGAAACTCGGAGCGTCTTTAGCAGGAG \
-2 TACCGTGAAAGGTGCGCTTAGTGGCATATGCGTTAAGAGCTAGGTAACGGTCTGGAGG \
-2 TAAGAAACTCGGAGTTTGGCCTGCGAGGTAGCTTGGGTGTTATGAAGAACGGCATGCG \
-2 GTTGCATTGACCCGAAGGGCTCGATGTTTAGGGAGGTCAGAAGTTGAGCGGGTTCAAA \
> "${DST}/stdout.txt" 2> "${DST}/stderr.txt";
then
echo "Error simulated reads ..." > /dev/stderr
exit 1
fi
gunzip "${DST}/reads_${readlen}_${INSERT_MEAN}.read.info.gz"
ln -sf "$(basename "${DST}")/reads_${readlen}_${INSERT_MEAN}_1.fq" "${DST}_1.fq"
ln -sf "$(basename "${DST}")/reads_${readlen}_${INSERT_MEAN}_2.fq" "${DST}_2.fq"
ln -sf "$(basename "${DST}")/reads_${readlen}_${INSERT_MEAN}.read.info" "${DST}.read.info"
fi
done
done
echo > /dev/stderr
}
function simulate_adapter_id_reads()
{
echo "------------------------------------------------------------" > /dev/stderr
echo "Simulating reads for adapter identification ..." > /dev/stderr
echo "" > /dev/stderr
readlen=100
for INSERT_MEAN in ${ADAPTER_ID_INSERT_SIZES[*]};
do
for run_n in ${REPLICATES};
do
DST="${SIMULATED_ADAPTER_ID_PREFIX}_${run_n}_${readlen}_${INSERT_MEAN}"
if [ -e "${DST}.read.info" ];
then
echo " Skipping ${DST}.*" > /dev/stderr
else
echo " Simulating reads run=${run_n}, l=${readlen}, m=${INSERT_MEAN}, v=75 ..." > /dev/stderr
rm -rf "${DST:?}/"
mkdir -p "${DST}/"
if ! ${EXEC_TIME} --verbose --output "${DST}/time" ${EXEC_PIRS} simulate -x "${SIMULATED_NREADS}" -l "${readlen}" -i "${REFSEQ}" -c 0 -m "${INSERT_MEAN}" -v 75 -Q 33 -o "${DST}/reads" \
> "${DST}/reads.stdout" 2> "${DST}/reads.stderr";
then
echo "Error simulated reads ..." > /dev/stderr
exit 1
fi
gunzip "${DST}/reads_${readlen}_${INSERT_MEAN}.read.info.gz"
ln -sf "$(basename "${DST}")/reads_${readlen}_${INSERT_MEAN}_1.fq" "${DST}_1.fq"
ln -sf "$(basename "${DST}")/reads_${readlen}_${INSERT_MEAN}_2.fq" "${DST}_2.fq"
ln -sf "$(basename "${DST}")/reads_${readlen}_${INSERT_MEAN}.read.info" "${DST}.read.info"
fi
done
done
echo > /dev/stderr
}
###############################################################################
function run_pear()
{
NTHREADS=$1
DST=$2
FQ_INFO=$3
FQ_MATE1=$4
FQ_MATE2=$5
shift 5
do_run "${DST}" ${EXEC_PEAR} paired -j "${NTHREADS}" -t 0 \
-f "${FQ_MATE1}" -r "${FQ_MATE2}" \
-o "${DST}/reads" "$@"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode PE --collapsed
}
function run_adapterremoval()
{
MODE=$1
EXECUTABLE=$2
NTHREADS=$3
DST=$4
FQ_INFO=$5
shift 5
if [ "$NTHREADS" -eq 1 ];
then
NTHREADS_CLI=""
else
NTHREADS_CLI="--threads ${NTHREADS}"
fi
if [ "${MODE}" = "COLLAPSE" ];
then
MODE="PE"
COLLAPSE_CLI="--collapsed"
else
COLLAPSE_CLI=""
fi
do_run "${DST}" "${EXECUTABLE}" --basename "${DST}/reads" ${NTHREADS_CLI} "$@"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode "${MODE}" ${COLLAPSE_CLI}
}
function run_peat_se()
{
NTHREADS=$1
DST=$2
FQ_INFO=$3
FQ_MATE1=$4
shift 4
do_run "${DST}" ${EXEC_PEAT} single -q SANGER -n "${NTHREADS}" \
-a "$(cat adapters/adapter_1.txt)" \
-i "${FQ_MATE1}" -o "${DST}/reads.fastq" "$@"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode SE
}
function run_peat_pe()
{
NTHREADS=$1
DST=$2
FQ_INFO=$3
FQ_MATE1=$4
FQ_MATE2=$5
shift 5
do_run "${DST}" ${EXEC_PEAT} paired -n "${NTHREADS}" \
-1 "${FQ_MATE1}" -2 "${FQ_MATE2}" \
-o "${DST}/reads" "$@"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode PE
}
function run_trimmomatic_se()
{
MODE=$1
NTHREADS=$2
DST=$3
FQ_INFO=$4
FQ_MATE1=$5
FQ_EXT=$6
shift 6
if [ "${MODE}" = "MIXED" ];
then
ADAPTERS="adapters/mixed.fasta"
else
ADAPTERS="adapters/adapters.fasta"
fi
do_run "${DST}" ${EXEC_JAVA} -jar ${JAR_TRIMMOMATIC} SE -phred33 -threads "${NTHREADS}" \
"${FQ_MATE1}" "${DST}/reads${FQ_EXT}" "$@" \
"ILLUMINACLIP:${ADAPTERS}:2:7:10"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode SE \
--dimers-are-discarded
}
function run_trimmomatic_pe()
{
MODE=$1
NTHREADS=$2
DST=$3
FQ_INFO=$4
FQ_MATE1=$5
FQ_MATE2=$6
FQ_EXT=$7
shift 7
if [ "${MODE}" = "MIXED" ];
then
ADAPTERS="adapters/mixed.fasta"
else
ADAPTERS="adapters/adapters.fasta"
fi
do_run "${DST}" ${EXEC_JAVA} -jar ${JAR_TRIMMOMATIC} PE \
-threads "${NTHREADS}" -phred33 \
"${FQ_MATE1}" "${FQ_MATE2}" \
"${DST}/reads.1${FQ_EXT}" "${DST}/reads.1.singletons.${FQ_EXT}" \
"${DST}/reads.2${FQ_EXT}" "${DST}/reads.2.singletons.${FQ_EXT}" \
"ILLUMINACLIP:${ADAPTERS}:2:30:7:1:true" "$@"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode PE \
--dimers-are-discarded
}
function run_flexbar()
{
MODE=$1
NTHREADS=$2
DST=$3
FQ_INFO=$4
shift 4
do_run "${DST}" ${EXEC_FLEXBAR} -m 0 -t "${DST}/reads" -n "${NTHREADS}" "$@"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode "${MODE}"
}
function run_skewer()
{
MODE=$1
NTHREADS=$2
DST=$3
FQ_INFO=$4
shift 4
do_run "${DST}" ${EXEC_SKEWER} -o "${DST}/reads" -l 0 -t "${NTHREADS}" "$@" \
do_evaluate "${DST}" "${FQ_INFO}" --read-mode "${MODE}"
}
function run_scythe()
{
DST=$1
FQ_INFO=$2
FQ_MATE1=$3
shift 3
do_run "${DST}" ${EXEC_SCYTHE} -M 0 "$@" \
-a "adapters/adapter_1.fasta" \
-o "${DST}/reads.trimmed" \
"${FQ_MATE1}"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode SE
}
function run_alientrimmer_se()
{
DST=$1
FQ_INFO=$2
FQ_MATE1=$3
shift 3
do_run "${DST}" ${EXEC_ALIENTRIMMER} -l 0 "$@" \
-i "${FQ_MATE1}" \
-o "${DST}/reads.trimmed"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode SE
}
function run_alientrimmer_pe()
{
DST=$1
FQ_INFO=$2
FQ_MATE1=$3
FQ_MATE2=$4
shift 4
do_run "${DST}" ${EXEC_ALIENTRIMMER} -l 0 "$@" \
-if "${FQ_MATE1}" \
-ir "${FQ_MATE2}" \
-os "${DST}/reads.trimmed" \
-or "${DST}/reads.trimmed.mate1" \
-of "${DST}/reads.trimmed.mate2"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode PE
}
function run_cutadapt_se()
{
DST=$1
FQ_INFO=$2
FQ_MATE1=$3
shift 3
do_run "${DST}" ${EXEC_CUTADAPT} "$@" \
-o "${DST}/reads.trimmed" \
"${FQ_MATE1}"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode SE
}
function run_cutadapt_pe()
{
DST=$1
FQ_INFO=$2
FQ_MATE1=$3
FQ_MATE2=$4
shift 4
do_run "${DST}" ${EXEC_CUTADAPT} "$@" \
-o "${DST}/reads.trimmed.1" \
-p "${DST}/reads.trimmed.2" \
"${FQ_MATE1}" \
"${FQ_MATE2}"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode PE
}
function run_leeHom()
{
MODE=$1
DST=$2
FQ_INFO=$3
shift 3
if [ "${MODE}" = "COLLAPSE" ];
then
MODE="PE"
COLLAPSE_CLI="--collapsed"
else
COLLAPSE_CLI=""
fi
do_run "${DST}" "${EXEC_LEEHOM}" "$@" -fqo "${DST}/reads"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode "${MODE}" ${COLLAPSE_CLI}
}
function run_fastq_mcf_se()
{
DST=$1
FQ_INFO=$2
ADAPTERS=$3
FQ_MATE1=$4
shift 4
# -0 to disable quality trimming
do_run "${DST}" ${EXEC_FASTQ_MCF} -0 \
"${ADAPTERS}" \
"${FQ_MATE1}" \
-o "${DST}/reads.trimmed" "$@"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode SE \
--dimers-are-discarded
}
function run_fastq_mcf_pe()
{
DST=$1
FQ_INFO=$2
ADAPTERS=$3
FQ_MATE1=$4
FQ_MATE2=$5
shift 5
# -0 to disable quality trimming
do_run "${DST}" ${EXEC_FASTQ_MCF} -0 \
"${ADAPTERS}" \
"${FQ_MATE1}" \
"${FQ_MATE2}" \
-o "${DST}/reads.trimmed.mate1" \
-o "${DST}/reads.trimmed.mate2" \
"$@"
do_evaluate "${DST}" "${FQ_INFO}" --read-mode PE \
--dimers-are-discarded
}
###############################################################################
function run_minion()
{
DST=$1
FQ_MATE1=$2
FQ_MATE2=$3
shift 3
if [ ! -e "${DST}/DONE" ];
then
echo "Runing ${DST} ..." > /dev/stderr
rm -rf "${DST:?}/"
mkdir -p "${DST}/"
${EXEC_MINION} search-adapter -show 5 -i "${FQ_MATE1}" \
> "${DST}/mate1.txt"
${EXEC_MINION} search-adapter -show 5 -i "${FQ_MATE2}" \
> "${DST}/mate2.txt"
touch "${DST}/DONE"
fi
}
function run_adapterremoval_id()
{
DST=$1
FQ_MATE1=$2
FQ_MATE2=$3
shift 3
if [ ! -e "${DST}/DONE" ];
then
echo "Runing ${DST} ..." > /dev/stderr
rm -rf "${DST:?}/"
mkdir -p "${DST}/"
${EXEC_ADAPTERREMOVAL2x} --identify-adapters \
--file1 "${FQ_MATE1}" --file2 "${FQ_MATE2}" \
> "${DST}/mates.txt"
touch "${DST}/DONE"
fi
}
###############################################################################
# Common replicates strings
REPLICATES=$(printf "%03i\n" $(seq 1 ${NUM_REPLICATES}))
function benchmark_se()
{
simulate_reads
echo "------------------------------------------------------------" > /dev/stderr
echo "Running SE benchmarks ..." > /dev/stderr
echo "" > /dev/stderr
for readlen in ${READ_LENGTHS[*]};
do
for run_n in ${REPLICATES};
do
{ # Shuffle each individual run
SIMULATED_MATE1="${SIMULATED_PREFIX}_${run_n}_${readlen}_1.fq"
SIMULATED_MATE2="${SIMULATED_PREFIX}_${run_n}_${readlen}_2.fq"
SIMULATED_INFO="${SIMULATED_PREFIX}_${run_n}_${readlen}.read.info"
RESULTS="results/se/${readlen}_${run_n}"
# -mm 3 corresponds to AR 2.x defaults
echo run_adapterremoval SE ${EXEC_ADAPTERREMOVAL1x} 1 \
"${RESULTS}/adapterremoval1x_mm3" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
--mm 3
# -mm 3 --minadapteroverlap 3 (test)
echo run_adapterremoval SE ${EXEC_ADAPTERREMOVAL2x} 1 \
"${RESULTS}/adapterremoval2x_min3_mm3" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
--minadapteroverlap 3 --mm 3
# -mm 5 --minadapteroverlap 3 (test)
echo run_adapterremoval SE ${EXEC_ADAPTERREMOVAL2x} 1 \
"${RESULTS}/adapterremoval2x_min3_mm5" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
--minadapteroverlap 3 --mm 5
for nthreads in $(seq 1 ${MAX_THREADS});
do
AR_PREFIX="${RESULTS}/adapterremoval2x"
echo run_adapterremoval SE ${EXEC_ADAPTERREMOVAL2x} "${nthreads}" \
"${AR_PREFIX}_t${nthreads}" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
echo run_skewer SE "${nthreads}" \
"${RESULTS}/skewer_t${nthreads}" \
"${SIMULATED_INFO}" \
"${SIMULATED_MATE1}"
echo run_flexbar SE "${nthreads}" \
"${RESULTS}/flexbar_t${nthreads}" \
"${SIMULATED_INFO}" \
-a "./adapters/adapter_1.fasta" \
-r "${SIMULATED_MATE1}"
echo run_trimmomatic_se SE "${nthreads}" \
"${RESULTS}/trimmomatic_t${nthreads}" \
"${SIMULATED_INFO}" \
"${SIMULATED_MATE1}" \
".fastq"
echo run_peat_se "${nthreads}" \
"${RESULTS}/peat_t${nthreads}" \
"${SIMULATED_INFO}" \
"${SIMULATED_MATE1}"
done
echo run_cutadapt_se "${RESULTS}/cutadapt" \
"${SIMULATED_INFO}" \
"${SIMULATED_MATE1}" \
-a "$(cat adapters/adapter_1.txt)"
echo run_scythe "${RESULTS}/scythe" \
"${SIMULATED_INFO}" \
"${SIMULATED_MATE1}"
echo run_alientrimmer_se "${RESULTS}/alientrimmer_q00" \
"${SIMULATED_INFO}" \
"${SIMULATED_MATE1}" \
-c "adapters/adapter_1.txt" \
-q 0
echo run_leeHom SE \
"${RESULTS}/leeHom" \
"${SIMULATED_INFO}" \
-fq1 "${SIMULATED_MATE1}"
echo run_leeHom SE \
"${RESULTS}/leeHom_ancient" \
"${SIMULATED_INFO}" \
-fq1 "${SIMULATED_MATE1}" \
--ancientdna
echo run_fastq_mcf_se "${RESULTS}/fastq_mcf" \
"${SIMULATED_INFO}" \
"./adapters/adapter_1.fasta" \
"${SIMULATED_MATE1}"
} | shuffle_and_run
done
done
${SCRIPT_MERGE} results/se > results/se.table
}
function benchmark_pe()
{
simulate_reads
echo "------------------------------------------------------------" > /dev/stderr
echo "Running PE benchmarks ..." > /dev/stderr
echo "" > /dev/stderr
for readlen in ${READ_LENGTHS[*]};
do
for run_n in ${REPLICATES};
do
{ # Shuffle each individual run
SIMULATED_MATE1="${SIMULATED_PREFIX}_${run_n}_${readlen}_1.fq"
SIMULATED_MATE2="${SIMULATED_PREFIX}_${run_n}_${readlen}_2.fq"
SIMULATED_INFO="${SIMULATED_PREFIX}_${run_n}_${readlen}.read.info"
RESULTS="results/pe/${readlen}_${run_n}"
DEFAULT_ARGS=("${SIMULATED_INFO}" "${SIMULATED_MATE1}" "${SIMULATED_MATE2}")
# -mm 3 corresponds to AR 2.x defaults
echo run_adapterremoval PE ${EXEC_ADAPTERREMOVAL1x} 1 \
"${RESULTS}/adapterremoval1x_mm3" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
--file2 "${SIMULATED_MATE2}" \
--mm 3
for nthreads in $(seq 1 ${MAX_THREADS});
do
AR_PREFIX="${RESULTS}/adapterremoval2x"
echo run_adapterremoval PE ${EXEC_ADAPTERREMOVAL2x} "${nthreads}" \
"${AR_PREFIX}_t${nthreads}" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
--file2 "${SIMULATED_MATE2}" \
echo run_skewer PE "${nthreads}" \
"${RESULTS}/skewer_t${nthreads}" \
"${DEFAULT_ARGS[*]}"
echo run_flexbar PE "${nthreads}" \
"${RESULTS}/flexbar_t${nthreads}" \
"${SIMULATED_INFO}" \
-a "./adapters/adapters.fasta" \
-r "${SIMULATED_MATE1}" \
-p "${SIMULATED_MATE2}"
echo run_trimmomatic_pe PE "${nthreads}" \
"${RESULTS}/trimmomatic_t${nthreads}" \
"${DEFAULT_ARGS[*]}" \
".fastq"
echo run_peat_pe "${nthreads}" \
"${RESULTS}/peat_t${nthreads}" \
"${DEFAULT_ARGS[*]}"
done
echo run_cutadapt_pe "${RESULTS}/cutadapt" \
"${DEFAULT_ARGS[*]}" \
-a "$(cat adapters/adapter_1.txt)" \
-A "$(cat adapters/adapter_2.txt)"
echo run_alientrimmer_pe "${RESULTS}/alientrimmer_q00" \
"${DEFAULT_ARGS[*]}" \
-cf "adapters/adapter_1.txt" \
-cr "adapters/adapter_2.txt" \
-q 0
echo run_leeHom PE \
"${RESULTS}/leeHom" \
"${SIMULATED_INFO}" \
-fq1 "${SIMULATED_MATE1}" \
-fq2 "${SIMULATED_MATE2}"
echo run_leeHom PE \
"${RESULTS}/leeHom_ancient" \
"${SIMULATED_INFO}" \
-fq1 "${SIMULATED_MATE1}" \
-fq2 "${SIMULATED_MATE2}" \
--ancientdna
echo run_fastq_mcf_pe "${RESULTS}/fastq_mcf" \
"${SIMULATED_INFO}" \
"./adapters/adapters.fasta" \
"${SIMULATED_MATE1}" \
"${SIMULATED_MATE2}"
} | shuffle_and_run
done
done
${SCRIPT_MERGE} results/pe > results/pe.table
}
function benchmark_collapse()
{
simulate_reads
echo "------------------------------------------------------------" > /dev/stderr
echo "Running collapsing benchmarks ..." > /dev/stderr
echo "" > /dev/stderr
for readlen in ${READ_LENGTHS[*]};
do
for run_n in ${REPLICATES};
do
{ # Shuffle each individual run
SIMULATED_MATE1="${SIMULATED_PREFIX}_${run_n}_${readlen}_1.fq"
SIMULATED_MATE2="${SIMULATED_PREFIX}_${run_n}_${readlen}_2.fq"
SIMULATED_INFO="${SIMULATED_PREFIX}_${run_n}_${readlen}.read.info"
RESULTS="results/collapse/${readlen}_${run_n}"
DEFAULT_ARGS=("${SIMULATED_INFO}" "${SIMULATED_MATE1}" "${SIMULATED_MATE2}")
# -mm 3 corresponds to AR 2.x defaults
echo run_adapterremoval COLLAPSE ${EXEC_ADAPTERREMOVAL1x} 1 \
"${RESULTS}/adapterremoval1x_mm3" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
--file2 "${SIMULATED_MATE2}" \
--mm 3 --collapse
for nthreads in $(seq 1 ${MAX_THREADS});
do
AR_PREFIX="${RESULTS}/adapterremoval2x"
echo run_adapterremoval COLLAPSE ${EXEC_ADAPTERREMOVAL2x} "${nthreads}" \
"${AR_PREFIX}_t${nthreads}" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
--file2 "${SIMULATED_MATE2}" \
--collapse
echo run_pear "${nthreads}" \
"${RESULTS}/pear_t${nthreads}" \
"${SIMULATED_INFO}" \
"${SIMULATED_MATE1}" \
"${SIMULATED_MATE2}"
done
echo run_leeHom COLLAPSE \
"${RESULTS}/leeHom" \
"${SIMULATED_INFO}" \
-fq1 "${SIMULATED_MATE1}" \
-fq2 "${SIMULATED_MATE2}"
echo run_leeHom COLLAPSE \
"${RESULTS}/leeHom_ancient" \
"${SIMULATED_INFO}" \
-fq1 "${SIMULATED_MATE1}" \
-fq2 "${SIMULATED_MATE2}" \
--ancientdna
} | shuffle_and_run
done
done
${SCRIPT_MERGE} results/collapse > results/collapse.table
}
function benchmark_mixed_se
{
simulate_mixed_reads
echo "------------------------------------------------------------" > /dev/stderr
echo "Running mixed se adapters benchmarks ..." > /dev/stderr
echo "" > /dev/stderr
for readlen in ${READ_LENGTHS[*]};
do
for run_n in ${REPLICATES};
do
{ # Shuffle each individual run
SIMULATED_MATE1="${SIMULATED_MIXED_PREFIX}_${run_n}_${readlen}_1.fq"
SIMULATED_MATE2="${SIMULATED_MIXED_PREFIX}_${run_n}_${readlen}_2.fq"
SIMULATED_INFO="${SIMULATED_MIXED_PREFIX}_${run_n}_${readlen}.read.info"
RESULTS="results/mixed_se/${readlen}_${run_n}"
DEFAULT_ARGS=("${SIMULATED_INFO}" "${SIMULATED_MATE1}" "${SIMULATED_MATE2}")
AR_PREFIX="${RESULTS}/adapterremoval2x"
# -mm 3 --minadapteroverlap 3 (test)
echo run_adapterremoval SE ${EXEC_ADAPTERREMOVAL2x} 1 \
"${AR_PREFIX}_min3_mm3" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
--adapter-list ./adapters/mixed.table \
--minadapteroverlap 3 --mm 3
# -mm 5 --minadapteroverlap 3 (test)
echo run_adapterremoval SE ${EXEC_ADAPTERREMOVAL2x} 1 \
"${AR_PREFIX}_min3_mm5" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
--adapter-list ./adapters/mixed.table \
--minadapteroverlap 3 --mm 5
for nthreads in $(seq 1 ${MAX_THREADS});
do
echo run_adapterremoval SE ${EXEC_ADAPTERREMOVAL2x} "${nthreads}" \
"${AR_PREFIX}_t${nthreads}" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
--adapter-list ./adapters/mixed.table
echo run_trimmomatic_se MIXED "${nthreads}" \
"${RESULTS}/trimmomatic_t${nthreads}" \
"${SIMULATED_INFO}" \
"${SIMULATED_MATE1}" \
".fastq"
done
echo run_alientrimmer_se "${RESULTS}/alientrimmer_q00" \
"${SIMULATED_INFO}" \
"${SIMULATED_MATE1}" \
-c "adapters/mixed_1.txt" \
-q 0
echo run_cutadapt_se "${RESULTS}/cutadapt" \
"${SIMULATED_INFO}" \
"${SIMULATED_MATE1}" \
$(for seq in $(cat adapters/mixed_1.txt); do echo "-a ${seq}";done)
echo run_fastq_mcf_se "${RESULTS}/fastq_mcf" \
"${SIMULATED_INFO}" \
"./adapters/mixed_1.fasta" \
"${SIMULATED_MATE1}"
} | shuffle_and_run
done
done
${SCRIPT_MERGE} results/mixed_se > results/mixed_se.table
}
function benchmark_mixed_pe
{
simulate_mixed_reads
echo "------------------------------------------------------------" > /dev/stderr
echo "Running mixed pe adapters benchmarks ..." > /dev/stderr
echo "" > /dev/stderr
for readlen in ${READ_LENGTHS[*]};
do
for run_n in ${REPLICATES};
do
{ # Shuffle each individual run
SIMULATED_MATE1="${SIMULATED_MIXED_PREFIX}_${run_n}_${readlen}_1.fq"
SIMULATED_MATE2="${SIMULATED_MIXED_PREFIX}_${run_n}_${readlen}_2.fq"
SIMULATED_INFO="${SIMULATED_MIXED_PREFIX}_${run_n}_${readlen}.read.info"
RESULTS="results/mixed_pe/${readlen}_${run_n}"
DEFAULT_ARGS=("${SIMULATED_INFO}" "${SIMULATED_MATE1}" "${SIMULATED_MATE2}")
for nthreads in $(seq 1 ${MAX_THREADS});
do
AR_PREFIX="${RESULTS}/adapterremoval2x"
echo run_adapterremoval PE ${EXEC_ADAPTERREMOVAL2x} "${nthreads}" \
"${AR_PREFIX}_t${nthreads}" \
"${SIMULATED_INFO}" \
--file1 "${SIMULATED_MATE1}" \
--file2 "${SIMULATED_MATE2}" \
--adapter-list ./adapters/mixed.table
echo run_peat_pe "${nthreads}" \
"${RESULTS}/peat_t${nthreads}" \
"${DEFAULT_ARGS[*]}"
echo run_trimmomatic_pe MIXED "${nthreads}" \
"${RESULTS}/trimmomatic_t${nthreads}" \
"${DEFAULT_ARGS[*]}" \
".fastq"
done
echo run_alientrimmer_pe "${RESULTS}/alientrimmer_q00" \
"${DEFAULT_ARGS[*]}" \
-cf "adapters/mixed_1.txt" \
-cr "adapters/mixed_2.txt" \
-q 0
echo run_cutadapt_pe "${RESULTS}/cutadapt" \
"${DEFAULT_ARGS[*]}" \
$(for seq in $(cat adapters/mixed_1.txt); do echo "-a ${seq}";done) \
$(for seq in $(cat adapters/mixed_2.txt); do echo "-A ${seq}";done)
echo run_fastq_mcf_pe "${RESULTS}/fastq_mcf" \
"${SIMULATED_INFO}" \
"./adapters/mixed.fasta" \
"${SIMULATED_MATE1}" \
"${SIMULATED_MATE2}"
} | shuffle_and_run
done
done
${SCRIPT_MERGE} results/mixed_pe > results/mixed_pe.table
}
function benchmark_adapter_id
{
simulate_adapter_id_reads
echo "------------------------------------------------------------" > /dev/stderr
echo "Running adapter id benchmarks ..." > /dev/stderr
echo "" > /dev/stderr
readlen=100
for INSERT_MEAN in ${ADAPTER_ID_INSERT_SIZES[*]};
do
for run_n in ${REPLICATES};
do
SIMULATED_MATE1="${SIMULATED_ADAPTER_ID_PREFIX}_${run_n}_${readlen}_${INSERT_MEAN}_1.fq"
SIMULATED_MATE2="${SIMULATED_ADAPTER_ID_PREFIX}_${run_n}_${readlen}_${INSERT_MEAN}_2.fq"
SIMULATED_INFO="${SIMULATED_ADAPTER_ID_PREFIX}_${run_n}_${readlen}_${INSERT_MEAN}.read.info"
RESULTS="results/adapter_id/${readlen}_${INSERT_MEAN}_${run_n}"
run_minion "${RESULTS}/minion" \
"${SIMULATED_MATE1}" \
"${SIMULATED_MATE2}"
run_adapterremoval_id "${RESULTS}/adapterremovalv2" \
"${SIMULATED_MATE1}" \
"${SIMULATED_MATE2}"
done
done
${SCRIPT_EVALUATE_ID} results/adapter_id > results/adapter_id.table
}
cd "$(dirname "$0")"
mkdir -p results
fetch_reference
echo > /dev/stderr
if [ "$* " = "all " ];
then
benchmark_se
benchmark_pe
benchmark_collapse
benchmark_adapter_id
benchmark_mixed_pe
benchmark_mixed_se
elif [ "$* " = "se " ];
then
benchmark_se
elif [ "$* " = "pe " ];
then
benchmark_pe
elif [ "$* " = "collapse " ];
then
benchmark_collapse
elif [ "$* " = "adapter_id " ];
then
benchmark_adapter_id
elif [ "$* " = "mixed " ];
then
benchmark_mixed_pe
benchmark_mixed_se
else
echo "Usage: benchmark.sh " > /dev/stderr
echo "Commands: all se pe collapse mixed adapter_id" > /dev/stderr
fi
adapterremoval-2.3.1/benchmark/patches/ 0000775 0000000 0000000 00000000000 13503706164 0020111 5 ustar 00root root 0000000 0000000 adapterremoval-2.3.1/benchmark/patches/leeHom.patch 0000664 0000000 0000000 00000002226 13503706164 0022345 0 ustar 00root root 0000000 0000000 diff --git a/src/leeHom.cpp b/src/leeHom.cpp
index 14ff31d..ae83533 100644
--- a/src/leeHom.cpp
+++ b/src/leeHom.cpp
@@ -449,7 +449,7 @@ int main (int argc, char *argv[]) {
}else{
if(result.sequence != ""){ //new sequence
- onereadgroup.single<<"@"< max(fo1->getSeq()->length(),fo2->getSeq()->length()) ){
mtr.incrementCountmergedoverlap();
diff --git a/libgab/gzstream/gzstream.C b/libgab/gzstream/gzstream.C
index 8cb4590..4de5c09 100644
--- a/libgab/gzstream/gzstream.C
+++ b/libgab/gzstream/gzstream.C
@@ -54,8 +54,10 @@ gzstreambuf* gzstreambuf::open( const char* name, int open_mode) {
char* fmodeptr = fmode;
if ( mode & std::ios::in)
*fmodeptr++ = 'r';
- else if ( mode & std::ios::out)
+ else if ( mode & std::ios::out) {
*fmodeptr++ = 'w';
+ *fmodeptr++ = '0';
+ }
*fmodeptr++ = 'b';
*fmodeptr = '\0';
file = gzopen( name, fmode);
adapterremoval-2.3.1/benchmark/patches/pIRS_111.patch 0000664 0000000 0000000 00000040164 13503706164 0022336 0 ustar 00root root 0000000 0000000 diff -rwu pIRS_111_original/src/pirs/src/global.h pIRS_111/src/pirs/src/global.h
--- pIRS_111_original/src/pirs/src/global.h 2013-09-26 14:52:51.000000000 +0200
+++ pIRS_111/src/pirs/src/global.h 2015-09-30 15:39:16.000000000 +0200
@@ -4,6 +4,8 @@
using namespace std;
using namespace boost;
+#include
+
typedef struct{
int Read_length;
@@ -17,7 +19,7 @@
int Q_shift;
int Mask_quality_mode;
int Output_type;
- double Coverage;
+ int NPairs;
double Error_rate;
string Input_ref1;
string Input_ref2;
@@ -25,6 +27,10 @@
string GC_depth_profile;
string InDel_error_profile;
string Output_prefix;
+ vector adapter_1;
+ vector adapter_2;
+ vector barcode_1;
+ vector barcode_2;
}PARAMETER;
#endif
diff -rwu pIRS_111_original/src/pirs/src/simulate_Illumina_reads.cpp pIRS_111/src/pirs/src/simulate_Illumina_reads.cpp
--- pIRS_111_original/src/pirs/src/simulate_Illumina_reads.cpp 2013-09-26 14:52:52.000000000 +0200
+++ pIRS_111/src/pirs/src/simulate_Illumina_reads.cpp 2015-09-30 15:39:16.000000000 +0200
@@ -15,6 +15,30 @@
using namespace std;
+
+// Barcode:
+// NNNNNN
+const std::string ADAPTER_1 = "AGATCGGAAGAGCACACGTCTGAACTCCAGTCACCACCTAATCTCGTATGCCGTCTTCTGCTTG";
+const std::string ADAPTER_2 = "AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT";
+
+
+void add_adapter(const std::string& adapter, int length, std::string& dst)
+{
+ if (dst.size() < length) {
+ dst.reserve(length);
+
+ for (int pos = 0; dst.size() < length; ++pos) {
+ if (pos < adapter.size()) {
+ dst.push_back(adapter.at(pos));
+ } else {
+ dst.push_back('A');
+ }
+ }
+ }
+}
+
+
+
/*parameter variable:
int Read_length;
@@ -28,7 +52,7 @@
int Q_shift;
int Mask_quality_mode;
int Output_type;
- double Coverage;
+ int NPairs;
double Error_rate;
string Input_ref1;
string Input_ref2;
@@ -37,7 +61,7 @@
string InDel_error_profile;
string Output_prefix;
*/
-PARAMETER InputParameter ={100,500,-1,1,0,1,1,1,64,0,1,5,-1,"","","","","","Illumina"};
+PARAMETER InputParameter ={100,500,-1,1,0,1,1,1,64,0,1,10000,-1,"","","","","","Illumina"};
int Ref_Base_num = 0; //ATCG: 4
int Statistical_Cycle_num = 0; //the cycle number in Base-calling profile
@@ -94,13 +118,19 @@
cout<<"you can get another diploid genome sequence by the command \"pirs diploid\", but remember that heterozygosis SNP rate and heterozygosis Indel rate only exist in diploid. \n";
cout< Adapter sequence appended to mate 1 reads,default:"< Adapter sequence appended to mate 2 reads,default:"< Barcode sequence appended to mate 1 reads"< Barcode sequence appended to mate 2 reads"< input_ref1, input reference genome sequence *.fa/*.fa.gz, no default vaule"< input_ref2, for diploid genome, input another reference genome sequence which was generated by command \"pirs diploid\""< Base-calling profile, input Base-calling profile for simulating substitution-error and quality score,default: (exe_path)"< GC content-coverage profile, input GC content-coverage file for simulating GC bias, the default profile are determined based on the twice of read length"< InDel-error profile, input InDel-error profile for simulating InDel-error of reads, default:(exe_path)"< read_len, set length of read, read1 and read2 have the same length,default:"< coverage, set the sequencing coverage(sometimes called depth),default:"< number of reads-pairs to generate,default:"< insertsize_mean, set the average value of insert size,default:"< insertsize_sd, set the standard deviation of insert sizes, default:insertsize_mean/20"< substitution-error rate, set the average substitution-error rate(0 or 0.0001~0.63) over all cycles, default=average substitution-error rate of Base-calling profile"< 0.63 ){cerr<<"Error: error_rate should be set 0 or between 0.0001 and 0.63, you can also set -1 to simulate default error rate according with error profile, please check option -e !"<seqlen){pair_count--;continue;}
- //get insert seq
- string sub_str=seq.substr(pos,insertsize);
-
map > indel1;
map > indel2;
int r1_slen = 0;
@@ -714,27 +750,36 @@
if(InputParameter.Is_simulate_InDel)
{
get_reads_indel(InputParameter.Read_length, indel1, indel2, r1_slen, r2_slen, InDel_max_len, InDel_error_matrix, InDel_num);
- //fixed in v1.1.1
- if(InputParameter.Read_length-r1_slen > sub_str.size() || InputParameter.Read_length-r2_slen > sub_str.size())
- {
- pair_count--;continue;
- }
}
string ref_read1, ref_read2;
int selection=int(rand()%2); //0 or 1, for selecting output file randomly and deciding read +/-
int read1_pos, read2_pos;
+
+ const int barcode_idx = rand() / (RAND_MAX / InputParameter.barcode_1.size() + 1);
+ const std::string barcode_1 = InputParameter.barcode_1.at(barcode_idx);
+ const std::string barcode_2 = InputParameter.barcode_2.at(barcode_idx);
+
+ //get insert seq
if(selection == 0)
{
+ const string sub_str = barcode_1 + seq.substr(pos,insertsize) + reversecomplementary(barcode_2);
+ const string sub_str_rev(sub_str.rbegin(), sub_str.rend());
+
ref_read1 = sub_str.substr(0, InputParameter.Read_length-r1_slen);
- ref_read2 = sub_str.substr(insertsize-InputParameter.Read_length+r2_slen, InputParameter.Read_length-r2_slen);
+ ref_read2 = sub_str_rev.substr(0, InputParameter.Read_length-r2_slen);
+ ref_read2 = std::string(ref_read2.rbegin(), ref_read2.rend());
read1_pos = pos+1;
- read2_pos = pos+insertsize-InputParameter.Read_length-r2_slen+1;
+ read2_pos = pos+ref_read2.size()+1;
}else{
- ref_read1 = sub_str.substr(insertsize-InputParameter.Read_length+r1_slen, InputParameter.Read_length-r1_slen);
+ const string sub_str = barcode_2 + seq.substr(pos,insertsize) + reversecomplementary(barcode_1);
+ const string sub_str_rev(sub_str.rbegin(), sub_str.rend());
+
+ ref_read1 = sub_str_rev.substr(0, InputParameter.Read_length-r1_slen);
+ ref_read1 = std::string(ref_read1.rbegin(), ref_read1.rend());
ref_read2 = sub_str.substr(0, InputParameter.Read_length-r2_slen);
- read1_pos = pos+insertsize-InputParameter.Read_length-r1_slen+1;
+ read1_pos = pos+ref_read1.size()+1;
read2_pos = pos+1;
}
@@ -747,8 +792,10 @@
//simulate GC bias
if(InputParameter.Is_simulate_GC_bias){
string check_seq = ref_read1+ref_read2;
+ if (!check_seq.empty()) {
if(simulate_GC_bias(check_seq,GC_bias_abundance)){pair_count--;continue;}
}
+ }
//insertsize statistics
if(InsertSize_distr[insertsize]>0)
@@ -790,6 +837,10 @@
exit(-1);
}
+ int adapter_idx = rand() / (RAND_MAX / InputParameter.adapter_1.size() + 1);
+ add_adapter(InputParameter.adapter_1.at(adapter_idx), InputParameter.Read_length - r1_slen, ref_read1);
+ add_adapter(InputParameter.adapter_2.at(adapter_idx), InputParameter.Read_length - r2_slen, ref_read2);
+
bool* Is_insertion_pos1;
bool* Is_insertion_pos2;
Is_insertion_pos1 = new bool[InputParameter.Read_length];
@@ -1234,7 +1285,9 @@
}
}
- Infor_outfile<