Skip to content
Permalink
Browse files

adding option to specify file directly to NanoFilt without using pipe

fixes #29
  • Loading branch information
wdecoster committed Mar 29, 2019
1 parent eff1028 commit 513bdc529317bebbd743c0dff799472f35d92f45
Showing with 37 additions and 18 deletions.
  1. +30 −15 README.md
  2. +6 −2 nanofilt/NanoFilt.py
  3. +1 −1 nanofilt/version.py
@@ -8,7 +8,7 @@ Filtering and trimming of long read sequencing data.


Filtering on quality and/or read length, and optional trimming after passing filters.
Reads from stdin, writes to stdout.
Reads from stdin, writes to stdout. Optionally reads directly from an uncompressed file specified on the command line.

Intended to be used:
- directly after fastq extraction
@@ -31,22 +31,37 @@ NanoFilt is written for Python 3.

### USAGE:
```
NanoFilt [-h] [-q QUALITY] [-l LENGTH] [--headcrop HEADCROP] [--tailcrop TAILCROP]
optional arguments:
-h, --help show this help message and exit
-s --summary SUMMARYFILE optional, the sequencing_summary file from albacore or guppy for extracting quality scores
-q, --quality QUALITY Filter on a minimum average read quality score
-l, --length LENGTH Filter on a minimum read length
NanoFilt [-h] [-v] [--logfile LOGFILE] [-l LENGTH]
[--maxlength MAXLENGTH] [-q QUALITY] [--minGC MINGC]
[--maxGC MAXGC] [--headcrop HEADCROP] [--tailcrop TAILCROP]
[-s SUMMARY] [--readtype {1D,2D,1D2}]
[input]
Perform quality and/or length and/or GC filtering of (long read) fastq data. Reads on stdin.
General options:
-h, --help show the help and exit
-v, --version Print version and exit.
--logfile LOGFILE Specify the path and filename for the log file.
input input, uncompressed fastq file (optional)
Options for filtering reads on.:
-l, --length LENGTH Filter on a minimum read length
--maxlength MAXLENGTH Filter on a maximum read length
--headcrop HEADCROP Trim n nucleotides from start of read
-q, --quality QUALITY Filter on a minimum average read quality score
--minGC MINGC Sequences must have GC content >= to this. Float between 0.0 and 1.0. Ignored if
using summary file.
--maxGC MAXGC Sequences must have GC content <= to this. Float between 0.0 and 1.0. Ignored if
using summary file.
Options for trimming reads.:
--headcrop HEADCROP Trim n nucleotides from start of read
--tailcrop TAILCROP Trim n nucleotides from end of read
--minGC MINGC Sequences must have GC content >= to this. Float
between 0.0 and 1.0. Ignored if using summary file.
--maxGC MAXGC Sequences must have GC content <= to this. Float
between 0.0 and 1.0. Ignored if using summary file.
```
Input options.:
-s, --summary SUMMARY Use albacore or guppy summary file for quality scores
--readtype Which read type to extract information about from summary. Options are 1D, 2D or 1D2
```

### EXAMPLES
```bash
@@ -63,9 +63,9 @@ def main():
if args.tailcrop:
args.tailcrop = -args.tailcrop
if args.summary:
filter_using_summary(sys.stdin, args)
filter_using_summary(args.input, args)
else:
filter_stream(sys.stdin, args)
filter_stream(args.input, args)
logging.info('NanoFilt finished.')
except Exception as e:
logging.error(e, exc_info=True)
@@ -97,6 +97,10 @@ def get_args(custom_formatter):
general.add_argument("--logfile",
help="Specify the path and filename for the log file.",
default="NanoFilt.log")
general.add_argument("input",
help="input, uncompressed fastq file",
default=sys.stdin,
nargs='?')
filtering = parser.add_argument_group(
title='Options for filtering reads on.')
filtering.add_argument("-l", "--length",
@@ -1 +1 @@
__version__ = "2.2.1"
__version__ = "2.3.0"

0 comments on commit 513bdc5

Please sign in to comment.
You can’t perform that action at this time.