Skip to content

Commit 413ea8c

Browse files
committed
Merge branch 'dev' of github.com:biocore/qiita into 2021.07
2 parents 2b375f0 + d076755 commit 413ea8c

File tree

4 files changed

+91
-2
lines changed

4 files changed

+91
-2
lines changed

qiita_db/support_files/patches/82.sql

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,45 @@ BEGIN
1111
ALTER TABLE settings ADD COLUMN max_preparation_samples INT DEFAULT 800;
1212
END IF;
1313
END $do$;
14+
15+
ALTER TABLE qiita.analysis
16+
DROP CONSTRAINT fk_analysis_user,
17+
ADD CONSTRAINT fk_analysis_user
18+
FOREIGN KEY (email)
19+
REFERENCES qiita.qiita_user(email)
20+
ON UPDATE CASCADE;
21+
22+
ALTER TABLE qiita.study_users
23+
DROP CONSTRAINT fk_study_users_user,
24+
ADD CONSTRAINT fk_study_users_user
25+
FOREIGN KEY (email)
26+
REFERENCES qiita.qiita_user(email)
27+
ON UPDATE CASCADE;
28+
29+
ALTER TABLE qiita.message_user
30+
DROP CONSTRAINT fk_message_user_0,
31+
ADD CONSTRAINT fk_message_user_0
32+
FOREIGN KEY (email)
33+
REFERENCES qiita.qiita_user(email)
34+
ON UPDATE CASCADE;
35+
36+
ALTER TABLE qiita.processing_job
37+
DROP CONSTRAINT fk_processing_job_qiita_user,
38+
ADD CONSTRAINT fk_processing_job_qiita_user
39+
FOREIGN KEY (email)
40+
REFERENCES qiita.qiita_user(email)
41+
ON UPDATE CASCADE;
42+
43+
ALTER TABLE qiita.processing_job_workflow
44+
DROP CONSTRAINT fk_processing_job_workflow,
45+
ADD CONSTRAINT fk_processing_job_workflow
46+
FOREIGN KEY (email)
47+
REFERENCES qiita.qiita_user(email)
48+
ON UPDATE CASCADE;
49+
50+
ALTER TABLE qiita.study
51+
DROP CONSTRAINT fk_study_user,
52+
ADD CONSTRAINT fk_study_user
53+
FOREIGN KEY (email)
54+
REFERENCES qiita.qiita_user(email)
55+
ON UPDATE CASCADE;

qiita_db/test/test_user.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,17 @@ def test_jobs(self):
498498
# no jobs
499499
self.assertEqual(qdb.user.User('[email protected]').jobs(), [])
500500

501+
def test_update_email(self):
502+
user = qdb.user.User('[email protected]')
503+
with self.assertRaisesRegex(IncorrectEmailError, 'Bad email given:'):
504+
user.update_email('bladfa.adferqerq@$EWE')
505+
506+
with self.assertRaisesRegex(IncorrectEmailError,
507+
'This email already exists'):
508+
user.update_email('[email protected]')
509+
510+
user.update_email('[email protected]')
511+
501512

502513
if __name__ == "__main__":
503514
main()

qiita_db/user.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,17 @@ def jobs(self, limit=30, ignore_status=['success'], show_hidden=False):
708708
return [qdb.processing_job.ProcessingJob(p[0])
709709
for p in qdb.sql_connection.TRN.execute_fetchindex()]
710710

711+
def update_email(self, email):
712+
if not validate_email(email):
713+
raise IncorrectEmailError(f'Bad email given: {email}')
714+
715+
if self.exists(email):
716+
raise IncorrectEmailError(f'This email already exists: {email}')
717+
718+
with qdb.sql_connection.TRN:
719+
sql = 'UPDATE qiita.qiita_user SET email = %s where email = %s'
720+
qdb.sql_connection.TRN.add(sql, [email, self.email])
721+
711722

712723
def validate_email(email):
713724
"""Validates an email

qiita_pet/support_files/doc/source/faq.rst

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,33 @@ for close reference picking), and summaries.
231231
How to convert Qiita files to QIIME2 artifacts?
232232
-----------------------------------------------
233233

234-
Please visit the `Transferring Qiita Artifacts to Qiime2 Tutorial <https://forum.qiime2.org/t/transferring-qiita-artifacts-to-qiime2/4790>`__
235-
in the `QIIME2 forum <https://forum.qiime2.org>`__. Note that all feature table (bioms) and analytical steps will generate qza and qzv, which are QIIME2 artifacts.
234+
As a reminder, Qiita and QIIME 2 artifacts are similar as they encapsulate multiple files. However, a big
235+
difference is that QIIME 2 only has 2 main artifact types: QZA (all kinds of files) and QZV (visualization).
236+
237+
Here is quick reference conversion table, but please visit the `Transferring Qiita Artifacts to Qiime2 Tutorial <https://forum.qiime2.org/t/transferring-qiita-artifacts-to-qiime2/4790>`__
238+
in the `QIIME2 forum <https://forum.qiime2.org>`__. for more details:
239+
240+
+----------------------------+----------------------------------------------------------------------+
241+
| Qiita | QIIME 2 |
242+
+============================+======================================================================+
243+
| beta diversity .tsv | DistanceMatrix (QZA) |
244+
+----------------------------+----------------------------------------------------------------------+
245+
| FASTA sequence files | FeatureData[Taxonomy | Sequence] (QZA) |
246+
+----------------------------+----------------------------------------------------------------------+
247+
| .biom tables | FeatureTable[Frequency | RelativeFrequency | PresenceAbsence] (QZA) |
248+
+----------------------------+----------------------------------------------------------------------+
249+
| ordination .txt | PCoAResults (QZA) |
250+
+----------------------------+----------------------------------------------------------------------+
251+
| phylogentic tree .txt | Phylogeny[Rooted] (QZA) |
252+
+----------------------------+----------------------------------------------------------------------+
253+
| alpha diversity .tsv | SampleData[AlphaDiversity] (QZA) |
254+
+----------------------------+----------------------------------------------------------------------+
255+
| taxonomic classifier | Taxonomic Classifier (QZA) |
256+
+----------------------------+----------------------------------------------------------------------+
257+
| all QIIME 2 visualizations | Visualization (QZV) |
258+
+----------------------------+----------------------------------------------------------------------+
259+
260+
Note that all feature table (bioms) and analytical steps will generate QZA and QZV, which are native QIIME2 artifacts.
236261

237262

238263
How to add extra files to a Qiita study?

0 commit comments

Comments
 (0)