Biodiverse pipeline for automating Biodiverse using R
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R_release
R_supercomputer
perl
pipeline_test
shape_files
.gitignore
biodiverse_pipeline.Rproj
outputfile
readme.Rmd
readme.html

readme.Rmd

title author date output
Biodiverse Pipeline Read Me
Nunzio Knerr
Monday, August 04, 2014
html_document

This file outlines the pipeline scripts. The file names are hopefully pretty self explanatory.
If everything is installed correctly you should only need to use the scripts in the R_release folder.
The scrpts in the perl directory are called by R which in turn uses Biodiverse.\

Installation

Prerequisites

R from here R home page\

R-Studio from here R-studio download page\

You need an SVN and Git client

Windows

SVN for windows here Tortoise svn
Git here Tortoise git
also needs this installed after Tortoise git GIT for Windows\

Mac

SVN for Mac here scplugin
Git here mac installer
Git gui for mac here gitx\


Extra Installation steps

Biodiverse from here Biodiverse Download page
Install the source version for your operating system.

from a terminal window you will need to run the following as well\

cpanm Getopt::Long::Descriptive

cpan Text::CSV

cpan Text::CSV_XS

cpanm Text::CSV

cpanm Text::CSV_XS

cpanm List::BinarySearch


Starting out

In R-studio you should open the "biodiverse_pipeline.Rproj"" file.
It is in the "biodiverSe_pipeline" folder"
This will set your working directory up and make all relative links work.
From here there are a few different types of scripts.\


Setup Scripts

These help get everything setup so it all works :)\

check_and_install_packages.R

The "check_and_install_packages.R" file does just that, it checks to see if you have a number of packages installed.
If you don't, then it attempts to download and install them.
Hopefully it will make setting up your R envinonment a lot quicker and easier.\


biodiverse_path_reference.R

This file contains all the path references needed. for perl etc. to work with the R scripts.
THIS NEEDS TO BE CORRECT OR NOTHING WILL WORK!!!


convert_csv_to_metres.R

This is the first file that takes some of your data and converts lat/longs to metres for use in the analyses.\


The folder stucture is given below


create_bds.pl

This file creates a biodiverse base data file .bds file\

Inputs:

  1. input csv file name\
  2. output file name\
  3. label column number\
  4. group column number x\
  5. group column number y\
  6. cell size x\
  7. cell size y\

Outputs:

  1. Output file .(bds)\

create_bts.pl

This file creates a biodiverse tree file from a nexus tree file.\

Inputs:

  1. input tree file\
  2. out file name\

Outputs:

  1. Output file .(bts)\

trim_bds_and_bts.pl

This file loads the biodiverse base data file (.bds) and the Biodiverse tree file (.bts) and trims then both to each other.
This makes sure that only taxa in the tree are included in the spatial data and visa versa.\

Inputs:

  1. input bds file name
  2. input bts file name
  3. output bds file name
  4. output bts file name

Outputs:

  1. output bds file name
  2. output bts file name

run_analyses.pl

This file loads and exports multipe basedata files in a directory\

Inputs:

  1. input bds file name
  2. input bts file NAME
  3. calcs (The comma delimited list of calculations to run)
  4. output bds file

Outputs:

  1. output bds file

run_randomisation_example.txt

This shows an example of the text format needed to use from the command line to get biodiverse to run randomisations.\

Inputs:

none

Outputs:

none


load_bds_and_export_results.pl

This file loads the biodiverse file and then exports the reuslts as .csv files.\

Inputs:

  1. input bds file
  2. output csv prefix

Outputs:

  1. output csv files

export_spatial_many_basedatas_r.pl

This file loads and exports multipe basedata files in a directory\

Inputs:

  1. folder with .bds files to export results from

Outputs:

  1. results .csv files \

biodiverse_path_reference.r

This file loads and exports multipe basedata files in a directory\

Inputs:

  1. Path to perl installasion\
  2. Path to PERL5LIB\
  3. Path to Biodiverse install folder\

Outputs:

None \


check_and_install_packages

This file loads and exports multipe basedata files in a directory\

Inputs:

none

\

Outputs:

none \


convert_csv_to_metres

This file loads a csv and converts the decimal lat long values to a projection in metres\

Inputs:

  1. input csv file
  2. output csv file
  3. long lat columns
  4. old projection eg. "+init=epsg:4326" #this is WGS84 most common used for google earth etc. in decimal degrees
  5. new projection eg. "+init=epsg:3577"

Outputs:

  1. output csv file (with added columns x_proj, y_proj) \

open_biodiverse_create_bds

This file loads a csv into biodiverse and saves it out as a basedata file.\

Inputs:

  1. csv file name
  2. out file name
  3. label column number
  4. group column number x
  5. group column number y
  6. cell_size_x
  7. cell size y

Outputs:

  1. out file \

open_biodiverse_create_bts

This file loads and exports multipe basedata files in a directory\

Inputs:

  1. input tree file
  2. out file name

Outputs:

  1. out file \

open_biodiverse_trim_bds_and_bts

This file loads and exports multipe basedata files in a directory\

Inputs:

  1. input bds file name
  2. input bts file name
  3. output bds file name
  4. output bts file name

Outputs:

  1. output bds file
  2. output bts file

\


open_biodiverse_run_analyses

This file loads and exports multipe basedata files in a directory\

Inputs:

  1. input bds file name
  2. input bts file name
  3. calcs eg. "calc_endemism_whole,calc_pd,calc_pe"

Outputs:

  1. input bds file with "_analysed.bds" suffix \

open_biodiverse_run_randomisations

This file loads and exports multipe basedata files in a directory\

Inputs:

  1. basedata file
  2. rand name to prefix to randomisation
  3. iterations (number of times to run the randomisation)
  4. args (extra arguments to pass to the script)

Outputs:

  1. basedata file with randomisation results embedded \

open_biodiverse_export_results_from_bds

This file loads and exports multipe basedata files in a directory\

Inputs:

  1. input bds file name
  2. output csv prefix (the name to prepend to the output file names)

Outputs:

  1. files for each of the results stored in the input .bds file with the specified prefix prepended to each. \

load_biodiverse_results_and_report_on_CANAPE_by_taxa

This file loads three results files from biodiverse and calculates CANAPE summaries from them.

Inputs:

  1. biodiverse group export
  2. biodiverse observed data
  3. biodiverse randomisation results

Outputs:

  1. CANAPE summary by group .csv file

load_biodiverse_results_and_plot_maps

This file loads two results files from biodiverse and calculates CANAPE and outputs maps of them.

Inputs:

  1. Biodiverse observed data
  2. Biodiverse randomisation results
  3. Shape file to use as an outline

Outputs:

  1. several image files \