RootDirs

Struct RootDirs 

Source
pub struct RootDirs {
    pub(crate) code: Option<PathBuf>,
    pub(crate) data: Option<PathBuf>,
    pub(crate) results: Option<PathBuf>,
    pub(crate) external: Option<PathBuf>,
    pub(crate) docs: Option<PathBuf>,
}
Expand description

Expected top-level directories to organize the project folder.

Fields§

§code: Option<PathBuf>

Top-level path for code.

This folder contains all the code used to process files from data, perform statistical analyses, create visualizations, and save the outputs in results. Generally, this directory contains a series of subdirectories, each of which contain a set of related scripts for a single research question. For example, each subdirectory may contain:

  • a workflow file (e.g. Snakefile or Nextflow)
  • a data pre-processing script
  • a statistical analysis and calculation script
  • a plotting script
§data: Option<PathBuf>

Top-level path for data.

All raw and processed data should be found within this directory. The datasets located here will then be sourced by code within the code directory and used to generate outputs in the results directory.

§results: Option<PathBuf>

Top-level path for results.

Code and scripts in the code directory should create outputs in this directory to ensure a separation of inputs, code, and outputs. Generally, this directory contains a series of subdirectories, each of which will contain all the outputs originating from the code in the corresponding code subdirectory.

§external: Option<PathBuf>

Top-level path for vendored external code.

In many research projects you will need a copy of some external code, such as a git submodule, or a package manifest of some kind, like a Nix derivation or an Anaconda recipe. This folder can be used to house all of the relevant code so as to not populate the custom code present in code.

§docs: Option<PathBuf>

Top-level path for documentation.

Documentation such as a manuscript, experimental descriptions from contract research organizations, or interactive HTML notebooks displaying the data and its results can go here. Data that belongs in data or notebooks which process data that belong in code should not be placed in here.

Trait Implementations§

Source§

impl Clone for RootDirs

Source§

fn clone(&self) -> RootDirs

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RootDirs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RootDirs

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<Option<ConfigFileRootDirs>> for RootDirs

Source§

fn from(value: Option<ConfigFileRootDirs>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.