From: Bo Li Date: Thu, 3 Apr 2014 17:30:24 +0000 (-0500) Subject: Use PATH env to instead the variable X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f49d6d79ed79ffed38df6f80dd15b6d09f1ec8ab;p=rsem.git Use PATH env to instead the variable --- diff --git a/EBSeq/BiocInstaller/DESCRIPTION b/EBSeq/BiocInstaller/DESCRIPTION deleted file mode 100644 index 269c539..0000000 --- a/EBSeq/BiocInstaller/DESCRIPTION +++ /dev/null @@ -1,13 +0,0 @@ -Package: BiocInstaller -Title: Install/Update Bioconductor and CRAN Packages -Description: Installs/updates Bioconductor and CRAN packages -Version: 1.12.0 -Author: Dan Tenenbaum and Biocore Team -Maintainer: Bioconductor Package Maintainer - -biocViews: Software -Depends: R (>= 3.0.0) -Suggests: RUnit, BiocGenerics -License: Artistic-2.0 -Packaged: 2013-10-15 04:03:53 UTC; biocbuild -Built: R 3.0.2; ; 2013-10-15 11:47:50 UTC; unix diff --git a/EBSeq/BiocInstaller/INDEX b/EBSeq/BiocInstaller/INDEX deleted file mode 100644 index ec33cf3..0000000 --- a/EBSeq/BiocInstaller/INDEX +++ /dev/null @@ -1,13 +0,0 @@ -BiocUpgrade Upgrade Bioconductor to the latest version - available for this version of R -biocLite Install or update Bioconductor and CRAN - packages -biocValid Validate installed package versions against - biocLite versions. -biocVersion Bioconductor version -biocases_group Convenience functions to return package names - associated with Bioconductor publications. -biocinstallRepos Display current Bioconductor and CRAN - repositories. -useDevel Get the 'devel' version of the BiocInstaller - package. diff --git a/EBSeq/BiocInstaller/Meta/Rd.rds b/EBSeq/BiocInstaller/Meta/Rd.rds deleted file mode 100644 index e07c822..0000000 Binary files a/EBSeq/BiocInstaller/Meta/Rd.rds and /dev/null differ diff --git a/EBSeq/BiocInstaller/Meta/hsearch.rds b/EBSeq/BiocInstaller/Meta/hsearch.rds deleted file mode 100644 index e320f87..0000000 Binary files a/EBSeq/BiocInstaller/Meta/hsearch.rds and /dev/null differ diff --git a/EBSeq/BiocInstaller/Meta/links.rds b/EBSeq/BiocInstaller/Meta/links.rds deleted file mode 100644 index cc993be..0000000 Binary files a/EBSeq/BiocInstaller/Meta/links.rds and /dev/null differ diff --git a/EBSeq/BiocInstaller/Meta/nsInfo.rds b/EBSeq/BiocInstaller/Meta/nsInfo.rds deleted file mode 100644 index f32ede4..0000000 Binary files a/EBSeq/BiocInstaller/Meta/nsInfo.rds and /dev/null differ diff --git a/EBSeq/BiocInstaller/Meta/package.rds b/EBSeq/BiocInstaller/Meta/package.rds deleted file mode 100644 index 8dee4bd..0000000 Binary files a/EBSeq/BiocInstaller/Meta/package.rds and /dev/null differ diff --git a/EBSeq/BiocInstaller/NAMESPACE b/EBSeq/BiocInstaller/NAMESPACE deleted file mode 100644 index 2415823..0000000 --- a/EBSeq/BiocInstaller/NAMESPACE +++ /dev/null @@ -1,4 +0,0 @@ -import("utils") - -export(biocLite, biocVersion, biocinstallRepos, useDevel, biocValid, - monograph_group, RBioinf_group, biocases_group, all_group) diff --git a/EBSeq/BiocInstaller/NEWS b/EBSeq/BiocInstaller/NEWS deleted file mode 100644 index 67c3189..0000000 --- a/EBSeq/BiocInstaller/NEWS +++ /dev/null @@ -1,16 +0,0 @@ -CHANGES IN VERSION 1.10.0 -------------------------- - -NEW FEATURES - - o biocValid() checks that installed packages are consistent with - those available via biocLite(). - - o biocVersion() returns the version of Bioconductor expected with - this version of the BiocInstaller package. - -USER-VISIBLE CHANGES - - o biocLite() invoked with no arguments updates currently installed - packages to their most-recent version. - diff --git a/EBSeq/BiocInstaller/R/BiocInstaller b/EBSeq/BiocInstaller/R/BiocInstaller deleted file mode 100644 index 3b65e3c..0000000 --- a/EBSeq/BiocInstaller/R/BiocInstaller +++ /dev/null @@ -1,27 +0,0 @@ -# File share/R/nspackloader.R -# Part of the R package, http://www.R-project.org -# -# Copyright (C) 1995-2012 The R Core Team -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# A copy of the GNU General Public License is available at -# http://www.r-project.org/Licenses/ - -local({ - info <- loadingNamespaceInfo() - pkg <- info$pkgname - ns <- .getNamespace(as.name(pkg)) - if (is.null(ns)) - stop("cannot find namespace environment for ", pkg, domain = NA); - dbbase <- file.path(info$libname, pkg, "R", pkg) - lazyLoad(dbbase, ns, filter = function(n) n != ".__NAMESPACE__.") -}) diff --git a/EBSeq/BiocInstaller/R/BiocInstaller.rdb b/EBSeq/BiocInstaller/R/BiocInstaller.rdb deleted file mode 100644 index 2e70858..0000000 Binary files a/EBSeq/BiocInstaller/R/BiocInstaller.rdb and /dev/null differ diff --git a/EBSeq/BiocInstaller/R/BiocInstaller.rdx b/EBSeq/BiocInstaller/R/BiocInstaller.rdx deleted file mode 100644 index bbce4ec..0000000 Binary files a/EBSeq/BiocInstaller/R/BiocInstaller.rdx and /dev/null differ diff --git a/EBSeq/BiocInstaller/help/AnIndex b/EBSeq/BiocInstaller/help/AnIndex deleted file mode 100644 index 93ce51c..0000000 --- a/EBSeq/BiocInstaller/help/AnIndex +++ /dev/null @@ -1,10 +0,0 @@ -all_group packageGroups -biocases_group packageGroups -biocinstallRepos biocinstallRepos -biocLite biocLite -BiocUpgrade BiocUpgrade -biocValid biocValid -biocVersion biocVersion -monograph_group packageGroups -RBioinf_group packageGroups -useDevel useDevel diff --git a/EBSeq/BiocInstaller/help/BiocInstaller.rdb b/EBSeq/BiocInstaller/help/BiocInstaller.rdb deleted file mode 100644 index e88fe48..0000000 Binary files a/EBSeq/BiocInstaller/help/BiocInstaller.rdb and /dev/null differ diff --git a/EBSeq/BiocInstaller/help/BiocInstaller.rdx b/EBSeq/BiocInstaller/help/BiocInstaller.rdx deleted file mode 100644 index 82d8f93..0000000 Binary files a/EBSeq/BiocInstaller/help/BiocInstaller.rdx and /dev/null differ diff --git a/EBSeq/BiocInstaller/help/aliases.rds b/EBSeq/BiocInstaller/help/aliases.rds deleted file mode 100644 index 9b2af13..0000000 Binary files a/EBSeq/BiocInstaller/help/aliases.rds and /dev/null differ diff --git a/EBSeq/BiocInstaller/help/paths.rds b/EBSeq/BiocInstaller/help/paths.rds deleted file mode 100644 index 7b4a225..0000000 Binary files a/EBSeq/BiocInstaller/help/paths.rds and /dev/null differ diff --git a/EBSeq/BiocInstaller/html/00Index.html b/EBSeq/BiocInstaller/html/00Index.html deleted file mode 100644 index 33a3a2e..0000000 --- a/EBSeq/BiocInstaller/html/00Index.html +++ /dev/null @@ -1,44 +0,0 @@ - -R: Install/Update Bioconductor and CRAN Packages - - - -

