Skip to content

Commit fe442c8

Browse files
authored
Merge pull request #20 from BreakerLab/revision-release
Revision release
2 parents ab7e9b1 + 8f7195c commit fe442c8

File tree

11 files changed

+12327
-10269
lines changed

11 files changed

+12327
-10269
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ The DIMPL discovery pipeline enables rapid extraction and selection of bacterial
1313

1414
#### For Compute Cluster
1515

16-
* [Infernal](http://eddylab.org/infernal/)
17-
* [BLAST+](https://www.ncbi.nlm.nih.gov/books/NBK279680/)
18-
* [CMfinder](https://sourceforge.net/projects/weinberg-cmfinder/)
19-
* [Dead Simple Queue](https://github.com/ycrc/dSQ)
20-
* [Slurm](https://slurm.schedmd.com/quickstart.html)
16+
* [Infernal v1.1.4](http://eddylab.org/infernal/)
17+
* [BLAST+ v2.11.0+](https://www.ncbi.nlm.nih.gov/books/NBK279680/)
18+
* [CMfinder v0.4.1.18+](https://sourceforge.net/projects/weinberg-cmfinder/)
19+
* [Dead Simple Queue v1.05+](https://github.com/ycrc/dSQ)
20+
* [Slurm v20.02+](https://slurm.schedmd.com/quickstart.html)
2121

2222
### Quick-start
2323

@@ -29,9 +29,10 @@ The DIMPL discovery pipeline enables rapid extraction and selection of bacterial
2929

3030
#### Local Configuration
3131

32-
1. Clone the repository (into any folder on drive - i.e. User/git). Cloning will create a folder called dimpl.
32+
1. Download the source code (into any folder on drive)
3333

34-
`git clone github.com/breakerlab/dimpl`
34+
`wget https://github.com/BreakerLab/dimpl/archive/v1.0.1.tar.gz`
35+
`tar xzvf v1.0.1.tar.gz`
3536

3637
2. Download the docker image.
3738

data/interim/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**.fasta
2+
**.plotly
3+
**.pickle
4+
**.sh
5+
**.svg
6+
**.csv
7+
**.conf

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ version: '3'
22

33
services:
44
notebook:
5-
image: breakerlab/dimpl
5+
image: breakerlab/dimpl:v1.0.1
66
ports:
77
- 8888:8888
88
environment:
9-
- JUPYTER_ENABLE_LAB=1
109
- GRANT_SUDO=yes
1110
volumes:
1211
- ./:/home/jovyan/work

docker/Dockerfile

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,15 @@ RUN ln -fs /opt/RNAstructure/exe/* /usr/local/bin/
5858
USER ${NB_USER}
5959
RUN rm /opt/conda/conda-meta/pinned
6060
RUN conda install --quiet --yes \
61-
'ipywidgets=7.4' \
61+
'ipywidgets>7.5' \
6262
'conda-forge::python-dotenv' \
63-
'conda-forge::click' \
6463
'biopython' \
6564
'bioconda::bedops' \
6665
'bioconda::bx-python' \
6766
'bioconda::bedtools' \
6867
'bioconda::pybedtools' \
6968
'bioconda::pysam' \
70-
'plotly::plotly=3.10.0' \
69+
'plotly::plotly' \
7170
'plotly::plotly-orca' \
7271
'mysql-connector-python' && \
7372
conda clean --all -f -y
@@ -83,16 +82,6 @@ RUN cd /opt/conda/lib/python3.7/site-packages/genomeview/ && \
8382
# Install Globus-cli
8483
RUN pip install globus-cli
8584

86-
# Install any necessary Jupyter lab extensions
87-
RUN jupyter labextension install [email protected] --no-build && \
88-
jupyter labextension install @jupyterlab/[email protected] --no-build && \
89-
jupyter labextension install [email protected] --no-build && \
90-
jupyter lab build && \
91-
npm cache clean --force && \
92-
rm -rf $CONDA_DIR/share/jupyter/lab/staging && \
93-
rm -rf /home/$NB_USER/.cache/yarn && \
94-
rm -rf /home/$NB_USER/.node-gyp
95-
9685
USER root
9786
RUN fix-permissions $CONDA_DIR && \
9887
fix-permissions /home/$NB_USER

docker/genomeview_custom.patch

Lines changed: 56 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ Subject: [PATCH] Glenn Gaffield modifications
55

66
---
77
__init__.py | 13 +++++++------
8-
axis.py | 3 ++-
98
bedtrack.py | 55 +++++++++++++++++++++++++++++++++++++++----------------
109
genomeview.py | 3 ++-
10+
intervaltrack.py | 1 +
1111
svg.py | 3 ++-
1212
5 files changed, 51 insertions(+), 24 deletions(-)
1313

1414
diff --git a/__init__.py b/__init__.py
15-
index 5a29ee8..cbd87f6 100644
15+
index 5a29ee8..cbd87f6 100755
1616
--- a/__init__.py
1717
+++ b/__init__.py
1818
@@ -5,14 +5,15 @@ from genomeview.genomesource import *
1919

2020
try:
2121
from genomeview._quickconsensus import *
22-
-except ImportError:
22+
-except ValueError:
2323
- import logging
2424
- logging.warn("Unable to load cythonized quickconsensus module; "
2525
- "drawing reads using quick consensus mode will be "
@@ -37,55 +37,11 @@ index 5a29ee8..cbd87f6 100644
3737
logging.error("Unable to load cythonized quickconsensus module; "
3838
"this is likely because pysam has been updated "
3939
"since genomeview was originally install. To "
40-
diff --git a/genomeview.py b/genomeview.py
41-
index 748239b..81a59c2 100644
42-
--- a/genomeview.py
43-
+++ b/genomeview.py
44-
@@ -5,7 +5,8 @@ from genomeview.svg import Renderer, SVG
45-
46-
47-
class Document:
48-
- header = """<svg version="1.1" baseProfile="full" width="{width}" height="{height}" xmlns="http://www.w3.org/2000/svg">"""
49-
+ #GG header = """<svg version="1.1" baseProfile="full" width="{width}" height="{height}" xmlns="http://www.w3.org/2000/svg">"""
50-
+ header = """<svg version="1.1" baseProfile="full" width="{width}" height="{height}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">"""
51-
footer = """</svg>"""
52-
53-
def __init__(self, width):
54-
diff --git a/svg.py b/svg.py
55-
index fd69227..aa2d5a4 100644
56-
--- a/svg.py
57-
+++ b/svg.py
58-
@@ -19,7 +19,8 @@ class SVG(GraphicsBackend):
59-
def text(self, x, y, text, size=10, anchor="middle", family="Helvetica", **kwdargs):
60-
defaults = {}
61-
assert anchor in ["start", "middle", "end"]
62-
- yield """<text x="{x:.2f}" y="{y:.2f}" font-size="{size}" font-family="{family}" text-anchor="{anchor}" {more}>{text}</text>""".format(
63-
+ #GG yield """<text x="{x:.2f}" y="{y:.2f}" font-size="{size}" font-family="{family}" text-anchor="{anchor}" {more}>{text}</text>""".format(
64-
+ yield """<a xlink:href="https://www.ncbi.nlm.nih.gov/protein/YP_034512.1" target="_blank"><text x="{x:.2f}" y="{y:.2f}" font-size="{size}" font-family="{family}" text-anchor="{anchor}" {more}>{text}</text></a>""".format(
65-
x=x, y=y, size=size, family=family, anchor=anchor, more=_addOptions(kwdargs, defaults), text=text)
66-
67-
def text_with_background(self, x, y, text, size=10, anchor="middle", text_color="black", bg="white", bg_opacity=0.8, **kwdargs):
68-
diff --git a/axis.py b/axis.py
69-
index fd69227..aa2d5a4 100644
70-
--- a/axis.py
71-
+++ b/axis.py
72-
@@ -72,9 +72,9 @@
73-
for i in range(int(roundStart), end, res):
74-
res_digits = math.log10(res)
75-
if res_digits >= 6:
76-
- label = "{}mb".format(i / 1e6)
77-
+ label = "{}mb".format(int(i / 1e6))
78-
elif res_digits >= 3:
79-
- label = "{:,}kb".format(i / 1e3)
80-
+ label = "{:,}kb".format(int(i / 1e3))
81-
else:
82-
label = "{:,}".format(i)
83-
8440
diff --git a/bedtrack.py b/bedtrack.py
85-
index 048b7a6..7d90013 100644
41+
index 048b7a6..7d90013 100755
8642
--- a/bedtrack.py
8743
+++ b/bedtrack.py
88-
@@ -41,6 +41,8 @@
44+
@@ -41,6 +41,8 @@ def tx_from_bedfields(bedfields):
8945
name = coding_start = coding_end = exons = color = None
9046
strand = "+"
9147

@@ -94,7 +50,7 @@ index 048b7a6..7d90013 100644
9450
if len(bedfields) >= 4:
9551
name = bedfields[3]
9652
if len(bedfields) >= 6:
97-
@@ -106,7 +108,8 @@
53+
@@ -106,7 +108,8 @@ def fetch_from_bigbed(path, chrom, start, end):
9854
def fetch_from_plainbed(path, chrom, start, end):
9955
found_chrom = False
10056
for line in open(path):
@@ -104,7 +60,7 @@ index 048b7a6..7d90013 100644
10460
if fields[0] != chrom: continue
10561
found_chrom = True
10662

107-
@@ -135,8 +138,10 @@
63+
@@ -135,8 +138,10 @@ class BEDTrack(IntervalTrack):
10864
self.draw_locus_labels = True
10965
self.include_locus_fn = None
11066

@@ -117,7 +73,7 @@ index 048b7a6..7d90013 100644
11773
self.thin_width = 5
11874
self.thinnest_width = 1
11975

120-
@@ -171,10 +176,11 @@
76+
@@ -171,10 +176,11 @@ class BEDTrack(IntervalTrack):
12177
def draw_interval(self, renderer, interval):
12278
# print(interval)
12379
interval_pixel_width = self.scale.relpixels(interval.tx.end-interval.tx.start)
@@ -133,7 +89,7 @@ index 048b7a6..7d90013 100644
13389

13490
# print(1)
13591
row = self.intervals_to_rows[interval.id]
136-
@@ -214,7 +220,8 @@
92+
@@ -214,7 +220,8 @@ class BEDTrack(IntervalTrack):
13793

13894
# Draw the "exons", both thin (non-coding/UTR) and thick (coding)
13995
# print(interval, tx.exons)
@@ -143,7 +99,7 @@ index 048b7a6..7d90013 100644
14399
for cur_start, cur_end in tx.exons:
144100
if which == "thick":
145101
cur_y = top
146-
@@ -227,11 +234,13 @@
102+
@@ -227,11 +234,13 @@ class BEDTrack(IntervalTrack):
147103
cur_start = max(tx.coding_start, cur_start)
148104
cur_end = min(tx.coding_end, cur_end)
149105
else:
@@ -161,7 +117,7 @@ index 048b7a6..7d90013 100644
161117

162118
cur_start = self.scale.topixels(cur_start)
163119
cur_end = self.scale.topixels(cur_end)
164-
@@ -241,12 +250,42 @@
120+
@@ -241,12 +250,26 @@ class BEDTrack(IntervalTrack):
165121
cur_start -= self.min_exon_width / 2
166122
width = self.min_exon_width
167123

@@ -185,27 +141,53 @@ index 048b7a6..7d90013 100644
185141
if interval.label is not None:
186142
end = self.scale.topixels(interval.end)
187143
+ end+= 5 if interval.strand=="+" else 0 #GG
188-
+
189-
+ #GG yield from renderer.text(end+self.label_distance, top+self.row_height-2, interval.label, anchor="start")
190-
+ start = self.scale.topixels(interval.start)
191-
+
192-
+ #GG prevent truncation of label on left side of image
193-
+ if start < 0:
194-
+ start = 0
195144

196145
- yield from renderer.text(end+self.label_distance, top+self.row_height-2, interval.label, anchor="start")
197146
-
198147
\ No newline at end of file
199-
+ #GG prevent label truncation on the right side of image
200-
+ # calculate an approximation of the rendered length
201-
+ arr=[4.3,4.3,5.45,8.5,8.5,19.5,10.15,3.0,5.15,5.15,6.0,8.9,4.3,5.15,4.3,4.3,8.5,7.45,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,4.3,4.3,8.9,8.9,8.9,8.5,15.35,10.15,10.15,11.0,11.0,10.15,9.3,11.8,11.0,4.3,7.45,10.15,8.5,12.65,11.0,11.8,10.15,11.8,11.0,10.15,9.3,11.0,10.15,14.3,10.15,10.15,9.3,4.3,4.3,4.3,7.20,8.5,5.15,8.5,8.5,7.45,8.5,8.5,4.0,8.5,8.5,3.45,3.45,7.45,3.45,12.65,8.5,8.5,8.5,8.5,5.15,7.45,4.3,8.5,7.45,11.0,7.45,7.45,7.45,5.15,4.0,5.15,8.9]
202-
+
203-
+ label_len=0
204-
+ for i, ch in enumerate(interval.label):
205-
+ label_len += arr[ord(ch)-32] * 0.6666667
206-
+
207-
+ if start + label_len >= 892:
208-
+ start = 892 - label_len
209-
+
148+
+ #GG yield from renderer.text(end+self.label_distance, top+self.row_height-2, interval.label, anchor="start")
149+
+ start = self.scale.topixels(interval.start)
210150
+ yield from renderer.text(start, top+self.row_height-5, interval.label, anchor="start")
211-
+
151+
+
152+
diff --git a/genomeview.py b/genomeview.py
153+
index 748239b..81a59c2 100755
154+
--- a/genomeview.py
155+
+++ b/genomeview.py
156+
@@ -5,7 +5,8 @@ from genomeview.svg import Renderer, SVG
157+
158+
159+
class Document:
160+
- header = """<svg version="1.1" baseProfile="full" width="{width}" height="{height}" xmlns="http://www.w3.org/2000/svg">"""
161+
+ #GG header = """<svg version="1.1" baseProfile="full" width="{width}" height="{height}" xmlns="http://www.w3.org/2000/svg">"""
162+
+ header = """<svg version="1.1" baseProfile="full" width="{width}" height="{height}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">"""
163+
footer = """</svg>"""
164+
165+
def __init__(self, width):
166+
diff --git a/intervaltrack.py b/intervaltrack.py
167+
index 01bb4f9..d5b89e6 100755
168+
--- a/intervaltrack.py
169+
+++ b/intervaltrack.py
170+
@@ -96,6 +96,7 @@ class IntervalTrack(Track):
171+
arrow_width = min(self.row_height / 2, self.margin_x * 0.7, self.scale.relpixels(30))
172+
direction = "right" if interval.strand=="+" else "left"
173+
174+
+ #print("rendered block arrow")
175+
yield from renderer.block_arrow(start, top, end-start, self.row_height,
176+
arrow_width=arrow_width, direction=direction,
177+
fill=color, **{"stroke":"none", "id":temp_label})
178+
diff --git a/svg.py b/svg.py
179+
index fd69227..aa2d5a4 100755
180+
--- a/svg.py
181+
+++ b/svg.py
182+
@@ -19,7 +19,8 @@ class SVG(GraphicsBackend):
183+
def text(self, x, y, text, size=10, anchor="middle", family="Helvetica", **kwdargs):
184+
defaults = {}
185+
assert anchor in ["start", "middle", "end"]
186+
- yield """<text x="{x:.2f}" y="{y:.2f}" font-size="{size}" font-family="{family}" text-anchor="{anchor}" {more}>{text}</text>""".format(
187+
+ #GG yield """<text x="{x:.2f}" y="{y:.2f}" font-size="{size}" font-family="{family}" text-anchor="{anchor}" {more}>{text}</text>""".format(
188+
+ yield """<a xlink:href="https://www.ncbi.nlm.nih.gov/protein/YP_034512.1" target="_blank"><text x="{x:.2f}" y="{y:.2f}" font-size="{size}" font-family="{family}" text-anchor="{anchor}" {more}>{text}</text></a>""".format(
189+
x=x, y=y, size=size, family=family, anchor=anchor, more=_addOptions(kwdargs, defaults), text=text)
190+
191+
def text_with_background(self, x, y, text, size=10, anchor="middle", text_color="black", bg="white", bg_opacity=0.8, **kwdargs):
192+
--
193+
2.7.4

0 commit comments

Comments
 (0)