Skip to content

Commit

Permalink
Merge pull request #123 from pachterlab/dev
Browse files Browse the repository at this point in the history
Fix Windows issue with gget setup elm
  • Loading branch information
lauraluebbert authored Feb 1, 2024
2 parents e66e7bd + ba00672 commit 061fbdd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gget/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
# Mute numexpr threads info
logging.getLogger("numexpr").setLevel(logging.WARNING)

__version__ = "0.28.3"
__version__ = "0.28.4"
__author__ = "Laura Luebbert"
__email__ = "[email protected]"
27 changes: 15 additions & 12 deletions gget/gget_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

## Variables for elm module
ELM_FILES = os.path.join(PACKAGE_PATH, "elm_files")
ELM_INSTANCES_FASTA = f"{ELM_FILES}/elm_instances.fasta"
ELM_CLASSES_TSV = f"{ELM_FILES}/elms_classes.tsv"
ELM_INSTANCES_TSV = f"{ELM_FILES}/elm_instances.tsv"
ELM_INTDOMAINS_TSV = f"{ELM_FILES}/elm_interaction_domains.tsv"
ELM_INSTANCES_FASTA = os.path.join(ELM_FILES, "elm_instances.fasta")
ELM_CLASSES_TSV = os.path.join(ELM_FILES, "elms_classes.tsv")
ELM_INSTANCES_TSV = os.path.join(ELM_FILES, "elm_instances.tsv")
ELM_INTDOMAINS_TSV = os.path.join(ELM_FILES, "elm_interaction_domains.tsv")

## Variables for alphafold module
ALPHAFOLD_GIT_REPO = "https://github.com/deepmind/alphafold"
Expand Down Expand Up @@ -132,10 +132,10 @@ def setup(module, verbose=True, out=None):

if out is not None:
elm_files_out = os.path.abspath(out)
elm_instances_fasta = f"{elm_files_out}/elm_instances.fasta"
elm_classes_tsv = f"{elm_files_out}/elms_classes.tsv"
elm_instances_tsv = f"{elm_files_out}/elm_instances.tsv"
elm_intdomains_tsv = f"{elm_files_out}/elm_interaction_domains.tsv"
elm_instances_fasta = os.path.join(elm_files_out, "elm_instances.fasta")
elm_classes_tsv = os.path.join(elm_files_out, "elms_classes.tsv")
elm_instances_tsv = os.path.join(elm_files_out, "elm_instances.tsv")
elm_intdomains_tsv = os.path.join(elm_files_out, "elm_interaction_domains.tsv")

# Create folder for ELM files (if it does not exist)
if not os.path.exists(elm_files_out):
Expand All @@ -151,14 +151,17 @@ def setup(module, verbose=True, out=None):
if not os.path.exists(ELM_FILES):
os.makedirs(ELM_FILES)

print(platform.system())
if platform.system() == "Windows":
# The double-quotation marks allow white spaces in the path, but this does not work for Windows
command = f"""
curl -o {elm_instances_fasta} {ELM_INSTANCES_FASTA_DOWNLOAD} \
&& curl -o {elm_classes_tsv} {ELM_CLASSES_TSV_DOWNLOAD} \
&& curl -o {elm_instances_tsv} {ELM_INSTANCES_TSV_DOWNLOAD} \
&& curl -o {elm_intdomains_tsv} {ELM_INTDOMAINS_TSV_DOWNLOAD}
curl -o {elm_instances_fasta} \"{ELM_INSTANCES_FASTA_DOWNLOAD}\" \
&& curl -o {elm_classes_tsv} \"{ELM_CLASSES_TSV_DOWNLOAD}\" \
&& curl -o {elm_instances_tsv} \"{ELM_INSTANCES_TSV_DOWNLOAD}\" \
&& curl -o {elm_intdomains_tsv} \"{ELM_INTDOMAINS_TSV_DOWNLOAD}\"
"""
print(command)

else:
command = f"""
curl -o '{elm_instances_fasta}' {ELM_INSTANCES_FASTA_DOWNLOAD} \
Expand Down

0 comments on commit 061fbdd

Please sign in to comment.