Skip to content

Commit

Permalink
mRNAseq genome alias
Browse files Browse the repository at this point in the history
  • Loading branch information
katarzyna.otylia.sikora@gmail.com committed Sep 9, 2024
1 parent 6b6eea6 commit d730283
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
11 changes: 11 additions & 0 deletions snakePipes/snakePipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
)
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

0 comments on commit d730283

Please sign in to comment.