Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
2db9f66
Detection of macos for DCC/FUCHS installation
tjakobi Jul 21, 2018
5a286c2
Fixes for external install on Mac
tjakobi Jul 21, 2018
29a1432
Adding OSX to travis build
tjakobi Jul 22, 2018
336ff00
Removing apt installation of bedtools
tjakobi Jul 22, 2018
eb103a3
Upating travis with build matrix for macOS support
tjakobi Jul 22, 2018
6c80939
Adding before install brew command for python
tjakobi Jul 22, 2018
8ee7a55
Using specific python 3.6 version
tjakobi Jul 22, 2018
2fe8d45
Change to upgrade brew
tjakobi Jul 22, 2018
d0e6dd6
Adding python2 brew recipe
tjakobi Jul 22, 2018
dbe3951
Typo
tjakobi Jul 22, 2018
63d12c2
Adding python 3.4 and 3.5 to OSX builds
tjakobi Jul 22, 2018
5d4f74f
Masking 3.5 and 3.4
tjakobi Jul 22, 2018
e273fb5
Adding additional installation triggers for macOS
tjakobi Jul 24, 2018
46bf242
Update travis with R installtion for macOS
tjakobi Jul 24, 2018
33d025c
Fixing broken travis config
tjakobi Jul 24, 2018
c295434
Fixing brew install error related to travis-ci/travis-ci#8826
tjakobi Jul 24, 2018
4d86540
Adding bioconductor dependency to travis Linux builds
tjakobi Jul 24, 2018
6cbe3d2
Specifically added R via apt-get for travis Linux builds
tjakobi Jul 24, 2018
85482fd
Adding sudo for apt-get
tjakobi Jul 24, 2018
9b6dc45
Fixed typo
tjakobi Jul 24, 2018
b0658a7
Fixing wrong R package name
tjakobi Jul 24, 2018
809c6c5
Making sure travis finds the R dependency installer
tjakobi Jul 24, 2018
b39f065
Adding debug pwd
tjakobi Jul 24, 2018
2d14a70
Travis R test
tjakobi Jul 24, 2018
babda6a
Changing to non-SSL HTTPS or bioconductor
tjakobi Jul 24, 2018
9e52aff
Running Rscript with sudo on travis
tjakobi Jul 24, 2018
9cb94df
Adding updates libssl to fix SSL errors
tjakobi Jul 24, 2018
1615a71
Changing bioC mirror
tjakobi Jul 24, 2018
596ea8b
Skipping statsmodels for debugging
tjakobi Jul 24, 2018
d681e0e
Changing back to HTTP
tjakobi Jul 24, 2018
1eb03cf
Back to HTTP
tjakobi Jul 24, 2018
0e8e871
Setting R_LIBS_USER
tjakobi Jul 24, 2018
5e76d3f
Using global variables for travis
tjakobi Jul 24, 2018
4cac2c4
Removing sudo Rscript for Travis
tjakobi Jul 24, 2018
122fc43
ENV change
tjakobi Jul 24, 2018
3f1ee49
Removing quotes, only using one build for now
tjakobi Jul 24, 2018
4ef0c8f
Storing R lib into Renvrion file
tjakobi Jul 24, 2018
5f58d86
Adding debug code
tjakobi Jul 24, 2018
cbb5325
Adding R language
tjakobi Jul 24, 2018
d0e9885
Trying sudo again
tjakobi Jul 24, 2018
7428191
Changing language to R
tjakobi Jul 24, 2018
d1c2c24
Removing R installation
tjakobi Jul 24, 2018
61de366
Try to get recent R into python travis imag
tjakobi Jul 24, 2018
84a8e01
Using generic backport way
tjakobi Jul 24, 2018
5c5bd5a
Adding gfortran
tjakobi Jul 24, 2018
e3c2f51
Adding libgit2
tjakobi Jul 24, 2018
ed1351e
Adding libssh2-1-dev
tjakobi Jul 24, 2018
498518e
Switching back to full test suite
tjakobi Jul 24, 2018
e475573
Fixing libgit2
tjakobi Jul 24, 2018
b099604
Adding first test for DCC [ci skip]
tjakobi Jul 24, 2018
52694cb
Linking in DCC test [ci skip]
tjakobi Jul 24, 2018
2677a33
Adding new ENV var for skipping R package install
tjakobi Jul 24, 2018
3c07c4b
Adding wait time for DCC run to keep build alive
tjakobi Jul 25, 2018
388d019
Using only chr1 subset to reduce memory usage
tjakobi Jul 25, 2018
effc89a
Removing travis_wait, fixing unpacking
tjakobi Jul 25, 2018
621cbc2
Temporary removing statsmodels
tjakobi Jul 25, 2018
4bd17d7
Fixing bunzip2
tjakobi Jul 25, 2018
5d85997
Fixing chr1 download URL
tjakobi Jul 25, 2018
7130dd0
Fixing path
tjakobi Jul 25, 2018
aa5ddee
Changing to circtools invocations, removing timing command
tjakobi Jul 25, 2018
18446a9
md5sum -> md5sum-lite
tjakobi Jul 25, 2018
3733a22
Fixing md5 discrepancy Linux<>macOS
tjakobi Jul 25, 2018
b43e01d
"Fixing" circtools detect call
tjakobi Jul 25, 2018
a1d01a9
Adding OS recognition
tjakobi Jul 25, 2018
c3f1fa4
Working on macOS DCC install
tjakobi Jul 25, 2018
3af0560
Removing bedtools for testing
tjakobi Jul 25, 2018
8f12865
Debug output
tjakobi Jul 25, 2018
24604c1
Additional debugging
tjakobi Jul 26, 2018
f4d3a26
Adding pysam dependency
tjakobi Jul 26, 2018
47b79be
Adding external install of old pysam version for HTSeq
tjakobi Jul 26, 2018
677abd3
Fixing spaces
tjakobi Jul 26, 2018
96b6f24
Version update, debug output
tjakobi Jul 26, 2018
d14d040
Debug output
tjakobi Jul 26, 2018
298102c
Trying with --force
tjakobi Jul 26, 2018
ed1be23
Venv debug
tjakobi Jul 26, 2018
59c751a
Let's try pip2
tjakobi Jul 26, 2018
de9f572
Updating setup for FUCHS to pip2
tjakobi Jul 26, 2018
b65f7a3
Getting md5 check ready
tjakobi Jul 26, 2018
f5f0877
Fixing md5 result path
tjakobi Jul 26, 2018
577ef79
Syncing fixes from master branch
tjakobi Jul 26, 2018
489e05d
Updating version number for next build
tjakobi Jul 26, 2018
bb83c3f
Switching back to Linux build for testing
tjakobi Jul 26, 2018
0c00dc3
Fixing DCC command line
tjakobi Jul 26, 2018
1e7afea
Adding log debug output
tjakobi Jul 26, 2018
a905fda
Fixing DCC command line
tjakobi Jul 26, 2018
46b46c2
Re-enabling all tests
tjakobi Jul 26, 2018
0a252b9
Triggering new build
tjakobi Jul 26, 2018
572f7a5
Fixing broken travis config
tjakobi Jul 26, 2018
3b7f2c3
Fixing broken travis config
tjakobi Jul 26, 2018
52e673d
Initial quickcheck test template generated
tjakobi Jul 27, 2018
b9b8099
Fixing legacy column in circtest output
tjakobi Jul 30, 2018
4ac27b7
Fixing another legacy column in circtest output
tjakobi Jul 30, 2018
0d3d9f9
Fixing typo
tjakobi Jul 30, 2018
1e428fc
Syncing back with master branch
tjakobi Aug 3, 2018
c859e40
Syncing back with master branch
tjakobi Aug 5, 2018
6022105
Disabling broken code for selective columns
tjakobi Aug 5, 2018
bd42a2a
First functional version of QC module test
tjakobi Aug 5, 2018
0a483a2
Adding QC module test to travis config
tjakobi Aug 5, 2018
46887a8
Removing Python 3.6.5 install task
tjakobi Aug 5, 2018
3130fe6
Re-adding ENV var for R package build process
tjakobi Aug 5, 2018
e83f5c1
Changing install command to pip3
tjakobi Aug 5, 2018
ee7220e
Trying caching of python package
tjakobi Aug 5, 2018
f531f67
Trying to cache R and python packages
tjakobi Aug 5, 2018
b8025d9
Minimal travis config for caching test
tjakobi Aug 5, 2018
3efff11
Changing to verbose pip3 install
tjakobi Aug 5, 2018
b6d28dc
Re-enable Linux builds to build the cache
tjakobi Aug 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 62 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,71 @@
sudo: true
sudo: true