Install/Update Bioconductor and CRAN Packages - -

-
-
-[Up] -[Top] -

Documentation for package ‘BiocInstaller’ version 1.12.0

- - - -

Help Pages

- - - - - - - - - - - - - - - - - - - - - - - -
all_groupConvenience functions to return package names associated with Bioconductor publications.
biocases_groupConvenience functions to return package names associated with Bioconductor publications.
biocinstallReposDisplay current Bioconductor and CRAN repositories.
biocLiteInstall or update Bioconductor and CRAN packages
BiocUpgradeUpgrade Bioconductor to the latest version available for this version of R
biocValidValidate installed package versions against biocLite versions.
biocVersionBioconductor version
monograph_groupConvenience functions to return package names associated with Bioconductor publications.
RBioinf_groupConvenience functions to return package names associated with Bioconductor publications.
useDevelGet the 'devel' version of the BiocInstaller package.
- diff --git a/EBSeq/BiocInstaller/html/R.css b/EBSeq/BiocInstaller/html/R.css deleted file mode 100644 index 6f058f3..0000000 --- a/EBSeq/BiocInstaller/html/R.css +++ /dev/null @@ -1,57 +0,0 @@ -BODY{ background: white; - color: black } - -A:link{ background: white; - color: blue } -A:visited{ background: white; - color: rgb(50%, 0%, 50%) } - -H1{ background: white; - color: rgb(55%, 55%, 55%); - font-family: monospace; - font-size: x-large; - text-align: center } - -H2{ background: white; - color: rgb(40%, 40%, 40%); - font-family: monospace; - font-size: large; - text-align: center } - -H3{ background: white; - color: rgb(40%, 40%, 40%); - font-family: monospace; - font-size: large } - -H4{ background: white; - color: rgb(40%, 40%, 40%); - font-family: monospace; - font-style: italic; - font-size: large } - -H5{ background: white; - color: rgb(40%, 40%, 40%); - font-family: monospace } - -H6{ background: white; - color: rgb(40%, 40%, 40%); - font-family: monospace; - font-style: italic } - -IMG.toplogo{ vertical-align: middle } - -IMG.arrow{ width: 30px; - height: 30px; - border: 0 } - -span.acronym{font-size: small} -span.env{font-family: monospace} -span.file{font-family: monospace} -span.option{font-family: monospace} -span.pkg{font-weight: bold} -span.samp{font-family: monospace} - -div.vignettes a:hover { - background: rgb(85%, 85%, 85%); -} - diff --git a/EBSeq/BiocInstaller/scripts/biocLite.R b/EBSeq/BiocInstaller/scripts/biocLite.R deleted file mode 100644 index 9940cfb..0000000 --- a/EBSeq/BiocInstaller/scripts/biocLite.R +++ /dev/null @@ -1,86 +0,0 @@ -## Mirrors: uncomment the following and change to your favorite CRAN mirror -## if you don't want to use the default (cran.fhcrc.org, Seattle, USA). -## options("repos" = c(CRAN="http://cran.fhcrc.org")) - -## Mirrors: uncomment the following and change to your favorite Bioconductor -## mirror, if you don't want to use the default (www.bioconductor.org, -## Seattle, USA) -## options("BioC_mirror" = "http://www.bioconductor.org") - -local({ - currBiocVers <- - package_version(readLines("http://bioconductor.org/bioc-version", - warn=FALSE)) - vers <- getRversion() - biocVers <- tryCatch({ - BiocInstaller::biocVersion() # recent BiocInstaller - }, error=function(...) { # no / older BiocInstaller - tools:::.BioC_version_associated_with_R_version - }) - - if (biocVers < currBiocVers) { - txt <- strwrap(sprintf("Your Bioconductor is out-of-date, upgrade - to version %s by following instructions at - http://bioconductor.org/install.", currBiocVers)) - message(paste(txt, collapse="\n")) - } - - if (vers > "2.13" && biocVers > "2.8") { - - if (exists("biocLite", .GlobalEnv, inherits=FALSE)) { - txt <- strwrap("There is an outdated biocLite() function in the - global environment; run 'rm(biocLite)' and try again.") - stop("\n", paste(txt, collapse="\n")) - } - - if (!suppressWarnings(require("BiocInstaller", quietly=TRUE))) { - a <- NULL - p <- file.path(Sys.getenv("HOME"), ".R", "repositories") - if (file.exists(p)) { - a <- tools:::.read_repositories(p) - if (!"BioCsoft" %in% rownames(a)) - a <- NULL - } - if (is.null(a)) { - p <- file.path(R.home("etc"), "repositories") - a <- tools:::.read_repositories(p) - } - if (!"package:utils" %in% search()) { - url <- "http://bioconductor.org/biocLite.R" - txt <- sprintf("use 'source(\"%s\")' to update 'BiocInstaller' - after 'utils' package is attached", - url) - message(paste(strwrap(txt), collapse="\n ")) - } else { - ## add a conditional for Bioc releases occuring WITHIN - ## a single R minor version - if (vers >= "2.15" && vers < "2.16") { - a["BioCsoft", "URL"] <- sub(as.character(biocVers), "2.11", - a["BioCsoft", "URL"]) - biocVers <- numeric_version("2.11") - } - install.packages("BiocInstaller", repos=a["BioCsoft", "URL"]) - if (!suppressWarnings(require("BiocInstaller", - quietly=TRUE))) { - url0 <- "http://www.bioconductor.org/packages" - url <- sprintf("%s/%s/bioc", - url0, as.character(biocVers)) - txt0 <- "'biocLite.R' failed to install 'BiocInstaller', - use 'install.packages(\"%s\", repos=\"%s\")'" - txt <- sprintf(txt0, "BiocInstaller", url) - message(paste(strwrap(txt), collapse="\n ")) - } - } - } - } else { - source("http://bioconductor.org/getBioC.R") - biocLite <<- - function(pkgs, groupName="lite", ...) - { - if (missing(pkgs)) - biocinstall(groupName=groupName, ...) - else - biocinstall(pkgs=pkgs, groupName=groupName, ...) - } - } -}) diff --git a/EBSeq/BiocInstaller/unitTests/test_BiocUpgrade.R b/EBSeq/BiocInstaller/unitTests/test_BiocUpgrade.R deleted file mode 100644 index d4cb4e7..0000000 --- a/EBSeq/BiocInstaller/unitTests/test_BiocUpgrade.R +++ /dev/null @@ -1,29 +0,0 @@ -test_useDevel <- function() -{ - if (!BiocInstaller:::IS_END_OF_LIFE) { - checkException(useDevel(), silent=TRUE) - } else if (!BiocInstaller:::IS_DOWNGRADEABLE) { - checkException(useDevel(FALSE), silent=TRUE) - } - if (!BiocInstaller:::IS_UPGRADEABLE) { - checkException(useDevel(), silent=TRUE) - opts <- options(warn=2); on.exit(options(opts)) - checkException(biocLite("BiocUpgrade")) - } -} - -test_getContribUrl_exist <- function() -{ - fun <- BiocInstaller:::.getContribUrl - - vers <- BiocInstaller:::BIOC_VERSION - checkTrue(grepl(vers, fun(vers))) - if (BiocInstaller:::IS_UPGRADEABLE) { - vers <- BiocInstaller:::UPGRADE_VERSION - checkTrue(grepl(vers, fun(vers))) - } - if (BiocInstaller:::IS_DOWNGRADEABLE) { - vers <- BiocInstaller:::DOWNGRADE_VERSION - checkTrue(grepl(vers, fun(vers))) - } -} diff --git a/EBSeq/BiocInstaller/unitTests/test_biocinstallRepos.R b/EBSeq/BiocInstaller/unitTests/test_biocinstallRepos.R deleted file mode 100644 index e6fb520..0000000 --- a/EBSeq/BiocInstaller/unitTests/test_biocinstallRepos.R +++ /dev/null @@ -1,27 +0,0 @@ -repos <- biocinstallRepos() - -test_biocinstallRepos_named_repositories <- function() -{ - - allOS <- c("BioCsoft", "CRAN", "BioCann", "BioCexp", "BioCextra") - windowsOnly <- "CRANextra" - - checkTrue(all(allOS %in% names(repos))) - if (.Platform$OS.type == "windows") - { - checkTrue(windowsOnly %in% names(repos)) - } else { - checkTrue(!windowsOnly %in% names(repos)) - } - -} - -test_biocinstallRepos_noNA_repositories <- function() -{ - checkTrue(!any(is.na(repos))) -} - -test_biocinstallRepos_order <- function() -{ - checkIdentical("BioCsoft", names(repos)[[1]]) -} diff --git a/EBSeq/makefile b/EBSeq/makefile index bf25454..898c8fa 100644 --- a/EBSeq/makefile +++ b/EBSeq/makefile @@ -10,4 +10,4 @@ rsem-for-ebseq-calculate-clustering-info : calcClusteringInfo.cpp $(CC) -O3 -Wall calcClusteringInfo.cpp -o $@ clean : - rm -rf blockmodeling $(PROGRAMS) *~ + rm -rf blockmodeling $(PROGRAMS) *~ BiocInstaller diff --git a/README.md b/README.md index dddf4bd..902e806 100644 --- a/README.md +++ b/README.md @@ -459,7 +459,7 @@ differential expression analysis. We thank earonesty and Dr. Samuel Arvidsson for contributing patches. -We thank Han Lin, j.miller, Joël Fillon and Dr. Samuel G. Younkin for suggesting possible fixes. +We thank Han Lin, j.miller, Joël Fillon, Dr. Samuel G. Younkin and Malcolm Cook for suggesting possible fixes. ## License diff --git a/convert-sam-for-rsem b/convert-sam-for-rsem index c077616..a7300f2 100755 --- a/convert-sam-for-rsem +++ b/convert-sam-for-rsem @@ -2,14 +2,18 @@ use Getopt::Long; use Pod::Usage; -use FindBin; -use lib $FindBin::Bin; use File::Basename; use File::Path 'rmtree'; -use strict; +use FindBin; +use lib $FindBin::RealBin; use rsem_perl_utils; +use Env qw(@PATH); +push(@PATH, $FindBin::RealBin, "$FindBin::RealBin/sam"); + +use strict; + my ($in_file, $out_file) = (); my @tmp_dirs = (); @@ -33,8 +37,6 @@ $suf = lc(substr($suf, 1)); pod2usage(-msg => "Input file's suffix is neither sam nor bam!", -exitval => 2, -verbose => 2) if (($suf ne "sam") && ($suf ne "bam")); my $isSam = ($suf eq "sam"); -$dir = "$FindBin::Bin/"; - my $temp_dir = "$out_file.temp"; if (-d $temp_dir) { print "Warning: $temp_dir exists, convert-sam-for-rsem will write temporary files into this folder and delete it after it finishes!\n"; } else { @@ -47,7 +49,7 @@ my $sam_file; if (!$isSam) { $sam_file = "$temp_dir/input.sam"; - $command = $dir."sam/samtools view -h -o $sam_file $in_file"; + $command = "samtools view -h -o $sam_file $in_file"; &runCommand($command); } else { @@ -70,7 +72,7 @@ $command .= " >> $tmp_sam"; # Phase II, parse the temporary SAM file to make paired-end alignments' two mates adjacent to each other -$command = $dir."rsem-scan-for-paired-end-reads $tmp_sam $out_file"; +$command = "rsem-scan-for-paired-end-reads $tmp_sam $out_file"; &runCommand($command); # delete temporary directory @@ -80,7 +82,7 @@ print STDERR "Conversion is completed. $out_file will be checked by 'rsem-sam-va # Phase III, validate if the resulting bam file is correct -$command = $dir."rsem-sam-validator $out_file"; +$command = "rsem-sam-validator $out_file"; &runCommand($command); __END__ diff --git a/rsem-calculate-expression b/rsem-calculate-expression index a9f26c9..9040272 100755 --- a/rsem-calculate-expression +++ b/rsem-calculate-expression @@ -2,12 +2,16 @@ use Getopt::Long; use Pod::Usage; -use FindBin; -use lib $FindBin::Bin; -use strict; +use FindBin; +use lib $FindBin::RealBin; use rsem_perl_utils qw(runCommand collectResults showVersionInfo); +use Env qw(@PATH); +push(@PATH, $FindBin::RealBin, "$FindBin::RealBin/sam"); + +use strict; + #const my $BURNIN = 200; my $NCV = 1000; @@ -127,10 +131,8 @@ GetOptions("keep-intermediate-files" => \$keep_intermediate_files, "q|quiet" => \$quiet, "h|help" => \$help) or pod2usage(-exitval => 2, -verbose => 2); -my $dir = "$FindBin::Bin/"; - pod2usage(-verbose => 2) if ($help == 1); -&showVersionInfo($dir) if ($version == 1); +&showVersionInfo($FindBin::RealBin) if ($version == 1); #check parameters and options @@ -251,7 +253,7 @@ if (!$is_sam && !$is_bam) { } # pipe to samtools to generate a BAM file - $command .= " | $dir\sam/samtools view -S -b -o $imdName.bam -"; + $command .= " | samtools view -S -b -o $imdName.bam -"; } else { $command = $bowtie2_path."bowtie2"; @@ -286,7 +288,7 @@ if (!$is_sam && !$is_bam) { } # pipe to samtools to generate a BAM file - $command .= " | $dir\sam/samtools view -S -b -o $imdName.bam -"; + $command .= " | samtools view -S -b -o $imdName.bam -"; } if ($mTime) { $time_start = time(); } @@ -301,7 +303,7 @@ if (!$is_sam && !$is_bam) { if ($mTime) { $time_start = time(); } -$command = $dir."rsem-parse-alignments $refName $imdName $statName"; +$command = "rsem-parse-alignments $refName $imdName $statName"; my $samInpType; if ($is_sam) { $samInpType = "s"; } @@ -314,7 +316,7 @@ if ($quiet) { $command .= " -q"; } &runCommand($command); -$command = $dir."rsem-build-read-index $gap"; +$command = "rsem-build-read-index $gap"; if ($read_type == 0) { $command .= " 0 $quiet $imdName\_alignable.fa"; } elsif ($read_type == 1) { $command .= " 1 $quiet $imdName\_alignable.fq"; } elsif ($read_type == 2) { $command .= " 0 $quiet $imdName\_alignable_1.fa $imdName\_alignable_2.fa"; } @@ -333,7 +335,7 @@ print OUTPUT "$mean $sd\n"; print OUTPUT "$L\n"; close(OUTPUT); -$command = $dir."rsem-run-em $refName $read_type $sampleName $imdName $statName -p $nThreads"; +$command = "rsem-run-em $refName $read_type $sampleName $imdName $statName -p $nThreads"; if ($genBamF) { $command .= " -b $samInpType $inpF"; if ($fn_list ne "") { $command .= " 1 $fn_list"; } @@ -356,17 +358,17 @@ else { } if ($genBamF) { - $command = $dir."sam/samtools sort -@ $nThreads -m $SortMem $sampleName.transcript.bam $sampleName.transcript.sorted"; + $command = "samtools sort -@ $nThreads -m $SortMem $sampleName.transcript.bam $sampleName.transcript.sorted"; &runCommand($command); - $command = $dir."sam/samtools index $sampleName.transcript.sorted.bam"; + $command = "samtools index $sampleName.transcript.sorted.bam"; &runCommand($command); if ($genGenomeBamF) { - $command = $dir."rsem-tbam2gbam $refName $sampleName.transcript.bam $sampleName.genome.bam"; + $command = "rsem-tbam2gbam $refName $sampleName.transcript.bam $sampleName.genome.bam"; &runCommand($command); - $command = $dir."sam/samtools sort -@ $nThreads -m $SortMem $sampleName.genome.bam $sampleName.genome.sorted"; + $command = "samtools sort -@ $nThreads -m $SortMem $sampleName.genome.bam $sampleName.genome.sorted"; &runCommand($command); - $command = $dir."sam/samtools index $sampleName.genome.sorted.bam"; + $command = "samtools index $sampleName.genome.sorted.bam"; &runCommand($command); } } @@ -376,7 +378,7 @@ if ($mTime) { $time_end = time(); $time_rsem = $time_end - $time_start; } if ($mTime) { $time_start = time(); } if ($calcPME || $var_opt || $calcCI ) { - $command = $dir."rsem-run-gibbs $refName $imdName $statName $BURNIN $NCV $SAMPLEGAP"; + $command = "rsem-run-gibbs $refName $imdName $statName $BURNIN $NCV $SAMPLEGAP"; $command .= " -p $nThreads"; if ($var_opt) { $command .= " --var"; } if ($quiet) { $command .= " -q"; } @@ -401,7 +403,7 @@ if ($calcPME || $calcCI) { } if ($calcCI) { - $command = $dir."rsem-calculate-credibility-intervals $refName $imdName $statName $CONFIDENCE $NCV $NSPC $NMB"; + $command = "rsem-calculate-credibility-intervals $refName $imdName $statName $CONFIDENCE $NCV $NSPC $NMB"; $command .= " -p $nThreads"; if ($quiet) { $command .= " -q"; } &runCommand($command); diff --git a/rsem-generate-ngvector b/rsem-generate-ngvector index dc874a9..44066b7 100755 --- a/rsem-generate-ngvector +++ b/rsem-generate-ngvector @@ -2,12 +2,16 @@ use Getopt::Long; use Pod::Usage; -use FindBin; -use lib $FindBin::Bin; -use strict; +use FindBin; +use lib $FindBin::RealBin; use rsem_perl_utils; +use Env qw(@PATH); +push(@PATH, "$FindBin::RealBin/EBSeq"); + +use strict; + my $k = 25; my $help = 0; @@ -17,13 +21,12 @@ GetOptions("k=i" => \$k, pod2usage(-verbose => 2) if ($help == 1); pod2usage(-msg => "Invalid number of arguments!", -exitval => 2, -verbose => 2) if (scalar(@ARGV) != 2); -my $dir = "$FindBin::Bin/"; my $command = ""; -$command = $dir."EBSeq/rsem-for-ebseq-calculate-clustering-info $k $ARGV[0] $ARGV[1].ump"; +$command = "rsem-for-ebseq-calculate-clustering-info $k $ARGV[0] $ARGV[1].ump"; &runCommand($command); -$command = $dir."EBSeq/rsem-for-ebseq-generate-ngvector-from-clustering-info $ARGV[1].ump $ARGV[1].ngvec"; +$command = "rsem-for-ebseq-generate-ngvector-from-clustering-info $ARGV[1].ump $ARGV[1].ngvec"; &runCommand($command); __END__ diff --git a/rsem-plot-transcript-wiggles b/rsem-plot-transcript-wiggles index 3aa7e35..1d14a22 100755 --- a/rsem-plot-transcript-wiggles +++ b/rsem-plot-transcript-wiggles @@ -2,11 +2,16 @@ use Getopt::Long; use Pod::Usage; + use FindBin; -use lib $FindBin::Bin; +use lib $FindBin::RealBin; +use rsem_perl_utils; + +use Env qw(@PATH); +push(@PATH, $FindBin::RealBin, "$FindBin::RealBin/sam"); + use strict; -use rsem_perl_utils; my $gene_list = 0; # default is 0, means input is not a gene list my $transcript_list = 0; # default is 0, this option can only be turned on if allele-specific expression is calculated @@ -27,29 +32,28 @@ if (-e "$ARGV[0].alleles.results") { $alleleS = 1; } pod2usage(-msg => "--transcript-list cannot be set if allele-specific reference is not built!", -exitval => 2, -verbose => 2) if (!$alleleS && $transcript_list); pod2usage(-msg => "--gene-list and --transcript-list cannot be set at the same time!", -exitval => 2, -verbose => 2) if ($gene_list && $transcript_list); -my $dir = "$FindBin::Bin/"; my $command = ""; unless (-e "$ARGV[0].transcript.sorted.bam") { - $command = $dir."sam/samtools sort $ARGV[0].transcript.bam $ARGV[0].transcript.sorted"; + $command = "samtools sort $ARGV[0].transcript.bam $ARGV[0].transcript.sorted"; &runCommand($command); } unless (-e "$ARGV[0].transcript.readdepth") { - $command = $dir."rsem-bam2readdepth $ARGV[0].transcript.sorted.bam $ARGV[0].transcript.readdepth"; + $command = "rsem-bam2readdepth $ARGV[0].transcript.sorted.bam $ARGV[0].transcript.readdepth"; &runCommand($command); } if ($show_unique) { unless (-e "$ARGV[0].uniq.transcript.bam") { - $command = $dir."rsem-get-unique $ARGV[0].transcript.bam $ARGV[0].uniq.transcript.bam"; + $command = "rsem-get-unique $ARGV[0].transcript.bam $ARGV[0].uniq.transcript.bam"; &runCommand($command); } unless (-e "$ARGV[0].uniq.transcript.sorted.bam") { - $command = $dir."sam/samtools sort $ARGV[0].uniq.transcript.bam $ARGV[0].uniq.transcript.sorted"; + $command = "samtools sort $ARGV[0].uniq.transcript.bam $ARGV[0].uniq.transcript.sorted"; &runCommand($command); } unless (-e "$ARGV[0].uniq.transcript.readdepth") { - $command = $dir."rsem-bam2readdepth $ARGV[0].uniq.transcript.sorted.bam $ARGV[0].uniq.transcript.readdepth"; + $command = "rsem-bam2readdepth $ARGV[0].uniq.transcript.sorted.bam $ARGV[0].uniq.transcript.readdepth"; &runCommand($command); } } @@ -66,7 +70,7 @@ else { if ($gene_list) { $id_type = 2; } } -$command = $dir."rsem-gen-transcript-plots $ARGV[0] $ARGV[1] $alleleS $id_type $show_unique $ARGV[2]"; +$command = "rsem-gen-transcript-plots $ARGV[0] $ARGV[1] $alleleS $id_type $show_unique $ARGV[2]"; &runCommand($command); __END__ diff --git a/rsem-prepare-reference b/rsem-prepare-reference index 8050356..a74d97d 100755 --- a/rsem-prepare-reference +++ b/rsem-prepare-reference @@ -3,11 +3,14 @@ use Getopt::Long; use Pod::Usage; use FindBin; -use lib $FindBin::Bin; -use strict; - +use lib $FindBin::RealBin; use rsem_perl_utils; +use Env qw(@PATH); +push(@PATH, $FindBin::RealBin); + +use strict; + my $status; my $gtfF = ""; @@ -75,12 +78,11 @@ elsif ($subsetFile ne "") { $polyAChoice = 2; } if ($bowtie_path ne "") { $bowtie_path .= "/"; } if ($bowtie2_path ne "") { $bowtie2_path .= "/"; } -my $dir = "$FindBin::Bin/"; my $command = ""; if ($type == 0) { $"=" "; - $command = $dir."rsem-extract-reference-transcripts $ARGV[1] $quiet $gtfF"; + $command = "rsem-extract-reference-transcripts $ARGV[1] $quiet $gtfF"; if ($mappingF ne "") { $command .= " 1 $mappingF"; } else { $command .= " 0"; } $command .= " @list"; @@ -88,7 +90,7 @@ if ($type == 0) { } else { $"=" "; - $command = $dir."rsem-synthesis-reference-transcripts $ARGV[1] $quiet"; + $command = "rsem-synthesis-reference-transcripts $ARGV[1] $quiet"; if ($mappingF ne "") { $command .= " 1 $mappingF"; } elsif ($alleleMappingF ne "") { $command .= " 2 $alleleMappingF"; } else { $command .= " 0"; } @@ -96,7 +98,7 @@ else { &runCommand($command); } -$command = $dir."rsem-preref $ARGV[1].transcripts.fa $polyAChoice $ARGV[1] -l $polyALen"; +$command = "rsem-preref $ARGV[1].transcripts.fa $polyAChoice $ARGV[1] -l $polyALen"; if ($polyAChoice == 2) { $command .= " -f $subsetFile"; } if ($no_ntog) { $command .= " --no-ntog"; } if ($quiet) { $command .= " -q"; } diff --git a/rsem-run-ebseq b/rsem-run-ebseq index 9693eee..59d35c8 100755 --- a/rsem-run-ebseq +++ b/rsem-run-ebseq @@ -2,12 +2,16 @@ use Getopt::Long; use Pod::Usage; -use FindBin; -use lib $FindBin::Bin; -use strict; +use FindBin; +use lib $FindBin::RealBin; use rsem_perl_utils; +use Env qw(@PATH); +push(@PATH, "$FindBin::RealBin/EBSeq"); + +use strict; + my $ngvF = ""; my $help = 0; @@ -18,7 +22,6 @@ pod2usage(-verbose => 2) if ($help == 1); pod2usage(-msg => "Invalid number of arguments!", -exitval => 2, -verbose => 2) if (scalar(@ARGV) != 3); pod2usage(-msg => "ngvector file cannot be named as #! # is reserved for other purpose!", -exitval => 2, -verbose => 2) if ($ngvF eq "#"); -my $dir = "$FindBin::Bin/"; my $command = ""; my @conditions = split(/,/, $ARGV[1]); @@ -28,7 +31,7 @@ pod2usage(-msg => "At least 2 conditions are required for differential expressio if ($ngvF eq "") { $ngvF = "#"; } $" = " "; -$command = $dir."EBSeq/rsem-for-ebseq-find-DE ".$dir."EBSeq $ngvF $ARGV[0] $ARGV[2] @conditions"; +$command = "rsem-for-ebseq-find-DE $FindBin::RealBin/EBSeq $ngvF $ARGV[0] $ARGV[2] @conditions"; &runCommand($command) __END__ diff --git a/rsem_perl_utils.pm b/rsem_perl_utils.pm index 6355f67..078d119 100644 --- a/rsem_perl_utils.pm +++ b/rsem_perl_utils.pm @@ -86,9 +86,9 @@ sub collectResults { close(OUTPUT); } -# dir +# 0, dir sub showVersionInfo { - open(INPUT, "$_[0]\WHAT_IS_NEW"); + open(INPUT, "$_[0]/WHAT_IS_NEW"); my $line = ; chomp($line); close(INPUT);