33import argparse
44import asyncio
55from dataclasses import dataclass
6+ from pathlib import Path
67
78import pandas as pd
89from fast_bioservices import Taxon
@@ -24,6 +25,7 @@ class _Arguments:
2425 minimum_cutoff : int | str
2526 library_prep : RNAPrepMethod
2627 taxon : Taxon
28+ write_zfpkm_png_filepath : Path
2729
2830 def __post_init__ (self ):
2931 self .library_prep = RNAPrepMethod .from_string (str (self .library_prep ))
@@ -48,6 +50,7 @@ async def _handle_context_batch(
4850 cut_off : int | float | str ,
4951 prep : RNAPrepMethod ,
5052 taxon : Taxon ,
53+ write_zfpkm_png_filepath : Path ,
5154) -> None :
5255 """Iterate through each context type and create rnaseq expression file.
5356
@@ -110,6 +113,7 @@ async def _handle_context_batch(
110113 technique = technique ,
111114 cut_off = cut_off ,
112115 taxon_id = taxon ,
116+ write_zfpkm_png_filepath = write_zfpkm_png_filepath ,
113117 )
114118 logger .success (f"Results saved at '{ rnaseq_output_filepath } '" )
115119
@@ -119,6 +123,7 @@ async def rnaseq_gen(
119123 config_filename : str ,
120124 prep : RNAPrepMethod ,
121125 taxon_id : int | str | Taxon ,
126+ write_zfpkm_png_filepath : Path ,
122127 replicate_ratio : float = 0.5 ,
123128 high_replicate_ratio : float = 1.0 ,
124129 batch_ratio : float = 0.5 ,
@@ -180,6 +185,7 @@ async def rnaseq_gen(
180185 cut_off = cut_off ,
181186 prep = prep ,
182187 taxon = taxon_id ,
188+ write_zfpkm_png_filepath = write_zfpkm_png_filepath ,
183189 )
184190
185191
@@ -287,6 +293,12 @@ def _parse_args() -> _Arguments:
287293 "Will separate samples into groups to only compare similarly prepared libraries. "
288294 "For example, mRNA, total-rna, scRNA, etc" ,
289295 )
296+ parser .add_argument (
297+ "--write-zfpkm-png-filepath" ,
298+ required = False ,
299+ type = Path ,
300+ help = "If using zFPKM, the location to write graphs" ,
301+ )
290302 args = parser .parse_args ()
291303 args .filtering_technique = args .filtering_technique .lower ()
292304 args .taxon = Taxon .from_int (int (args .taxon )) if str (args .taxon ).isdigit () else Taxon .from_string (str (args .taxon )) # type: ignore
@@ -306,5 +318,6 @@ def _parse_args() -> _Arguments:
306318 cut_off = args .minimum_cutoff ,
307319 prep = args .library_prep ,
308320 taxon_id = args .taxon ,
321+ write_zfpkm_png_filepath = args .write_zfpkm_png_filepath ,
309322 )
310323 )
0 commit comments