Skip to content

Commit

Permalink
update europe builds and flag outlier script
Browse files Browse the repository at this point in the history
  • Loading branch information
rneher committed Nov 13, 2024
1 parent 7bb45d3 commit a010740
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions profiles/europe/builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ array-builds:
annotation: "config/{lineage}/{{segment}}/genemap.gff"
tree_exclude_sites: "config/{lineage}/{{segment}}/exclude-sites.txt"
clades: "config/{lineage}/ha/clades.tsv"
subclades: "config/{lineage}/{{segment}}/subclades.tsv"
auspice_config: "config/{lineage}/auspice_config.json"
vaccines: "config/{lineage}/vaccine.json"
enable_glycosylation: true
Expand Down Expand Up @@ -113,6 +114,7 @@ array-builds:
annotation: "config/{lineage}/{{segment}}/genemap.gff"
tree_exclude_sites: "config/{lineage}/{{segment}}/exclude-sites.txt"
clades: "config/{lineage}/ha/clades.tsv"
subclades: "config/{lineage}/{{segment}}/subclades.tsv"
auspice_config: "config/{lineage}/auspice_config.json"
vaccines: "config/{lineage}/vaccine.json"
enable_glycosylation: true
Expand Down Expand Up @@ -163,6 +165,7 @@ array-builds:
annotation: "config/{lineage}/{{segment}}/genemap.gff"
tree_exclude_sites: "config/{lineage}/{{segment}}/exclude-sites.txt"
clades: "config/{lineage}/ha/clades.tsv"
subclades: "config/{lineage}/{{segment}}/subclades.tsv"
auspice_config: "config/{lineage}/auspice_config.json"
vaccines: "config/{lineage}/vaccine.json"
enable_glycosylation: true
Expand Down
9 changes: 6 additions & 3 deletions scripts/flag_outliers.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def prepare_tree(T):
parser.add_argument('--reroot', action="store_true", help="reroot the tree")
parser.add_argument('--optimize', action="store_true", help="optimize sigma and mu")
parser.add_argument('--dates', type=str, help='csv/tsv file with dates for each sequence')
parser.add_argument('--keep-strains', type=str, help='a list of strains to keep in the output tree regardless of outlier status (i.e., reference strains that need to be retained in the build)')
parser.add_argument('--keep-strains', type=str, nargs='+', help='a list of strains to keep in the output tree regardless of outlier status (i.e., reference strains that need to be retained in the build)')
parser.add_argument('--output-outliers', type=str, help='file for outliers')
parser.add_argument('--output-tree', type=str, help='file for pruned tree')

Expand Down Expand Up @@ -156,8 +156,11 @@ def prepare_tree(T):
if args.output_tree:
keep_strains = set()
if args.keep_strains:
with open(args.keep_strains, "r", encoding="utf-8") as fh:
keep_strains = {line.strip() for line in fh}
if type(args.keep_strains)==str:
args.keep_strains = [args.keep_strains]
for fname in args.keep_strains:
with open(fname, "r", encoding="utf-8") as fh:
keep_strains = {line.strip() for line in fh}

from Bio import Phylo
T = tt.tree
Expand Down

0 comments on commit a010740

Please sign in to comment.