[med-svn] [Git][med-team/minimac4][upstream] New upstream version 4.0.3

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Sun Jun 26 12:21:52 BST 2022



Étienne Mollier pushed to branch upstream at Debian Med / minimac4


Commits:
0954910f by Étienne Mollier at 2022-06-25T20:37:41+02:00
New upstream version 4.0.3
- - - - -


6 changed files:

- CMakeLists.txt
- README.md
- requirements.txt
- src/Analysis.cpp
- src/DosageData.cpp
- src/MarkovModel.cpp


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -1,5 +1,9 @@
 cmake_minimum_required(VERSION 3.2)
-project(minimac4 VERSION 1.0.2)
+project(minimac4 VERSION 1.0.3)
+
+if(NOT CMAKE_BUILD_TYPE)
+    set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose build type (Debug|Release|RelWithDebInfo|MinSizeRel)" FORCE)
+endif()
 
 set(CMAKE_CXX_STANDARD 11)
 execute_process(COMMAND date OUTPUT_VARIABLE DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -15,8 +19,6 @@ if (OPENMP_FOUND)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
 endif()
 
-
-
 find_package(ZLIB REQUIRED)
 find_library(STATGEN_LIBRARY StatGen)
 add_executable(minimac4


=====================================
README.md
=====================================
@@ -33,25 +33,19 @@ pip install --user cget --ignore-installed six
 ```
 
 ## Installation
-The easiest way to install Minimac4 and its dependencies is to use the install.sh file provided.
-
-```
-cd Minimac4
-bash install.sh
-```
-
-Alternatively, you can use cget as follows:
+The easiest way to install Minimac4 and its dependencies is to use cget as follows:
 ```bash
 cget install --prefix <install_prefix> statgen/Minimac4
 ```
 
-Alternatively, you can setup a dev environment cmake directly.
+Alternatively, you can install manually:
 ```bash
 cd Minimac4
 cget install -f ./requirements.txt                      # Install dependencies locally.
 mkdir build && cd build                                 # Create out of source build directory.
 cmake -DCMAKE_TOOLCHAIN_FILE=../cget/cget/cget.cmake .. # Configure project with dependency paths.
 make                                                    # Build.
+make install                                            # Install
 ```
 
 


=====================================
requirements.txt
=====================================
@@ -1,2 +1,2 @@
-zlib,http://zlib.net/zlib-1.2.11.tar.gz
+zlib,https://zlib.net/fossils/zlib-1.2.11.tar.gz --hash md5:1c9f62f0778697a09d36121ead88e08e
 statgen/libStatGen --cmake dep/libstatgen.cmake


=====================================
src/Analysis.cpp
=====================================
@@ -57,11 +57,11 @@ bool Analysis::CreateRecombinationMap()
             denom += GeneticMapData[i][0] - GeneticMapData[i-1][0];
             num = referencePanel.VariantList[SecondIndex].bp - referencePanel.VariantList[SecondIndex-1].bp;
             Val += GeneticMapData[i][1];
-            referencePanel.Recom[SecondIndex-1]=(1-exp(-Val*num/denom/50))/2;
+//            referencePanel.Recom[SecondIndex-1]=(1-exp(-Val*num/denom/50))/2;
             if(num==0  || Val==0)
                 referencePanel.Recom[SecondIndex-1]=RECOM_MIN;
             else
-                referencePanel.Recom[SecondIndex-1]=max(RECOM_MIN,Val*num/denom);
+                referencePanel.Recom[SecondIndex-1]=max(RECOM_MIN, 0.01*Val*num/denom);
 
 //            cout<<" RECOM = "<<SecondIndex-1<<"\t"<<referencePanel.Recom[SecondIndex-1]<<"\t"<<num/denom<<"\t"<<Val*num/denom<<endl;
             SecondIndex++;
@@ -430,6 +430,11 @@ void Analysis::AppendtoMainVcfFaster(int ChunkNo, int MaxIndex)
         tempFileIndex+=(".chunk."+(string)(strs1.str())+".dose.part." +
                          (string)(strs.str())+".vcf.gz");
         vcfdosepartialList[i-1] = ifopen(tempFileIndex.c_str(), "r");
+        if (!vcfdosepartialList[i-1])
+        {
+            std::cout << "Error: Could not open temporary file. Ensure that `ulimit -n` is at least greater than " << (MaxIndex + 5) << "." << std::endl;
+            exit(-1);
+        }
     }
     string line;
     int i=0;
@@ -953,7 +958,7 @@ bool Analysis::OpenStreamOutputFiles()
         ifprintf(vcfLoodosepartial,"##contig=<ID=%s>\n",referencePanel.finChromosome.c_str());
         ifprintf(vcfLoodosepartial,"##INFO=<ID=TYPED,Number=0,Type=Flag,Description=\"Marker was genotyped AND imputed\">\n");
         ifprintf(vcfLoodosepartial,"##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotyped alleles from Array\">\n");
-        ifprintf(vcfLoodosepartial,"##FORMAT=<ID=LDS,Number=1,Type=String,Description=\"Leave-one-out Imputed Dosage : Estimated Haploid Alternate Allele Dosage assuming site was NOT genotyped \">\n");
+        ifprintf(vcfLoodosepartial,"##FORMAT=<ID=LDS,Number=2,Type=Float,Description=\"Leave-one-out Imputed Dosage : Estimated Haploid Alternate Allele Dosage assuming site was NOT genotyped \">\n");
         ifprintf(vcfLoodosepartial,"##minimac4_Command=%s\n",MyAllVariables->myOutFormat.CommandLine.c_str());
         ifprintf(vcfLoodosepartial,"#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT");
 


=====================================
src/DosageData.cpp
=====================================
@@ -297,7 +297,7 @@ void DosageData::PrintDiploidLooDosage(float &x, float &y, AlleleType a, AlleleT
     PrintEmpStringLength+=sprintf(PrintEmpStringPointer+PrintEmpStringLength,"\t");
     PrintEmpStringLength+=sprintf(PrintEmpStringPointer+PrintEmpStringLength,"%c|%c",a,b);
     PrintEmpStringLength+=sprintf(PrintEmpStringPointer+PrintEmpStringLength,":");
-    PrintEmpStringLength+=sprintf(PrintEmpStringPointer+PrintEmpStringLength,"%.3f|%.3f",x , y);
+    PrintEmpStringLength+=sprintf(PrintEmpStringPointer+PrintEmpStringLength,"%.3f,%.3f",x , y);
 }
 
 
@@ -342,7 +342,7 @@ void DosageData::PrintDosageForVcfOutputForID(int MarkerIndex)
                  if( tHapFull->MissingSampleUnscaffolded[gwasHapIndex][TypedMarkerIndex] =='1'
                      || tHapFull->MissingSampleUnscaffolded[gwasHapIndex+1][TypedMarkerIndex]=='1')
                  {
-                     PrintEmpStringLength+=sprintf(PrintEmpStringPointer+PrintEmpStringLength,"\t.|.:.|.");
+                     PrintEmpStringLength+=sprintf(PrintEmpStringPointer+PrintEmpStringLength,"\t.|.:.,.");
                  }
                  else
                  {


=====================================
src/MarkovModel.cpp
=====================================
@@ -661,11 +661,11 @@ void MarkovModel::unfoldProbabilitiesWithThreshold(int bridgeIndex,
         tempInvCardinality=thisInfo.InvuniqueCardinality[i];
 
         temp=LeftNoRecomProb[i];
-        LeftAdj_Rec[i] = (LeftTotalProb[i] - temp ) * tempInvCardinality;
+        LeftAdj_Rec[i] = std::max(LeftTotalProb[i] - temp, 0.) * tempInvCardinality;
         LeftAdj_NoRrec[i] = temp / (PrevLeftFoldedProb[i]+1e-30);
 
         temp=RightNoRecomProb[i];
-        RightAdj_Rec[i] = (RightTotalProb[i] - temp )  * tempInvCardinality;
+        RightAdj_Rec[i] = std::max(RightTotalProb[i] - temp, 0.)  * tempInvCardinality;
         RightAdj_NoRec[i] = RightNoRecomProb[i] / (PrevRightFoldedProb[i]+1e-30);
     }
 
@@ -682,6 +682,7 @@ void MarkovModel::unfoldProbabilitiesWithThreshold(int bridgeIndex,
             UnMappedIndex=thisInfo.uniqueIndexReverseMaps[i][K];
             probHapFullAverage[UnMappedIndex]=(LeftAdj_Rec[i] + LeftAdj_NoRrec[i]*LeftPrev[UnMappedIndex])
                                                * (RightAdj_Rec[i] + RightAdj_NoRec[i]*RightPrev[UnMappedIndex]);
+            assert(probHapFullAverage[UnMappedIndex] >= 0.);
             BestMatchFullRefHaps[NoBestMatchFullRefHaps++]=UnMappedIndex;
         }
     }
@@ -704,6 +705,7 @@ void MarkovModel::FoldBackProbabilitiesWithThreshold(ReducedHaplotypeInfo &Info)
         MappedIndex=Info.uniqueIndexMap[UnMappedIndex];
         FinalBestMatchfHapsIndicator[MappedIndex]=1;
         FoldedProbValue[MappedIndex]+=probHapFullAverage[UnMappedIndex];
+        assert(FoldedProbValue[MappedIndex] >= 0.);
     }
 
     for (int i=0; i<rHapFull->maxRepSize; i++)



View it on GitLab: https://salsa.debian.org/med-team/minimac4/-/commit/0954910f724bcaf0135ce7bfcbda80486b17e29a

-- 
View it on GitLab: https://salsa.debian.org/med-team/minimac4/-/commit/0954910f724bcaf0135ce7bfcbda80486b17e29a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220626/3dbfa798/attachment-0001.htm>


More information about the debian-med-commit mailing list