language: python
language: python
cache:
directories:
- $HOME/virtualenv/
- $HOME/.R
- $HOME/Library

os:
- linux

env:
- TRAVISBUILD="True"
matrix:
include:
# Use the built in venv for linux builds
- os: linux
sudo: required
python: "3.4"
dist: trusty
before_install:
- sudo apt-get install libssl1.0.0
- sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'
- gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
- gpg -a --export E084DAB9 | sudo apt-key add -
- sudo apt-get update -qq
- sudo apt-get -y --no-install-recommends install r-base build-essential gcc g++ gfortran libblas-dev liblapack-dev libncurses5-dev libreadline-dev libjpeg-dev libpcre3-dev libpng-dev zlib1g-dev libbz2-dev liblzma-dev libgit2-dev libssh2-1-dev

python:
- "3.4"
- "3.5"
- "3.6"
- os: linux
sudo: required
python: "3.5"
dist: trusty
before_install:
- sudo apt-get install libssl1.0.0
- sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'
- gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
- gpg -a --export E084DAB9 | sudo apt-key add -
- sudo apt-get update -qq
- sudo apt-get -y --no-install-recommends install r-base build-essential gcc g++ gfortran libblas-dev liblapack-dev libncurses5-dev libreadline-dev libjpeg-dev libpcre3-dev libpng-dev zlib1g-dev libbz2-dev liblzma-dev libgit2-dev libssh2-1-dev

