def cli(ctx, **kwds): """Make a bioconda recipe, given a R or bioconductor package name. package_name = motifbreakR bioconda_dir = '/Users/nturaga/Documents/workspace'. """ package_name = kwds.get("package_name") clone = kwds.get("clone") update = kwds.get("update") bioconda_dir_path = kwds.get("bioconda_dir_path") write_bioconda_recipe(package_name, clone, update, bioconda_dir_path) return
def __init__(self, requirement, bioconda_path=None, update=False): """Initialize Requirements class for Bioc tool builder.""" parts = requirement.split("@", 1) # Get version from requirements, if version not given if len(parts) > 1: name = parts[0] version = "@".join(parts[1:]) else: name = parts[0] version = None if name == "R": self.name = name self.version = version else: # Write biconda recipe with given requirement if bioconda_path is None: bioconda_path = os.path.expanduser("~") write_bioconda_recipe(name, True, update, bioconda_path) recipe_path = os.path.join(bioconda_path, "bioconda-recipes", "recipes", "bioconductor-" + name.lower(), "meta.yaml") if not os.path.exists(recipe_path): recipe_path = os.path.join(bioconda_path, "bioconda-recipes", "recipes", "r-" + name.lower(), "meta.yaml") with open(recipe_path, 'r') as f: doc = yaml.safe_load(f) if not version: version = doc["package"]["version"] package_url = doc["about"]["home"] package_help = doc["about"]["summary"] self.name = name self.version = version self.package_url = package_url self.package_help = package_help