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
74 stars 19 forks source link

Error while using v1.6.0 #25

Closed X-human closed 1 year ago

X-human commented 4 years ago

I am a freshman to this software, please forgive me if i leave out some information while asking for help.

My command line is: R -e 'library("STITCH"); STITCH(chr="chr1", bamlist="bamlist.txt", sampleNames_file="samNameList.txt",posfile="chr1.pos.txt", genfile="chr1.gen.txt", outputdir="Output",tempdir="Output", K=40, nGen=2000, nCores=1,regionStart=1,regionEnd=5000000,buffer=250000,regenerateInput=TRUE,reference_haplotype_file="chr1.hap.gz",reference_legend_file="chr1.legend.gz",reference_sample_file="1000GP_Phase3.sample",reference_populations=c("CHB", "CHS", "CDX"))'

And the log is: [2019-08-29 12:27:53] Load and convert BAM 16600 of 16723 [2019-08-29 12:28:31] Load and convert BAM 16700 of 16723 [2019-08-29 12:28:39] Done generating inputs [2019-08-29 12:28:39] Copying files onto tempdir [2019-08-29 14:36:05] Done copying files onto tempdir [2019-08-29 14:36:05] Generate allele count [2019-08-29 15:01:10] Quantiles across SNPs of per-sample depth of coverage [2019-08-29 15:01:10] 5% 25% 50% 75% 95% [2019-08-29 15:01:10] 0.000 0.063 0.122 0.165 0.229 [2019-08-29 15:01:10] Done generating allele count [2019-08-29 15:01:10] Outputting will be done in 2 blocks with on average 8358.5 SNPs in them [2019-08-29 15:01:10] Begin parameter initialization [2019-08-29 15:01:10] Begin initializing paramters using reference haplotypes [2019-08-29 15:01:10] Begin get haplotypes from reference [2019-08-29 15:01:10] Load and validate reference legend header [2019-08-29 15:01:10] Load and validate reference legend [2019-08-29 15:01:10] Keeping 301 out of 2504 reference samples from populations:CHB,CHS,CDX [2019-08-29 15:01:11] Extract reference haplotypes [2019-08-29 15:01:11] In the region to be imputed plus buffer there are the following number of SNPs: [2019-08-29 15:01:11] 17550 from the posfile [2019-08-29 15:01:11] 17537 from the reference haplotypes [2019-08-29 15:01:11] 17537 in the intersection of the posfile and the reference haplotypes [2019-08-29 15:01:36] Load reference haplotypes [2019-08-29 15:01:40] Succesfully extracted 602 haplotypes from reference data [2019-08-29 15:01:40] End get haplotypes from reference [2019-08-29 15:01:40] The following correlations are observed between allele frequencies estimated from the sequencing pileup and the reference haplotype counts: [2019-08-29 15:01:40] 0.792 for all SNPs [2019-08-29 15:01:40] 0.922 for > 5% MAF SNPs [2019-08-29 15:01:40] 0.653 for < 5% MAF SNPs [2019-08-29 15:01:40] A plot of allele frequencies from sequencing pileup vs reference haplotype counts is at:/hwfssz5/ST_MCHRI/BIGDATA/USER/linlong/LongGang_Hospital_BigData/Imputation/Output/plots/alleleFrequency_pileup_vs_reference_haplotypes.chr1.1.5000000.png [2019-08-29 15:01:41] Begin convert reference haplotypes to internal input format [2019-08-29 15:02:24] End convert reference haplotypes to internal input format Error in rowSums(haps) : object 'haps' not found Calls: STITCH ... get_and_initialize_from_reference -> sample_haps_to_use -> rowSums -> is.data.frame Execution halted

Would you please tell me how to solve this problem?

rwdavies commented 4 years ago

This is my fault. I forgot to propagate a variable name change throughout the code and got caught on code that wasn't covered with tests

I think the offending line was this https://github.com/rwdavies/STITCH/blob/f101f626bad6a0468e26743c16d965035f9a4646/STITCH/R/reference.R#L926

Which is now https://github.com/rwdavies/STITCH/commit/fd8a2d48a87a1236674453ba8cd1d1a7ccb9caca

You can re-compile using ./scripts/build-and-install.R. I'm working on this part of the code currently in a branch, and will add tests to minimize the risk of something like this happening again. I'm hoping this is the only instance of this problem, but will know better once I've written some tests.

Thanks!

X-human commented 4 years ago

Actually, I have tried both ways recommended at the homepage to install STITCH in my computer environment, but no one succeeded. Somehow I made a combination as re-installing my R by miniconda and install STITCH by downloading the source code in tar.gz and then R CMD install it, and it seems work as the recommended test is passed. So what i am concerning here is can the updating process accomplished by re-downloading the source code and re-install it ?

rwdavies commented 4 years ago

Did the conda STITCH not work? Do you have any error messages?

As a super-hacky workaround until I upload a new version, you couldbe in your current environment where STITCH works in R (getting the compiled c++ code), then load in the R code on top of that using a cloned version of the repo, doing something like this https://github.com/rwdavies/STITCH/blob/master/STITCH/tests/testthat/test-acceptance-general.R#L3

X-human commented 4 years ago

I did not keep the installation log, but I remember the 'conda install' process is successful but when put in use: R -e 'library("STITCH")', it gave a error like 'can't find a file' which actually exists. Even when my combination worked, at my first run on the recommended test, it gave a error about rsync in a subdir of miniconda, after I muted the miniconda in the .bashrc to get the default rsync back did the test run successfully.

I am not well familiar with R, so I will try to see if I can fix as you guide.

Thanks

rwdavies commented 4 years ago

Hmm, weird about the rsync, it's specified for inclusion in the conda package. I vaguely remember having a similar problem lately though. If you ever have the time to recreate those problems, it would be great to see those logs.

Good luck, sorry about the bug, hope things run smoothly from now on

X-human commented 4 years ago

Error in getting the latest source. Ps: fd8a2d4 seems not in the release?

wget https://github.com/rwdavies/stitch/releases/download/1.6.2/STITCH_1.6.2.tar.gz --2019-09-02 09:11:22-- https://github.com/rwdavies/stitch/releases/download/1.6.2/STITCH_1.6.2.tar.gz Connecting to 10.53.15.246:3128... connected. Proxy request sent, awaiting response... 404 Not Found 2019-09-02 09:11:23 ERROR 404: Not Found.