Skip to content

Release candidate November 1st, 2017 #2373

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 190 commits into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
52e98a5
replace printable for try/except utf-8
antgonza Aug 28, 2017
e367b54
add sleeps for tests
antgonza Aug 28, 2017
5f7177e
moving wait_for_prep_information_job
antgonza Aug 28, 2017
01da18f
just leaving the changes on this pr
antgonza Aug 28, 2017
2ae9511
Fixing tests
josenavas Aug 28, 2017
2026d0c
Reverting changes
josenavas Aug 28, 2017
f098fcf
dist: precise
antgonza Aug 28, 2017
97a8397
Merge branch 'printable-to-utf8' of https://github.com/antgonza/qiita…
antgonza Aug 28, 2017
e195e07
addressing @josenavas comments
antgonza Aug 29, 2017
ef4f566
Merge pull request #2255 from antgonza/printable-to-utf8
josenavas Aug 29, 2017
7d5da5c
fix-2212
josenavas Aug 29, 2017
21f0287
Adding branch description to Contributing (#2256)
josenavas Aug 29, 2017
2e102b4
Merge branch 'dev' of https://github.com/biocore/qiita into dev
josenavas Aug 31, 2017
de5c89f
upgrading software
antgonza Aug 31, 2017
6248208
mv r_client to qiita
antgonza Aug 31, 2017
eb19870
from redis import Redis
antgonza Aug 31, 2017
120e9ac
Merge pull request #2261 from antgonza/upgrading-software
josenavas Aug 31, 2017
58e2dab
Merge branch 'remove-moi' of https://github.com/biocore/qiita into r_…
antgonza Aug 31, 2017
8b4ce80
Merge pull request #2262 from antgonza/r_client-to-qiita
josenavas Aug 31, 2017
fa7cf3d
rm moi and ipython
antgonza Aug 31, 2017
a47c13b
Move qiita_db/private.py -> qiita_ware/private_plugin.py
josenavas Aug 31, 2017
c8c1b59
_system_call as system_call
antgonza Aug 31, 2017
c46c05f
flake8
antgonza Aug 31, 2017
f7e9b1e
rm create_raw_data
antgonza Aug 31, 2017
c16b177
Transferring VAMPS submission to internal job
josenavas Aug 31, 2017
4de94cd
rm other unnecessary files
antgonza Aug 31, 2017
f50dc35
addressing @josenavas comment
antgonza Aug 31, 2017
d4f8d8c
Merge pull request #2263 from antgonza/rm-moi-ipython
josenavas Aug 31, 2017
925a3a5
Merge branch 'remove-moi' of https://github.com/biocore/qiita into rm…
antgonza Aug 31, 2017
58cd5ae
Merge branch 'remove-moi' of https://github.com/biocore/qiita into tr…
josenavas Aug 31, 2017
0be1275
Merge pull request #2264 from antgonza/rm-create_raw_data
josenavas Aug 31, 2017
263f956
Solving merge conflicts
josenavas Aug 31, 2017
efa1924
Merge branch 'transfer-submit-to-vamps' into transfer-copy-raw-data
josenavas Aug 31, 2017
4f43236
Fixing merge conflicts
josenavas Aug 31, 2017
a528e04
Adding tests to private plugin
josenavas Aug 31, 2017
242df8e
rm wrapper.py
antgonza Aug 31, 2017
0bf7307
Removing import
josenavas Aug 31, 2017
6ee9022
Fixing import
josenavas Aug 31, 2017
c13e8bd
Merge branch 'transfer-submit-to-vamps' into transfer-copy-raw-data
josenavas Aug 31, 2017
c3bc77c
Modifying GUI to use the plugin
josenavas Aug 31, 2017
fbf5402
moving qiita pet in .travis.yml
antgonza Aug 31, 2017
71c0b41
Transfer submit to vamps (#2265)
josenavas Aug 31, 2017
b6f43c0
Merge branch 'remove-moi' of https://github.com/biocore/qiita into rm…
antgonza Aug 31, 2017
8051cbb
some other .travis.yml fixes
antgonza Aug 31, 2017
10d8cfd
Fixing import
josenavas Aug 31, 2017
df5f5c8
addressing @josenavas comment
antgonza Aug 31, 2017
5230bae
Merge pull request #2266 from antgonza/rm-wrapper.py
josenavas Aug 31, 2017
044e562
Merge branch 'remove-moi' of https://github.com/biocore/qiita into tr…
josenavas Aug 31, 2017
f2a12c6
Adding success test
josenavas Aug 31, 2017
a9e302a
adding some methods
antgonza Aug 31, 2017
dde3296
flake8
antgonza Aug 31, 2017
779a5d1
Transfer copy raw data (#2267)
josenavas Aug 31, 2017
2113fa4
fix conflicts
antgonza Aug 31, 2017
e03997a
change imports
antgonza Sep 1, 2017
48abc1e
adding delete_artifact and create_sample_template
antgonza Sep 1, 2017
2d8dffa
fixing errors and gui
antgonza Sep 1, 2017
df64ef5
fix delete error
antgonza Sep 2, 2017
dc7f78c
Merge pull request #2268 from antgonza/mv-some-methods
josenavas Sep 5, 2017
9a8d271
Merge pull request #2257 from josenavas/fix-2212
adswafford Sep 6, 2017
6673792
ENH: Make jobs list modal
ElDeveloper Sep 6, 2017
c227463
erge branch 'master' of https://github.com/biocore/qiita
antgonza Sep 7, 2017
22d52f0
Transfer update delete templates (#2274)
josenavas Sep 8, 2017
fb60c20
Merge branch 'remove-moi' of git://github.com/biocore/qiita into jobs…
ElDeveloper Sep 8, 2017
0440cb7
BUG: Fix job updates
ElDeveloper Sep 8, 2017
8178bab
Merge branch 'dev' of https://github.com/biocore/qiita
antgonza Sep 9, 2017
fb65ff1
Fixing the redis DB (#2277)
josenavas Sep 9, 2017
61e66a8
Merge branch 'remove-moi' of https://github.com/biocore/qiita into re…
antgonza Sep 10, 2017
caaf730
redbiom install
antgonza Sep 10, 2017
7b906b9
redbiom to install_requires
antgonza Sep 10, 2017
ecfbaf7
Merge branch 'remove-moi' of https://github.com/biocore/qiita into mo…
antgonza Sep 10, 2017
0a9182f
mv moi-ws to qiita_websocket
antgonza Sep 11, 2017
4ed9285
Merge pull request #2279 from antgonza/moi.send
josenavas Sep 11, 2017
45e0175
Merge pull request #2260 from biocore/remove-moi
josenavas Sep 11, 2017
6525487
Merge branch 'dev' of https://github.com/biocore/qiita into redbiom-i…
antgonza Sep 11, 2017
5e99089
init commit
antgonza Sep 11, 2017
84d1ebd
addressing @wasade comment
antgonza Sep 11, 2017
21549c1
rm webdis.log
antgonza Sep 11, 2017
8ab4066
cleaning code for initial review
antgonza Sep 13, 2017
d3590f6
install latest redbiom
antgonza Sep 13, 2017
ab397c1
fix test
antgonza Sep 13, 2017
42dd9a9
Merge pull request #2278 from antgonza/redbiom-install
josenavas Sep 13, 2017
eef49b1
Merge branch 'dev' of https://github.com/biocore/qiita into initial-r…
antgonza Sep 13, 2017
c808c63
ENH: Change phrasing of upload text (#2281)
ElDeveloper Sep 13, 2017
e482bce
addressing @wasade comments and adding other tests
antgonza Sep 13, 2017
25ee54f
flake8
antgonza Sep 13, 2017
079f4eb
addressing @josenavas comments
antgonza Sep 14, 2017
9e1c1b5
Merge pull request #2282 from antgonza/initial-redbiom-code
josenavas Sep 14, 2017
e4e8ffd
fix #2258
antgonza Sep 14, 2017
49015c2
fix #2258
antgonza Sep 14, 2017
955d5cd
fix #858 (#2286)
antgonza Sep 15, 2017
d8c4a72
addressing @ElDeveloper and @josenavas comments
antgonza Sep 15, 2017
b482b4e
@ElDeveloper :|
antgonza Sep 15, 2017
a9aa1c4
Merge pull request #2287 from antgonza/fix-2258
josenavas Sep 15, 2017
d4cc989
redbiom now adds per sample studies to analysis
antgonza Sep 15, 2017
525102e
Merge branch 'jobs-list-as-modal' of https://github.com/ElDeveloper/q…
antgonza Sep 15, 2017
7906727
jobs-list-as-modal
antgonza Sep 15, 2017
de75346
addresssing @josenavas comments
antgonza Sep 15, 2017
b8e3da4
rm () from update_processing_job_data
antgonza Sep 15, 2017
46b174e
add prints to review errors
antgonza Sep 16, 2017
38e5cd7
rm prints
antgonza Sep 16, 2017
91f0051
Merge pull request #2289 from antgonza/jobs-list-as-modal
josenavas Sep 18, 2017
ae3dc0c
Merge pull request #2288 from antgonza/redbiom-per-sample
josenavas Sep 18, 2017
c9045ff
Fix 2190 (#2292)
josenavas Sep 18, 2017
15b849f
add is_from_analysis to artifact_handlers (#2293)
antgonza Sep 18, 2017
81bd7b3
WIP: rm sudo from travis
antgonza Sep 18, 2017
191199c
adding sed for config file
antgonza Sep 18, 2017
53579aa
fix sed
antgonza Sep 18, 2017
d12ed87
rm &
antgonza Sep 18, 2017
ea5d647
cat redis.conf
antgonza Sep 18, 2017
4c40d83
using local redis.conf
antgonza Sep 18, 2017
fad8935
# protected-mode yes
antgonza Sep 18, 2017
91bdbbc
# supervised no
antgonza Sep 18, 2017
e0d83bc
redis-server --port 7777 &
antgonza Sep 18, 2017
1b7e38c
Fix 1293 (#2291)
antgonza Sep 18, 2017
6adf8b1
rm redis.conf
antgonza Sep 18, 2017
20226ed
fix awaiting_approval list bug
antgonza Sep 19, 2017
d5ecf8a
Merge pull request #2295 from antgonza/rm-sudo
josenavas Sep 19, 2017
33054b2
Merge pull request #2296 from antgonza/awaiting_approval-list
josenavas Sep 19, 2017
064d35a
Fix #2276 (#2294)
josenavas Sep 19, 2017
5081f21
update dev 0917
antgonza Sep 27, 2017
07e4b7e
Fixing patch
josenavas Sep 27, 2017
05acf90
Merge branch 'master' of https://github.com/biocore/qiita into update…
antgonza Sep 27, 2017
6c855a6
fix error
antgonza Oct 2, 2017
0331592
Merge branch 'update-dev-0917' of https://github.com/antgonza/qiita i…
josenavas Oct 4, 2017
e4d2804
Fixing failing test
josenavas Oct 5, 2017
7d50388
Merge pull request #1 from josenavas/update-dev-0917
antgonza Oct 5, 2017
10286b5
Merge pull request #2314 from antgonza/update-dev-0917
josenavas Oct 5, 2017
0d16b99
fix #2214
antgonza Oct 9, 2017
34cc455
addressing @josenavas comment
antgonza Oct 10, 2017
4fe3f5e
fix #2209
antgonza Oct 10, 2017
79aa8f9
Merge pull request #2327 from antgonza/fix-2214
wasade Oct 10, 2017
041eac8
fix #2331
antgonza Oct 11, 2017
0e79434
Merge pull request #2329 from antgonza/fix-2209
josenavas Oct 11, 2017
d301b95
Merge pull request #2339 from antgonza/fix-2331
wasade Oct 11, 2017
8c7ed99
fix #2326 (#2328)
antgonza Oct 11, 2017
097e1bc
fix #2226 (#2330)
antgonza Oct 11, 2017
26d16ad
fix #2336
antgonza Oct 13, 2017
be5f7e2
fix #2316
antgonza Oct 13, 2017
2a224ca
Fixes 2269
josenavas Oct 13, 2017
65ee914
addressing @josenavas comments
antgonza Oct 13, 2017
2435f28
Merge pull request #2352 from josenavas/fix-2269
wasade Oct 16, 2017
9419b79
Fixes 2038 (#2349)
josenavas Oct 17, 2017
5f5b61f
Merge pull request #2348 from antgonza/fix-2336
josenavas Oct 17, 2017
c37188f
fix #2333
antgonza Oct 17, 2017
2b000fc
Merge pull request #2351 from antgonza/fix-2316
wasade Oct 19, 2017
19f2b07
addressing @josenavas
antgonza Oct 19, 2017
e35e838
Merge pull request #2356 from antgonza/fix-2333
josenavas Oct 19, 2017
0f44404
fixes #2245 (#2350)
josenavas Oct 19, 2017
3f4310e
Fixing Qiita installation (#2362)
josenavas Oct 19, 2017
5c49ab0
Sync-ing with master (#2367)
josenavas Oct 20, 2017
0d329b6
fix #2084 (#2365)
antgonza Oct 20, 2017
7beb06a
fix #2125 (#2366)
antgonza Oct 20, 2017
e4bb1b3
fix #2364
antgonza Oct 20, 2017
91b9e08
fix #1812
antgonza Oct 21, 2017
35b0168
add tests
antgonza Oct 21, 2017
352e9bb
flake8
antgonza Oct 21, 2017
0da47b2
populating ProcessingJob.create True
antgonza Oct 22, 2017
0dc98c6
fix more errors
antgonza Oct 22, 2017
c15303f
addressing comments from @josenavas and @stephanieorch
antgonza Oct 22, 2017
180b6d7
mv ProcessingJob.create True around
antgonza Oct 22, 2017
4d383db
Partial #2237 (#2368)
josenavas Oct 23, 2017
4105e9a
Merge pull request #2369 from antgonza/fix-2364
josenavas Oct 23, 2017
9fe81b0
fix-1591 (#2370)
antgonza Oct 23, 2017
03db962
Merge branch 'dev' of https://github.com/biocore/qiita into fix-1812
antgonza Oct 23, 2017
1fb126d
addressing @ElDeveloper and @josenavas comments
antgonza Oct 23, 2017
69b5645
Fix 2230 (#2372)
danteese Oct 23, 2017
7303611
addressing @wasade and @ElDeveloper comments
antgonza Oct 23, 2017
123ef94
fixing errors
antgonza Oct 23, 2017
c5db978
fix GUI and erros
antgonza Oct 23, 2017
aa27112
addressing @ElDeveloper comments
antgonza Oct 24, 2017
66e3b09
Merge pull request #2371 from antgonza/fix-1812
wasade Oct 24, 2017
7df64f3
rm artifacts from parameters listing
antgonza Oct 24, 2017
18bd7b6
fix flake8
antgonza Oct 24, 2017
fbde992
Merge pull request #2374 from antgonza/fix-study-list
josenavas Oct 24, 2017
b826546
fix ilike quote params
antgonza Oct 25, 2017
f0cf016
addressing @josenavas comment and adding test for job without children
antgonza Oct 25, 2017
bb82a65
fix errors
antgonza Oct 25, 2017
bee4a9b
addressing @josenavas comment
antgonza Oct 25, 2017
242741d
Merge pull request #2375 from antgonza/fix-ilike-parameters
josenavas Oct 25, 2017
0107f97
Fixing network labels (#2376)
josenavas Oct 26, 2017
5de1b5e
Update redbiom.html
adswafford Oct 27, 2017
c9bf203
Update redbiom.html
adswafford Oct 30, 2017
d1e198e
Update redbiom.html
adswafford Oct 30, 2017
735bc39
Patch 61 - transfer all parameters to str (#2379)
josenavas Oct 30, 2017
c678ff4
rm lower from redbiom
antgonza Oct 30, 2017
7a0c441
Merge pull request #2381 from antgonza/redbiom-lower
wasade Oct 31, 2017
4b3f057
Merge branch 'redbiom-help-update' of https://github.com/biocore/qiit…
antgonza Oct 31, 2017
6630cc9
fixing smal details and adding emp_release1
antgonza Oct 31, 2017
ca7810e
fixing
antgonza Oct 31, 2017
2d561f2
Merge pull request #2382 from antgonza/redbiom-help-update
josenavas Oct 31, 2017
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ install:
# install a few of the dependencies that pip would otherwise try to install
# when intalling scikit-bio
- travis_retry conda create --yes -n qiita python=$PYTHON_VERSION pip nose flake8
pyzmq networkx pyparsing natsort mock future libgfortran seaborn nltk
pyzmq 'networkx<2.0' pyparsing natsort mock future libgfortran seaborn nltk
'pandas>=0.18' 'matplotlib>=1.1.0' 'scipy>0.13.0' 'numpy>=1.7' 'h5py>=2.3.1'
- source activate qiita
- pip install -U pip
Expand Down
16 changes: 9 additions & 7 deletions qiita_db/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def create(cls, owner, name, description, from_default=False,
'analysis': a_id,
'merge_dup_sample_ids': merge_duplicated_sample_ids})
job = qdb.processing_job.ProcessingJob.create(
owner, params)
owner, params, True)
sql = """INSERT INTO qiita.analysis_processing_job
(analysis_id, processing_job_id)
VALUES (%s, %s)"""
Expand Down Expand Up @@ -429,15 +429,17 @@ def mapping_file(self):

Returns
-------
str or None
full filepath to the mapping file or None if not generated
int or None
The filepath id of the analysis mapping file or None
if not generated
"""
fp = [fp for _, fp, fp_type in qdb.util.retrieve_filepaths(
"analysis_filepath", "analysis_id", self._id)
if fp_type == 'plain_text']
fp = [fp_id
for fp_id, _, fp_type in qdb.util.retrieve_filepaths(
"analysis_filepath", "analysis_id", self._id)
if fp_type == 'plain_text']

if fp:
# returning the actual path vs. an array
# returning the actual filepath id vs. an array
return fp[0]
else:
return None
Expand Down
3 changes: 2 additions & 1 deletion qiita_db/handlers/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def get(self, analysis_id):
"""
with qdb.sql_connection.TRN:
a = _get_analysis(analysis_id)
mf_fp = a.mapping_file
mf_fp = qdb.util.get_filepath_information(
a.mapping_file)['fullpath']
response = None
if mf_fp is not None:
df = qdb.metadata_template.util.load_template_to_dataframe(
Expand Down
2 changes: 1 addition & 1 deletion qiita_db/handlers/processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def post(self):
params = qdb.software.Parameters.load(cmd, json_str=params_dict)

job = qdb.processing_job.ProcessingJob.create(
qdb.user.User(user), params)
qdb.user.User(user), params, True)

if status:
job._set_status(status)
Expand Down
4 changes: 2 additions & 2 deletions qiita_db/handlers/tests/test_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def test_get_artifact(self):
'prep_information': [],
'study': None,
'analysis': 1,
'processing_parameters': {'biom_table': 8, 'depth': 9000,
'subsample_multinomial': False},
'processing_parameters': {'biom_table': '8', 'depth': '9000',
'subsample_multinomial': 'False'},
'files': exp_fps}
obs = loads(obs.body)
# The timestamp is genreated at patch time, so we can't check for it
Expand Down
4 changes: 1 addition & 3 deletions qiita_db/metadata_template/test/test_prep_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,7 @@ def test_create(self):
def test_create_already_prefixed_samples(self):
"""Creates a new PrepTemplate"""
fp_count = qdb.util.get_count('qiita.filepath')
pt = npt.assert_warns(
qdb.exceptions.QiitaDBWarning,
qdb.metadata_template.prep_template.PrepTemplate.create,
pt = qdb.metadata_template.prep_template.PrepTemplate.create(
self.metadata_prefixed, self.test_study, self.data_type)
self._common_creation_checks(pt, fp_count)

Expand Down
4 changes: 1 addition & 3 deletions qiita_db/metadata_template/test/test_sample_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,9 +1084,7 @@ def test_create_str_prefixes(self):

def test_create_already_prefixed_samples(self):
"""Creates a new SampleTemplate with the samples already prefixed"""
st = npt.assert_warns(
qdb.exceptions.QiitaDBWarning,
qdb.metadata_template.sample_template.SampleTemplate.create,
st = qdb.metadata_template.sample_template.SampleTemplate.create(
self.metadata_prefixed, self.new_study)
new_id = self.new_study.id
# The returned object has the correct id
Expand Down
24 changes: 22 additions & 2 deletions qiita_db/metadata_template/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from six import StringIO
from unittest import TestCase, main
import warnings

import numpy.testing as npt
import pandas as pd
Expand Down Expand Up @@ -36,12 +37,31 @@ def test_prefix_sample_names_with_id(self):
}
exp_df = pd.DataFrame.from_dict(exp_metadata_dict, orient='index',
dtype=str)
qdb.metadata_template.util.prefix_sample_names_with_id(
self.metadata_map, 1)
with warnings.catch_warnings(record=True) as warn:
qdb.metadata_template.util.prefix_sample_names_with_id(
self.metadata_map, 1)
self.assertEqual(len(warn), 0)
self.metadata_map.sort_index(inplace=True)
exp_df.sort_index(inplace=True)
assert_frame_equal(self.metadata_map, exp_df)

# test that it only prefixes the samples that are needed
metadata_dict = {
'Sample1': {'int_col': 1, 'float_col': 2.1, 'str_col': 'str1'},
'1.Sample2': {'int_col': 2, 'float_col': 3.1, 'str_col': '200'},
'Sample3': {'int_col': 3, 'float_col': 3, 'str_col': 'string30'},
}
metadata_map = pd.DataFrame.from_dict(
metadata_dict, orient='index', dtype=str)
with warnings.catch_warnings(record=True) as warn:
qdb.metadata_template.util.prefix_sample_names_with_id(
metadata_map, 1)
self.assertEqual(len(warn), 1)
self.assertEqual(str(warn[0].message), 'Some of the samples were '
'already prefixed with the study id.')
metadata_map.sort_index(inplace=True)
assert_frame_equal(metadata_map, exp_df)

def test_load_template_to_dataframe(self):
obs = qdb.metadata_template.util.load_template_to_dataframe(
StringIO(EXP_SAMPLE_TEMPLATE))
Expand Down
42 changes: 19 additions & 23 deletions qiita_db/metadata_template/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,25 @@ def prefix_sample_names_with_id(md_template, study_id):
study_id : int
The study to which the metadata belongs to
"""
# Get all the prefixes of the index, defined as any string before a '.'
prefixes = {idx.split('.', 1)[0] for idx in md_template.index}
# If the samples have been already prefixed with the study id, the prefixes
# set will contain only one element and it will be the str representation
# of the study id
if len(prefixes) == 1 and prefixes.pop() == str(study_id):
# The samples were already prefixed with the study id
warnings.warn("Sample names were already prefixed with the study id.",
qdb.exceptions.QiitaDBWarning)
else:
# Create a new pandas series in which all the values are the study_id
# and it is indexed as the metadata template
study_ids = pd.Series([str(study_id)] * len(md_template.index),
index=md_template.index)
# Create a new column on the metadata template that includes the
# metadata template indexes prefixed with the study id
md_template['sample_name_with_id'] = (study_ids + '.' +
md_template.index.values)
md_template.index = md_template.sample_name_with_id
del md_template['sample_name_with_id']
# The original metadata template had the index column unnamed - remove
# the name of the index for consistency
md_template.index.name = None
# loop over the samples and prefix those that aren't prefixed
md_template['qiita_sample_name_with_id'] = pd.Series(
[idx if idx.split('.', 1)[0] == str(study_id)
else '%d.%s' % (study_id, idx)
for idx in md_template.index], index=md_template.index)

# get the rows that are gonna change
changes = len(md_template.index[
md_template['qiita_sample_name_with_id'] != md_template.index])
if changes != 0 and changes != len(md_template.index):
warnings.warn(
"Some of the samples were already prefixed with the study id.",
qdb.exceptions.QiitaDBWarning)

md_template.index = md_template.qiita_sample_name_with_id
del md_template['qiita_sample_name_with_id']
# The original metadata template had the index column unnamed -> remove
# the name of the index for consistency
md_template.index.name = None


def load_template_to_dataframe(fn, index='sample_name'):
Expand Down
Loading