Package: nanoprep-ffm
NanoPreP: a fully-equipped, fast, and memory-efficient pre-processor for ONT transcriptomic dataRequirementsPython (>= 3.7)edlib (>=1.3.8)plotlyGetting startedOption 1:use git clone and run NanoPreP as a python module without installationgit clone https://github.com/Woodformation1136/NanoPreP.git
cd NanoPreP
python -m NanoPreP --helpOption 2:use pip installpip install nanoprep-ffm
nanoprep --helpHow NanoPreP worksRead annotationNanoPreP first annotateslocations of adapter/primer and polyA/Ton each input read using a"local-searching"method, and classifies each read as eitherfusion, full-length or truncatedbased on the adapter/primer locations.For the"local-searching"method, adapter/primer sequences (see sectionHow to specify adapter/primer and polyA/T sequences) are aligned to both (1) the"ideal searching locations"for adapter/primer (isl5andisl3) and (2) the"read body"between 5' and 3' ideal searching locations.Based on the alignment hits of adapter/primer, each read can be classified into one of the three categories:Fusion/chimeric: reads with a adapter/primer hit on the"read body"Full-length: reads that are notfusion/chimericand possess both5' and 3' adapters/primerson5' and 3' "ideal searching locations", respecitvely.Truncated: reads that are notfusion/chimericand notfull-length.During the annotation step, user can decide to skip low-quality or too-short reads using options--skip_lowqand--skip_shortwith the desired cutoff values, respectively. The skipped reads will not be annotated and will not be included in the final output file.Read processing: trimming, filtering and orientationAfter the annotation steps,trimming,filteringandorientationcan be performed on each read.Trimmingof adapter/primer and polyA/T sequences can be applied with the flags--trim_adapterand--trim_poly.Filteringof low-quality or too-short sequences (after trimming) can be performed using options--filter_lowqand--filter_shortwith desired cutoff values.Orientationof read strand to sense or antisense can be performed using option--orientation.Read outputFor the output options, user can choose to outputfusion/chimeric,full-length, and/ortruncatedreads using options--output_fusion,--output_full_length, and--output_truncated, respectively, with assigned file names (or '-' to write to stdout).General usageUse NanoPreP with thestandardmode to gethigh-quality, non-chimeric, full-length, strand-oriented, adapter/primer-removed, polyA-removedreads:nanoprep \
  --mode standard \
  --output_full_length output.fq \
  --report report.json \
  input.fq--mode standard← run NanoPreP withstandardmode (see sectionModes)--output_full_length output.fq← output full-length reads tooutput.fq--report report.json← output details of the run toreport.jsoninput.fq← input FASTQAfter running this command, two output filesoutput.fqandreport.jsonwill appear in your working directory.  Thereport.jsonrecords start/stop times, the parameters used, and the detail information of the input FASTQ file. Theoutput.fqcontains full-length reads processed by NanoPreP. For each processed read, NanoPreP appends the annotations to the ID line (the line started with @):@read_1 strand=0.91 full_length=1 fusion=0 ploc5=0 ploc3=0 poly5=0 poly3=-20
