juicer icon indicating copy to clipboard operation
juicer copied to clipboard

Enhancement of CPU/juicer.sh in error judgement of genomePath

Open xuzhougeng opened this issue 4 years ago • 1 comments

Describe the bug

In https://github.com/aidenlab/juicer/blob/master/CPU/juicer.sh, it use if [ -z "$genomePath" ] to judge whether the genomePath is set or not , but even you set the unexisted file to -z, it will not stop.

For example, use -z

genomePath=test
[ -z "$genomePath" ] && echo file existed || echo file not existed 

it will return file existed, but if you use -f

[ -f "$genomePath" ] && echo file existed || echo file not existed

it will return file not existed, which will be more robust .

so, it may be better to use -d for directory related parameter and -f for file related parameter.

xuzhougeng avatar Aug 24 '19 04:08 xuzhougeng

Thanks, we will look into it or feel free to resolve and send a pull request.

On Sat, Aug 24, 2019 at 12:41 AM xuzhougeng [email protected] wrote:

Describe the bug

In https://github.com/aidenlab/juicer/blob/master/CPU/juicer.sh, it use if [ -z "$genomePath" ] to judge whether the genomePath is set or not , but even you set the un-existed file to -z.

For example

genomePath=test [ -z "$genomePath" ] && echo file existed || echo file not existed

it will return file existed, but

[ -f "$genomePath" ] && echo file existed || echo file not existed

it will return file not existed, which will be more robust .

so, it may be better to use -d for directory related parameter and -f for file related parameter.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aidenlab/juicer/issues/130?email_source=notifications&email_token=AAK2EW7ITO3ORN6I22AOQRLQGC3YRA5CNFSM4IPFE3EKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HHFEA3Q, or mute the thread https://github.com/notifications/unsubscribe-auth/AAK2EW7RL42NUKLHHT7JAZDQGC3YRANCNFSM4IPFE3EA .

-- Neva Cherniavsky Durand, Ph.D. Staff Scientist, Aiden Lab www.aidenlab.org

nchernia avatar Sep 06 '19 17:09 nchernia