Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Andersen Lab ingest to new metadata #64

Merged
merged 4 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ingest/build-configs/ncbi/bin/transform-host
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ def parse_host_map(host_map_file: str) -> dict:
"""
host_map = {}
with open(host_map_file) as tsv_file:
reader = csv.DictReader(tsv_file, delimiter="\t")
reader = csv.reader(tsv_file, delimiter="\t")
for row in reader:
host_map[row["old_name"].lower()] = row["new_name"]
# Skip comments
if not row or row[0].lstrip()[0] == '#':
continue

host_map[row[0].lower()] = row[1]

return host_map

Expand Down
2 changes: 2 additions & 0 deletions ingest/build-configs/ncbi/defaults/annotations.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ A/environment/USA/CO-UW-9084466/2024 division Colorado # Based on linked BioSamp
A/environment/USA/CO-UW-9084466/2024 host Cattle # This sequence from commercial milk is definitively from cattle, strain name guidelines are going to be updated here
A/ALPACA/USA/24-014328-007/2024 division Idaho # Based on news reports https://www.cidrap.umn.edu/avian-influenza-bird-flu/alpacas-infected-h5n1-avian-flu-idaho
A/Alpaca/USA/24-015080-001/2024 division Idaho # Based on news reports https://www.cidrap.umn.edu/avian-influenza-bird-flu/alpacas-infected-h5n1-avian-flu-idaho
A/House-Mouse/USA/24-014780-002/2024 division New Mexico # Based on https://wahis.woah.org/#/in-review/4451?reportId=167771&fromPage=event-dashboard-url
A/House-Mouse/USA/24-014782-003/2024 division New Mexico # Based on https://wahis.woah.org/#/in-review/4451?reportId=167771&fromPage=event-dashboard-url
4 changes: 3 additions & 1 deletion ingest/build-configs/ncbi/defaults/host-map.tsv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
old_name new_name
# Check for bird codes in https://www.carolinabirdclub.org/bandcodes.html
alpaca Nonhuman Mammal
american crow Avian
american wigeon Avian
Expand Down Expand Up @@ -50,6 +50,8 @@ harris hawk Avian
harris-hawk Avian
hawk Avian
Homo sapiens Human
HOSP Avian
House-Mouse Nonhuman Mammal
Icteridae Avian
Larus occidentalis Avian
Lophodytes cucullatus Avian
Expand Down
10 changes: 5 additions & 5 deletions ingest/build-configs/ncbi/rules/ingest_andersen_lab.smk
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ rule extract_automated_metadata:
input:
andersen_lab_repo = "andersen-lab/data/avian-influenza.tar.gz"
output:
metadata = "andersen-lab/data/PRJNA1102327_automated_metadata.csv"
metadata = "andersen-lab/data/SraRunTable_automated_metadata.csv",
params:
metadata_file_path = "metadata/SraRunTable_PRJNA1102327_automated.csv",
metadata_file_path = "metadata/SraRunTable_automated.csv",
shell:
"""
tar xz -O --file={input.andersen_lab_repo} \
Expand All @@ -58,9 +58,9 @@ rule join_old_and_automated_metadata:
"""
input:
old_metadata = "andersen-lab/data/PRJNA1102327_old_metadata.csv",
automated_metadata = "andersen-lab/data/PRJNA1102327_automated_metadata.csv",
automated_metadata = "andersen-lab/data/SraRunTable_automated_metadata.csv",
output:
metadata = "andersen-lab/data/PRJNA1102327_metadata.csv",
metadata = "andersen-lab/data/raw_metadata.csv",
params:
join_field = "Run",
shell:
Expand Down Expand Up @@ -114,7 +114,7 @@ rule rename_and_concatenate_segment_fastas:

rule curate_metadata:
input:
metadata = "andersen-lab/data/PRJNA1102327_metadata.csv",
metadata = "andersen-lab/data/raw_metadata.csv",
geolocation_rules = "defaults/geolocation_rules.tsv",
annotations=config["curate"]["annotations"],
output:
Expand Down