Commit 22ecf3a4 authored by cziegenhain's avatar cziegenhain
Browse files

miniconda update

parent b7e98781
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+2 −0
Original line number Diff line number Diff line
zUMIs-env/
zUMIs-miniconda.tar.bz2
+18 −1
Original line number Diff line number Diff line
# Welcome to zUMIs :wrench: :red_car::dash: :wrench:

## Quickstart
Nobody likes reading long README files so here is how you get going:
Fetch zUMIs by cloning the repository:
```
git clone https://github.com/sdparekh/zUMIs.git`
```
Start anaylysing your data:
```
zUMIs/zUMIs-master.sh -c -y my_config.yaml
```
zUMIs now comes with its own [miniconda](https://docs.conda.io/en/latest/miniconda.html) environment, so you do not need to deal with dependencies or installations (use the -c flag to use conda).
If you wish to use your own dependencies, head to the [zUMIs wiki](https://github.com/sdparekh/zUMIs/wiki/Installation#dependencies) to see what is required. 


## Intro
zUMIs is a fast and flexible pipeline to process RNA-seq data with (or without) UMIs.

The input to this pipeline is simply fastq files. In the most common cases, you will have a read containing the cDNA sequence and other read(s) containing UMI and Cell Barcode information. Furthermore, you will need a STAR index for your genome and GTF annotation file.
@@ -11,9 +26,11 @@ You can read more about zUMIs in our [paper](https://doi.org/10.1093/gigascience
## Loom output
The loom format is increasing in popularity and compatible with downstream analysis using python out of the box.
We provide a script to convert zUMIs output into loom file automatically based on the [loomR package from the Satija lab](https://satijalab.org/loomR/loomR_tutorial.html). Please make sure you have loomR installed.
To convert zUMIs output to loom, simply run `Rscript rds2loom.R myRun.yaml`.
zUMIs will try to automatically do this, otherwise convert zUMIs output to loom by simply running `Rscript rds2loom.R myRun.yaml`.

## Changelog
19 Feb 2020: [zUMIs2.7.0 released](https://github.com/sdparekh/zUMIs/releases/tag/2.7.0): Simplify installation greatly by a cond-pack of miniconda with all dependencies. The conda environment is used with `zUMIs-master.sh -c`, with the old behavior staying as the default. 

13 Feb 2020: zUMIs2.6.3: Faster demultiplexing using python/pysam. Made forking of UMI collapse worker threads more robust.

06 Feb 2020: zUMIs2.6.2: Changes to the hamming distance UMI collapse to avoid overcollapsing of highly expressed genes.
+1 −1
Original line number Diff line number Diff line
@@ -382,7 +382,7 @@ demultiplex_bam <- function(opt, bamfile, nBCs){
    dir.create( paste0(opt$out_dir,"/zUMIs_output/demultiplexed/") )
  }

  installed_py <- system("pip3 freeze", intern = TRUE)
  installed_py <- system("pip freeze", intern = TRUE)

  if(any(grepl("pysam==",installed_py))){
    print("Using python implementation to demultiplex.")
+3 −3
Original line number Diff line number Diff line
@@ -16,11 +16,11 @@ rds_to_loom <- function(zUMIsRDS){
  for(type in names(rds)){
    for(quant in names(rds[[type]])){
      outfile <- paste0(opt$out_dir,"/zUMIs_output/expression/",opt$project,".",type,".",quant,".all.loom")
      loomR::create(filename = outfile, data = as.matrix(rds[[type]][[quant]][["all"]]), transpose = TRUE,overwrite = TRUE)
      loomR::create(filename = outfile, data = as.matrix(rds[[type]][[quant]][["all"]]), do.transpose = TRUE,overwrite = TRUE)
      
      for(d in names(rds[[type]][[quant]][["downsampling"]])){
        outfile <- paste0(opt$out_dir,"/zUMIs_output/expression/",opt$project,".",type,".",quant,".",d,".loom")
        loomR::create(filename = outfile, data = as.matrix(rds[[type]][[quant]][["downsampling"]][[d]]), transpose = TRUE,overwrite = TRUE)
        loomR::create(filename = outfile, data = as.matrix(rds[[type]][[quant]][["downsampling"]][[d]]), do.transpose = TRUE,overwrite = TRUE)
        
      }
    }
+51 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
# Pipeline to run UMI-seq analysis from fastq to read count tables.
# Authors: Swati Parekh, Christoph Ziegenhain, Beate Vieth & Ines Hellmann
# Contact: sparekh@age.mpg.de or christoph.ziegenhain@ki.se
vers=2.6.3b
vers=2.7.0
currentv=`curl -s https://raw.githubusercontent.com/sdparekh/zUMIs/master/zUMIs-master.sh | grep '^vers=' | cut -f2 -d "="`
if [ "$currentv" != "$vers" ]; then echo -e "------------- \n\n Good news! A newer version of zUMIs is available at https://github.com/sdparekh/zUMIs \n\n-------------"; fi

