MCPcopy Create free account
hub / github.com/BirolLab/RNA-Bloom / getMaxReadLength

Method getMaxReadLength

src/rnabloom/RNABloom.java:958–982  ·  view source on GitHub ↗
(String path)

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 6

isCorrectFormatMethod · 0.95
hasNextMethod · 0.95
closeMethod · 0.95
isCorrectFormatMethod · 0.95
nextMethod · 0.95
nextWithoutNameMethod · 0.45

Tested by

no test coverage detected