before_install:
- sudo apt-get install bedtools
- os: linux
sudo: required
python: "3.6"
dist: trusty
before_install:
- sudo apt-get install libssl1.0.0
- sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'
- gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
- gpg -a --export E084DAB9 | sudo apt-key add -
- sudo apt-get update -qq
- sudo apt-get -y --no-install-recommends install r-base build-essential gcc g++ gfortran libblas-dev liblapack-dev libncurses5-dev libreadline-dev libjpeg-dev libpcre3-dev libpng-dev zlib1g-dev libbz2-dev liblzma-dev libgit2-dev libssh2-1-dev

- os: osx
language: generic
python: "3.6"
before_install:
# below the formula for python 3.6
#- brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
- brew install python@2
- brew cask uninstall oclint
- brew install R
- brew install md5sha1sum

install:

- python setup.py install
env:
- TRAVISBUILD="True", INSTALL_R_PACKAGES=True

install:
- pip3 install . --upgrade --force -v

script:
- circtools --help
- circtools --version
# - ./tests/01_test_dcc.sh
# - ./tests/02_test_quickcheck.sh
149 changes: 128 additions & 21 deletions circtools/circtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import os.path

# global settings
version = "1.1.0-beta"
program_name = "circtest"
version = "1.1.0.4"
program_name = "circtools"


