Skip to content

Commit 51700c2

Browse files
authored
Merge pull request #47 from ygidtu/dev
update web to v0.0.5, fix several bugs, update docs
2 parents 94464be + abf01aa commit 51700c2

20 files changed

Lines changed: 584 additions & 837 deletions

File tree

WebDockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ RUN cd $ROOT_DIR && \
99
pip install -i $PYPI fastapi uvicorn pydantic jinja2 && \
1010
pip install -r requirements.txt && ls -l $ROOT_DIR
1111

12-
ENTRYPOINT ["python", "/opt/sashimi/server.py"]
12+
ENTRYPOINT ["python", "/opt/sashimi/server.py", "--host", "0.0.0.0"]

docs/imgs/web/add.png

-1.13 KB
Loading

docs/imgs/web/draw.png

2.95 KB
Loading

docs/imgs/web/main.png

498 KB
Loading

docs/imgs/web/preview.png

119 KB
Loading

docs/installation.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ docker run --rm -v $PWD:$PWD --user $(id -u):$(id -g) ygidtu/sashimi --help
6969

7070
- `-v`, `--volumn`: mount the working directory to docker container
7171
- `--user`: prevent docker read and write file using root privileges
72-
- the rest usage please check [Command line usage](./command_line_usage.md)
72+
- the rest usage please check [Command line usage](./command.md)
7373

74-
**Note: ** detailed command line usage please check [Command line Usage](./command_line_usage.md)
74+
**Note: ** detailed command line usage please check [Command line Usage](./command.md)
7575

7676

7777
## Build Web interface from source
@@ -101,6 +101,8 @@ python server.py --help
101101
```bash
102102
docker pull ygidtu/sashimiweb
103103

104-
export PORT=8080 # the port your are trying to exposed
105-
docker run --rm -v $PWD:$PWD --user $(id -u):$(id -g) -p $PORT:5000 ygidtu/sashimiweb
104+
docker run --name sashimiweb \
105+
--rm -v $PWD:$PWD \
106+
-p 5000:5000 \
107+
ygidtu/sashimiweb
106108
```

docs/web.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
#### 1. requirements
88

9-
Except the sashimi, we still required `fastapi`, `uvicorn` and `pydantic`
9+
Except the sashimi, we required `fastapi`, `uvicorn` and `pydantic` and `nodejs`
10+
11+
The deployment please check the [Build Web interface from source](./installation.md)
1012

1113
## Usage
1214

sashimi/base/ReadDepth.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ def __init__(self,
5555

5656
@property
5757
def wiggle(self) -> np.array:
58-
if self.plus is None or np.sum(self.plus) == 0:
58+
if (self.plus is None or np.sum(self.plus) == 0) and self.minus is not None:
5959
return self.minus
60-
elif self.minus is None or np.sum(self.minus) == 0:
61-
return self.plus
60+
61+
if self.plus is not None and self.minus is not None:
62+
return self.plus + self.minus
63+
6264
return self.plus
6365

6466
def __add__(self, other):

sashimi/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,8 @@ def main(**kwargs):
564564
n_y_ticks=kwargs["n_y_ticks"],
565565
show_y_label=not kwargs["hide_y_label"],
566566
show_site_plot=kwargs["show_site"],
567-
strand_choice=kwargs["site_strand"])
567+
strand_choice=kwargs["site_strand"],
568+
density_by_strand=kwargs["density_by_strand"],)
568569
elif key == "heatmap":
569570
for f in process_file_list(kwargs[key], key):
570571
if barcodes and f.label in barcodes.keys() and f.category in ["bam", "atac"]:

sashimi/file/Bam.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def create(cls,
5353
barcodes: Optional[Set[str]] = None,
5454
barcode_tag: str = "CB",
5555
umi_tag: str = "UB",
56-
library: str = "fru"
56+
library: str = "fru",
57+
density_by_strand: bool = False
5758
):
5859
u"""
5960
@@ -88,7 +89,8 @@ def create(cls,
8889
barcodes=barcode,
8990
barcode_tag=barcode_tag,
9091
umi_tag=umi_tag,
91-
library=library
92+
library=library,
93+
density_by_strand=density_by_strand
9294
)
9395

9496
def __hash__(self):
@@ -282,11 +284,11 @@ def load(self,
282284
spanned_junctions_plus, spanned_junctions_minus = {}, {}
283285

284286
self.data = ReadDepth(
285-
plus,
287+
plus if self.density_by_strand else plus + minus,
286288
junctions_dict=filtered_junctions,
287289
site_plus=site_plus,
288290
site_minus=site_minus,
289-
minus=minus,
291+
minus=minus if self.density_by_strand else None,
290292
junction_dict_plus=spanned_junctions_plus,
291293
junction_dict_minus=spanned_junctions_minus,
292294
strand_aware=False if self.library == "fru" else True)

0 commit comments

Comments
 (0)