JetBrains-Research / span

SPAN Semi-supervised Peak Analyzer
https://doi.org/10.1093/bioinformatics/btab376
MIT License
9 stars 1 forks source link

Model fit failed #18

Closed EllieDuan closed 5 years ago

EllieDuan commented 5 years ago

SPAN worked well in some files, but failed in other files, here is the error message, any suggestions? Thank you!

Model fit: recalculating /SPAN_peak_calling/fit/2_4hr_3_sorted_removeDup_input_2_4hr_3_sorted_removeDup_200#1e296.span: [FAILED] after 445.9 ms
Caused by: ERROR zf.getEntry(name + ".npy") must not be null
java.lang.IllegalStateException: zf.getEntry(name + ".npy") must not be null
        at org.jetbrains.bio.npy.NpzFile$Reader.get(Npz.kt:77)
        at org.jetbrains.bio.npy.NpzFile$Reader.get$default(Npz.kt:76)
        at org.jetbrains.bio.coverage.PairedEndCoverage$Companion.load$bioinf_commons(PairedEndCoverage.kt:166)
        at org.jetbrains.bio.coverage.Coverage$Companion.load$bioinf_commons(Coverage.kt:61)
        at org.jetbrains.bio.query.ReadsQuery.coverage(ReadsQuery.kt:61)
        at org.jetbrains.bio.query.ReadsQuery.getUncached(ReadsQuery.kt:30)
        at org.jetbrains.bio.query.ReadsQuery.getUncached(ReadsQuery.kt:22)
        at org.jetbrains.bio.query.CachingInputQuery$get$1.invoke(InputQuery.kt:33)
        at org.jetbrains.bio.util.LockManager.synchronized(LockManager.kt:39)
        at org.jetbrains.bio.query.CachingInputQuery.get(InputQuery.kt:29)
        at org.jetbrains.bio.span.CoverageScoresQuery$scores$2.invoke(CoverageScoresQuery.kt:49)
        at org.jetbrains.bio.span.CoverageScoresQuery$scores$2.invoke(CoverageScoresQuery.kt:16)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at org.jetbrains.bio.span.CoverageScoresQuery.getScores(CoverageScoresQuery.kt)
        at org.jetbrains.bio.span.CoverageScoresQuery.getUncached(CoverageScoresQuery.kt:39)
        at org.jetbrains.bio.span.CoverageScoresQuery.getUncached(CoverageScoresQuery.kt:16)
        at org.jetbrains.bio.query.CachingQuery$apply$1$2.call(Query.kt:31)
        at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4869)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3523)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2249)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2132)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
        at com.google.common.cache.LocalCache.get(LocalCache.java:3962)
        at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4864)
        at org.jetbrains.bio.query.CachingQuery$apply$1.invoke(Query.kt:31)
        at org.jetbrains.bio.util.LockManager.synchronized(LockManager.kt:39)
        at org.jetbrains.bio.query.CachingQuery.apply(Query.kt:29)
        at org.jetbrains.bio.span.CoverageScoresQueryKt.scoresDataFrame(CoverageScoresQuery.kt:109)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$Companion$createEffectiveQueries$4.getUncached(SpanModelFitExperiment.kt:370)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$Companion$createEffectiveQueries$4.getUncached(SpanModelFitExperiment.kt:364)
        at org.jetbrains.bio.query.CachingQuery$apply$1$2.call(Query.kt:31)
        at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4869)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3523)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2249)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2132)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
        at com.google.common.cache.LocalCache.get(LocalCache.java:3962)
        at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4864)
        at org.jetbrains.bio.query.CachingQuery$apply$1.invoke(Query.kt:31)
        at org.jetbrains.bio.util.LockManager.synchronized(LockManager.kt:39)
        at org.jetbrains.bio.query.CachingQuery.apply(Query.kt:29)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$preprocessedData$2.invoke(SpanModelFitExperiment.kt:233)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$preprocessedData$2.invoke(SpanModelFitExperiment.kt:202)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.getPreprocessedData(SpanModelFitExperiment.kt)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.calculateModel(SpanModelFitExperiment.kt:243)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.access$calculateModel(SpanModelFitExperiment.kt:202)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$getOrLoadResults$1.invoke(SpanModelFitExperiment.kt:284)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$getOrLoadResults$1.invoke(SpanModelFitExperiment.kt:202)
        at org.jetbrains.bio.util.PathExtensionsKt$checkOrRecalculate$1$$special$$inlined$time$lambda$1.invoke(PathExtensions.kt:326)
        at org.jetbrains.bio.util.PathExtensionsKt$checkOrRecalculate$1$$special$$inlined$time$lambda$1.invoke(PathExtensions.kt)
        at org.jetbrains.bio.util.PathExtensionsKt$checkOrRecalculate$1.invoke(PathExtensions.kt:467)
        at org.jetbrains.bio.util.PathExtensionsKt$checkOrRecalculate$1.invoke(PathExtensions.kt)
        at org.jetbrains.bio.util.LockManager.synchronized(LockManager.kt:39)
        at org.jetbrains.bio.util.PathExtensionsKt.checkOrRecalculate(PathExtensions.kt:307)
        at org.jetbrains.bio.util.PathExtensionsKt.checkOrRecalculate$default(PathExtensions.kt:304)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.getOrLoadResults(SpanModelFitExperiment.kt:281)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.access$getOrLoadResults(SpanModelFitExperiment.kt:202)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$results$2.invoke(SpanModelFitExperiment.kt:220)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$results$2.invoke(SpanModelFitExperiment.kt:202)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.getResults(SpanModelFitExperiment.kt)
        at org.jetbrains.bio.span.SpanCLA$analyze$$inlined$with$lambda$1.invoke(SpanCLA.kt:196)
        at org.jetbrains.bio.span.SpanCLA$analyze$$inlined$with$lambda$1.invoke(SpanCLA.kt:31)
        at org.jetbrains.bio.util.OptionParserExtensionsKt.parse(OptionParserExtensions.kt:62)
        at org.jetbrains.bio.util.OptionParserExtensionsKt.parse$default(OptionParserExtensions.kt:26)
        at org.jetbrains.bio.span.SpanCLA.analyze(SpanCLA.kt:108)
        at org.jetbrains.bio.span.SpanCLA.main(SpanCLA.kt:74)
