()
| 1959 | } |
| 1960 | |
| 1961 | @Override |
| 1962 | public void run() { |
| 1963 | try { |
| 1964 | ArrayList<String> segments; |
| 1965 | while((segments = rin.nextSegments()) != null) { |
| 1966 | ++numParsed; |
| 1967 | |
| 1968 | if (reverseComplement) { |
| 1969 | int numSegments = segments.size(); |
| 1970 | |
| 1971 | if (numSegments > 1) { |
| 1972 | Collections.reverse(segments); |
| 1973 | } |
| 1974 | |
| 1975 | for (int i=0; i<numSegments; ++i) { |
| 1976 | segments.set(i, reverseComplement(segments.get(i))); |
| 1977 | } |
| 1978 | } |
| 1979 | |
| 1980 | String seq = connect(segments, graph, lookahead); |
| 1981 | |
| 1982 | if (seq.length() >= this.readLengthThreshold) { |
| 1983 | if (!isLowComplexityShort(seq)) { |
| 1984 | ArrayList<Kmer> kmers = graph.getKmers(seq); |
| 1985 | |
| 1986 | if (!kmers.isEmpty()) { |
| 1987 | ArrayList<Kmer> corrected = null; |
| 1988 | |
| 1989 | if (errorCorrectionIterations > 0) { |
| 1990 | corrected = correctErrorsSE(kmers, |
| 1991 | graph, |
| 1992 | lookahead, |
| 1993 | maxIndelSize, |
| 1994 | maxCovGradient, |
| 1995 | covFPR, |
| 1996 | percentIdentity, |
| 1997 | minKmerCov); |
| 1998 | if (corrected != null && !corrected.isEmpty()) { |
| 1999 | kmers = corrected; |
| 2000 | } |
| 2001 | } |
| 2002 | |
| 2003 | if (kmers.size() >= lookahead) { |
| 2004 | float minCov = Float.MAX_VALUE; |
| 2005 | boolean hasComplexKmer = false; |
| 2006 | |
| 2007 | for (Kmer kmer : kmers) { |
| 2008 | if (kmer.count < minCov) { |
| 2009 | minCov = kmer.count; |
| 2010 | } |
| 2011 | |
| 2012 | if (!hasComplexKmer && !graph.isRepeatKmer(kmer)) { |
| 2013 | hasComplexKmer = true; |
| 2014 | } |
| 2015 | } |
| 2016 | |
| 2017 | if (hasComplexKmer) { |
| 2018 | if (corrected != null && !corrected.isEmpty()) { |
nothing calls this directly
no test coverage detected