Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 1049 and 1009 #1054

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions snakePipes/snakePipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down Expand Up @@ -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,
Expand All @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion snakePipes/workflows/DNAmapping/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
5 changes: 3 additions & 2 deletions snakePipes/workflows/mRNAseq/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
Loading