dievsky commented 5 years ago

Could you please specify the version of Span that you used? Also: did you use a custom chrom.sizes file when launching Span?

EllieDuan commented 5 years ago

Thank you for reply!

I used: 'span/0.10.0.4787'

The chrom.sizes file was download from UCSC: http://hgdownload.cse.ucsc.edu/goldenPath/dm6/bigZips/ I do receive some message on that as well in standard output:


May 16, 2019 6:12:13 AM org.jline.utils.Log logr
WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
com.google.common.util.concurrent.UncheckedExecutionException: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Cache file /SPAN_peak_calling/cache/coverage_input_0-2hr_1_sorted_removeDup_unique#2a3ba.npz doesn't contain chrUn_DS483736v1.
It's likely that chrom.sizes file used for its creation differs from the one being used to read it now.
If problem persists, delete the cache file /SPAN_peak_calling/cache/coverage_input_0-2hr_1_sorted_removeDup_unique#2a3ba.npz and Span will recreate it with correct settings.
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2051)
        at com.google.common.cache.LocalCache.get(LocalCache.java:3962)
        at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4864)
        at org.jetbrains.bio.query.CachingQuery$apply$1.invoke(Query.kt:31)
        at org.jetbrains.bio.util.LockManager.synchronized(LockManager.kt:39)
        at org.jetbrains.bio.query.CachingQuery.apply(Query.kt:29)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$preprocessedData$2.invoke(SpanModelFitExperiment.kt:233)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$preprocessedData$2.invoke(SpanModelFitExperiment.kt:202)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.getPreprocessedData(SpanModelFitExperiment.kt)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.calculateModel(SpanModelFitExperiment.kt:243)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.access$calculateModel(SpanModelFitExperiment.kt:202)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$getOrLoadResults$1.invoke(SpanModelFitExperiment.kt:284)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$getOrLoadResults$1.invoke(SpanModelFitExperiment.kt:202)
        at org.jetbrains.bio.util.PathExtensionsKt$checkOrRecalculate$1$$special$$inlined$time$lambda$1.invoke(PathExtensions.kt:326)
        at org.jetbrains.bio.util.PathExtensionsKt$checkOrRecalculate$1$$special$$inlined$time$lambda$1.invoke(PathExtensions.kt)
        at org.jetbrains.bio.util.PathExtensionsKt$checkOrRecalculate$1.invoke(PathExtensions.kt:467)
        at org.jetbrains.bio.util.PathExtensionsKt$checkOrRecalculate$1.invoke(PathExtensions.kt)
        at org.jetbrains.bio.util.LockManager.synchronized(LockManager.kt:39)
        at org.jetbrains.bio.util.PathExtensionsKt.checkOrRecalculate(PathExtensions.kt:307)
        at org.jetbrains.bio.util.PathExtensionsKt.checkOrRecalculate$default(PathExtensions.kt:304)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.getOrLoadResults(SpanModelFitExperiment.kt:281)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.access$getOrLoadResults(SpanModelFitExperiment.kt:202)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$results$2.invoke(SpanModelFitExperiment.kt:220)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$results$2.invoke(SpanModelFitExperiment.kt:202)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment.getResults(SpanModelFitExperiment.kt)
        at org.jetbrains.bio.span.SpanCLA$analyze$$inlined$with$lambda$1.invoke(SpanCLA.kt:196)
        at org.jetbrains.bio.span.SpanCLA$analyze$$inlined$with$lambda$1.invoke(SpanCLA.kt:31)
        at org.jetbrains.bio.util.OptionParserExtensionsKt.parse(OptionParserExtensions.kt:62)
        at org.jetbrains.bio.util.OptionParserExtensionsKt.parse$default(OptionParserExtensions.kt:26)
        at org.jetbrains.bio.span.SpanCLA.analyze(SpanCLA.kt:108)
        at org.jetbrains.bio.span.SpanCLA.main(SpanCLA.kt:74)
