Skip to content

Commit

Permalink
update test to use qiime2.Metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
wasade committed Feb 22, 2022
1 parent 85521c4 commit ab9e616
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sample_name total_reads control_cell_into_extraction extraction_mass_g positive_control
#q2:types numeric numeric categorical categorical
13414.plate1.h9 4 False
13414.plate1.b10 6 False
13414.plate1.e12 6 False
Expand Down
19 changes: 5 additions & 14 deletions q2_katharoseq/tests/test_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,26 +166,17 @@ def test_threshold(self):

def test_estimating_biomass(self):
fp = join(dirname(abspath(getfile(currentframe()))), 'support_files')
data = pd.read_csv(
f'{fp}/input_estimating_biomass.tsv', sep='\t', dtype={
'sample_name': str, 'total_reads': float,
'control_cell_into_extraction': float,
'extraction_mass_g': float,
'positive_control': str})
data.set_index('sample_name', inplace=True)
data = qiime2.Metadata.load(f'{fp}/input_estimating_biomass.tsv')

obs = estimating_biomass(
total_reads=qiime2.NumericMetadataColumn(data['total_reads']),
control_cell_extraction=qiime2.NumericMetadataColumn(
data['control_cell_into_extraction']),
total_reads=data.get_column('total_reads'),
control_cell_extraction=data.get_column('control_cell_into_extraction'), # noqa
min_total_reads=1150,
positive_control_value='True',
positive_control_column=qiime2.CategoricalMetadataColumn(
data['positive_control']),
positive_control_column=data.get_column('positive_control'),
pcr_template_vol=5,
dna_extract_vol=60,
extraction_mass_g=qiime2.NumericMetadataColumn(
data['extraction_mass_g'])
extraction_mass_g=data.get_column('extraction_mass_g')
)
exp = pd.read_csv(
f'{fp}/output_estimating_biomass.tsv', sep='\t', index_col=0)
Expand Down

0 comments on commit ab9e616

Please sign in to comment.