MCPcopy Create free account
hub / github.com/RealTimeGenomics/rtg-tools / autoName

Method autoName

src/main/java/com/rtg/graph/DataBundle.java:185–206  ·  view source on GitHub ↗
(File f, String scoreName)

Source from the content-addressed store, hash-verified

183
184 // Make an appropriate automatic name from weighted ROC data file
185 static String autoName(File f, String scoreName) {
186 final StringBuilder autoname = new StringBuilder();
187 final String parentDir = mangleDir(f.getAbsoluteFile().getParentFile().getName());
188 autoname.append(parentDir);
189
190 final String fname = f.getName();
191 final int rocIdx = fname.indexOf(RocFilter.ROC_EXT);
192 if (rocIdx != -1 && !fname.startsWith(RocFilter.ALL.fileName())) {
193 if (autoname.length() > 0) {
194 autoname.append(' ');
195 }
196 autoname.append(fname, 0, rocIdx);
197 }
198
199 if (scoreName != null) {
200 if (autoname.length() > 0) {
201 autoname.append(' ');
202 }
203 autoname.append(scoreName);
204 }
205 return autoname.toString();
206 }
207
208 // Set an automatic name based on directory name of file and score field if no explicit name was provided
209 void setTitle(File f, String name) {

Callers 2

testAutoNameMethod · 0.95
setTitleMethod · 0.95

Calls 7

mangleDirMethod · 0.95
indexOfMethod · 0.80
fileNameMethod · 0.80
getNameMethod · 0.65
appendMethod · 0.65
lengthMethod · 0.65
toStringMethod · 0.65

Tested by 1

testAutoNameMethod · 0.76