-
Notifications
You must be signed in to change notification settings - Fork 18
/
setup_project_dir.sh
executable file
·78 lines (58 loc) · 2.52 KB
/
setup_project_dir.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env bash
# don't overwrite files.
set -o noclobber
# Exit if no arguments were provided.
[ $# -eq 0 ] && { echo "Usage: $0 [target directory]"; exit 1; }
# the first argument passed into the script should be the dir
# where you want the folder structure setup
echo "Setting up folder structure in $1"
if [ ! -d "$1" ]; then
mkdir $1
fi
cd $1
mkdir doc data src bin results
cd doc
echo "Doc directory with one subdirectory per manuscript" > README
touch .gitkeep
cd ../data
echo "Data directory for storing fixed data sets" > README
touch .gitkeep
cd ../src
echo "src for source code" > README
touch .gitkeep
cd ../bin
echo "bin for compiled binaries or scripts" > README
touch .gitkeep
cd ../results
echo "Results directory for tracking computational experiments peformed on data" > README
touch .gitkeep
echo "Folders created."
cd ..
cat > README.md << EOF
#computational-project-cookie-cutter
A cookie cutter (aka project template) to set up a folder structure for a computational project.
This is a quick way to setup a folder structure that follows one standard to organize a project.
This helps with project management, reproducibility, sharing, and publishing your data, analysis, and results.
This project was inspired (and modeled off) by:
[Noble WS 2009 A Quick Guide to Organizing Computational Biology Projects. PLoS Comput Biol 5 7: e1000424. doi:10.1371/journal.pcbi.1000424](http://dx.doi.org/10.1371/journal.pcbi.1000424)
## What it does
the \`setup_project_dir.sh\` script creates the following folder structure:
Path_Provided
|- doc/ # directory for documentation, one subdirectory for manuscript
|
|- data/ # data for storing fixed data sets
|
|- src/ # any source code
|
|- bin/ # any compiled binaries or scripts
|
|- results/ # output for tracking computational experiments performed on data
A README containing a brief blurb is placed in each folder.
This is because git will not track empty folders and placing a README will
remind you of what goes in each folder, and also the overall
folder structure will be retained
If you use a webservice in conjunction with your version control (e.g. github, bitbucket, gitlabs, gitbucket, etc)
the webservice will be able to render these README and other [markdown](https://help.github.com/articles/markdown-basics/) files automatically.
This project was taken from [this](https://github.com/chendaniely/computational-project-cookie-cutter) github repo
EOF
echo "Top-level README.md created"