rwdavies / STITCH

STITCH - Sequencing To Imputation Through Constructing Haplotypes
http://www.nature.com/ng/journal/v48/n8/abs/ng.3594.html
GNU General Public License v3.0
76 stars 17 forks source link

Error in validate_shuffleHaplotypeIterations #15

Open vigneshravi opened 5 years ago

vigneshravi commented 5 years ago

I am running into the following error: Any help understanding this and fixing will be of great help! Thanks

Version is STITCH_1.5.6

time ./STITCH.R --chr=chr19 --bamlist=bamlist.txt --posfile=pos.txt --genfile=gen.txt --outputdir=./ --K=4 --nGen=100 --nCores=1

[2019-04-16 15:51:46] Running STITCH(chr = chr19, nGen = 100, posfile = STITCH/examples/pos.txt, K = 4, outputdir = ./, tempdir = NA, bamlist = STITCH/examples/bamlist.txt, cramlist = , sampleNames_file = , reference = , genfile = STITCH/examples/gen.txt, method = diploid, output_format = bgvcf, B_bit_prob = 16, outputInputInVCFFormat = FALSE, downsampleToCov = 50, downsampleFraction = 1, readAware = TRUE, chrStart = NA, chrEnd = NA, regionStart = NA, regionEnd = NA, buffer = NA, maxDifferenceBetweenReads = 1000, maxEmissionMatrixDifference = 1e+10, alphaMatThreshold = 1e-04, emissionThreshold = 1e-04, iSizeUpperLimit = 600, bqFilter = 17, niterations = 40, shuffleHaplotypeIterations = c(4, 8, 12, 16), splitReadIterations = 25, nCores = 1, expRate = 0.5, maxRate = 100, minRate = 0.1, Jmax = 1000, regenerateInput = TRUE, originalRegionName = NA, keepInterimFiles = FALSE, keepTempDir = FALSE, outputHaplotypeProbabilities = FALSE, switchModelIteration = NA, generateInputOnly = FALSE, restartIterations = NA, refillIterations = c(6, 10, 14, 18), downsampleSamples = 1, downsampleSamplesKeepList = NA, subsetSNPsfile = NA, useSoftClippedBases = FALSE, outputBlockSize = 1000, outputSNPBlockSize = 10000, inputBundleBlockSize = NA, reference_haplotype_file = , reference_legend_file = , reference_sample_file = , reference_populations = NA, reference_phred = 20, reference_iterations = 10, reference_shuffleHaplotypeIterations = c(4, 8, 12, 16), output_filename = NULL, initial_min_hapProb = 0.4, initial_max_hapProb = 0.6, regenerateInputWithDefaultValues = FALSE, plotHapSumDuringIterations = FALSE, plot_shuffle_haplotype_attempts = FALSE, plotAfterImputation = TRUE, save_sampleReadsInfo = FALSE, gridWindowSize = NA, shuffle_bin_nSNPs = NULL, shuffle_bin_radius = 5000, keepSampleReadsInRAM = FALSE, useTempdirWhileWriting = FALSE, output_haplotype_dosages = FALSE)

Error in validate_shuffleHaplotypeIterations(reference_shuffleHaplotypeIterations, : The parameter niterations is set to 10 and shuffleHaplotypeIterations is set to c(4,8,12,16). shuffleHaplotypeIterations (trying to reshuffle the ancestral haplotypes to minimize switching among ancestral haplotypes in analyzed samples) has a small but beneficial improvement on imputation performance, but due to methods involve, will initially lead to a decrease in imputation performance for the next few EM iterations. Please set niterations > (max(shuffleHaplotypeIterations) + 4), or if you want to use a small number of iterations, it is recommended you disable shuffleHaplotypeIterations by setting this parameter equal to NA Calls: STITCH -> validate_shuffleHaplotypeIterations

rwdavies commented 5 years ago

Can you try version 1.5.7 and update the repo to the latest commit? reference_iterations should have a default value of 40, which is what STITCH.R shows in the github repo (and what I believe 1.5.6 and 1.5.7 have) (if you installed using conda, can you re-install to get 1.5.7)

vigneshravi commented 5 years ago

I am not using conda. Should I still try this with 1.5.7? Can I explicitly provide values through an argument?

rwdavies commented 5 years ago

You can, but shouldn't need to (if you wanted to, would be something like ./STITCH.R --chr=chr19 --bamlist=bamlist.txt --posfile=pos.txt --genfile=gen.txt --outputdir=./ --K=4 --nGen=100 --nCores=1 --reference_iterations=40) How about giving 1.5.7 a try, and making sure the repo is at the latest version (to get the latest "STITCH.R" file)

vigneshravi commented 5 years ago

Sure, I will try 1.5.7 and get back to you on this.

Thank you!

vigneshravi commented 5 years ago

Version 1.5.7 helped fix the previous error. Although there is a new one. I am using R3.5.3

Error in .External2(C_X11, paste0("jpeg::", quality, ":", filename), g$width, : unable to start device JPEG Calls: STITCH -> plotMetricsForPostImputationQC -> jpeg In addition: Warning message: In jpeg(file.path(outputdir, "plots", paste0("metricsForPostImputationQC.", : no jpeg support in this version of R Execution halted

rwdavies commented 5 years ago

Either 1) Try setting plotAfterImputation=FALSE to disable those plots 2) try installing using bioconda (I hope this works with conda??) 3) install different version of R / R dependencies to be able to run R and save jpegs