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

Method next

src/rnabloom/io/FastaReader.java:70–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 private String header = null;
69
70 @Override
71 public synchronized String next() throws FileFormatException {
72 if (!itr.hasNext()) {
73 return null;
74 }
75
76 if (header == null) {
77 header = itr.next().trim();
78 }
79
80 if (header.isEmpty()) {
81 return null; //throw new FileFormatException("Empty FASTA header");
82 }
83 else if (header.charAt(0) != '>') {
84 throw new FileFormatException("Incorrect FASTA header format");
85 }
86
87 StringBuilder builder = new StringBuilder();
88 while (itr.hasNext()) {
89 String line = itr.next().trim();
90 if (line.isEmpty()) {
91 header = null;
92 break;
93 }
94 else if (line.charAt(0) == '>') {
95 header = line;
96 break;
97 }
98 else {
99 builder.append(line);
100 }
101 }
102
103 return builder.toString();
104 }
105
106 @Override
107 public synchronized String[] nextWithName() throws FileFormatException {

Callers 10

runMethod · 0.95
runMethod · 0.95
getReadLengthsMethod · 0.95
getMaxReadLengthMethod · 0.95
clusterLongReadsMethod · 0.95
isCorrectFormatMethod · 0.95
hasOnlyOneSequenceMethod · 0.95
getListFromFileMethod · 0.95
reduceRedundancyMethod · 0.95

Calls 3

hasNextMethod · 0.65
nextMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected