yanboANU / Kmer2SNP

22 stars 2 forks source link

Empty hete.peak.k$1 file created if Rscript line fails #6

Closed tbenavi1 closed 4 years ago

tbenavi1 commented 4 years ago

Hello,

On line 24 of runkmercalling.sh, the code will create an empty hete.peak.k$1 file if Rscript is unable to properly run. This causes issues when trying to rerun Kmer2SNP after fixing the Rscript issue. Would it be possible to make Kmer2SNP not produce a file if there is an error. For example, perhaps changing the line to:

out=$(Rscript /path2Kmer2SNP/Kmer2SNP/libprism/local/runfindGSE.r chr_k$1.histo $1 ./ $2) && echo "$out" > hete.peak.k$1

according to https://stackoverflow.com/questions/31424456/how-to-redirect-output-of-a-program-only-if-it-succeeded. Thanks.

yanboANU commented 4 years ago

Thanks for you advice, I will update my code soon.


Yanbo Li 4.32, Building 145 (Hanna Neumann) Research School of Computer Science The Australian National University

Email: yanbo.li@anu.edu.aumailto:yu.lin@anu.edu.au


From: Timothy Rhyker Ranallo-Benavidez notifications@github.com Sent: Thursday, August 6, 2020 7:39 AM To: yanboANU/Kmer2SNP Kmer2SNP@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [yanboANU/Kmer2SNP] Empty hete.peak.k$1 file created if Rscript line fails (#6)

Hello,

On line 24 of runkmercalling.sh, the code will create an empty hete.peak.k$1 file if Rscript is unable to properly run. This causes issues when trying to rerun Kmer2SNP after fixing the Rscript issue. Would it be possible to make Kmer2SNP not produce a file if there is an error. For example, perhaps changing the line to:

out=$(Rscript /path2Kmer2SNP/Kmer2SNP/libprism/local/runfindGSE.r chr_k$1.histo $1 ./ $2) && echo "$out" > hete.peak.k$1

according to https://stackoverflow.com/questions/31424456/how-to-redirect-output-of-a-program-only-if-it-succeeded. Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/yanboANU/Kmer2SNP/issues/6, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHZV5JRPBHUOC5SYYBNY433R7HGQFANCNFSM4PV5QD5Q.