(String path)
| 956 | } |
| 957 | |
| 958 | public static int getMaxReadLength(String path) throws FileFormatException, IOException{ |
| 959 | int max = -1; |
| 960 | |
| 961 | if (FastqReader.isCorrectFormat(path)) { |
| 962 | FastqRecord r = new FastqRecord(); |
| 963 | FastqReader fr = new FastqReader(path); |
| 964 | for (int i=0; i< 100 && fr.hasNext(); ++i) { |
| 965 | fr.nextWithoutName(r); |
| 966 | max = Math.max(max, r.seq.length()); |
| 967 | } |
| 968 | fr.close(); |
| 969 | } |
| 970 | else if (FastaReader.isCorrectFormat(path)) { |
| 971 | FastaReader fr = new FastaReader(path); |
| 972 | for (int i=0; i< 100 && fr.hasNext(); ++i) { |
| 973 | max = Math.max(max, fr.next().length()); |
| 974 | } |
| 975 | fr.close(); |
| 976 | } |
| 977 | else { |
| 978 | throw new FileFormatException("Incompatible file format for `" + path + "`"); |
| 979 | } |
| 980 | |
| 981 | return max; |
| 982 | } |
| 983 | |
| 984 | public void initializeGraph(boolean strandSpecific, |
| 985 | long dbgbfNumBits, |
nothing calls this directly
no test coverage detected