Caused by: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Cache file /SPAN_peak_calling/cache/coverage_input_0-2hr_1_sorted_removeDup_unique#2a3ba.npz doesn't contain chrUn_DS483736v1.
It's likely that chrom.sizes file used for its creation differs from the one being used to read it now.
If problem persists, delete the cache file /SPAN_peak_calling/cache/coverage_input_0-2hr_1_sorted_removeDup_unique#2a3ba.npz and Span will recreate it with correct settings.
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2051)
        at com.google.common.cache.LocalCache.get(LocalCache.java:3962)
        at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4864)
        at org.jetbrains.bio.query.CachingQuery$apply$1.invoke(Query.kt:31)
        at org.jetbrains.bio.util.LockManager.synchronized(LockManager.kt:39)
        at org.jetbrains.bio.query.CachingQuery.apply(Query.kt:29)
        at org.jetbrains.bio.span.CoverageScoresQueryKt.scoresDataFrame(CoverageScoresQuery.kt:109)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$Companion$createEffectiveQueries$4.getUncached(SpanModelFitExperiment.kt:370)
        at org.jetbrains.bio.experiments.fit.SpanModelFitExperiment$Companion$createEffectiveQueries$4.getUncached(SpanModelFitExperiment.kt:364)
        at org.jetbrains.bio.query.CachingQuery$apply$1$2.call(Query.kt:31)
        at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4869)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3523)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2249)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2132)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
        ... 32 more
Caused by: java.lang.IllegalStateException: Cache file /SPAN_peak_calling/cache/coverage_input_0-2hr_1_sorted_removeDup_unique#2a3ba.npz doesn't contain chrUn_DS483736v1.
It's likely that chrom.sizes file used for its creation differs from the one being used to read it now.
If problem persists, delete the cache file /SPAN_peak_calling/cache/coverage_input_MTD_0-2hr_1_sorted_removeDup_unique#2a3ba.npz and Span will recreate it with correct settings.
        at org.jetbrains.bio.coverage.PairedEndCoverage$Companion.load$bioinf_commons(PairedEndCoverage.kt:169)
        at org.jetbrains.bio.coverage.Coverage$Companion.load$bioinf_commons(Coverage.kt:61)
        at org.jetbrains.bio.query.ReadsQuery.coverage(ReadsQuery.kt:61)
        at org.jetbrains.bio.query.ReadsQuery.getUncached(ReadsQuery.kt:30)
        at org.jetbrains.bio.query.ReadsQuery.getUncached(ReadsQuery.kt:22)
        at org.jetbrains.bio.query.CachingInputQuery$get$1.invoke(InputQuery.kt:33)
        at org.jetbrains.bio.util.LockManager.synchronized(LockManager.kt:39)
        at org.jetbrains.bio.query.CachingInputQuery.get(InputQuery.kt:29)
        at org.jetbrains.bio.span.CoverageScoresQuery$scores$2.invoke(CoverageScoresQuery.kt:49)
        at org.jetbrains.bio.span.CoverageScoresQuery$scores$2.invoke(CoverageScoresQuery.kt:16)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at org.jetbrains.bio.span.CoverageScoresQuery.getScores(CoverageScoresQuery.kt)
        at org.jetbrains.bio.span.CoverageScoresQuery.getUncached(CoverageScoresQuery.kt:39)
        at org.jetbrains.bio.span.CoverageScoresQuery.getUncached(CoverageScoresQuery.kt:16)
        at org.jetbrains.bio.query.CachingQuery$apply$1$2.call(Query.kt:31)
        at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4869)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3523)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2249)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2132)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
        ... 46 more
