File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
qiita_db/metadata_template Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -505,3 +505,25 @@ def status(self):
505
505
pd_statuses = conn_handler .execute_fetchall (sql , (self ._id ,))
506
506
507
507
return infer_status (pd_statuses )
508
+
509
+ @property
510
+ def qiime_map_fp (self ):
511
+ """The QIIME mapping file path of the prep template
512
+
513
+ Returns
514
+ -------
515
+ str
516
+ The filepath of the QIIME mapping file
517
+ """
518
+ conn_handler = SQLConnectionHandler ()
519
+
520
+ sql = """SELECT filepath_id, filepath
521
+ FROM qiita.filepath
522
+ JOIN qiita.{0} USING (filepath_id)
523
+ JOIN qiita.filepath_type USING (filepath_type_id)
524
+ WHERE {1} = %s AND filepath_type = 'qiime_map'
525
+ ORDER BY filepath_id DESC""" .format (self ._filepath_table ,
526
+ self ._id_column )
527
+ fn = conn_handler .execute_fetchall (sql , (self ._id ,))[0 ][1 ]
528
+ base_dir = get_mountpoint ('templates' )[0 ][1 ]
529
+ return join (base_dir , fn )
Original file line number Diff line number Diff line change @@ -1293,6 +1293,12 @@ def test_update_category(self):
1293
1293
self .assertEqual (self .tester ['1.SKB8.640193' ]['center_name' ], 'FOO' )
1294
1294
self .assertEqual (self .tester ['1.SKD8.640184' ]['center_name' ], 'BAR' )
1295
1295
1296
+ def test_qiime_map_fp (self ):
1297
+ pt = PrepTemplate (1 )
1298
+ exp = join (get_mountpoint ('templates' )[0 ][1 ],
1299
+ '1_prep_1_qiime_19700101-000000.txt' )
1300
+ self .assertEqual (pt .qiime_map_fp , exp )
1301
+
1296
1302
1297
1303
EXP_PREP_TEMPLATE = (
1298
1304
'sample_name\t barcodesequence\t center_name\t center_project_name\t '
You can’t perform that action at this time.
0 commit comments