Skip to content

Commit

Permalink
removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Goina committed Jun 4, 2024
1 parent 1b0e136 commit 856227a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,14 @@ private <N extends AbstractNeuronEntity> void populateOtherComputeFilesFromInput
Set<ComputeFileType> computeFileTypes,
List<LibraryVariantArg> libraryVariants) {
String searchableMIPFile = new File(neuronEntity.getComputeFileName(ComputeFileType.InputColorDepthImage)).getName();
String searchableMIPBaseName = RegExUtils.replacePattern(searchableMIPFile, "(_CDM)?\\..*$", "");
String searchableMIPBaseName = RegExUtils.replacePattern(searchableMIPFile, "(?:_CDM)?\\..*$", "");
String[] searchableMIPNameComps = StringUtils.split(searchableMIPBaseName, "-_");
StringBuilder patternBuilder = new StringBuilder(".*")
.append(neuronEntity.getNeuronId()).append(".*");
if (searchableMIPNameComps.length > 1) {
if (!MIPsHandlingUtils.isEmLibrary(neuronEntity.getLibraryName())) {
LMNeuronEntity lmNeuronEntity = (LMNeuronEntity) neuronEntity;
patternBuilder.append(lmNeuronEntity.getObjective())
patternBuilder.append("(?:").append(lmNeuronEntity.getObjective()).append(")?") // make the objective optional
.append(".*");
patternBuilder
.append(searchableMIPNameComps[searchableMIPNameComps.length-2])
Expand All @@ -399,8 +399,8 @@ private <N extends AbstractNeuronEntity> void populateOtherComputeFilesFromInput
}
patternBuilder.append(searchableMIPNameComps[searchableMIPNameComps.length-1]);
// add searchable MIP name to the pattern
patternBuilder.insert(0, "(")
.append(")|(.*")
patternBuilder.insert(0, "(?:")
.append(")|(?:.*")
.append(searchableMIPBaseName)
.append(".*)");
Pattern variantPattern = Pattern.compile(patternBuilder.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ public LibraryVariantArg convert(String value) {
}

String libraryName;
// variant type: CDM, grad, zgap, 3d-vol
String variantType;
// there can be more than one location for a specific variant
// very often there is a location with significant variants and one with "junk" variants
// and we may still want to keep these separate
Collection<String> variantPaths;
String variantIgnoredPattern;
String variantTypeSuffix; // this is typically the suffix appended to a foldername such as _gradient or _RGB20x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,27 +113,6 @@ static String extractEMBodyIdFromName(String name) {
}
}

static String extractObjectiveFromMIPName(String mipName) {
Pattern regExPattern = Pattern.compile("[_-]([0-9]+x)[_-]", Pattern.CASE_INSENSITIVE);
Matcher objectiveMatcher = regExPattern.matcher(mipName);
if (objectiveMatcher.find()) {
return objectiveMatcher.group(1);
} else {
return null;
}
}

static String extractGenderFromMIPName(String mipName) {
// this assumes the gender is right before the objective
Pattern regExPattern = Pattern.compile("(m|f)[_-]([0-9]+x)[_-]", Pattern.CASE_INSENSITIVE);
Matcher objectiveMatcher = regExPattern.matcher(mipName);
if (objectiveMatcher.find()) {
return objectiveMatcher.group(1);
} else {
return null;
}
}

static boolean isEmLibrary(String lname) {
return lname != null && (
StringUtils.startsWithIgnoreCase(lname, "flyem") ||
Expand Down

0 comments on commit 856227a

Please sign in to comment.