From 2be47160c230fa56c57f79990061a05ebe1c4c93 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Mon, 4 Nov 2019 07:30:28 +0000 Subject: [PATCH 1/8] rename output --- DEploid.wiki | 2 +- docs/FAQ.md | 4 +- docs/{output.rst => Output.md} | 80 +++++++++++++++++----------------- docs/_build/man/dEploid.1 | 6 ++- docs/index.rst | 3 +- 5 files changed, 48 insertions(+), 47 deletions(-) rename docs/{output.rst => Output.md} (60%) diff --git a/DEploid.wiki b/DEploid.wiki index 36d30258..8d33b672 160000 --- a/DEploid.wiki +++ b/DEploid.wiki @@ -1 +1 @@ -Subproject commit 36d302583a922b7da8afd9f71091c65c8e7f0591 +Subproject commit 8d33b67205aac5efea0829a0fcbb00540662ac6a diff --git a/docs/FAQ.md b/docs/FAQ.md index c311c38f..1fcfb1f2 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -126,4 +126,6 @@ utilities/interpretDEploid.r -vcf data/exampleData/PG0400-C.eg.vcf.gz \ Benchmark --------- -Please refer to our paper [Zhu et.al (2017)](https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/btx530/4091117) section [3 Validation and performance](https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/btx530/4091117#96977811). +Please refer to our paper [Zhu et.al (2017)](https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/btx530/4091117) section [3 Validation and performance](https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/btx530/4091117#96977811) for benchmarking inference results on number of strains, proportions and haplotype quality. + +For the enhanced version -- DEploid-IBD, we compared our results against [Zhu et.al (2017)](https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/btx530/4091117), and conducted more experiments and validations [Zhu et.al (2019)](https://elifesciences.org/articles/40845#s2). diff --git a/docs/output.rst b/docs/Output.md similarity index 60% rename from docs/output.rst rename to docs/Output.md index c88cd283..7e68a4cf 100644 --- a/docs/output.rst +++ b/docs/Output.md @@ -1,45 +1,44 @@ -.. _sec-output: - -========================== Making sense of the output ========================== -************ Output files -************ +------------ ``dEploid`` outputs text files with user-specified prefix with flag **-o**. -*prefix*.log - Log file records ``dEploid`` version, input file paths, parameter used and proportion estimates at the final iteration. +***prefix*****.log** -*prefix*.llk - Log likelihood of the MCMC chain. +Log file records ``dEploid`` version, input file paths, parameter used and proportion estimates at the final iteration. -*prefix*.prop - MCMC updates of the proportion estimates. +***prefix*****.llk** -*prefix*.hap - Haplotypes at the final iteration in plain text file. +Log likelihood of the MCMC chain. -*prefix*.vcf - When flag ``-vcfOut`` is turned on, haplotypes are saved at the final iteration in VCF format. +***prefix*****.prop** -*prefix*.single[i] - When flag ``-exportPostProb`` is turned on, posterior probabilities of the final iteration of strain [i]. +MCMC updates of the proportion estimates. +***prefix*****.hap** -****************************** -Example of output interpretion -****************************** +Haplotypes at the final iteration in plain text file. + +***prefix*****.vcf** + +When flag ``-vcfOut`` is turned on, haplotypes are saved at the final iteration in VCF format. +***prefix*****.single[i]** + +When flag ``-exportPostProb`` is turned on, posterior probabilities of the final iteration of strain [i]. + + +Example of output interpretion +------------------------------ -Example 1. Standard deconvolution output -**************************************** +### Example 1. Standard deconvolution output -:: +```bash $ ./dEploid -vcf data/exampleData/PG0390-C.eg.vcf.gz \ -plaf data/exampleData/labStrains.eg.PLAF.txt \ -noPanel -o PG0390-CNopanel -seed 1 @@ -48,9 +47,11 @@ Example 1. Standard deconvolution output -dEprefix PG0390-CNopanel \ -o PG0390-CNopanel -ring -.. image:: _static/PG0390-CNopanel.interpretDEploidFigure.1.png - :width: 1024px - :alt: interpretDEploidFigure.1 +``` + +![interpretDEploidFigure.1](_static/PG0390-CNopanel.interpretDEploidFigure.1.png "Output figure 1") + + The top three figures are the same as figures show in :ref:`data example `, with a small addition of inferred WSAF marked in blue, in the top right figure. @@ -58,20 +59,19 @@ The top three figures are the same as figures show in :ref:`data example Date: Sat, 16 Nov 2019 02:43:57 +0000 Subject: [PATCH 2/8] update doc --- Makefile.am | 4 +- configure.ac | 1 + docs/Output.md | 11 ++++- docs/_build/man/dEploid.1 | 100 +++++++++++++++++++++++--------------- 4 files changed, 74 insertions(+), 42 deletions(-) diff --git a/Makefile.am b/Makefile.am index 7386da5d..f675becd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -87,7 +87,7 @@ clean-local: clean-local-check clean-local-check: -rm -rf src/*.gc* tests/unittest/*.gc* src/*.gcov -utilities: utilities/dataExplore.r utilities/interpretDEploid.r +utilities_SOURCES = utilities/dataExplore.r utilities/interpretDEploid.r +utilities: sed -i'.bak' -e '/#!\/usr\/bin\/env Rscript/d' -e '/rm(list=ls())/d' utilities/dataExplore.r ; echo "#!/usr/bin/env Rscript" > tmpTxt; echo "rm(list=ls()); dEploidRootDir=\"$(PWD)\"" >> tmpTxt ; cat utilities/dataExplore.r >> tmpTxt ; mv tmpTxt utilities/dataExplore.r; chmod a+x utilities/dataExplore.r; sed -i'.bak' -e '/#!\/usr\/bin\/env Rscript/d' -e '/rm(list=ls())/d' utilities/interpretDEploid.r; echo "#!/usr/bin/env Rscript" > tmpTxt; echo "rm(list=ls()); dEploidRootDir=\"$(PWD)\"" >> tmpTxt ; cat utilities/interpretDEploid.r >> tmpTxt ; mv tmpTxt utilities/interpretDEploid.r; chmod a+x utilities/interpretDEploid.r - diff --git a/configure.ac b/configure.ac index 43ad45b8..d87fdcd8 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,7 @@ AM_SILENT_RULES([yes]) AC_PROG_INSTALL AC_PREREQ AC_CANONICAL_HOST +AC_PROG_F77 # Checks for programs. AC_PROG_RANLIB diff --git a/docs/Output.md b/docs/Output.md index 7e68a4cf..ebcaa15f 100644 --- a/docs/Output.md +++ b/docs/Output.md @@ -31,8 +31,17 @@ When flag ``-vcfOut`` is turned on, haplotypes are saved at the final iteration When flag ``-exportPostProb`` is turned on, posterior probabilities of the final iteration of strain [i]. +### DEploid-IBD -Example of output interpretion +When "flag" ``-ibd`` is used. 'DEploid' executes first learns the number of strain and their proportions with an identity by descent model ('DEploid-IBD'). Then it fixes the number of strains and proportions and train the haplotypes, and train the haplotypes using the original DEploid algorithm ('DEploid-classic'). The staged output are labelled with ".ibd" and ".classic" respectively, and followed by the prefix. + + +### DEploid-BEST + +When "flag" ``-best`` is used. 'DEploid-BEST' executes the deconvolution algorithms in an optimised sequence to best report the number of strains, proportions and haplotypes. The program ('DEploid-Lasso') learns the number of strain with optimised reference panel; ".chooseK" is appended to the prefix for these output (NOTE: likelihood is not tracked in this case). It ('DEploid-IBD') then fixes the number of strains and tune the strain proportions with an identity by descent model; ".ibd" is appended to the prefix for these output. Finally, the program ('DEploid-Lasso') fixes the number of strains and proportions, and uses the optimised reference panel again to train and report the haplotypes; ".final" is appended to the prefix for these output. When ``-vcfOut`` and ``-exportPostProb`` are applied, these outputs will only associate with the final haplotypes. + + +Example of output interpretation ------------------------------ ### Example 1. Standard deconvolution output diff --git a/docs/_build/man/dEploid.1 b/docs/_build/man/dEploid.1 index 44d5aa7a..de0f017d 100644 --- a/docs/_build/man/dEploid.1 +++ b/docs/_build/man/dEploid.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "DEPLOID" "1" "Nov 03, 2019" "v0.6-beta" "DEploid" +.TH "DEPLOID" "1" "Nov 16, 2019" "v0.6-beta" "DEploid" .SH NAME dEploid \- . @@ -559,48 +559,62 @@ Figure on the right show allele frequency within sample, compare against the pop .SS Output files .sp \fBdEploid\fP outputs text files with user\-specified prefix with flag \fB\-o\fP\&. -.INDENT 0.0 -.TP -.B \fIprefix\fP\&.log +.sp +\fB\fIprefix\fP\fP\fB\&.log\fP +.sp Log file records \fBdEploid\fP version, input file paths, parameter used and proportion estimates at the final iteration. -.TP -.B \fIprefix\fP\&.llk +.sp +\fB\fIprefix\fP\fP\fB\&.llk\fP +.sp Log likelihood of the MCMC chain. -.TP -.B \fIprefix\fP\&.prop +.sp +\fB\fIprefix\fP\fP\fB\&.prop\fP +.sp MCMC updates of the proportion estimates. -.TP -.B \fIprefix\fP\&.hap +.sp +\fB\fIprefix\fP\fP\fB\&.hap\fP +.sp Haplotypes at the final iteration in plain text file. -.TP -.B \fIprefix\fP\&.vcf +.sp +\fB\fIprefix\fP\fP\fB\&.vcf\fP +.sp When flag \fB\-vcfOut\fP is turned on, haplotypes are saved at the final iteration in VCF format. -.TP -.B \fIprefix\fP\&.single[i] -When flag \fB\-exportPostProb\fP is turned on, posterior probabilities of the final iteration of strain [i]. -.UNINDENT -.SS Example of output interpretion +.sp +\fB\fIprefix\fP\fP\fB\&.single[i]\fP +.sp +When flag \fB\-exportPostProb\fP is turned on, posterior probabilities of the final iteration of strain [i]\&. +.SS DEploid\-IBD +.sp +When "flag" \fB\-ibd\fP is used. \(aqDEploid\(aq executes first learns the number of strain and their proportions with an identity by descent model (\(aqDEploid\-IBD\(aq). Then it fixes the number of strains and proportions and train the haplotypes, and train the haplotypes using the original DEploid algorithm (\(aqDEploid\-classic\(aq). The staged output are labelled with ".ibd" and ".classic" respectively, and followed by the prefix. +.SS DEploid\-BEST +.sp +When "flag" \fB\-best\fP is used. \(aqDEploid\-BEST\(aq executes the deconvolution algorithms in an optimised sequence to best report the number of strains, proportions and haplotypes. The program (\(aqDEploid\-Lasso\(aq) learns the number of strain with optimised reference panel; ".chooseK" is appended to the prefix for these output (NOTE: likelihood is not tracked in this case). It (\(aqDEploid\-IBD\(aq) then fixes the number of strains and tune the strain proportions with an identity by descent model; ".ibd" is appended to the prefix for these output. Finally, the program (\(aqDEploid\-Lasso\(aq) fixes the number of strains and proportions, and uses the optimised reference panel again to train and report the haplotypes; ".final" is appended to the prefix for these output. When \fB\-vcfOut\fP and \fB\-exportPostProb\fP are applied, these outputs will only associate with the final haplotypes. +.SS Example of output interpretation .SS Example 1. Standard deconvolution output .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C -$ ./dEploid \-vcf data/exampleData/PG0390\-C.eg.vcf.gz \e -\-plaf data/exampleData/labStrains.eg.PLAF.txt \e -\-noPanel \-o PG0390\-CNopanel \-seed 1 -$ utilities/interpretDEploid.r \-vcf data/exampleData/PG0390\-C.eg.vcf.gz \e -\-plaf data/exampleData/labStrains.eg.PLAF.txt \e -\-dEprefix PG0390\-CNopanel \e -\-o PG0390\-CNopanel \-ring + $ ./dEploid \-vcf data/exampleData/PG0390\-C.eg.vcf.gz \e + \-plaf data/exampleData/labStrains.eg.PLAF.txt \e + \-noPanel \-o PG0390\-CNopanel \-seed 1 + $ utilities/interpretDEploid.r \-vcf data/exampleData/PG0390\-C.eg.vcf.gz \e + \-plaf data/exampleData/labStrains.eg.PLAF.txt \e + \-dEprefix PG0390\-CNopanel \e + \-o PG0390\-CNopanel \-ring + + .ft P .fi .UNINDENT .UNINDENT +.sp [image: interpretDEploidFigure.1] [image] + .sp -The top three figures are the same as figures show in data example, with a small addition of inferred WSAF marked in blue, in the top right figure. +The top three figures are the same as figures show in :ref:\fBdata example \fP, with a small addition of inferred WSAF marked in blue, in the top right figure. .INDENT 0.0 .IP \(bu 2 The bottom left figure show the relative proportion change history of the MCMC chain. @@ -609,8 +623,10 @@ The middle figure show the correlation between the expected and observed allele .IP \(bu 2 The right figure shows changes in MCMC likelihood . .UNINDENT +.sp [image: interpretDEploidFigure.2] [image] + .sp This panel figure shows all allele frequencies within sample across all 14 chromosomes. Expected and observed WSAF are marked in blue and red respectively. .SS Example 2. Haplotype painting from a given panel @@ -621,31 +637,37 @@ This panel figure shows all allele frequencies within sample across all 14 chrom .sp .nf .ft C -$ ./dEploid \-vcf data/exampleData/PG0390\-C.eg.vcf.gz \e -\-plaf data/exampleData/labStrains.eg.PLAF.txt \e -\-panel data/exampleData/labStrains.eg.panel.txt \e -\-o PG0390\-CPanel \-seed 1 \-k 3 -$ ./dEploid \-vcf data/exampleData/PG0390\-C.eg.vcf.gz \e -\-plaf data/exampleData/labStrains.eg.PLAF.txt \e -\-panel data/exampleData/labStrains.eg.panel.txt \e -\-o PG0390\-CPanel \e -\-painting PG0390\-CPanel.hap \e -\-initialP 0.8 0 0.2 \-k 3 -$ utilities/interpretDEploid.r \-vcf data/exampleData/PG0390\-C.eg.vcf.gz \e -\-plaf data/exampleData/labStrains.eg.PLAF.txt \e -\-dEprefix PG0390\-CPanel \e -\-o PG0390\-CPanel \-ring + $ ./dEploid \-vcf data/exampleData/PG0390\-C.eg.vcf.gz \e + \-plaf data/exampleData/labStrains.eg.PLAF.txt \e + \-panel data/exampleData/labStrains.eg.panel.txt \e + \-o PG0390\-CPanel \-seed 1 \-k 3 + $ ./dEploid \-vcf data/exampleData/PG0390\-C.eg.vcf.gz \e + \-plaf data/exampleData/labStrains.eg.PLAF.txt \e + \-panel data/exampleData/labStrains.eg.panel.txt \e + \-o PG0390\-CPanel \e + \-painting PG0390\-CPanel.hap \e + \-initialP 0.8 0 0.2 \-k 3 + $ utilities/interpretDEploid.r \-vcf data/exampleData/PG0390\-C.eg.vcf.gz \e + \-plaf data/exampleData/labStrains.eg.PLAF.txt \e + \-dEprefix PG0390\-CPanel \e + \-o PG0390\-CPanel \-ring + + .ft P .fi .UNINDENT .UNINDENT +.sp [image: PG0390fwdBwdRing] [image] + .SS Example 3. Deconvolution followed by IBD painting .sp In addition to lab mixed samples, here we show example of \fBdEploid\fP deconvolute field sample PD0577\-C. +.sp [image: PD0577inbreeding] [image] + .SH PF3K WORKFLOW .sp Our main work flow consist with three steps: From d467e4ec036d320c8f2339d9ad36ed403264566b Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Sun, 17 Nov 2019 19:34:40 +0000 Subject: [PATCH 3/8] no need fortan --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index d87fdcd8..43ad45b8 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,6 @@ AM_SILENT_RULES([yes]) AC_PROG_INSTALL AC_PREREQ AC_CANONICAL_HOST -AC_PROG_F77 # Checks for programs. AC_PROG_RANLIB From e72ecbbcb0f7a551ca12ff01c3eb5201c3f7cbf5 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Sun, 17 Nov 2019 22:53:27 +0000 Subject: [PATCH 4/8] rework on bin programs definitions --- Makefile.am | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index f675becd..6ecf8991 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,7 @@ EXTRA_DIST = bootstrap \ COMPILEDATE = $(shell date -u | sed -e "s/ /-/g") distdir = $(PACKAGE)-$(VERSION) -bin_PROGRAMS = dEploid dEploid_dbg utilities +bin_PROGRAMS = dEploid dEploid_dbg man1_MANS = docs/_build/man/dEploid.1 @@ -87,7 +87,6 @@ clean-local: clean-local-check clean-local-check: -rm -rf src/*.gc* tests/unittest/*.gc* src/*.gcov -utilities_SOURCES = utilities/dataExplore.r utilities/interpretDEploid.r -utilities: +utilities: utilities/dataExplore.r utilities/interpretDEploid.r sed -i'.bak' -e '/#!\/usr\/bin\/env Rscript/d' -e '/rm(list=ls())/d' utilities/dataExplore.r ; echo "#!/usr/bin/env Rscript" > tmpTxt; echo "rm(list=ls()); dEploidRootDir=\"$(PWD)\"" >> tmpTxt ; cat utilities/dataExplore.r >> tmpTxt ; mv tmpTxt utilities/dataExplore.r; chmod a+x utilities/dataExplore.r; sed -i'.bak' -e '/#!\/usr\/bin\/env Rscript/d' -e '/rm(list=ls())/d' utilities/interpretDEploid.r; echo "#!/usr/bin/env Rscript" > tmpTxt; echo "rm(list=ls()); dEploidRootDir=\"$(PWD)\"" >> tmpTxt ; cat utilities/interpretDEploid.r >> tmpTxt ; mv tmpTxt utilities/interpretDEploid.r; chmod a+x utilities/interpretDEploid.r From 8776183caa2c441ba21aac8193ac6b2c59ab18af Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Sun, 17 Nov 2019 23:34:06 +0000 Subject: [PATCH 5/8] output final hap vcf --- src/dEploid.cpp | 1 + src/dEploidIO.hpp | 3 ++- src/export/writeMcmcRelated.cpp | 19 ++++++++++--------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/dEploid.cpp b/src/dEploid.cpp index e046c10e..a993f4b7 100644 --- a/src/dEploid.cpp +++ b/src/dEploid.cpp @@ -240,6 +240,7 @@ int main(int argc, char *argv[]) { dEploidIO.paintIBD(); dEploidIO.writeHap(hap, "final"); + dEploidIO.writeVcf(hap, dEploidLassoIO.initialProp, "final"); } else { // classic version, and DEploid-IBD if (dEploidIO.useIBD()) { // ibd McmcSample * ibdMcmcSample = new McmcSample(); diff --git a/src/dEploidIO.hpp b/src/dEploidIO.hpp index 0dffe651..47b14468 100644 --- a/src/dEploidIO.hpp +++ b/src/dEploidIO.hpp @@ -115,6 +115,8 @@ class DEploidIO{ vector < vector > lassoAltCount; void writeHap (vector < vector > &hap, string jobbrief); + void writeVcf (vector < vector > &hap, + vector &prop, string jobbrief); bool doPrintLassoPanel_; // Trimming related @@ -370,7 +372,6 @@ class DEploidIO{ void writeLLK (McmcSample * mcmcSample, string jobbrief); void writeProp (McmcSample * mcmcSample, string jobbrief); - void writeVcf (McmcSample * mcmcSample, string jobbrief); void writeLastSingleFwdProb( vector < vector >& probabilities, size_t chromIndex, size_t strainIndex, bool useIBD ); void writeLastPairFwdProb( UpdatePairHap & updatePair, size_t chromIndex ); void writeLog (ostream * writeTo ); diff --git a/src/export/writeMcmcRelated.cpp b/src/export/writeMcmcRelated.cpp index 6d2e718a..55bbad24 100644 --- a/src/export/writeMcmcRelated.cpp +++ b/src/export/writeMcmcRelated.cpp @@ -32,7 +32,7 @@ void DEploidIO::writeMcmcRelated (McmcSample * mcmcSample, string jobbrief, bool this->writeHap(mcmcSample->hap, jobbrief); if ( useIBD == false ){ - this->writeVcf(mcmcSample, jobbrief); + this->writeVcf(mcmcSample->hap, mcmcSample->proportion.back(), jobbrief); this->siteOfTwoSwitchOne = mcmcSample->siteOfTwoSwitchOne; this->siteOfTwoMissCopyOne = mcmcSample->siteOfTwoMissCopyOne; this->siteOfTwoSwitchTwo = mcmcSample->siteOfTwoSwitchTwo; @@ -139,7 +139,9 @@ void DEploidIO::writePanel(Panel *panel, size_t chromI, vector hdr){ -void DEploidIO::writeVcf(McmcSample * mcmcSample, string jobbrief){ +void DEploidIO::writeVcf(vector < vector > &hap, + vector &prop, + string jobbrief){ if ( !doExportVcf() ) return; this->strExportVcf = this->prefix_ + "." + jobbrief + ".vcf"; @@ -174,11 +176,11 @@ void DEploidIO::writeVcf(McmcSample * mcmcSample, string jobbrief){ (*writeTo) << endl; // Include proportions - for ( size_t ii = 0; ii < kStrain_; ii++){ + for ( size_t ii = 0; ii < prop.size(); ii++){ (*writeTo) << "##Proportion of strain " << ( this->useVcf() ? this->vcfReaderPtr_->sampleName : "h" ) << "." << (ii+1) - << "=" << mcmcSample->proportion.back()[ii] << endl; + << "=" << prop[ii] << endl; } // HEADER @@ -222,19 +224,18 @@ void DEploidIO::writeVcf(McmcSample * mcmcSample, string jobbrief){ << "GT" << "\t"; } - for ( size_t ii = 0; ii < mcmcSample->hap[siteIndex].size(); ii++){ - (*writeTo) << mcmcSample->hap[siteIndex][ii]; - (*writeTo) << ((ii < (mcmcSample->hap[siteIndex].size()-1)) ? "\t" : "\n") ; + for ( size_t ii = 0; ii < hap[siteIndex].size(); ii++){ + (*writeTo) << hap[siteIndex][ii]; + (*writeTo) << ((ii < (hap[siteIndex].size()-1)) ? "\t" : "\n") ; } siteIndex++; } } - assert ( siteIndex == mcmcSample->hap.size()); + assert ( siteIndex == hap.size()); if ( compressVcf() ){ ogstreamExport.close(); } else { ofstreamExportTmp.close(); } } - From bfa965de045dc05c7d0e1973d080cd53abfbe2dd Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Mon, 18 Nov 2019 00:20:16 +0000 Subject: [PATCH 6/8] fixing #314 --- docs/Output.md | 2 +- src/dEploid.cpp | 2 +- src/export/dEploidIOExport.cpp | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/Output.md b/docs/Output.md index ebcaa15f..204d3f45 100644 --- a/docs/Output.md +++ b/docs/Output.md @@ -38,7 +38,7 @@ When "flag" ``-ibd`` is used. 'DEploid' executes first learns the number of stra ### DEploid-BEST -When "flag" ``-best`` is used. 'DEploid-BEST' executes the deconvolution algorithms in an optimised sequence to best report the number of strains, proportions and haplotypes. The program ('DEploid-Lasso') learns the number of strain with optimised reference panel; ".chooseK" is appended to the prefix for these output (NOTE: likelihood is not tracked in this case). It ('DEploid-IBD') then fixes the number of strains and tune the strain proportions with an identity by descent model; ".ibd" is appended to the prefix for these output. Finally, the program ('DEploid-Lasso') fixes the number of strains and proportions, and uses the optimised reference panel again to train and report the haplotypes; ".final" is appended to the prefix for these output. When ``-vcfOut`` and ``-exportPostProb`` are applied, these outputs will only associate with the final haplotypes. +When "flag" ``-best`` is used. 'DEploid-BEST' executes the deconvolution algorithms in an optimised sequence to best report the number of strains, proportions and haplotypes. The program ('DEploid-Lasso') learns the number of strain with optimised reference panel; ".chooseK" is appended to the prefix for these output (NOTE: likelihood is not tracked in this case). It ('DEploid-IBD') then fixes the number of strains and tune the strain proportions with an identity by descent model; ".ibd" is appended to the prefix for these output. Finally, the program ('DEploid-Lasso') fixes the number of strains and proportions, and uses the optimised reference panel again to train and report the haplotypes; ".final" is appended to the prefix for these output. When ``-vcfOut`` is applied, this will only be the final haplotypes. Example of output interpretation diff --git a/src/dEploid.cpp b/src/dEploid.cpp index a993f4b7..34da9ebb 100644 --- a/src/dEploid.cpp +++ b/src/dEploid.cpp @@ -251,7 +251,7 @@ int main(int argc, char *argv[]) { dEploidIO.panel, &dEploidIO, "DEploid-IBD", - "DEploid-IBD", + "ibd", ibdMcmcSample, &ibdRg, true); diff --git a/src/export/dEploidIOExport.cpp b/src/export/dEploidIOExport.cpp index ccb779c6..8b6912b2 100644 --- a/src/export/dEploidIOExport.cpp +++ b/src/export/dEploidIOExport.cpp @@ -183,6 +183,17 @@ void DEploidIO::writeLog ( ostream * writeTo ){ (*writeTo) << setw(14) << "Likelihood: " << this->prefix_ << ".*.llk\n"; (*writeTo) << setw(14) << "Proportions: " << this->prefix_ << ".*.prop\n"; (*writeTo) << setw(14) << "Haplotypes: " << this->prefix_ << ".*.hap\n"; + } else if(this->useBestPractice()){ + (*writeTo) << setw(14) << "ChooseK Haps: " << this->prefix_ << ".chooseK.hap\n"; + (*writeTo) << setw(14) << "IBD Haps: " << this->prefix_ << ".ibd.hap\n"; + (*writeTo) << setw(14) << "Final Haps: " << this->prefix_ << ".final.hap\n"; + (*writeTo) << setw(14) << "IBD llks: " << this->prefix_ << ".ibd.llk\n"; + (*writeTo) << setw(14) << "Proportions: " << this->prefix_ << ".chooseK.prop\n"; + (*writeTo) << setw(14) << "IBD props: " << this->prefix_ << ".ibd.prop\n"; + } else { + (*writeTo) << setw(14) << "Likelihood: " << this->prefix_ << ".llk\n"; + (*writeTo) << setw(14) << "Proportions: " << this->prefix_ << ".prop\n"; + (*writeTo) << setw(14) << "Haplotypes: " << this->prefix_ << ".hap\n"; } if (this->ibdProbsIntegrated.size()>1){ (*writeTo) << setw(14) << "IBD probs: " << strIbdExportProbs << "\n\n"; From fef5429a426f50b5d5e60e681a07e40286bd1b47 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Mon, 18 Nov 2019 00:22:10 +0000 Subject: [PATCH 7/8] updaet wiki --- DEploid.wiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEploid.wiki b/DEploid.wiki index 8d33b672..b85e517a 160000 --- a/DEploid.wiki +++ b/DEploid.wiki @@ -1 +1 @@ -Subproject commit 8d33b67205aac5efea0829a0fcbb00540662ac6a +Subproject commit b85e517a788d9f9f751d99abe433b74e7ba97726 From 3aebb03e21fb33fdc3b2bea977b40fa54c53a4ac Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Mon, 18 Nov 2019 00:34:34 +0000 Subject: [PATCH 8/8] update submodule --- DEploid.wiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEploid.wiki b/DEploid.wiki index b85e517a..96bfded4 160000 --- a/DEploid.wiki +++ b/DEploid.wiki @@ -1 +1 @@ -Subproject commit b85e517a788d9f9f751d99abe433b74e7ba97726 +Subproject commit 96bfded4a424d743abb9a3de53aee159c7ab70fe