-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
7,812 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ pnpm-debug.log* | |
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
## ViralWasm-Consensus | ||
|
||
A client-side WebAssembly pipeline for viral consensus sequence calling. For an offline version of this site, please see the offline-mode branch: https://github.com/Niema-Lab/ViralWasm-Consensus/tree/offline-mode | ||
A client-side WebAssembly pipeline for viral consensus sequence calling. To run the pipeline locally without internet, download the **offline** version of ViralWasm-Consensus. To do so, download the latest release / repository (https://github.com/Niema-Lab/ViralWasm-Consensus/releases/latest/master.zip) and run the following command: | ||
|
||
```python3 run_website.py``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import http.server | ||
import socketserver | ||
import subprocess | ||
import socket | ||
|
||
PORT = 5000 | ||
DIRECTORY = "dist" | ||
|
||
def kill_port_unix(port): | ||
command = f"lsof -i :{port} -t" | ||
try: | ||
result = subprocess.check_output(command, shell=True).decode("utf-8") | ||
pids = result.strip().split("\n") | ||
for pid in pids: | ||
subprocess.run(f"kill -9 {pid}", shell=True) | ||
except subprocess.CalledProcessError as e: | ||
return | ||
|
||
def kill_port_windows(port): | ||
command = f"netstat -ano | findstr :{port}" | ||
try: | ||
result = subprocess.check_output(command, shell=True).decode("utf-8").strip().split("\n") | ||
for line in result: | ||
pid = line.split()[-1] | ||
subprocess.run(f"taskkill /F /PID {pid}", shell=True) | ||
except subprocess.CalledProcessError as e: | ||
return | ||
|
||
# Check if port is already in use | ||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
port_in_use = sock.connect_ex(('127.0.0.1', PORT)) == 0 | ||
sock.close() | ||
|
||
# If port is in use, suggest using --force option | ||
if port_in_use: | ||
force_port = input(f"Port {PORT} is already in use. Try to close the port and continue [Y/n]? ") | ||
if force_port.lower() == "y": | ||
kill_port_unix(PORT) | ||
kill_port_windows(PORT) | ||
else: | ||
exit(1) | ||
|
||
class Handler(http.server.SimpleHTTPRequestHandler): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, directory=DIRECTORY, **kwargs) | ||
|
||
with socketserver.TCPServer(("", PORT), Handler) as httpd: | ||
print(f'Serving at port {PORT}. Visit http://localhost:{PORT}/index.html') | ||
httpd.serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters