xiaolei-lab / SIMER

Data Simulation for Life Science and Breeding
Apache License 2.0
26 stars 8 forks source link

a little bug #3

Open ericHuu opened 1 year ago

ericHuu commented 1 year ago

the file path in JSON file should be more fixable example: "/home/yindong/R/x86_64-pc-linux-gnu-library/4.0/simer/extdata/05others/pedigree.txt" should be replaced by "${users r path}/simer/extdata/05others/pedigree.txt"

if you can debug this, i would be appreciated that

thanks

hyacz commented 1 year ago

Thanks for using SIMER and pointing out this issue, you can directly make a Pull Request to fix it. 😄

Foredawnbio commented 1 year ago

Thanks for your suggestion. "${users r path}/simer/extdata/05others/pedigree.txt" is a good idea, but it will make errors when facing Windows users. So I fixed this bug in another way:

  1. Write the absolute path in a JSON file when you are sure about the paths of the genotype data, pedigree file path, and phenotype file path.
  2. Or SIMER regards the absolute path of the JSON file as dataPath (dataPath <- dirname(jsonFile)) where genotype path, pedigree file, and phenotype file exsit (e.g., pedigree: "../05others/pedigree.txt", SIMER calls file.path(dataPath, "../05others/pedigree.txt") to get a correct pedigree path).