Skip to content

Commit

Permalink
updated .travis.yml and fixed genda.plotting.plotting_utils.coverage_…
Browse files Browse the repository at this point in the history
…hist to accurately account for introns
  • Loading branch information
jeffhsu3 committed Jan 19, 2016
1 parent 138d72f commit d1d2295
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.lock
*.DS_Store
*.swp
*.swo
*.out
*.c
*.o
Expand Down
24 changes: 22 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
# Ideas taken from: https://gist.github.com/dan-blanchard/7045057

language: python

python:
- 2.7

install: "pip install -r requirements.txt"


before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chomd +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda


install:
- conda install --yes python=$TRAVIS_PYTHON_VERSION atlas numpy scipy nose dateutil pandas statsmodels matplotlib requests cython biopython
- conda install --yes -c bioconda pysam bx-python
- python setup.py install





env:
global:
- NOSE_ARGS="not slow"
- NOSE_ARGS="not slow"


3 changes: 2 additions & 1 deletion genda/plotting/plotting_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ def coverage_hist(read, hist_array, start):
hist_array[ii + cont:ii+cont+j] +=1
cont += j
elif i==3:
pass
# cigar is always ordered
cont += j


def create_gene_path(gtf_iter, gene, x_scale):
Expand Down
22 changes: 22 additions & 0 deletions genda/transcripts/transcripts_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from itertools import tee, izip
import requests
# Requires bx python
from bx.intervals.intersection import Intersecter, Interval

Expand All @@ -24,6 +25,26 @@ def __init__(self, region, start, end):



def get_transcript_ids(gene):
""" Get transcript ids from Ensembl REST api
Returns a list of transcripts,
:TODO make out_transcripts a list of transcript class
"""
server = "http://rest.ensembl.org"
ext = "/lookup/id/{0}?species=homo_sapiens;expand=1"
r = requests.get(server+ext.format(gene), headers={ "Content-Type" :
"application/json"})
out_transcripts = []
decoded = r.json()
for i in decoded['Transcript']:
out_transcripts.append(i['id'])
return(out_transcripts,
decoded['display_name'],
decoded['seq_region_name'],
(int(decoded['start']), int(decoded['end'])))


class Transcript(object):
""" A collection of exons
"""
Expand Down Expand Up @@ -120,6 +141,7 @@ def compare_two_transcripts(trans1, trans2, transcript_dict):
Returns:
5' upstream exons -
3' downstram exons -
"""
t1 = transcript_dict[trans1]
t2 = transcript_dict[trans2]
Expand Down

0 comments on commit d1d2295

Please sign in to comment.