Skip to content

Commit

Permalink
use open3 cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Dec 20, 2024
1 parent c67baed commit 89dc9c1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ boto3==1.35.84
botocore==1.35.84
certifi==2024.12.14
charset-normalizer==3.4.0
click==8.1.7
decorator==5.1.1
executing==2.1.0
idna==3.10
Expand All @@ -27,5 +28,5 @@ tqdm==4.67.1
traitlets==5.14.3
typing_extensions==4.12.2
urllib3==2.2.3
wags_tails==0.2.1
wags_tails==0.2.2
wcwidth==0.2.13
10 changes: 9 additions & 1 deletion server/lib/genome/importers/base.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'csv'
require 'open3'

module Genome
module Importers
Expand Down Expand Up @@ -41,7 +42,14 @@ def default_filename
end

def default_data_dir
"#{Dir.home}/.local/share/wags_tails"
begin
stdout, stderr, process_status = Open3.capture3('wags-tails path')
rescue Errno::ENOENT
raise 'wags-tails executable not found. Is it on your $PATH? See README.'
end
raise "wags-tails path lookup failed with code #{stderr}." unless process_status.success?

stdout.chomp
end

def handle_file_location(file_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def create_new_source
def handle_file_location(file_path)
return file_path unless file_path.nil?

"#{Dir.home}/.local/share/wags_tails/clearity_foundation/clearity_foundation_biomarkers_claims.tsv"
"#{default_data_dir}/clearity_foundation/clearity_foundation_biomarkers_claims.tsv"
end

def create_interaction_claims
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def create_new_source
def handle_file_location(file_path)
return file_path unless file_path.nil?

"#{Dir.home}/.local/share/wags_tails/clearity_foundation/clearity_foundation_clinical_trial_claims.tsv"
"#{default_data_dir}/clearity_foundation/clearity_foundation_clinical_trial_claims.tsv"
end

def create_interaction_claims
Expand Down

0 comments on commit 89dc9c1

Please sign in to comment.