gkichaev / PAINTOR_V3.0

Fast, integrative fine mapping with functional data
55 stars 21 forks source link

terminate called after throwing an instance of 'std::invalid_argument' what(): stod #41

Open YaoXueming opened 5 years ago

YaoXueming commented 5 years ago

hi,everyone,

I used the PAINTOR for fine mapping. But it came out a error. here is the log file.

[jli01@ln3%tianhe PAINTOR_V3.0-master]$ ./PAINTOR -input /vol6/home/jli01/yao/finemap/neuro-new-locus/locus.input -in /vol6/home/jli01/yao/finemap/neuro-new-locus/ -Zhead ZSCORE -LDname ld -out /vol6/home/jli01/yao/finemap/neuro-new-locus/ -enumerate 1 -annotations fBrain-DS11872.hotspot.twopass.fdr0.05.merge.bed Running PAINTOR with full enumeration Maximum number of causals per locus: 1 Proportion of LD variance kept when performing truncated SVD for estimating N*h2g: 0.95 Model annotations: fBrain-DS11872.hotspot.twopass.fdr0.05.merge.bed


Reading in files for: locus1.1 terminate called after throwing an instance of 'std::invalid_argument' what(): stod Aborted

and here is my locus file and my annotations file

[jli01@ln3%tianhe PAINTOR_V3.0-master]$ head /vol6/home/jli01/yao/finemap/neuro-new-locus/locus1.1 CHR POS RSID ZSCORE chr12 98488097 rs11337592 0.112534016 chr12 98488292 rs11836620 0.479476053 chr12 98488437 rs6538838 -1.481024669 chr12 98488720 rs12298515 -0.939644387 chr12 98488834 rs6538839 -0.022561568 chr12 98489268 rs11109346 -0.053165555 chr12 98489409 rs117562868 1.459236594 chr12 98489966 rs11109347 -3.600996373 chr12 98490004 rs4762456 1.463758299

[jli01@ln3%tianhe PAINTOR_V3.0-master]$ head /vol6/home/jli01/yao/finemap/neuro-new-locus/locus1.1.annotations fBrain-DS11872.hotspot.twopass.fdr0.05.merge.bed fBrain-DS11877.hotspot.twopass.fdr0.05.merge.bed fBrain-DS14464.hotspot.twopass.fdr0.05.merge.bed fBrain-DS14717.hotspot.twopass.fdr0.05.merge.bed fBrain-DS14718.hotspot.twopass.fdr0.05.merge.bed fBrain-DS14803.hotspot.twopass.fdr0.05.merge.bed fBrain-DS14815.hotspot.twopass.fdr0.05.merge.bed fBrain-DS15453.hotspot.twopass.fdr0.05.merge.bed fBrain-DS16302.hotspot.twopass.fdr0.05.merge.bed fBrain-DS20221.hg19.hotspot.twopass.fdr0.05.merge.bed fBrain-DS20226.hg19.hotspot.twopass.fdr0.05.merge.bed fBrain-DS20231.hg19.hotspot.twopass.fdr0.05.merge.bed 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Can you tell me how to solve the problem?

Best wishes Xueming Yao

Jeremy37 commented 5 years ago

Hi Yao - I got the same error, and it was because my annotation input file included a column which had non-numeric values. Do you have any non-numeric values in your annotation file? Perhaps you have one or more entries that are e.g. "NA" or something? In the Functions_IO.cpp file I changed a few lines to the following (and re-compiled), which helped me find the problem. (You should be able to find the relevant lines by searching for annotation_matrix.)

try {
    for(i = 0; i < num_snps; i++){
        for(j= 0; j < num_annotations; j++){
            annotation_matrix(i,j)= stod(all_annotation_line_split[i][j]);
        }
    }
} catch (exception& e) {
    cout << string("Error reading annotations. Offending annotation: ") + all_annotation_line_split[i][j] << endl;
    throw;
}
whynesspower commented 1 year ago

Hi Yao - I got the same error, and it was because my annotation input file included a column which had non-numeric values. Do you have any non-numeric values in your annotation file? Perhaps you have one or more entries that are e.g. "NA" or something? In the Functions_IO.cpp file I changed a few lines to the following (and re-compiled), which helped me find the problem. (You should be able to find the relevant lines by searching for annotation_matrix.)

try {
    for(i = 0; i < num_snps; i++){
      for(j= 0; j < num_annotations; j++){
          annotation_matrix(i,j)= stod(all_annotation_line_split[i][j]);
      }
  }
} catch (exception& e) {
  cout << string("Error reading annotations. Offending annotation: ") + all_annotation_line_split[i][j] << endl;
  throw;
}

Hey what if I not having strings at all, Could I somehow get this error in long long integer types?