WansonChoi / MakeReference_v2

Temporary Repository to distribute MakeReference_v2
0 stars 1 forks source link

change global path to relative #1

Open yluo86 opened 6 years ago

yluo86 commented 6 years ago

Hi Wanson,

Thanks for this updates. A quick suggestion: instead of using an 'absolute path' which we assume everything is run from the ./MakeReference_v2/ directory, I would make it to a relative path where, for example,

SOFTWARE_PATH = os.path.dirname(__file__) _p_plink=os.path.join(SOFTWARE_PATH, '/dependency/plink_mac')

to replace ./ in your original script.

def MakeReference(_INPUT_DATA, _HLA_ped, _OUTPUT_Prefix, _p_plink='./dependency/plink_mac', ...

WansonChoi commented 5 years ago

Dear Yang,

I'm sincerely sorry for checking this issue now.

I think it's a good idea. I guess it's for future integration problem.

By the way, The representation "./" actually means a "current directory" where the main script is implemented and is a relative path usage. In other words, "./dependency/plink_mac" is exactly same as "dependency/plink_mac" where the current directory would be "MakeReference_v2/" project folder. In contrast, '/dependency/plink_mac' is a absolute path usage.

Anyway, I integrated "_p_plink", "_p_beagle" and "_p_linkage2beagle" to the single "_p_dependency" and maybe this "_p_dependency" variable can do the same job which "SOFTWARE_PATH" was supposed to do.

Would it be okay not to modify "_p_dependency" variable and just to add one more "parser.add_argument()" for it so that users can set "_p_dependency" by themselves?

WansonChoi commented 5 years ago

Hi Wanson,

Thanks for this updates. A quick suggestion: instead of using an 'absolute path' which we assume everything is run from the ./MakeReference_v2/ directory, I would make it to a relative path where, for example,

SOFTWARE_PATH = os.path.dirname(__file__) _p_plink=os.path.join(SOFTWARE_PATH, '/dependency/plink_mac')

to replace ./ in your original script.

def MakeReference(_INPUT_DATA, _HLA_ped, _OUTPUT_Prefix, _p_plink='./dependency/plink_mac', ...