drivenbyentropy / aptasuite

A full-featured bioinformatics software collection for the comprehensive analysis of aptamers in HT-SELEX experiments.
https://drivenbyentropy.github.io/
GNU General Public License v3.0
25 stars 11 forks source link

[Bug]Unable to enter "Aptamer Family Analysis" Tab #47

Closed Eggsorer closed 6 years ago

Eggsorer commented 6 years ago

I first clustered aptamer pools with Aptasuite in command line. Then I tried to view it in "Aptamer Family Analysis" tab in GUI. However, I got this error in GUI:

[5:36:42 | SEVERE | Thread-19 ] : lib.aptamer.datastructures.Experiment Error invoking ClusterContainer backend

Meanwhile in the cmd, the error message goes:

java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at lib.aptamer.datastructures.Experiment.instantiateClusterContainer(Experiment.java:380) at gui.core.aptamer.family.analysis.AptamerFamilyAnalysisRootController.loadClusterInformation(AptamerFamilyAnalysisRootController.java:473) at gui.core.aptamer.family.analysis.AptamerFamilyAnalysisRootController.access$100(AptamerFamilyAnalysisRootController.java:97) at gui.core.aptamer.family.analysis.AptamerFamilyAnalysisRootController$1.run(AptamerFamilyAnalysisRootController.java:326) at gui.activity.ProgressPaneController$1.call(ProgressPaneController.java:179) at gui.activity.ProgressPaneController$1.call(ProgressPaneController.java:175) at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.lang.Thread.run(Thread.java:748) Caused by: org.mapdb.DBException$FileLocked: File is already opened and is locked: /path/to/resultfolder/clusterdata/clusters.mapdb at org.mapdb.volume.Volume.lockFile(Volume.java:495) at org.mapdb.volume.MappedFileVol.(MappedFileVol.java:88) at org.mapdb.volume.MappedFileVol$MappedFileFactory.factory(MappedFileVol.java:64) at org.mapdb.volume.MappedFileVol$MappedFileFactory.makeVolume(MappedFileVol.java:38) at org.mapdb.StoreDirect$volume$1.invoke(StoreDirect.kt:77) at org.mapdb.StoreDirect$volume$1.invoke(StoreDirect.kt:16) at org.mapdb.StoreDirect.(StoreDirect.kt:76) at org.mapdb.StoreDirect$Companion.make(StoreDirect.kt:57) at org.mapdb.StoreDirect$Companion.make$default(StoreDirect.kt:56) at org.mapdb.DBMaker$Maker.make(DBMaker.kt:450) at lib.aptamer.datastructures.MapDBClusterContainer.(MapDBClusterContainer.java:88) ... 13 more Caused by: java.nio.channels.OverlappingFileLockException at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255) at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152) at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1108) at java.nio.channels.FileChannel.tryLock(FileChannel.java:1155) at org.mapdb.volume.Volume.lockFile(Volume.java:490) ... 23 more Error invoking ClusterContainer backend

I am running aptasuite in an interactive mode on a HPC, with 15 cores. I am connecting the HPC via putty and my X11 server is XMing. I am not sure why the error message says the file is already opened and locked. I am pretty sure that the process that shows this message is the only process that is accessing the cluster files.

drivenbyentropy commented 6 years ago

Hi, Just to make sure, did you replace the actual path of the cluster folder in the log with /path/to/resultfolder/clusterdata/?

Assuming you did, the first thing I would try is to restart the remote machine if you have the rights to do so. MapDB (the data engine AptaSuite is based on) uses file locks to prevent concurrent writing (and possible corruption) of the files storing the data. Depending on the operating system, these locks are automatically released once the program terminates. If the program terminates unexpectedly (e.g. gets killed), it could lead to the lock remaining and a restart of the computer might be required.

If the problem persists after the reboot, we can look into other possible causes (network drives, etc).

Eggsorer commented 6 years ago

yea, I did replace it so that people don't know I am Chen :p But, BUT, the weirdest thing is , I left the interactive job overnight (the same one that gave me the errors I posted), now the "Aptamer Family Analysis" tab is open... I am not sure what happened during last night, but here is the log:

Error invoking ClusterContainer backend Retrieving Cluster Data Initializing cluster data structures Sorting Clusters Extracting aptamers for cluster 219742990 Determining cluster diversity Determining cluster membership of aptamers Extracting aptamer sizes Sorting cluster members Extracting aptamers for cluster 230814370 Determining cluster diversity Determining cluster membership of aptamers Extracting aptamer sizes

And the error "Error invoking ClusterContainer backend" happened multiple times before. All happened when I have only one Aptasuite opening. In any case, I thought it might is a recurring bug. If this happen again, I'll let you know.

drivenbyentropy commented 6 years ago

Thanks for letting me know :). Is the data residing on a network drive?

The exception Error invoking ClusterContainer backend can occur when you open the aptamer family tab in AptaSuite but no cluster information exists (i.e. AptaCluster has not been run yet). This should however be caught and handled correctly by AptaSuite.

I am closing this ticket for now but please feel free to reopen if this behavior persists.

Eggsorer commented 6 years ago

This data is on a network drive.

Eggsorer commented 6 years ago

OK. I think I figured out the cause of "bugs" I saw. When I first clicked on "Aptamer Family Analysis", the GUI showed "No Aptamer Cluster Found" or something like that. But there is not a message on GUI showing "Retrieving Cluster from Files" or something alike. There is no similar message on the CLI side either. There is just one loading circle turning around and around. So I thought the program can't find my cluster and is frozen. Then I closed the tab. When I reopened it, it gave the error I described initially, which is related to file being locked. But if I waited overnight when I first clicked on the "Aptamer Family Analysis" Tab, I can load my clusters just fine.

So if you can add some message in the cluster loading stage, it might pacify anxious users like me :) or you can just let them figure out themselves.

drivenbyentropy commented 6 years ago

Thank for finding this out.

I will see to add more details progress information in future versions. The paradigm I took with AptaSuite is to trade off memory consumption for disk storage (so that large datasets can be analyzed on many machines). This in turn means more disk I/O which, on a network drive, can be painstakingly slow. If you are running things on a cluster and have space on a local (or scratch) drive, I highly recommend copying the data over first, then run your analysis, and copy it back. Using an incremental backup tool such as rsync can speed this operation up substantially.