-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ConesaLab/config
Arguments are now passed using a config file instead of argparse
- Loading branch information
Showing
9 changed files
with
276 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Tue Dec 10 11:17:49 2024 | ||
@author: frobledo | ||
""" | ||
|
||
import logging | ||
import urllib.request | ||
|
||
# Note that cranlogs only shows downloads since RStudio started tracking them in 2012 | ||
BASE_URL: str = "https://cranlogs.r-pkg.org/badges/grand-total/{package}" | ||
logger = logging.getLogger("Bioconductor") | ||
|
||
def downloads_in_cran(package): | ||
url:str = BASE_URL.format(package=package) | ||
with urllib.request.urlopen(url) as response: | ||
error_code:int = response.getcode() | ||
logging.info("Connecting to cranlogs...") | ||
if (error_code == 200): | ||
logging.info("Succesfully connected to fetch cran downloads for: {package}".format(package=package)) | ||
data = response.read() | ||
else: | ||
logging.error("Error connecting to cranlogs to fetch downloads for: {package}".format(package=package)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"root_folder":"", | ||
"backup" : { | ||
"activate": false, | ||
"method": "webdav", | ||
"compression": ["tar.gz"], | ||
"user": "", | ||
"password": "", | ||
"backup_url_folder":"" | ||
}, | ||
|
||
"tools": { | ||
"sqanti3": { | ||
"github": { | ||
"owner":"", | ||
"repo":"", | ||
"apikey":"", | ||
"savefile_prefix":"" | ||
}, | ||
|
||
"docker" : { | ||
"owner":"", | ||
"repo": "", | ||
"apikey": "", | ||
"savefile":"" | ||
} | ||
}, | ||
|
||
"MOSim": { | ||
|
||
"github": { | ||
"owner": "", | ||
"repo": "", | ||
"apikey":"", | ||
"savefile_prefix":"" | ||
}, | ||
|
||
"bioconductor": { | ||
"package": "", | ||
"savefile":"" | ||
} | ||
}, | ||
|
||
"get_homologues" : { | ||
|
||
"conda" : { | ||
"owner":"", | ||
"repo":"", | ||
"savefile":"" | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Tue Dec 10 11:32:26 2024 | ||
@author: frobledo | ||
""" | ||
|
||
import os | ||
import json | ||
import logging | ||
|
||
import collections | ||
|
||
logger = logging.getLogger("Config reader") | ||
|
||
def load_config(path:str) -> dict: | ||
path:str = os.path.abspath(path) | ||
logging.info("Loading config file from: {path}".format(path=path)) | ||
config:dict = json.load(open(path)) | ||
logging.info("Config file loaded succesfully") | ||
return config |
Oops, something went wrong.