33from pathlib import Path
44from types import SimpleNamespace
55
6- from pyfixtures import fixture
76from virtool_core .utils import compress_file , decompress_file , is_gzipped
87from virtool_workflow import hooks , step
98from virtool_workflow .data .subtractions import WFNewSubtraction
@@ -16,27 +15,6 @@ async def delete_subtraction(new_subtraction: WFNewSubtraction):
1615 await new_subtraction .delete ()
1716
1817
19- @fixture
20- async def bowtie_index_path (work_path : Path ) -> Path :
21- """The output directory for the subtraction's Bowtie2 index."""
22- path = work_path / "bowtie"
23- await asyncio .to_thread (path .mkdir )
24-
25- return path
26-
27-
28- @fixture
29- async def decompressed_fasta_path (work_path : Path ) -> Path :
30- """The path to the input FASTA file for the subtraction."""
31- return work_path / "subtraction.fa"
32-
33-
34- @fixture
35- def intermediate () -> SimpleNamespace :
36- """A namespace for intermediate variables."""
37- return SimpleNamespace ()
38-
39-
4018@step (name = "Decompress FASTA" )
4119async def decompress (
4220 decompressed_fasta_path : Path ,
@@ -64,6 +42,9 @@ async def compute_gc_and_count(
6442 """Compute the GC and count."""
6543
6644 def func (path : Path ):
45+ if not path .suffix != "fa" :
46+ raise ValueError ("Input file is not a FASTA file." )
47+
6748 _count = 0
6849 _nucleotides = {"a" : 0 , "t" : 0 , "g" : 0 , "c" : 0 , "n" : 0 }
6950
0 commit comments