Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions qiita_db/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,27 +888,15 @@ def _build_mapping_file(self, samples, rename_dup_samples=False):
"""Builds the combined mapping file for all samples
Code modified slightly from qiime.util.MetadataMap.__add__"""
with qdb.sql_connection.TRN:
# query to get the latest qiime mapping file
sql = """SELECT filepath
FROM qiita.filepath
JOIN qiita.prep_template_filepath USING (filepath_id)
JOIN qiita.prep_template USING (prep_template_id)
JOIN qiita.filepath_type USING (filepath_type_id)
WHERE filepath_type = 'qiime_map'
AND artifact_id IN (SELECT *
FROM qiita.find_artifact_roots(%s))
ORDER BY filepath_id DESC LIMIT 1"""
_, fp = qdb.util.get_mountpoint('templates')[0]

all_ids = set()
to_concat = []
for aid, samps in viewitems(samples):
qdb.sql_connection.TRN.add(sql, [aid])
qm_fp = qdb.sql_connection.TRN.execute_fetchindex()[0][0]
qiime_map_fp = qdb.artifact.Artifact(
aid).prep_templates[0].qiime_map_fp

# Parse the mapping file
qm = qdb.metadata_template.util.load_template_to_dataframe(
join(fp, qm_fp), index='#SampleID')
qiime_map_fp, index='#SampleID')

# if we are not going to merge the duplicated samples
# append the aid to the sample name
Expand Down
2 changes: 1 addition & 1 deletion qiita_pet/templates/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
$('.resumable-drop-metadata'), $('.progress-metadata'),
$('.uploader-list'), $('.file-edit-container'),
maxFileSize, "{{study_id}}", "{{extensions}}",
{% raw qiita_config.portal_dir %}));
"{% raw qiita_config.portal_dir %}"));
})(jQuery);

{% for dirid, filename in files %}
Expand Down