Commit bcac30f4 authored by cziegenhain's avatar cziegenhain
Browse files

revert mapping to STAR bam output

parent ff7e879c
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ We provide a script to convert zUMIs output into loom file automatically based o
zUMIs will try to automatically do this, otherwise convert zUMIs output to loom by simply running `Rscript rds2loom.R myRun.yaml`.

## Changelog
23 June 2020: zUMIs2.8.3: Merged code contribution from @gringer: prevent errors by emitting SAM headers in chunked unmapped .bam file output of fqfilter. Changed call to STAR to prevent stalling of samtools pipe. 

18 May 2020: zUMIs2.8.2: Added `merge_demultiplexed_fastq.R` to concatenate previously demultiplexed fastq files. For usage details see here: https://github.com/sdparekh/zUMIs/wiki/Starting-from-demultiplexed-fastq-files

15 May 2020: zUMIs2.8.1: Smart-seq3 UMI pattern detection now takes one hamming distance error into account.
+6 −6
Original line number Diff line number Diff line
@@ -329,12 +329,12 @@ for (my $i=0; $i<=$#keys; $i++) {
  close $fhTmp;
}

if ($filtered == 0) {
  print(STDERR "No reads emitted; please check the parameter file and the warnings above.\n");
  exit;
} else {
  print(STDERR "reads kept: $filtered; reads discarded: $discarded\n");
}
#if ($filtered == 0) {
#  print(STDERR "No reads emitted; please check the parameter file and the warnings above.\n");
#  exit;
#} else {
#  print(STDERR "reads kept: $filtered; reads discarded: $discarded\n");
#}

open BCOUT, '>', $outbcstats || die "Couldn't open file ".$outbcstats.". Check permissions!\n";
foreach my $bc (keys %bclist) {
+15 −12
Original line number Diff line number Diff line
@@ -77,31 +77,34 @@ cDNA_read_length <- getmode(nchar(cDNA_peek$V1))
# Setup STAR mapping ------------------------------------------------------
samtools_load_cores <- ifelse(inp$num_threads>8,2,1)
avail_cores <- inp$num_threads - samtools_load_cores #reserve threads for samtools file opening
if(avail_cores < 3){
  cores_samtools <- 1
  cores_star <- 2
}else{
  cores_samtools <- floor(avail_cores/3)
  cores_star <- avail_cores - cores_samtools
#if(avail_cores < 3){
#  cores_samtools <- 1
#  cores_star <- 2
#}else{
#  cores_samtools <- floor(avail_cores/3)
#  cores_star <- avail_cores - cores_samtools
#}
if(avail_cores < 2){
  avail_cores = 1
}

param_defaults <- paste("--readFilesCommand ",samtools," view -@",samtools_load_cores," --outSAMmultNmax 1 --outFilterMultimapNmax 50 --outSAMunmapped Within --outSAMtype SAM --outStd SAM")
#param_defaults <- paste("--readFilesCommand ",samtools," view -@",samtools_load_cores," --outSAMmultNmax 1 --outFilterMultimapNmax 50 --outSAMunmapped Within --outSAMtype SAM --outStd SAM")
param_defaults <- paste("--readFilesCommand ",samtools," view -@",samtools_load_cores," --outSAMmultNmax 1 --outFilterMultimapNmax 50 --outSAMunmapped Within --outSAMtype BAM Unsorted")
param_misc <- paste("--genomeDir",inp$reference$STAR_index,
                    "--sjdbGTFfile",gtf_to_use,
                    "--runThreadN",cores_star,
                    "--runThreadN",avail_cores,
                    "--readFilesIn",paste0(filtered_bams,collapse=","),
                    "--outFileNamePrefix",paste(inp$out_dir,"/",inp$project,".filtered.tagged.",sep=""),
                    "--sjdbOverhang", cDNA_read_length-1,
                    "--readFilesType SAM",inp$read_layout)

STAR_command <- paste(STAR_exec,param_defaults,param_misc,inp$reference$additional_STAR_params,param_additional_fa)
if(inp$counting_opts$twoPass==T){
if(inp$counting_opts$twoPass==TRUE){
  STAR_command <- paste(STAR_command,"--twopassMode Basic")
}

samtools_output <- paste0(" | ",samtools," view -@ ",cores_samtools," -o ",inp$out_dir,"/",inp$project,".filtered.tagged.Aligned.out.bam")

STAR_command <- paste(STAR_command,samtools_output)
#samtools_output <- paste0(" | ",samtools," view -@ ",cores_samtools," -o ",inp$out_dir,"/",inp$project,".filtered.tagged.Aligned.out.bam")
#STAR_command <- paste(STAR_command,samtools_output)

#finally, run STAR
if(inp$which_Stage == "Filtering"){
+1 −1
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.8.2
vers=2.8.3
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