You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,12 @@ and you should see the versions of <strong>pangolin</strong>, and <strong>pangoL
67
67
68
68
> Note: Even if you have previously installed <strong>pangolin</strong>, as it is being worked on intensively, we recommend you check for updates before running.
69
69
70
-
To update:
70
+
To update pangolin, pangoLEARN, and lineages automatically to the latest stable release:
parser.add_argument('-d', '--data', action='store',help="Data directory minimally containing a fasta alignment and guide tree")
34
40
parser.add_argument('-n', '--dry-run', action='store_true',help="Go through the motions but don't actually run")
35
41
parser.add_argument('--tempdir',action="store",help="Specify where you want the temp stuff to go. Default: $TMPDIR")
36
42
parser.add_argument("--no-temp",action="store_true",help="Output all intermediate files, for dev purposes.")
43
+
parser.add_argument('--decompress-model',action="store_true",dest="decompress",help="Permanently decompress the model file to save time running pangolin.")
37
44
parser.add_argument('--max-ambig', action="store", default=0.5, type=float,help="Maximum proportion of Ns allowed for pangolin to attempt assignment. Default: 0.5",dest="maxambig")
38
45
parser.add_argument('--min-length', action="store", default=10000, type=int,help="Minimum query length allowed for pangolin to attempt assignment. Default: 10000",dest="minlen")
39
46
parser.add_argument('--panGUIlin', action='store_true',help="Run web-app version of pangolin",dest="panGUIlin")
parser.add_argument("-lv","--lineages-version", action='version', version=f"lineages {lineages.__version__}",help="show lineages's version number and exit")
47
54
parser.add_argument("-pv","--pangoLEARN-version", action='version', version=f"pangoLEARN {pangoLEARN.__version__}",help="show pangoLEARN's version number and exit")
55
+
parser.add_argument("--update", action='store_true', default=False, help="Automatically updates to latest release of pangolin, pangoLEARN, and lineages then exits")
sys.stderr.write('Error: cannot find query (input) fasta file at {}\nPlease enter your fasta sequence file and refer to pangolin usage at:\nhttps://github.com/hCoV-2019/pangolin#usage\n for detailed instructions\n'.format(query))
78
+
# to enable not having to pass a query if running update
79
+
# by allowing query to accept 0 to many arguments
80
+
iflen(args.query) >1:
81
+
print(f"Error: Too many query (input) fasta files supplied: {args.query}\nPlease supply one only")
82
+
parser.print_help()
70
83
sys.exit(-1)
71
84
else:
72
-
print(f"The query file is {query}")
85
+
# find the query fasta
86
+
query=os.path.join(cwd, args.query[0])
87
+
ifnotos.path.exists(query):
88
+
sys.stderr.write('Error: cannot find query (input) fasta file at {}\nPlease enter your fasta sequence file and refer to pangolin usage at:\nhttps://github.com/hCoV-2019/pangolin#usage\n for detailed instructions\n'.format(query))
print("""Check your environment, didn't find appropriate files from the lineages repo, please see https://cov-lineages.org/pangolin.html for installation instructions. \nTreefile must end with `.treefile`.\
212
233
\nAlignment must be in `.fasta` format.\n Trained model must exist. \
print("""Check your environment, didn't find appropriate files from the pangoLEARN repo.\n Trained model must be installed, please see https://cov-lineages.org/pangolin.html for installation instructions.""")
243
264
exit(1)
244
265
else:
266
+
ifargs.decompress:
267
+
prev_size=os.path.getsize(trained_model)
268
+
269
+
print("Decompressing model and header files")
270
+
model=joblib.load(trained_model)
271
+
joblib.dump(model, trained_model, compress=0)
272
+
headers=joblib.load(header_file)
273
+
joblib.dump(headers, header_file, compress=0)
274
+
275
+
ifos.path.getsize(trained_model) >=prev_size:
276
+
print(f'Success! Decompressed the model file. Exiting\n')
277
+
sys.exit(0)
278
+
else:
279
+
print(f'Error: failed to decompress model. Exiting\n')
0 commit comments