@@ -38,6 +38,10 @@ function usage () {
## Program path ##
	-d  <zUMIs-dir>   	 : Directory containing zUMIs scripts.  Default: path to this script.

## Miniconda environment

  -c : Use zUMIs dependencies in the preinstalled conda enviroment.

zUMIs version $vers

EOF
@@ -46,10 +50,12 @@ EOF
# Define the default variables #
zumisdir=$(dirname `readlink -f $0`)

while getopts ":y:d:h" options; do #Putting <:> between keys implies that they can not be called without an argument.

while getopts ":y:d:ch" options; do #Putting <:> between keys implies that they can not be called without an argument.
  case $options in
  y ) yaml=$OPTARG;;
  d ) zumisdir=$OPTARG;;
  c ) conda=true;;
  h ) usage
          exit 1;;
  \? ) echo -e "\n This key is not available! Please check the usage again: -$OPTARG"
@@ -109,6 +115,43 @@ if grep -q 'Rscript_exec:' $yaml
    echo "Rscript_exec: $Rexc" >> $yaml
fi

#check for conda usage!
if [[ $conda = true ]]; then
  echo "Using miniconda environment for zUMIs!"
  samtoolsexc=samtools
  if grep -q 'samtools_exec:' $yaml; then
      sed -i '/samtools_exec:/d' $yaml
  fi
  echo "samtools_exec: $samtoolsexc" >> $yaml
  pigzexc=pigz
  if grep -q 'pigz_exec:' $yaml; then
      sed -i '/pigz_exec:/d' $yaml
  fi
  echo "pigz_exec: $pigzexc" >> $yaml
  starexc=STAR
  if grep -q 'STAR_exec:' $yaml; then
      sed -i '/STAR_exec:/d' $yaml
  fi
  echo "STAR_exec: $starexc" >> $yaml
  Rexc=Rscript
  if grep -q 'Rscript_exec:' $yaml; then
      sed -i '/Rscript_exec:/d' $yaml
  fi
  echo "Rscript_exec: $Rexc" >> $yaml

  zumisenv=$zumisdir/zUMIs-env
  miniconda=$zumisdir/zUMIs-miniconda.tar.bz2
  #check if zUMIs environment has been unpacked from tar
  if [[ ! -d $zumisenv ]] || [[ $zumisdir/zUMIs-miniconda.partaa -nt $zumisenv ]] ; then
    [ -d $zumisenv ] || mkdir -p $zumisenv
    cat $zumisdir/zUMIs-miniconda.parta* > $miniconda
    tar -xj --overwrite -f $miniconda -C $zumisenv
  fi
  #activate zUMIs environment!
  source $zumisenv/bin/activate
  conda-unpack
fi

if grep -q 'zUMIs_directory:' $yaml
  then
    sed -i "s|zUMIs_directory:.*|zUMIs_directory: $zumisdir|" $yaml
@@ -261,3 +304,9 @@ then
  fi
  date
fi


#close conda enviroment if necessary
if [ $conda = true ]; then
  source $zumisenv/bin/deactivate
fi