Open dahun73 opened 3 years ago
It could be a formatting issue. I suggest you check that.
Thank you for reply
So, I tried to set the first header to the same as an example like this: But, same error message still came out....
Which formatting is not correct...?
If you post part of the file as text here, I can try to replicate the error.
Thank you so much
chr start end CpG C1-N C1-X C2-N C2-X E1-N E1-X E2-N E2-X chr1 15189 15239 3 45 44 100 97 49 48 147 143 chr1 15865 15912 3 NA NA 38 37 40 40 63 62 chr1 51592 51722 12 48 37 36 33 44 34 84 77 chr1 61803 61954 6 75 58 NA NA 42 29 NA NA chr1 62082 62140 4 20 15 NA NA 30 22 NA NA chr1 87256 87409 6 29 19 NA NA NA NA NA NA chr1 133165 133217 3 28 25 27 25 38 32 28 24 chr1 136388 136485 6 35 34 NA NA 84 75 25 25 chr1 136876 136913 4 88 80 100 86 148 124 167 113 chr1 137702 137877 6 22 21 NA NA NA NA NA NA chr1 139029 139073 3 27 21 NA NA 74 55 NA NA chr1 139320 139366 3 22 21 NA NA NA NA NA NA chr1 181324 181442 15 90 66 206 157 104 92 306 207 chr1 181583 181676 15 45 36 NA NA 30 20 30 25 chr1 185692 185760 4 39 37 27 27 40 36 29 23 chr1 186270 186443 6 NA NA NA NA 26 19 32 29 chr1 189333 189410 6 NA NA NA NA NA NA 20 18 chr1 191438 191526 4 67 50 32 28 101 82 33 27 chr1 267505 267636 7 NA NA NA NA 21 14 NA NA chr1 595820 595884 5 NA NA NA NA 30 22 NA NA chr1 608685 608745 4 NA NA NA NA NA NA 24 22 chr1 609338 609397 7 NA NA 154 60 47 42 126 62 chr1 610789 610890 8 72 54 NA NA 94 71 NA NA chr1 618415 618473 4 NA NA 29 16 36 16 27 8 chr1 631682 632022 13 283 1 299 12 397 24 131 7 chr1 632386 632512 7 NA NA 21 0 23 17 NA NA chr1 722079 722174 8 30 24 38 27 24 20 29 26 chr1 727150 727277 8 38 38 54 53 58 54 48 44 chr1 727763 727773 4 72 72 64 63 88 86 108 107 chr1 736512 736590 3 36 36 NA NA 30 29 30 28 chr1 737558 737650 3 21 15 NA NA 20 20 NA NA chr1 744131 744181 3 27 22 NA NA 21 20 27 27 chr1 777996 778073 6 30 24 30 16 98 65 80 50 chr1 778541 778738 16 NA NA NA NA 54 0 38 0 chr1 778874 778920 7 36 0 45 0 96 1 60 0 chr1 779067 779185 10 117 0 117 0 204 1 118 0 chr1 779661 779741 5 23 8 NA NA NA NA NA NA chr1 779860 779903 4 22 17 20 19 NA NA NA NA chr1 806448 806610 5 27 23 NA NA 25 24 NA NA chr1 817978 818111 10 NA NA 58 58 NA NA 102 100 chr1 818757 818830 6 27 27 30 27 37 34 21 20 chr1 826795 827234 28 71 0 78 12 101 2 144 4 chr1 827413 827586 18 298 0 153 1 321 1 321 1 chr1 827697 827749 10 190 2 160 3 170 5 190 1 chr1 833783 833891 8 NA NA NA NA 31 27 25 22 chr1 842806 842956 8 49 44 36 30 45 42 50 48 chr1 844615 844921 10 175 151 114 86 209 187 117 94 chr1 850161 850422 8 20 17 NA NA NA NA NA NA chr1 852082 852303 7 53 49 65 60 28 27 44 39 chr1 856477 856552 5 21 18 NA NA 28 26 NA NA chr1 858389 858850 13 55 16 58 12 76 21 87 29 chr1 863705 863920 8 NA NA 32 24 40 32 20 17 chr1 865270 865296 3 23 20 NA NA 24 16 25 19 chr1 865580 865838 8 97 53 104 65 99 68 96 52 chr1 866396 866495 5 NA NA NA NA 33 21 30 14 chr1 869722 869972 13 158 2 212 0 353 4 178 1 chr1 869997 870226 24 656 62 505 29 728 101 651 19 chr1 873755 873798 5 50 46 65 61 124 101 45 42 chr1 873972 874089 3 28 21 34 27 48 33 48 39 chr1 886887 887001 6 34 24 37 31 58 40 45 33 chr1 898327 898570 7 50 36 37 22 69 53 50 35 chr1 899127 899319 12 NA NA NA NA 36 31 NA NA chr1 901138 901216 5 35 28 NA NA 47 30 53 33 chr1 902505 902790 12 NA NA 44 32 36 33 37 33 chr1 902895 902991 10 103 99 96 82 203 190 153 132 chr1 903792 904055 10 143 129 103 97 204 180 130 111 chr1 904136 904467 21 252 62 212 75 327 105 256 127 chr1 904752 904977 24 212 1 115 1 373 3 335 8 chr1 905175 905421 20 240 30 218 13 228 52 193 28 chr1 905839 906273 10 61 38 35 25 41 23 50 36 chr1 907841 907986 6 34 31 22 18 NA NA 26 25 chr1 908111 908270 6 28 23 NA NA 77 73 23 21 chr1 908901 908965 7 66 47 58 40 66 48 84 57 chr1 909425 909456 4 NA NA 36 35 NA NA 23 23 chr1 909825 910174 30 177 56 247 54 301 84 282 102 chr1 910235 910576 24 251 41 255 33 359 84 273 34 chr1 910611 910974 8 105 74 42 23 89 56 80 53 chr1 911016 911364 14 64 48 25 16 49 34 68 54 chr1 911477 911724 7 NA NA NA NA 26 24 37 22 chr1 912876 913128 17 249 156 216 150 354 268 335 216 chr1 913143 913401 7 148 128 100 89 129 119 96 84 chr1 913718 913873 7 100 74 78 63 112 88 97 83 chr1 914033 914198 6 65 54 51 43 67 61 40 32 chr1 914308 914395 4 45 34 40 28 57 39 40 31 chr1 914671 914872 8 NA NA NA NA NA NA 22 21 chr1 915404 915556 12 49 42 NA NA NA NA 47 39 chr1 916382 916432 5 35 19 125 85 89 73 108 79 chr1 916535 916802 12 145 22 132 22 166 17 162 45 chr1 917325 917576 9 34 19 25 19 41 22 NA NA chr1 917676 917838 9 114 66 100 55 140 58 107 64 chr1 918271 918496 9 43 31 34 22 60 32 66 37 chr1 918609 918708 4 NA NA NA NA NA NA 23 12 chr1 919094 919430 12 75 61 43 35 97 75 88 76 chr1 919444 919787 18 91 82 40 32 130 114 74 61 chr1 920312 920361 3 NA NA 20 11 29 26 35 28 chr1 920549 920740 11 158 62 74 39 170 86 199 58 chr1 921079 921313 14 253 1 221 1 343 2 241 2 chr1 922982 923167 8 41 38 33 31 45 42 36 30 chr1 923410 923599 9 57 5 50 3 94 11 62 9
this is top100 lines of original file
I don't get an error when I run that:
$ Rscript findDMRs.r -i ECcombined.tsv -o test_output.tsv C1,C2 E1,E2 -n Ctrl,Exp
$ cat test_output.tsv
chr start end CpG Ctrl:mu Exp:mu Ctrl->Exp:diff Ctrl->Exp:pval
chr1 185692 185760 4 0.9660651 0.8501196 -0.1159454 0.03101
chr1 632386 632512 7 0.0246383 0.7361098 0.7114715 0
chr1 737558 737650 3 0.710552 0.9865427 0.2759907 0.0075366
chr1 744131 744181 3 0.8087366 0.9731341 0.1643975 0.047408
chr1 902505 902790 12 0.7249294 0.9014276 0.1764982 0.0381796
chr1 916382 916432 5 0.6376645 0.7729422 0.1352776 0.0488898
chr1 920312 920361 3 0.5524294 0.842526 0.2900967 0.0167393
Really...? But... I still have an error...
Hello,
I found the main problem. It was R version.
Using anaconda, I made and ran the command in the R 3.6.1 version. It works well.
When I use R version 4.1, error comes up. I think we should know about that.
The issue can be solved in R 4.3.1 by making the following modification to the findDMRs.r script -
level <- levels(res$chr) intChr <- strChr <- intLev <- strLev <- c() for (i in 1:length(level)){ if(isTRUE(level) && substr(level[i], 1, 3) == 'chr'){ sub <- substr(level[i], 4, nchar(level[i])) if (isTRUE(sub) && !is.na(suppressWarnings(as.integer(sub)))) { intChr <- c(intChr, as.numeric(sub)) } else { strChr <- c(strChr, sub) } }else{ sub <- level[i] if (isTRUE(sub) && !is.na(suppressWarnings(as.integer(sub)))) { intLev <- c(intLev, as.numeric(sub)) } else { strLev <- c(strLev, sub) } } }
Hope this helps!!
Thanks you for adding the solution here. It would really help if this was also in the README.
Hello all!
When running findDMRs.r, one error came out. But, I don't know why that error came out.
There were 50 or more warnings (use warnings() to see the first 50) Error in if (substr(level[i], 1, 3) == "chr") { : argument is of length zero Execution halted
I think this is simple error such as format of object. Is there any good suggestion?
Thanks!