Skip to content

Commit

Permalink
Revert "Change ovStore data names to be POSIX compliant. Import canu-…
Browse files Browse the repository at this point in the history
…specific object store methods from meryl-utility. Issue #1732."

This reverts commit 3f55aa6.
  • Loading branch information
snurk committed Jul 10, 2020
1 parent d8bcc0a commit bbad236
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 423 deletions.
25 changes: 24 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,31 @@ ifeq (${OSTYPE}, SunOS)
endif
endif


# Some filesystems cannot use < or > in file names, but for reasons unknown
# (or, at least, reasons we're not going to admit to), files in the overlap
# store are named ####<###>. Enabling POSIX_FILE_NAMES Will change the
# names to ####.###.
#
# Be aware this will break object store compatibility.
#
ifeq ($(POSIX_FILE_NAMES), 1)
CXXFLAGS += -DPOSIX_FILE_NAMES

else
# Try to create non-<posix> file names. It's tempting to use 'wildcard' instead
# of the 'ls', but it doesn't work.
$(shell touch "non-<posix>-name" > /dev/null 2>&1)

ifeq (non-<posix>-name, $(shell ls "non-<posix>-name" 2> /dev/null))
#$(info Extended POSIX filenames allowed.)
else
#$(info POSIX filenames required.)
CXXFLAGS += -DPOSIX_FILE_NAMES
endif

$(shell rm -f "non-<posix>-name")
endif

# Set compiler and flags based on discovered hardware
#
# By default, debug symbols are included in all builds (even optimized).
Expand Down
3 changes: 1 addition & 2 deletions src/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ SOURCES := utility/src/utility/runtime.C \
utility/src/utility/hexDump.C \
utility/src/utility/md5.C \
utility/src/utility/mt19937ar.C \
utility/src/utility/objectStore.C \
utility/src/utility/speedCounter.C \
utility/src/utility/sweatShop.C \
\
Expand Down Expand Up @@ -90,8 +91,6 @@ SOURCES := utility/src/utility/runtime.C \
stores/libsnappy/snappy-stubs-internal.cc \
stores/libsnappy/snappy.cc \
\
stores/objectStore.C \
\
overlapInCore/overlapReadCache.C \
\
overlapInCore/liboverlap/Binomial_Bound.C \
Expand Down
64 changes: 0 additions & 64 deletions src/pipelines/canu/OverlapStore.pm
Original file line number Diff line number Diff line change
Expand Up @@ -724,63 +724,6 @@ sub deleteOverlapIntermediateFiles ($$@) {



#
# Scan the overlap store for old-format file names. If any are found,
# create new-format names as symlinks to the original files.
#
sub updateOverlapStoreFiles ($$$) {
my $asm = shift @_;
my $tag = shift @_;
my $base = shift @_;

my %oldToNew;
my @newExists;

# Scan the store for any old-format files.
# Remember if new-format links exist too.
open(L, "ls $base/$asm.ovlStore/ | ");
while (<L>) {
chomp;

if (m/^(\d\d\d\d)<(\d\d\d)>$/) {
my $old = "$1<$2>";
my $new = "$1-$2";

$oldToNew{$old} = $new;
}

if (m/^(\d\d\d\d)-(\d\d\d)$/) {
my $old = "$1<$2>";
my $new = "$1-$2";

push @newExists, $old;
}
}
close(L);

# Forget about old-format names with new-format links already present.
foreach my $nn (@newExists) {
delete $oldToNew{$nn};
}

# If there are any old-format names left, make links for them, logging
# whatever we do.
if (scalar(%oldToNew) > 0) {
print STDERR "--\n";
print STDERR "-- UPDATING $base/$asm.ovlStore data files to new name format:\n";

foreach my $oo (keys %oldToNew) {
print STDERR "-- '$oo' -> '$oldToNew{$oo}'\n";
system("ln -s '$oo' '$base/$asm.ovlStore/$oldToNew{$oo}'");
}

print STDERR "--\n";
}
}




sub createOverlapStore ($$) {
my $asm = shift @_;
my $tag = shift @_;
Expand All @@ -793,13 +736,6 @@ sub createOverlapStore ($$) {
$base = "trimming" if ($tag eq "obt");
$base = "unitigging" if ($tag eq "utg");

# A compatibility fix for renaming ovlStore data files from 0000<000> to 0000-000.
# This change occurred around July 7 2020.

updateOverlapStoreFiles($asm, $tag, $base);

# Now, if the directory exists, we have a store.

goto allDone if ((-d "$base/$asm.ovlStore") || (fileExists("$base/$asm.ovlStore.tar.gz")));
goto allDone if ((-d "$base/$asm.ctgStore") || (fileExists("$base/$asm.ctgStore.tar.gz")));

Expand Down
Loading

0 comments on commit bbad236

Please sign in to comment.