Skip to content

Commit

Permalink
Master merge (#190)
Browse files Browse the repository at this point in the history
* Major DROP update

* removed obsolete file

* changed project folder structure for initialisation

* API change: separated config and sample annotation parsers

* fixed missin root path

* import config differently

* package finding for subpackage

* running pipeline

* added circleci config

* removed obsolete file

* changed project folder structure for initialisation

* API change: separated config and sample annotation parsers

* fixed missin root path

* import config differently

* package finding for subpackage

* using correct .travis.yml

* removed subworkflow and running pipeline for aberrantExpression; new functions introduced for Script-Rule-Html conversions; analysis script directory renamed; pipeline code copied to different destination

* removed subworkflow for AS and MAE; changed folder structure; using log for tmp snakemake objects

* fixed input flags for analysis scripts

* running pipeline

* added circleci config

* removed obsolete file

* changed project folder structure for initialisation

* API change: separated config and sample annotation parsers

* fixed missin root path

* import config differently

* package finding for subpackage

* API change: separated config and sample annotation parsers

* fixed missin root path

* import config differently

* package finding for subpackage

* removed subworkflow and running pipeline for aberrantExpression; new functions introduced for Script-Rule-Html conversions; analysis script directory renamed; pipeline code copied to different destination

* removed subworkflow for AS and MAE; changed folder structure; using log for tmp snakemake objects

* fixed input flags for analysis scripts

* set submodules to master

* applied branch-specific modifications

* removed submodules.py and refactored path setup

* fixed Readme and config copy errors

* fixed copying helpers functions

* using wbuild with fixed Readme.html functionality and saving wbuild config in DropConfig

* moved exportCounts into separate class

* parsing GENE_COUNT_FILE column in sample annotation

* removed wbuild from conda recipe

* using bioconda version of drop for dependencies, pip install drop, no conda building

* remove bioconda wbuild

* install wbuild with expl pip

* remove wbuild with pip

* get count info from AE class

* some refactoring and saving external counts IDs in separate dictionary

* removed ID renaming in merge script (naming already in counts script); fixed missing input bug in DropConfig

* add external counts to count files

* merge counts and coverage including external counts

* file checks for config and sample annotation reimplemented

* config file getters for submodules

* refactored export counts

* travis run export counts rule

* reapplied bcftools command modification

* Documentation update (#102)

* README update to include Baylor counts
* updated drop installation command
* update install command docs to include conda-forge plus better descriptions

Co-authored-by: Vicente <yepez@in.tum.de>
Co-authored-by: Michaela Müller <mi.mueller@tum.de>
Co-authored-by: Christian Mertes <mertes@in.tum.de>

* updated documentation to include count import

* splicing export counts all columns added

* resolved requested formality errors

* fixed requested MAE changes

* removed scanBamParam

* create missing columns for MAE results

* Subindex (#3)

* first version of subindex implemented

* including readme and dependency graph for subindexes; removed fileRegex key from config (using default of ".*\.(R|md)")

* using different (wb1.8) config file

* separated dependency graph computation from rest of the pipeline

* using latest updated wbuild version

* use conda install for wbuild

Co-authored-by: mumichae <mi.mueller@tum.de>

* Fix version for wbuild (#108)

Co-authored-by: mumichae <mi.mueller@tum.de>

* updated version number in README and drop/cli

* Tests (#4)

Added pytest suite to project. The main things tested are:

* cli: basic drop command line functions

* all config classes

* pipeline runs for all submodules (including checking numbers of entries in output) and count export


## Commits

* first setup of pytest, pipeline runthroughs, no output checking yet

* updated version number in README and drop/cli

* fixed dependencies

* pip uninstall with -y

* changed pytest installation and error catching

* compare pipeline output and add more pipeline tests

* refactored pipeline tests

* fixed demo creation

* refactored pipeline tests again & fixed fixture scoping

* fixed minor issues in tests

* added config tests

* refactored getHtmlFromScript

Co-authored-by: mumichae <mi.mueller@tum.de>

* downloading data to temporary directory

* updated version to 1.0.0

Co-authored-by: Michaela Müller <mi.mueller@tum.de>
Co-authored-by: Vicente <yepez@in.tum.de>
Co-authored-by: Christian Mertes <mertes@in.tum.de>

* updated travis to use correct R and wbuild versions

* use github release badge instead of fixing it

* Fix Issue #114 (#116)

* refactored drop demo code s.t. config and sample annotation files are in the package

* adapted pipeline to handle non-existing external counts
new group in demo to distinguish count import from no count import cases
some bugfixes regarding exportCounts parsing and import counts subsetting

* fixed AE pipeline test

* travis with latest R version 4

* revert pipeline in pytest to 2 cores

* R 4.0.2

Co-authored-by: mumichae <mi.mueller@tum.de>

* Refactoring (#118)

* refactored Submodule classes into separate files

* using MAE and AS functions from respective classes instead of Snakefile or R script header

* fixed input for MAE rules

* use chr with bam counts for ASEReadCounter

* added test for aberrant splicing count file functions

* FRASER compatibility fixes

* fixed subsetGroup API change

Co-authored-by: Michaela Müller <mi.mueller@tum.de>
Co-authored-by: Christian Mertes <mertes@in.tum.de>

* using wbuild 1.8.0 for pip installation

* fixed travis install error

* adapt DROP to theta usage in FRASER (#129)

* adapt DROP to theta usage in FRASER

* use travis wait

* due to new filters one donor site is deleted

* Fix import counts (#122)

* updated version number

* version checking for drop

* use defaultdict for group IDs; add testcase for removing import counts in demo input; fix count param data types

* moved no import file modifications into separate fixture

* fixed sample annotation ID mapping check

* using groups defined in config instead of inferring from ID objects

* force ignoring first column as index when reading sample annotation file

* added wait to pytest command

* drop update to overwrite files every time & shortened output for creating drop demo fixture

* fixed deprecation message

* profiling runtime for tests

Co-authored-by: mumichae <mi.mueller@tum.de>

* Offline addons (#137)

* Update gene_name_mapping.R

* add hpoFile option

* fix hg38 on FRASER counting

* doc hpoFile, files to download

* add hpoFile option

* doc hpoFile, files to download

* vcf doc fixed

* gene_biotype added

Co-authored-by: Vicente <yepez@in.tum.de>

* Offline addons (#139)

* Update gene_name_mapping.R

* add hpoFile option

* fix hg38 on FRASER counting

* doc hpoFile, files to download

* add hpoFile option

* doc hpoFile, files to download

* vcf doc fixed

* gene_biotype added

* hpo term column can be blank

Co-authored-by: Vicente <yepez@in.tum.de>

* remove file extension in outrider module (#140)

* Update splicing export (#141)

* export known junction with K and N counts

* add AnnotationDbi

* fix type

* properly load BSgenome

* correctly export splice counts (use K and N) and use GTF seqlevelsStyle

* speed up conda install

* fix package removal

* use travis python version for drop environment

Co-authored-by: mumichae <51025211+mumichae@users.noreply.github.com>

* Version check (#143)

* include version check for R packages when calling pipeline

* silence package loading when checking R installation

* hide warning messages in R install

Co-authored-by: mumichae <mi.mueller@tum.de>

* better check for chromosome style (#148)

* GitHub actions (#151)

* Create python-package-conda.yml

* install repo version of drop

* commented out travis file

* Export counts meta (#144)

* refactored writing export count meta files in separate python script rather than SampleAnnotation script

* include python scripts in non-module directories upon installation

Co-authored-by: mumichae <mi.mueller@tum.de>

* use buildins for flake8

* Install needed BSgenome on the fly (#147)

* remove assembly specific packages closes #142
* fix pipeline when no import count matrix in sample annotation #114 
* refactored config parsers by submodule
* update to FRASER 1.2.0 @c-mertes 
* update aberrant splicing export @c-mertes 
* local loading of HPO file if present @vyepez88 
* fixed buggy file extension when saving ods @jemten 
* Add files via upload (#146)
* update OUTRIDER version and bugfixes
* allow NCBI based assembly in config fixes #135
* move assembly version test to DropConf and adjust the pipeline.
* add unlock if snakemake fails
* use addAF to check installation
* Add badge to readme
Co-authored-by: mumichae <51025211+mumichae@users.noreply.github.com>
Co-authored-by: Vicente Yepez <30469316+vyepez88@users.noreply.github.com>

* Offline res (#160)

* annotate splice results using GTF (requires FRASER 1.3.0)

* added random seed for demo

Co-authored-by: Vicente <yepez@in.tum.de>
Co-authored-by: Christian Mertes <mertes@in.tum.de>
Co-authored-by: Michaela Mueller <mumichae@in.tum.de>

* add bumpversion config

* Bump version: 1.0.2 → 1.0.3

* rename gene_biotype->gene_type in GTF (#162)

* Apply suggestions from code review

Co-authored-by: Christian Mertes <mertes@in.tum.de>

* FRASER version and author list

Co-authored-by: Christian Mertes <mertes@in.tum.de>

* Simplify MAE Pipeline (#158)

* removed separate QC VCF workflow, reusing MAE workflow

* Chr style (#177)

* mae chr style fixed

* bug in chr style of FRASER fixed

* add possibility of both chr styles

* ncbi fds object added

* minor fixes chr subset

* count matrices added

Co-authored-by: Vicente <yepez@in.tum.de>

* Qol changes (#179)

QOL changes are made to improve the ease and user experience. This branch contains changes to allow the following:

* safe overwriting of the local working directory with changes from the source drop directory. This should save some reprocessing time as only modified scripts will be rerun
* allowing multiple genomic reference files. allow for user to designate multiple references or a global reference from the config file and sample annotation table
* added additional checks and error messages
* use changes in the sample annotation to trigger reruns of the aberrantExpression and MAE pipelines. (aberrantSplicing is still in progress)

* Update warnings/errors
* Update tests 
* Handle GENOME column
* Backwards compatibility: ANNOTATION -> GENE_ANNOTATION
* Docs sample anno expanded including genome option
* update wildcard constraint
* Refactored genome operations to separate Genome class
* sampleParams file and class
* remove sampleParam code from Submodule class

Co-authored-by: Smith Nicholas <smith@in.tum.de>
Co-authored-by: nickhsmith <smithnickh@gmail.com>
Co-authored-by: Vicente <yepez@in.tum.de>
Co-authored-by: Christian Mertes <mertes@in.tum.de>
Co-authored-by: Michaela Mueller <mumichae@in.tum.de>

* Qol changes real (#185)

* fresh QOL branch

* remove GENOME when not in SA

* configure paths, and fix tests to be more specific

* update pytest test_AS.py

* Update 07_extract_results_FraseR.R

* Update DropConfig.py

* Update SampleAnnotation.py

* Update test_AS.py

add potential future test for ncbi_fds obj

* Update test_AS.py

update assert

* additional checks and warnings for reading genome path

* fix warning trigger

* update sa-table column header. ANNOTATION -> GENE_ANNOTATION

* docs sample anno expanded

* check if sample has both BAM and extcount inputs

* update warnings

* docs updated with genome option

* force r-dpylr later version install

* correct typo

* set r-dpylr value

* update warnings

* update warnings/errors

* add comments, and changes based on code review discussion

* update wildcard constraint, and move it from AS to main template

* Refactored genome operations to separate Genome class

* rename sample sa to annotationTable

* fix reference mapping

* save local changes

* sampleParams file and class

* remove sampleParam code from Submodule class

* update errors and warnings for MAE

Co-authored-by: Smith Nicholas <smith@in.tum.de>
Co-authored-by: Vicente <yepez@in.tum.de>
Co-authored-by: Christian Mertes <mertes@in.tum.de>
Co-authored-by: Michaela Mueller <mumichae@in.tum.de>

Co-authored-by: mumichae <51025211+mumichae@users.noreply.github.com>
Co-authored-by: Michaela Müller <mi.mueller@tum.de>
Co-authored-by: Vicente <yepez@in.tum.de>
Co-authored-by: Christian Mertes <mertes@in.tum.de>
Co-authored-by: Anders Jemt <jemten@users.noreply.github.com>
Co-authored-by: Michaela Mueller <mumichae@in.tum.de>
Co-authored-by: Alex Paul <github@ajpdev.com>
Co-authored-by: Smith Nicholas <smith@in.tum.de>
Co-authored-by: nickhsmith <smithnickh@gmail.com>
  • Loading branch information
10 people committed May 11, 2021
1 parent f089b63 commit a9a94f5
Show file tree
Hide file tree
Showing 46 changed files with 738 additions and 306 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
#conda env update --file environment.yml --name base
conda install -c conda-forge -c bioconda drop
conda install -c conda-forge -c bioconda drop 'r-dplyr=1.0.5'
pip install .
- name: Lint with flake8
run: |
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ snakemake aberrantExpression --cores 10
The following publicly-available datasets of gene counts can be used as controls.
Please cite as instructed for each dataset.

* 119 non-strand specific fibroblasts: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3887450.svg)](https://doi.org/10.5281/zenodo.3887450)
* 154 non-strand specific fibroblasts, Technical University of Munich: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4646823.svg)](https://doi.org/10.5281/zenodo.4646823)

* 139 strand specific fibroblasts: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3963473.svg)](https://doi.org/10.5281/zenodo.3963473)
* 269 strand specific fibroblasts, Technical University of Munich: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4646827.svg)](https://doi.org/10.5281/zenodo.4646827)

* 125 strand specific blood: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3963469.svg)](https://doi.org/10.5281/zenodo.3963469)
* 139 strand specific fibroblasts, Baylor College of Medicine: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3963473.svg)](https://doi.org/10.5281/zenodo.3963473)

* 125 strand specific blood, Baylor College of Medicine: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3963469.svg)](https://doi.org/10.5281/zenodo.3963469)

If you want to contribute with your own count matrices, please contact us: yepez at in.tum.de
53 changes: 43 additions & 10 deletions docs/source/prepare.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ indexWithFolderName boolean If true, the basename of the project directory
genomeAssembly character Either hg19/hs37d5 or hg38/GRCh38, depending on the genome assembly used for mapping ``/data/project1``
sampleAnnotation character Full path of the sample annotation table ``/data/project1/sample_annotation.tsv``
root character Full path of the folder where the subdirectories processed_data and processed_results will be created containing DROP's output files. ``/data/project1``
genome character Full path of a human reference genome fasta file ``/path/to/hg19.fa``
genome dictionary (Optional) Multiple fasta files can be specified when RNA-seq BAM files belong to different genome assemblies (eg, ncbi, ucsc). ``ncbi: /path/to/hg19_ncbi.fa``

``ucsc: /path/to/hg19_ucsc.fa``
geneAnnotation dictionary A key-value list of the annotation name (key) and the full path to the GTF file (value). More than one annotation file can be provided. ``anno1: /path/to/gtf1.gtf``

``anno2: /path/to/gtf2.gtf``
Expand Down Expand Up @@ -75,7 +79,7 @@ groups list DROP groups that should be executed in

``- group2``
minIds numeric A positive number indicating the minimum number of samples that a group needs in order to be analyzed. We recommend at least 50. ``1``
fpkmCutoff numeric A positive number indicating the minimum FPKM 5% of the samples per gene should have. If a gene has less it will be filtered out. ``1 # suggested by OUTRIDER``
fpkmCutoff numeric A positive number indicating the minimum FPKM per gene that 5% of the samples should have. If a gene has less it is filtered out. ``1 # suggested by OUTRIDER``
implementation character Either 'autoencoder', 'pca' or 'peer'. Methods to remove sample covariation in OUTRIDER. ``autoencoder``
zScoreCutoff numeric A non-negative number. Z scores (in absolute value) greater than this cutoff are considered as outliers. ``0``
padjCutoff numeric A number between (0, 1] indicating the maximum FDR an event can have in order to be considered an outlier. ``0.05``
Expand Down Expand Up @@ -110,7 +114,6 @@ Mono-allelic expression dictionary
Parameter Type Description Default/Examples
===================== ========= ======================================================================================================================== ======
groups list Same as in aberrant expression. ``# see aberrant expression example``
genome character Full path of a human reference genome fasta file ``/path/to/hg19.fa``
gatkIgnoreHeaderCheck boolean If true (recommended), it ignores the header warnings of a VCF file when performing the allelic counts ``true``
padjCutoff numeric Same as in aberrant expression. ``0.05``
allelicRatioCutoff numeric A number between [0.5, 1) indicating the maximum allelic ratio allele1/(allele1+allele2) for the test to be significant. ``0.8``
Expand All @@ -126,15 +129,32 @@ Creating the sample annotation table
------------------------------------

For a detailed explanation of the columns of the sample annotation, please refer to
the DROP manuscript.
Inside the sample annotation, each row corresponds to a unique pair of RNA and DNA
Box 3 of the `DROP manuscript <https://www.rdcu.be/cdMmF>`_.

Each row of the sample annotation table corresponds to a unique pair of RNA and DNA
samples derived from the same individual. An RNA assay can belong to one or more DNA
assays, and vice-versa. If so, they must be specified in different rows. The required
columns are ``RNA_ID``, ``RNA_BAM_FILE`` and ``DROP_GROUP``, plus other module-specific
ones (see DROP manuscript). In case external counts are included, add a new row for each
sample from those files (or a subset if not all samples are needed).
ones (see DROP manuscript).

The following columns describe the RNA-seq experimental setup:
``PAIRED_END``, ``STRAND``, ``COUNT_MODE`` and ``COUNT_OVERLAPS``. They affect the
counting procedures of the aberrant expression and splicing modules. For a detailed
explanation, refer to the documentation of `HTSeq <https://htseq.readthedocs.io/en/latest/>`_.

To run the MAE module, the columns ``DNA_ID`` and ``DNA_VCF_FILE`` are needed.

In case external counts are included, add a new row for each sample from those
files (or a subset if not all samples are needed). Add the columns: ``GENE_COUNTS_FILE``,
``GENE_ANNOTATON``, ``SPLIT_COUNTS_FILE`` and ``NON_SPLIT_COUNTS_FILE``. See examples below.

In case RNA-seq BAM files belong to different genome assemblies (eg, ncbi, ucsc), multiple
reference genome fasta files can be specified. Add a column called `GENOME` that
contains, for each sample, the key from the `genome` parameter in the config file that
matches its genome assembly (eg, ncbi or ucsc).


The sample annotation file should be saved in the tab-separated values (tsv) format. The
The sample annotation file must be saved in the tab-separated values (tsv) format. The
column order does not matter. Also, it does not matter where it is stored, as the path is
specified in the config file. Here we provide some examples on how to deal with certain
situations. For simplicity, we do not include all possible columns in the examples.
Expand Down Expand Up @@ -215,12 +235,13 @@ Advanced options
A local copy of DROP can be edited and modified for uncovering potential issues or increasing outputs.
For example, the user might want to add new plots to the ``Summary`` scripts, or add
additional columns to the results tables.
Specifically, the number of threads allowed for a computational step can be modified by the user.
Also, the number of threads allowed for a computational step can be modified.

.. note::

DROP needs to be installed from a local directory :ref:`otherversions` using ``pip install -e <path/to/drop-repo>``
so that any changes in the code will be available in the next pipeline run.
DROP needs to be installed from a local directory using ``pip install -e <path/to/drop-repo>``
so that any changes in the code will be available in the next pipeline run
(see :ref:`otherversions`).
Any changes made to the R code need to be updated with ``drop update`` in the project directory.

The aberrant expression and splicing modules use a denoising autoencoder to
Expand All @@ -230,4 +251,16 @@ We recommend the search space to be at most N/3 for the aberrant expression,
and N/6 for the aberrant splicing case. Nevertheless, the user can specify the
denominator with the parameter ``maxTestedDimensionProportion``.

DROP allows that BAM files from RNA-seq from samples belonging to the same `DROP_GROUP`
were aligned to different genome assemblies from the same build (eg, some to ucsc
and others to ncbi, but all to either hg19 or hg38). If so, for the aberrant
expression and splicing modules, no special configuration is needed.
For the MAE module, the different fasta files must be specified as a dictionary in
the `genome` parameter of the config file, and, for each sample, the corresponding
key of the `genome` dictionary must be specified in the `GENOME` column of the
sample annotation.
In additon, DROP allows that BAM files from RNA-seq were aligned to one genome
assembly (eg ucsc) and the corresponding VCF files from DNA sequencing to another
genome assembly (eg ncbi). If so, the assembly of the reference genome fasta file
must correspond to the one of the BAM file from RNA-seq.

77 changes: 63 additions & 14 deletions drop/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
import drop
import yaml
from pathlib import Path
from shutil import copyfile
from shutil import copy2
from distutils.dir_util import mkpath, copy_tree, remove_tree
import subprocess
import click
import click_log
import logging
import os
import filecmp as fc

wbuildPath = Path(wbuild.__file__).parent / ".wBuild"
logger = logging.getLogger(__name__)
Expand All @@ -20,22 +22,66 @@ def main():
pass


def copyModuleCode(repoPaths, projectPaths):
def overwrite(base_repo,local_proj):
fc.clear_cache() # clear file compare cache to avoid mistakes
compare_obj = fc.dircmp(base_repo,local_proj)

#remove all things not in the base_repo
for i in compare_obj.right_only:
logger.info(f"removing local file {i} it is not in the base drop")
if os.path.isfile(local_proj / i):
removeFile(local_proj / i,warn = False)
else:
remove_tree(local_proj / i)

# for all dirs and files in base_dir
for i in compare_obj.left_list:
#files
if os.path.isfile(base_repo / i):
# filename is the same in both
if i in compare_obj.common_files:

# if file is diff copy original over. otherwise do nothing
if i in compare_obj.diff_files:
logger.info(f"overwriting {local_proj / i} with {base_repo / i})")
copy2(base_repo / i,local_proj / i)


# file not present in local project. Copy it
else:
logger.info(f"overwriting {local_proj / i} with {base_repo / i})")
copy2(base_repo / i,local_proj / i)

#dirs
elif os.path.isdir(base_repo / i):
if i in compare_obj.common_dirs:
overwrite(base_repo / i, local_proj / i)
else:
logger.info(f"the directory {str(base_repo / i)} does not exist locally. copying here: {str(local_proj)}")
copy_tree(str(base_repo / i), str(local_proj / i))

# other?
else:
logger.info(i, "is something other than file or dir. Ignoring")


def copyModuleCode(repoPaths,projectPaths):
repo_map = {
"aberrant-expression-pipeline": "AberrantExpression",
"aberrant-splicing-pipeline": "AberrantSplicing",
"mae-pipeline": "MonoallelicExpression"
}

for repo, analysis_dir in repo_map.items():
module_repo = repoPaths["modules"] / repo
module_project = projectPaths["Scripts"] / analysis_dir / "pipeline"
if module_project.is_dir():
remove_tree(module_project)
print(f"overwriting pipeline scripts for {analysis_dir}")
copy_tree(str(module_repo), str(module_project))


fc.clear_cache() # clear file compare cache to avoid mistakes
base_repo = repoPaths["modules"] / repo
local_proj = projectPaths["Scripts"] / analysis_dir / "pipeline"
if not local_proj.is_dir(): # module directory does not exist. copy it
logger.info(f"{local_proj} is not a directory, copy over from drop base")
copy_tree(str(base_repo), str(local_proj))
else: #module dir does exist. Do a safe-overwrite
overwrite(base_repo,local_proj)

def removeFile(filePath, warn=True):
filePath = Path(filePath)
if filePath.is_file():
Expand All @@ -44,7 +90,7 @@ def removeFile(filePath, warn=True):
filePath.unlink()


def setFiles(projectDir=None, warn=True):
def setFiles(projectDir=None):
projectDir = Path.cwd().resolve() if projectDir is None else projectDir
repoPaths, projectPaths = drop.setupPaths(projectRoot=projectDir)

Expand All @@ -60,17 +106,18 @@ def setFiles(projectDir=None, warn=True):
# TODO: put version info there

# copy Scripts and pipelines
copyfile(repoPaths["template"] / "Snakefile", projectPaths["projectDir"] / "Snakefile")
copy2(repoPaths["template"] / "Snakefile", projectPaths["projectDir"] / "Snakefile")
copy_tree(str(repoPaths["Scripts"]), str(projectPaths["Scripts"]))
copyModuleCode(repoPaths, projectPaths)
#copyModuleCode(repoPaths, projectPaths)

config_file = projectPaths["projectDir"] / "config.yaml"
if not config_file.is_file():
copyfile(repoPaths["template"] / "config.yaml", config_file)
copy2(repoPaths["template"] / "config.yaml", config_file)

# search for a file containing the word readme and .md
if not list(projectPaths["projectDir"].glob("readme*.md")):
copyfile(repoPaths["template"] / "readme.md", projectPaths["projectDir"] / "readme.md")
copy2(repoPaths["template"] / "readme.md", projectPaths["projectDir"] / "readme.md")


@main.command()
Expand All @@ -85,6 +132,8 @@ def init():
@main.command()
def update():
drop.checkDropVersion(Path().cwd().resolve(), force=True)
logger.info("updating local Scripts if necessary")
setFiles()
logger.info("update...done")


Expand Down

0 comments on commit a9a94f5

Please sign in to comment.