Skip to content

Adding qiime map file #678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Nov 24, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
adding test for create_qiime_map
  • Loading branch information
antgonza committed Nov 23, 2014
commit 4dae65cd5b573884e2245be27e06d75b4de0e738
15 changes: 11 additions & 4 deletions qiita_db/metadata_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,11 @@ def create_qiime_map(self, prep_template_fp):
The filepath of the prep template we want to generate the qiime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revise this sentence?

mapping file

Returns
-------
filepath : str
The filepath of the created qiime file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file ➡️ mapping file


Raises
------
QiitaDBColumnError
Expand Down Expand Up @@ -1727,15 +1732,17 @@ def create_qiime_map(self, prep_template_fp):

# figuring out the filepath for the qiime map file
_id, fp = get_mountpoint('templates')[0]
mapping_fp = join(fp, '%d_prep_%d_qiime_%s.txt' % (self.study_id,
self.id, strftime("%Y%m%d-%H%M%S")))
filepath = join(fp, '%d_prep_%d_qiime_%s.txt' % (self.study_id,
self.id, strftime("%Y%m%d-%H%M%S")))

# Save the mapping file
mapping.to_csv(mapping_fp, index_label='#SampleID', na_rep='unknown',
mapping.to_csv(filepath, index_label='#SampleID', na_rep='unknown',
sep='\t')

# adding the fp to the object
self.add_filepath(mapping_fp)
self.add_filepath(filepath)

return filepath


def load_template_to_dataframe(fn):
Expand Down
Loading