# samtools/git like parsing from http://chase-seibert.github.io/blog/2014/03/21/python-multilevel-argparse.html
Expand All @@ -46,7 +46,7 @@ def __init__(self):
description="circtools: a modular, python-based framework for circRNA-related tools that unifies "
"several functions in single command line driven software.",
usage="""circtools [-V] <command> [<args>]

Available commands:

enrich: circular RNA RBP enrichment scan
Expand Down Expand Up @@ -332,17 +332,85 @@ def primex():
def detect():
parser = argparse.ArgumentParser(
description="circular RNA detection")
# NOT prefixing the argument with -- means it"s not optional
parser.add_argument("-C",
"--params",
dest="cli_params",
help="Defines the input parameters for DCC",
default="--help"
)
args = parser.parse_args(sys.argv[2:])

parser.add_argument("--version", action="version", version=version)
parser.add_argument("Input", metavar="Input", nargs="+",
help="Input of the Chimeric.out.junction file from STAR. Alternatively, a sample sheet "
"specifying where your chimeric.out.junction files are, each sample per line, "
"provide with @ prefix (e.g. @samplesheet)")
parser.add_argument("-k", "--keep-temp", dest="temp", action="store_true", default=False,
help="Temporary files will not be deleted [default: False]")
parser.add_argument("-T", "--threads", dest="cpu_threads", type=int, default=2,
help="Number of CPU threads used for computation [default: 2]")
parser.add_argument("-O", "--output", dest="out_dir", default="./",
help="DCC output directory [default: .]")
parser.add_argument("-t", "--temp", dest="tmp_dir", default="_tmp_DCC/",
help="DCC temporary directory [default: _tmp_DCC/]")

group = parser.add_argument_group("Find circRNA Options", "Options to find circRNAs from STAR output")
group.add_argument("-D", "--detect", action="store_true", dest="detect", default=False,
help="Enable circRNA detection from Chimeric.out.junction files [default: False]")
group.add_argument("-ss", action="store_true", dest="secondstrand", default=False,
help="Must be enabled for stranded libraries, aka 'fr-secondstrand' [default: False]")
group.add_argument("-N", "--nonstrand", action="store_false", dest="strand", default=True,
help="The library is non-stranded [default stranded]")
group.add_argument("-E", "--endTol", dest="endTol", type=int, default=5, choices=range(0, 10),
help="Maximum base pair tolerance of reads extending over junction sites [default: 5]")
group.add_argument("-m", "--maximum", dest="max", type=int, default=1000000,
help="The maximum length of candidate circRNAs (including introns) [default: 1000000]")
group.add_argument("-n", "--minimum", dest="min", type=int, default=30,
help="The minimum length of candidate circRNAs (including introns) [default 30]")
group.add_argument("-an", "--annotation", dest="annotate",
help="Gene annotation file in GTF/GFF3 format, to annotate "
"circRNAs by their host gene name/identifier")

group.add_argument("-Pi", "--PE-independent", action="store_true", dest="pairedendindependent", default=False,
help="Has to be specified if the paired end mates have also been mapped separately."
"If specified, -mt1 and -mt2 must also be provided [default: False]")
group.add_argument("-mt1", "--mate1", dest="mate1", nargs="+",
help="For paired end data, Chimeric.out.junction files from mate1 independent mapping result")
group.add_argument("-mt2", "--mate2", dest="mate2", nargs="+",
help="For paired end data, Chimeric.out.junction files from mate2 independent mapping result")
parser.add_argument_group(group)

group = parser.add_argument_group("Filtering Options", "Options to filter the circRNA candidates")
group.add_argument("-F", "--filter", action="store_true", dest="filter", default=False,
help="If specified, the program will perform a recommended filter step on the detection results")
group.add_argument("-f", "--filter-only", dest="filteronly", nargs=2,
help="If specified, the program will only filter based on two files provided: "
"1) a coordinates file [BED6 format] and 2) a count file. E.g.: -f example.bed counts.txt")
group.add_argument("-M", "--chrM", action="store_true", dest="chrM", default=False,
help="If specified, circRNA candidates located on the mitochondrial chromosome will be removed")
group.add_argument("-R", "--rep_file", dest="rep_file",
help="Custom repetitive region file in GTF format to filter out "
"circRNA candidates in repetitive regions")
group.add_argument("-L", "--Ln", dest="length", type=int, default=50,
help="Minimum length in base pairs to check for repetitive regions [default 50]")
group.add_argument("-Nr", nargs=2, type=int, metavar=("countthreshold", "replicatethreshold"), default=[2, 5],
help="countthreshold replicatethreshold [default: 2,5]")
group.add_argument("-fg", "--filterbygene", action="store_true", dest="filterbygene", default=False,
help="If specified, filter also by gene annotation (candidates are not allowed to span"
" more than one gene) default: False")
parser.add_argument_group(group)

group = parser.add_argument_group("Host gene count Options", "Options to count host gene expression")
group.add_argument("-G", "--gene", action="store_true", dest="gene", default=False,
help="If specified, the program will count host gene expression given circRNA coordinates "
"[default: False]")
group.add_argument("-C", "--circ", dest="circ",
help="User specified circRNA coordinates, any tab delimited file with first three "
"columns as circRNA coordinates: chr\tstart\tend, which DCC will use to count "
"host gene expression")
group.add_argument("-B", "--bam", dest="bam", nargs="+",
help="A file specifying the mapped BAM files from which host gene expression is computed; "
"must have the same order as input chimeric junction files")
group.add_argument("-A", "--refseq", dest="refseq",
help="Reference sequence FASTA file")

parser.add_argument_group(group)

import os
os.system("DCC " + args.cli_params)
os.system("DCC " + " ".join(sys.argv[2:]))

@staticmethod
def circtest():
Expand Down Expand Up @@ -751,17 +819,56 @@ def reconstruct():
parser = argparse.ArgumentParser(
description="circular RNA reconstruction")
# NOT prefixing the argument with -- means it"s not optional
parser.add_argument("-C",
"--params",
dest="cli_params",
help="Defines the input parameters for DCC",
default="--help"
)
args = parser.parse_args(sys.argv[2:])

# input
parser.add_argument('-C', '--circIDs', dest='circlefile', default='none',
help='Tab-separated file chr:start_end(tab)read1,read2,read3.')
parser.add_argument('-D', '--DCC', dest='CircRNACount', default='none',
help='If you mapped with STAR and are using step1 you need to provide a list'
' of circle ids (CircRNACount or CircCoordinates from DCC)'
'You must supply either -C or -DCC')
parser.add_argument('-J', '--chimericJunctions', dest='chimeric_junction', default='none',
help='If you mapped with STAR and are using step1 you need to provide the paired end Chimeric.junction.out file here')
parser.add_argument('-F', '--mate1', dest='mate1', default='none',
help='If you mapped with STAR and are using step1 you need to provide the mate1.Chimeric.junction.out file here (optional if ends were mapped separately)')
parser.add_argument('-R', '--mate2', dest='mate2', default='none',
help='If you mapped with STAR and are using step1 you need to provide the mate2.Chimeric.junction.out file here (optional if ends were mapped separately)')
parser.add_argument('-B', '--bamfile', dest='bamfile', required=True,
help='BAM file containing chimeric reads, linear reads may be in it but are not required.')
parser.add_argument('-A', '--annotation', dest='bedfile', required=True,
help='bed formatted feature file including exons.')
# output
parser.add_argument('-O', '--outFolder', dest='out_folder', default='.',
help='Output folder. There will be a sub folder for the sample containing a BAM file '
'for each circle.')
parser.add_argument('-N', '--sampleName', dest='sample', required=True,
help='sample name to title every thing.')

# options
parser.add_argument('-r', '--thresholdReads', dest='reads', default=5, type=int,
help='Circle has to have at least <r> reads to be analysed.')

# TODO: default: no multi map
parser.add_argument('-q', '--thresholdMapq', dest='mapq', default=3, type=int,
help='MAPQ cutoff, only reads passing this threshold will be written to circle BAM file.')
# TODO: add 0 based info
parser.add_argument('-c', '--splitCharacter', dest='split_character', default='_',
help='feature name separator.')
parser.add_argument('-e', '--exonIndex', dest='exon_index', default=3, type=int,
help='Field indicating the exon number after splitting feature name by split_character (for the annotation file).')
parser.add_argument('-p', '--annotationFormat', dest='ref_platform', default='refseq',
help='Specifies the annotation platform which was used (refseq or ensembl)')
parser.add_argument('-s', '--skipSteps', dest='skipped_steps', default='none',
help='Comma separated list of steps that should be skipped (e.g. step3,step4,step6)')
parser.add_argument('-T', '--tmp', dest='tmp_folder', default='/tmp/',
help='Folder to store temporary files generated by pybedtools.')

parser.add_argument('-P', '--cpus', dest='num_cpus', default=4, type=int,
help='Number of CPUs used.')

import os
os.system("FUCHS " + args.cli_params)
os.system("FUCHS " + " ".join(sys.argv[2:]))


if __name__ == "__main__":
main()
main()
4 changes: 2 additions & 2 deletions circtools/exon_usage/exon_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def run_module(self):
# ------------------------------------ need to call the correct R script here -----------------------

# need to define path top R wrapper
exon_script = 'circtools_exon'
exon_script = 'circtools_exon_wrapper.R'

# Variable number of args in a list
args = [
Expand All @@ -143,4 +143,4 @@ def run_module(self):
# ------------------------------------ run script and check output -----------------------

import os
os.system(exon_script + " " + ' '.join(str(e) for e in args))
os.system(exon_script + " " + ' '.join(str(e) for e in args))
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
numpy>=1.14.5
pybedtools>=0.7.10
biopython >= 1.71
biopython >= 1.71
scipy>=0.19.0
1 change: 0 additions & 1 deletion scripts/circtools_exon

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ colnames(RNAse_RenrichedCircTest) <- c( "Gene",
"Start.End.Region",
"OverallRegion",
"sig_p",
"NA",
"GeneID",
"NExons",
"P.Value",
Expand Down Expand Up @@ -482,8 +481,7 @@ colnames(circTestSummary) <- c( "Chr",
"Strand",
"Start.End.Region",
"OverallRegion",
"sig_p",
"NA"
"sig_p"
)

addWorksheet(wb, sheetName = "Other BSJ FDR 1%")
Expand Down
8 changes: 4 additions & 4 deletions scripts/circtools_quickcheck_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ star_runs <- star_runs[endsWith(star_runs, arg_starfolder_suffix)]
star_runs <- star_runs[!grepl("*mate*", star_runs)]

# check columns to remove
if (arg_remove_columns != "0" && length(arg_remove_columns) > 0) {
tmp <- unlist(lapply(arg_remove_columns, function(x){x-3}))
star_runs <- star_runs[-tmp]
}
# if (arg_remove_columns != "0" && length(arg_remove_columns) > 0) {
# tmp <- unlist(lapply(arg_remove_columns, function(x){x-3}))
# star_runs <- star_runs[-tmp]
# }

# new empty list
uniquely_mapped_reads <- numeric();
Expand Down
4 changes: 2 additions & 2 deletions scripts/install_R_dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@


# set mirrors
source("https://bioconductor.statistik.tu-dortmund.de/biocLite.R")
options(repos = c(CRAN = "https://cran.uni-muenster.de/"))
source("http://bioconductor.org/biocLite.R")
options(repos = c(CRAN = "http://cran.uni-muenster.de/"))
biocLite()

pkgs <- c(
Expand Down
Loading