Skip to content

Commit

Permalink
Merge pull request #27 from EBI-Metagenomics/feature/extend_metadata_…
Browse files Browse the repository at this point in the history
…platform

Feature/extend metadata platform
  • Loading branch information
Ge94 authored Aug 30, 2024
2 parents 7046b59 + a747143 commit 0cd9a1a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM mambaorg/micromamba:1.5.8

LABEL maintainer="Microbiome Informatics"
LABEL version="1.0.0"
LABEL version="1.0.1"
LABEL description="EBI Fetch Tool."

COPY --chown=$MAMBA_USER:$MAMBA_USER conda_environment.yml /tmp/env.yaml
Expand Down
3 changes: 1 addition & 2 deletions conda_environment.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: fetchtool
channels:
- bioconda
- conda-forge
- defaults
- bioconda
dependencies:
- python=3.10
- pip=24.0
Expand Down
5 changes: 5 additions & 0 deletions fetchtool/fetch_reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class FetchReads(AbstractDataFetcher):
"experiment_accession",
"run_accession",
"instrument_model",
"instrument_platform",
"library_layout",
"fastq_ftp",
"fastq_md5",
Expand Down Expand Up @@ -207,6 +208,8 @@ def _retrieve_project_info_from_api(self, project_accession):
"LIBRARY_STRATEGY": d.get("library_strategy"),
"LIBRARY_SOURCE": d.get("library_source"),
"LIBRARY_LAYOUT": d.get("library_layout"),
"INSTRUMENT_MODEL": d.get("instrument_model"),
"INSTRUMENT_PLATFORM": d.get("instrument_platform"),
}
)
return mapped_data
Expand All @@ -228,6 +231,8 @@ def map_project_info_to_row(self, run):
"file_path": run["DATA_FILE_PATH"],
"library_strategy": run["LIBRARY_STRATEGY"],
"library_source": run["LIBRARY_SOURCE"],
"instrument_model": run["INSTRUMENT_MODEL"],
"instrument_platform": run["INSTRUMENT_PLATFORM"],
}

def _get_project_accessions_from_runs(self, runs):
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/test_fetch_reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def test_map_project_info_db_row_should_copy_fields(self):
"LIBRARY_LAYOUT": "PAIRED",
"LIBRARY_SOURCE": "METAGENOMIC",
"LIBRARY_STRATEGY": "WGS",
"INSTRUMENT_MODEL": "Illumina HiSeq 2000",
"INSTRUMENT_PLATFORM": "ILLUMINA",
"file": "ERR599383_1.fastq.gz;ERR599383_2.fastq.gz",
"DATA_FILE_PATH": "/tmp/ERP001736/ERR599383_1.fastq.gz;/tmp/ERP001736/ERR599383_2.fastq.gz",
}
Expand All @@ -103,6 +105,8 @@ def test_map_project_info_db_row_should_copy_fields(self):
("LIBRARY_LAYOUT", "library_layout"),
("LIBRARY_STRATEGY", "library_strategy"),
("LIBRARY_SOURCE", "library_source"),
("INSTRUMENT_MODEL", "instrument_model"),
("INSTRUMENT_PLATFORM", "instrument_platform"),
)
for f1, f2 in equivalent_fields:
assert raw_data[f1] == transform[f2]
Expand All @@ -129,6 +133,7 @@ def mock_get_run_metadata(self, *args, **kwargs):
"experiment_accession": "ERX2789866",
"run_accession": "ERR2777788",
"instrument_model": "unspecified",
"instrument_platform": "ILLUMINA",
"library_layout": "PAIRED",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR277/009/ERR2777788/ERR2777788_1.txt.gz;"
"ftp.sra.ebi.ac.uk/vol1/fastq/ERR277/009/ERR2777790/ERR2777788_2.txt.gz",
Expand All @@ -147,6 +152,7 @@ def mock_get_run_metadata(self, *args, **kwargs):
"experiment_accession": "ERX2789866",
"run_accession": "ERR2777789",
"instrument_model": "unspecified",
"instrument_platform": "LS454",
"library_layout": "PAIRED",
"fastq_ftp": "",
"fastq_md5": "",
Expand All @@ -164,6 +170,7 @@ def mock_get_run_metadata(self, *args, **kwargs):
"experiment_accession": "ERX2789867",
"run_accession": "ERR2777790",
"instrument_model": "unspecified",
"instrument_platform": "LS454",
"library_layout": "PAIRED",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR277/009/ERR2777790/ERR2777790_1.fastq.gz;"
"ftp.sra.ebi.ac.uk/vol1/fastq/ERR277/009/ERR2777790/ERR2777790_2.fastq.gz",
Expand Down

0 comments on commit 0cd9a1a

Please sign in to comment.