Skip to content
Snippets Groups Projects
Commit 614203d4 authored by Dominik Brilhaus's avatar Dominik Brilhaus
Browse files

Merge branch 'ConvertToCWL' into 'main'

cwl kallisto_index

See merge request brilator/samplearc_rnaseq!5
parents 86c6495e 3fe71fce
No related branches found
No related tags found
No related merge requests found
# cwltool README
## First cd into the (runs) folder, with the .yml file
cd /Users/dominikbrilhaus/03_DataPLANT_gitlab/samplearc_rnaseq/runs/kallisto_index
## Let it flow
```bash
### store arc root (two levels up from here) as variable
arc_root=$(echo ${PWD%/*/*})
### replace arc root line in yml (specific to the machine from where this is run)
### not sure, if this works on linux...
sed -i '' "s|^arc_root:.*|arc_root: $arc_root|g" kallisto_index.yml
### run with cwltool
cwltool ../../workflows/kallisto_index.cwl kallisto_index.yml
```
cores: 1
sh_script:
class: File
path: ../../workflows/kallisto_index.sh
in_genome_ref: studies/TalinumGenomeDraft/resources/Talinum.gm.CDS.nt.fa
out_folder: runs/kallisto_index
arc_root: /Users/dominikbrilhaus/03_DataPLANT_gitlab/samplearc_rnaseq
# Kallisto
## Manual
http://pachterlab.github.io/kallisto/manual.html
## MacOS Installation
```bash
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install kallisto
```
```bash
git clone https://github.com/pachterlab/kallisto.git
cd kallisto
mkdir build
cd build
cmake .. -DUSE_HDF5=ON
```
#!/usr/bin/env Rscript
########################
# Installation of R dependencies
########################
### sleuth installation
if (!requireNamespace("BiocManager", quietly = TRUE)){install.packages("BiocManager")}
if(!"BiocManager" %in% row.names(installed.packages())){BiocManager::install()}
if(!"devtools" %in% row.names(installed.packages())){BiocManager::install("devtools")}
# BiocManager::install("pachterlab/sleuth")
# There's currently (early 2022) an issue with sleuth installation.
# Using this workaround from https://github.com/pachterlab/sleuth/issues/259#issuecomment-1001076030
if(!"sleuth" %in% row.names(installed.packages())){remotes::install_github("pachterlab/sleuth#260")}
library(sleuth)
### other packages
library(tidyverse)
library(jsonlite)
library(openxlsx)
required_packages <-
c('tidyverse', ## data wrangling and plotting
'jsonlite', ## read/write json files
'openxlsx') ## read/write xlsx files
for(package in required_packages)
{
## Check if package is installed. If not, install
if(!package %in% row.names(installed.packages())){install.packages(package,
repos ="https://cran.uni-muenster.de/")}
# ## Check if package is up to date. If not, update
# update.packages(package, repos = "https://cran.uni-muenster.de/")
## Load package
library(package, character.only = T)
print(paste("installed R package", package))
}
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
inputs:
- id: sh_script
type: File
inputBinding:
position: 0
- id: arc_root
type: string
inputBinding:
position: 1
- id: in_genome_ref
type: string
inputBinding:
position: 2
- id: out_folder
type: string
inputBinding:
position: 3
outputs:
- id: outdir
type:
type: array
items: Directory
outputBinding:
glob: $(runtime.outdir)/$(inputs.out_folder)
baseCommand:
- bash
\ No newline at end of file
#!/usr/bin/env bash
### Build kallisto index
################################################
#### Read arguments from CLI
################################################
arc_root=$1
in_genome_ref=$2
out_folder=$3
################################################
#### Print version and citation to test kallisto
################################################
kallisto version
kallisto cite
################################################
#### If it does not exist, create out dir
################################################
mkdir -p "$arc_root/$out_folder/"
################################################
#### Build kallisto index
################################################
kallisto index -i "$arc_root/$out_folder/kallisto_index" "$arc_root/$in_genome_ref"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment