From d73028305913e7a030a9243be7f75dcb48a66409 Mon Sep 17 00:00:00 2001 From: "katarzyna.otylia.sikora@gmail.com" Date: Mon, 9 Sep 2024 14:41:59 +0200 Subject: [PATCH] mRNAseq genome alias --- snakePipes/snakePipes.py | 11 +++++++++++ snakePipes/workflows/DNAmapping/Snakefile | 2 +- snakePipes/workflows/mRNAseq/Snakefile | 5 +++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/snakePipes/snakePipes.py b/snakePipes/snakePipes.py index 63b49f6d1..5b867ecb7 100755 --- a/snakePipes/snakePipes.py +++ b/snakePipes/snakePipes.py @@ -381,6 +381,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 +408,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':