diff --git a/snakePipes/snakePipes.py b/snakePipes/snakePipes.py index 63b49f6d1..6d358a5fa 100755 --- a/snakePipes/snakePipes.py +++ b/snakePipes/snakePipes.py @@ -103,6 +103,12 @@ def parse_arguments(): "in the workflow-specific yaml files and where conda is installed.", ) + configParser.add_argument( + "--snakemakeProfile", + help="Path to custom snakemake profile file.", + default=defaults["snakemakeProfile"] + ) + configParser.add_argument( "--organismsDir", help="The directory where global organism YAML files are to be stored. Both " @@ -381,6 +387,7 @@ def updateConfig(args): if args.configMode == "manual": d = { "snakemakeOptions": args.snakemakeOptions, + "snakemakeProfile": args.snakemakeProfile, "condaEnvDir": args.condaEnvDir, "organismsDir": args.organismsDir, "tempDir": args.tempDir, @@ -407,6 +414,16 @@ def updateConfig(args): sys.exit("Config file not found\n") updatedDict = cof.merge_dicts(currentDict, d) cof.write_configfile(os.path.join(baseDir, "shared", "defaults.yaml"), updatedDict) + + #update conda-prefix in snakemakeProfile + if args.condaEnvDir: + profilePath = cof.resolveSnakemakeProfile(d['snakemakeProfile'], baseDir) + f = open(profilePath / 'config.yaml') + pf = yaml.load(f, Loader=yaml.FullLoader) + pf['conda-prefix'] = args.condaEnvDir + cof.write_configfile(os.path.join(profilePath, "config.yaml"), pf) + f.close() + cof.load_configfile( os.path.join(baseDir, "shared", "defaults.yaml"), True, "Final Updated Config" ) diff --git a/snakePipes/workflows/DNAmapping/Snakefile b/snakePipes/workflows/DNAmapping/Snakefile index 579d10430..f5047efc3 100755 --- a/snakePipes/workflows/DNAmapping/Snakefile +++ b/snakePipes/workflows/DNAmapping/Snakefile @@ -63,7 +63,7 @@ if "allelic-mapping" in mode: SNPFile = "snp_genome/all_SNPs_" + strains[0] + "_" + genome_alias + ".txt.gz" elif len(strains) == 2: allele_hybrid = 'dual' - SNPFile = SNPFile = "snp_genome/all_" + strains[1] + "_SNPs_" + strains[0] + "_reference.based_on_" + genome_alias + ".txt" + SNPFile = "snp_genome/all_" + strains[1] + "_SNPs_" + strains[0] + "_reference.based_on_" + genome_alias + ".txt" include: os.path.join(maindir, "shared", "rules", "masked_genomeIndex.snakefile") elif allele_mode == 'map_only': diff --git a/snakePipes/workflows/mRNAseq/Snakefile b/snakePipes/workflows/mRNAseq/Snakefile index 9a914a587..d551b0f4b 100755 --- a/snakePipes/workflows/mRNAseq/Snakefile +++ b/snakePipes/workflows/mRNAseq/Snakefile @@ -52,15 +52,16 @@ if not fromBAM: ## Allele-specific JOBS if "allelic-mapping" in mode: + genome_alias = os.path.splitext(os.path.basename(genome))[0] # Updated global vars if mode = "allelic-mapping" if allele_mode == 'create_and_map': star_index_allelic = 'snp_genome/star_Nmasked/Genome' if len(strains) == 1: allele_hybrid = 'single' - SNPFile = "snp_genome/all_SNPs_" + strains[0] + "_" + genome + ".txt.gz" + SNPFile = "snp_genome/all_SNPs_" + strains[0] + "_" + genome_alias + ".txt.gz" elif len(strains) == 2: allele_hybrid = 'dual' - SNPFile = "snp_genome/all_" + strains[1] + "_SNPs_" + strains[0] + "_reference.based_on_" + genome + ".txt" + SNPFile = "snp_genome/all_" + strains[1] + "_SNPs_" + strains[0] + "_reference.based_on_" + genome_alias + ".txt" include: os.path.join(maindir, "shared", "rules", "masked_genomeIndex.snakefile") elif allele_mode == 'map_only':