Skip to content

Commit

Permalink
Merge pull request #1072 from maxplanck-ie/createIndices_orgyamls
Browse files Browse the repository at this point in the history
Create indices orgyamls
  • Loading branch information
WardDeb authored Oct 22, 2024
2 parents 55e560b + 1a0d33d commit 19d195b
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ jobs:
'CONDA_PREPROCESSING_ENV',
'CONDA_NONCODING_RNASEQ_ENV',
'CONDA_SAMBAMBA_ENV',
'CONDA_pysam_ENV'
'CONDA_pysam_ENV',
'CONDA_FQLINT_ENV'
]
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ jobs:
'CONDA_PREPROCESSING_ENV',
'CONDA_NONCODING_RNASEQ_ENV',
'CONDA_SAMBAMBA_ENV',
'CONDA_pysam_ENV'
'CONDA_pysam_ENV',
'CONDA_FQLINT_ENV'
]
runs-on: macos-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions docs/content/News.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ________________

* installation test for python 3.13
* bulk mode in makePairs wf
* Removal of --user flag in createIndices. Organism yamls are by default written to both installation folder and output folder.

snakePipes 3.0.0
________________
Expand Down
4 changes: 3 additions & 1 deletion snakePipes/common_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def set_env_yamls():
'CONDA_NONCODING_RNASEQ_ENV': 'envs/noncoding.yaml',
'CONDA_SAMBAMBA_ENV': 'envs/sambamba.yaml',
'CONDA_pysam_ENV': 'envs/pysam.yaml',
'CONDA_SEACR_ENV': 'envs/chip_seacr.yaml'}
'CONDA_SEACR_ENV': 'envs/chip_seacr.yaml',
'CONDA_FQLINT_ENV': 'envs/fqlint.yaml'
}


def merge_dicts(x, y):
Expand Down
4 changes: 2 additions & 2 deletions snakePipes/shared/rules/FASTQ.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if pairedEnd or pipeline=="scrnaseq":
r2 = indir+"/{sample}"+reads[1]+ext
output:
temp("originalFASTQ/{sample}.valid")
conda: CONDA_SHARED_ENV
conda: CONDA_FQLINT_ENV
shell:"""
fq lint {input.r1} {input.r2}
touch {output}
Expand All @@ -16,7 +16,7 @@ else:
r1 = indir+"/{sample}"+reads[0]+ext
output:
temp("originalFASTQ/{sample}.valid")
conda: CONDA_SHARED_ENV
conda: CONDA_FQLINT_ENV
shell:"""
fq lint {input.r1}
touch {output}
Expand Down
4 changes: 4 additions & 0 deletions snakePipes/shared/rules/envs/fqlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
channels:
- bioconda
dependencies:
- fq = 0.12.0
1 change: 0 additions & 1 deletion snakePipes/shared/rules/envs/shared.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ dependencies:
- multiqc = 1.23
- fastp = 0.23.4
- umi_tools = 1.1.4
- fq = 0.11.0
- pybigwig = 0.3.22

15 changes: 9 additions & 6 deletions snakePipes/workflows/createIndices/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,15 @@ onsuccess:
f = open(os.path.join(outdir, "genome_fasta", "effectiveSize"))
organismDictionary['genome_size'] = int(float(f.read().strip()))
f.close()
if not userYAML:
yamlPath = os.path.join(maindir, organismsDir, "{}.yaml".format(genome))
else:
yamlPath = os.path.join(outdir, "{}.yaml".format(genome))
print("Storing the organism YAML file in {}".format(yamlPath))
cf.write_configfile(yamlPath, organismDictionary)
orgDir_yamlPath = os.path.join(maindir, organismsDir, f"{genome}.yaml")
outDir_yamlPath = os.path.join(outdir, f"{genome}.yaml")
try:
cf.write_configfile(orgDir_yamlPath, organismDictionary)
print(f"{genome} yaml written to {orgDir_yamlPath}")
except (PermissionError, FileNotFoundError) as e:
print(f"Error writing in the organism dir {e}")
cf.write_configfile(outDir_yamlPath, organismDictionary)
print(f"{genome} yaml written to {outDir_yamlPath}")
if "verbose" in config and config["verbose"]:
print("\n--- index creation workflow finished successfully! --------------------------------\n")

Expand Down
4 changes: 0 additions & 4 deletions snakePipes/workflows/createIndices/createIndices.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ def parse_args(defaults={"configFile": None, "clusterConfigFile": None,
optional.add_argument("--rmskURL",
help="URL or local path to where the repeat masker output file is located. This is only required if you plan to run the ncRNAseq workflow.")

optional.add_argument("--userYAML",
action="store_true",
help="By default, this workflow creates an organism YAML file where snakePipes will look for it by default. If this isn't desired (e.g., you don't want the organism to be selectable by default or you don't have write permissions to the snakePipes installation) you can specify this option and the YAML file will instead be created in the location specified by the `-o` option.")

optional.add_argument("--salmonIndexOptions",
help="Options to pass to salmon for index creation.",
default=defaults["salmonIndexOptions"])
Expand Down

0 comments on commit 19d195b

Please sign in to comment.