AGAGGCTGGCGGGAACGGGC......TTTCAAAGCCAGGCGGATTC
+
+,),+'$)'%671*%('&$%......((&'(*($%$&%&$-((84*As shown in the example above, several flags are used for the annotation:flagregexdefaultexplanationstrand-?\d+.\d*00: unknown; > 0: sense; < 0: antisensefull_length[0|1]00: non-full-length; 1: full-lengthfusion[0|1]00: non-chimeric/-fusion; 1: chimeric/fusionploc5-?\d+-1-1: unknown; 0: removed; > 0: 5' adapter/primer locationploc3-?\d+-1-1: unknown; 0: removed; > 0: 3' adapter/primer locationpoly5-?\d+-10: unknown; > 0: 5' polymer length; < 0: trimmed 5' polymer lengthpoly3-?\d+-10: unknown; > 0: 3' polymer length; < 0: trimmed 3' polymer lengthAccording to the annotation, the example "read1" is a sense strand (strand=0.91), full-length (full_length=1), non-chimeric (fusion=0),  adapter/primer removed (ploc5=0 ploc3=0), and polyA removed (poly3=-20) read.ModesIn addition to thestandardmode, NanoPreP also provides othermodeoptions for different usages:standard: outputhigh-quality, non-chimeric, full-length, strand-oriented, adapter/primer-removed, polyA-removedreadsnanoprep \
 --mode standard \
 --output_full_length output.fq \
 --report report.json \
 input.fqannotate: annotate without skipping/trimming/filtering/orienting readsnanoprep --mode annotate input.fq > annotated.fqreport: generate report.json from NanoPreP-annotated FASTQ filesnanoprep --mode report --report report.json annotated.fqEachmodeoption applies multiple options at the same time, which can be detailed as follows:modeoptionsstandard--skip_lowq 7--p5_sense TCGGTGTCTTTGTGTTTCTGTTGGTGCTGATATTGCTGGG--p3_sense A{100}GAAGATAGAGCGACAGGCAAGTCACAAAGACACCGACAAC--isl5 0 130--isl3 -60 -1--pid_isl 0.7--pid_body 0.7--poly_w 6--poly_k 4--filter_short 1--trim_adapter--trim_poly--orientation 1--output_full_length output.fq--report report.jsonannotate--p5_sense TCGGTGTCTTTGTGTTTCTGTTGGTGCTGATATTGCTGGG--p3_sense A{100}GAAGATAGAGCGACAGGCAAGTCACAAAGACACCGACAAC--isl5 0 130--isl3 -60 -1--pid_isl 0.7--pid_body 0.7--poly_w 6--poly_k 4--orientation 0--output_fusion ---output_truncated ---output_full_length ---report report.jsonreport--disable_annot--report report.jsonHow to specify adapter/primer and polyA/T sequencesTo perform read annotation,adapter/primerandpolyA/T(if provided) sequences on thesense strandcan be specified using options--p5_senseand--p3_sense.For example, the following command means that the 5' and 3' adatper/primer sequences on the sense strand are 'CATTC' and 'GACTA', respectively.--p5_sense CATTC --p3_sense GACTAIf users wish to detect polyA/T tails, a patternN{M}can be used to specify the location and length of polyA/T tails:--p5_sense CATTC --p3_sense A{50}GACTAThe command above means that there are poly"A"tails of maximum length"50"bp next to the 3' adapters/primers.Full usageusage: nanoprep [-h] [--version] --input_fq str [--mode [standard|annotate|report]]
                [--config str] [--report str] [-n int] [--precision float]
                [--disable_annot] [--skip_lowq float] [--skip_short int]
                [--p5_sense str] [--p3_sense str] [--isl5 int int] [--isl3 int int]
                [--pid_isl float] [--pid_body float] [--poly_w int] [--poly_k int]
                [--trim_adapter] [--trim_poly] [--filter_lowq float]
                [--filter_short int] [--orientation int] [--output_fusion str]
                [--output_truncated str] [--output_full_length str]
                [--suffix_filtered str]

options:
  -h, --help                show this help message and exit
  --version                 show program's version number and exit
  --input_fq str            input FASTQ
  --mode str                use presets standard/annotate/report (can be overriden by `config` and command line arguments)
  --config str              use the parameters in this config file (JSON)(can be overriden by command line arguments)
  --report str              output report file (JSON)
  -n int                    max number of reads to sample during optimzation (default: 100000)
  --precision float         precision cutoff while optimizing pid cutoff
  --disable_annot           use this flag to disable annotation
  --skip_lowq float         skip low-quality reads (default: -1)
  --skip_short int          skip too-short reads (default: -1)
  --p5_sense str            5' sense adatper/primer/polymer sequences
  --p3_sense str            3' sense adatper/primer/polymer sequences
  --isl5 int int            ideal searching location for 5' adapter/primer sequences (e.g. 0 130)
  --isl3 int int            ideal searching location for 3' adapter/primer sequences (e.g. -60 -1)
  --pid_isl float           adapter/primer percent identity cutoff (in ISL)
  --pid_body float          adapter/primer percent identity cutoff (on read body)
  --poly_w int              window size for homopolymer identification
  --poly_k int              number of monomers to be expected in the window
  --trim_adapter            use this flag to trim adatper/primer sequences
  --trim_poly               use this flag to trim homopolymers
  --filter_lowq float       filter low-quality reads after all trimming steps (default: -1)
  --filter_short int        filter too short reads after all trimming steps (default: -1)
  --orientation int         re-orient reads (0: generic (default), 1: sense, -1: antisense)
  --output_fusion str       output fusion/chimeric reads to this file (use '-' for stdout)
  --output_truncated str    output truncated/non-full-length reads to this file (use '-' for stdout)
  --output_full_length str  output full-length reads to this file (use '-' for stdout)
  --suffix_filtered str     output filtered reads with the suffix