Caused by: java.lang.IllegalStateException: zf.getEntry(name + ".npy") must not be null
        at org.jetbrains.bio.npy.NpzFile$Reader.get(Npz.kt:77)
        at org.jetbrains.bio.npy.NpzFile$Reader.get$default(Npz.kt:76)
        at org.jetbrains.bio.coverage.PairedEndCoverage$Companion.load$bioinf_commons(PairedEndCoverage.kt:166)
        ... 65 more
ERROR: java.lang.IllegalStateException: Cache file /SPAN_peak_calling/cache/coverage_input_MTD_0-2hr_1_sorted_removeDup_unique#2a3ba.npz doesn't contain chrUn_DS483736v1.
It's likely that chrom.sizes file used for its creation differs from the one being used to read it now.
If problem persists, delete the cache file /SPAN_peak_calling/cache/coverage_input_MTD_0-2hr_1_sorted_removeDup_unique#2a3ba.npz and Span will recreate it with correct settings.
Option (* = required)         Description
---------------------         -----------
-?, -h, --help                Show help
-b, --bin <Integer>           Bin size (default: 200)
-c, --control <Path>          Control file. bam, bed or bed.gz file;
                              Single control file or separate file per each
                              treatment file required.
* --chrom.sizes, --cs <Path>  Chromosome sizes path, can be downloaded at
                              http://hgdownload.cse.ucsc.
                                edu/goldenPath/<build>/bigZips/<build>.chrom.
                                sizes
-d, --debug                   Print all the debug information, used for
                                troubleshooting.
-f, --fdr <Double>            FDR value (default: 1.0E-6)
--fragment <Integer>          Fragment size. If provided, reads are shifted
                                appropriately.
                              If not provided, the shift is estimated from the
                                data.
-g, --gap <Integer>           Gap size to merge peaks (default: 5)
-k, --keep-dup                Keep duplicates
--labels <Path>               Labels BED file
-m, --model <Path>            Path to model file
-p, --peaks <Path>            Path to result peaks file in ENCODE broadPeak
                                (BED 6+3) format
-q, --quiet                   Turn off output
* -t, --treatment <Path>      ChIP-seq treatment file. bam, bed or .bed.gz file;
                              If multiple files are given, treated as
                                replicates.
--threads <Integer>           Parallelism level
-w, --workdir <Path>          Path to the working dir (default:
                                /gpfs/scratch/jduan9/SPAN_peak_calling)
dievsky commented 5 years ago

Have you tried deleting /SPAN_peak_calling/cache/coverage_input_MTD_0-2hr_1_sorted_removeDup_unique#2a3ba.npz and relaunching?

EllieDuan commented 5 years ago

Thank you for the suggestion! I use the same input file for 3 different IP files, so the input in cache/ folder caused this issue. I separated them in 3 working folders and them problem solved. Thank you very much!

dievsky commented 5 years ago

Glad I could help! It's hard to tell without more details, but I strongly believe that the problem you've encountered will be fixed in the upcoming release (0.11), and you will be able to just use the same file without making separate folders. I will link a corresponding issue from our internal repository here for my (and my colleagues') future reference.

dievsky commented 5 years ago

https://github.com/JetBrains-Research/epigenome/issues/1426