From 5cb0665d936b0f477b82de87a772e6356fc736f3 Mon Sep 17 00:00:00 2001 From: Alexis CRISCUOLO <alexis.criscuolo@pasteur.fr> Date: Thu, 12 Nov 2020 17:27:48 +0100 Subject: [PATCH] v2.0 --- src/AlienTrimmer.java | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/AlienTrimmer.java b/src/AlienTrimmer.java index 36a6f8d..1466bd8 100644 --- a/src/AlienTrimmer.java +++ b/src/AlienTrimmer.java @@ -299,7 +299,7 @@ public class AlienTrimmer { outS = ( gz ) ? new BufferedWriter(new OutputStreamWriter(new GZIPOutputStream(Files.newOutputStream(Path.of(filename + ".gz")), BUFFER_SIZE)), BUFFER_SIZE) : Files.newBufferedWriter(Path.of(filename)); } else { - filename = basename + "fastq"; + filename = basename + ".fastq"; out1 = ( gz ) ? new BufferedWriter(new OutputStreamWriter(new GZIPOutputStream(Files.newOutputStream(Path.of(filename + ".gz")), BUFFER_SIZE)), BUFFER_SIZE) : Files.newBufferedWriter(Path.of(filename)); } //## counters @@ -509,14 +509,14 @@ public class AlienTrimmer { //## assessing R1 length ########################################################## l = e1 - s1; //## NOTE: l = length of trimmed read discard1 = ( l < minLgt ); + //## assessing R1 composition ##################################################### + if ( ! discard1 ) { + i = e1; x = 0; while ( --i >= s1 ) x += bad[i]; + discard1 = ( 100 * x > l * prop ); //## NOTE: x/l > prop/100, where x is the no. 'bad' bases in the trimmeed read + } + + if ( verbose && l != lgt1 ) display(l1_1, l1_2, l1_4, cov, bad, lgt1, s1, e1, discard1); } - //## assessing R1 composition ##################################################### - if ( ! discard1 ) { - i = e1; x = 0; while ( --i >= s1 ) x += bad[i]; - discard1 = ( 100 * x > l * prop ); //## NOTE: x/l > prop/100, where x is the no. 'bad' bases in the trimmeed read - } - - if ( verbose && l != lgt1 ) display(l1_1, l1_2, l1_4, cov, bad, lgt1, s1, e1, discard1); } //## writing single-end outfile ####################################################### @@ -649,14 +649,14 @@ public class AlienTrimmer { //## assessing R2 length ########################################################## l = e2 - s2; //## NOTE: l = length of trimmed read discard2 = ( l < minLgt ); - } - //## assessing R2 composition ##################################################### - if ( ! discard2 ) { - i = e2; x = 0; while ( --i >= s2 ) x += bad[i]; - discard2 = ( 100 * x > l * prop ); //## NOTE: x/l > prop/100, where x is the no. 'bad' bases in the trimmed read - } + //## assessing R2 composition ##################################################### + if ( ! discard2 ) { + i = e2; x = 0; while ( --i >= s2 ) x += bad[i]; + discard2 = ( 100 * x > l * prop ); //## NOTE: x/l > prop/100, where x is the no. 'bad' bases in the trimmed read + } - if ( verbose && l != lgt2 ) display(l2_1, l2_2, l2_4, cov, bad, lgt2, s2, e2, discard2); + if ( verbose && l != lgt2 ) display(l2_1, l2_2, l2_4, cov, bad, lgt2, s2, e2, discard2); + } } //## writing paired-end outfiles ###################################################### -- GitLab