Skip to content
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: false
env:
global:
- PYTHON_VERSION=3.5
- secure: "bR44P87PdbaXtdh4SMw7wF6pVCvPF1UkJequCABT1fQknljI2seBLda6otdXFJiWynmvKnubJQh2iz22wJ/maLwhoNorZ7OLFof0pRtA916uoBzcWCeocf1QhPxqR2kJOIV4oaRSdd9xvy9oKS3lrODxyuQ2CTnWMYD9oe9n8qk="
- secure: "OFyFddp26BbuaYxD2suftmbSfyaLcvleOL9heGh4IqqbvDVX+EcaqvmUALRaBL4HQlK5W0rO9H4pFsXuq26Xl3S2EKr+Pne4SDlw9ekmU3n6bWVNwReG7V+9c7OEgfNHbZ4pNwRzti62n1ESlRSZVkLVGg+pI0Ikvbh1+yUm9Eg="
matrix:
- TEST_ADD_STUDIES=False COVER_PACKAGE=qiita_db
- TEST_ADD_STUDIES=False COVER_PACKAGE=qiita_pet
Expand Down
18 changes: 11 additions & 7 deletions qiita_pet/support_files/doc/source/analyzingsamples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,19 @@ Rarefying Features
.. figure:: rarefy.png
:align: center

* **Rarefy features** :ref:`[11]<reference11>` , :ref:`[12]<reference12>` : Subsample frequencies from all samples without replacement so that the sum of frequencies in each sample is equal to the sampling-depth
* **Rarefy features**: Subsample frequencies from all samples without replacement so that the sum of frequencies in each sample is equal to the sampling-depth.

* **BIOM table** (required): Feature table containing the samples for which features should be rarefied
* **Parameter set**: Parameters at which the rarefication is run
* **Sampling depth** (required): Total frequency that each sample should be rarefied to, samples where sum of frequencies is less than sampling depth will not be included in resulting table

Note that rarefaction has some advantages for beta-diversity analyses
:ref:`[11]<reference11>`, but can have undesirable properties in tests of
differential abundance :ref:`[12]<reference12>`. To analyze your data with
alternative normalization strategies, you can easily download the raw biom
tables (see :doc:`../tutorials/downloading`) and load them into an analysis
pipeline such as `Phyloseq <https://bioconductor.org/packages/release/bioc/html/phyloseq.html>`__.

Filtering Samples by Metadata
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -369,9 +376,6 @@ Calculating Beta Group Significance
.. figure:: beta_group_significance.png
:align: center

Calculating Beta Group Significance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* **Calculate beta group significance**: Determines whether groups of samples are significantly different from one another using a permutation-based statistical test

* **Distance matrix** (required): Matrix of distances between pairs of samples
Expand All @@ -384,12 +388,12 @@ Calculating Beta Group Significance

* **Number of permutations** (required): Number of permutations to be run when computing p-values

.. figure:: beta_correlation.png
:align: center

Calculating Beta Correlation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. figure:: beta_correlation.png
:align: center

* **Calculate beta correlation**: Identifies a correlation between the distance matrix and a numeric sample metadata category

* **Distance-matrix** (required): Matrix of distances between pairs of samples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ EBI-ENA NULL values vocabulary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For all public studies including those being submitted to EBI, no blanks are allowed in the sample information.
We support the following null values: *not applicable*, *missing: not collected*, *missing: not provided*,
*missing: restricted access*.
We support the following null values: *not applicable*, *not collected*, *not provided*,
*restricted access*.

For the latest definitions and explanation visit the `EBI/ENA Missing value reporting <http://www.ebi.ac.uk/ena/about/missing-values-reporting>`__.

Expand Down
3 changes: 2 additions & 1 deletion qiita_pet/templates/artifact_ajax/artifact_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ <h4>
{% if files %}
<div class='row'>
<div class='col-md-12'>
<b>Available files:</b>
<button class="btn btn-default" data-toggle="collapse" data-target="#available-files-div">
<span class="glyphicon glyphicon-eye-open"></span>
Available files:
Show/Hide
</button>
<div id="available-files-div" class="collapse {% if len(files) <= 10 %} in {% end %}" style="padding: 10px 10px 10px 10px; border-radius: 10px; background: #EEE;">
{% for f_id, f_name in files %}
Expand Down
26 changes: 18 additions & 8 deletions qiita_ware/test/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
from tempfile import mkdtemp
import pandas as pd
from datetime import datetime
from shutil import rmtree

from h5py import File
from qiita_files.demux import to_hdf5

from qiita_ware.exceptions import ComputeError, EBISubmissionError
from qiita_ware.exceptions import ComputeError
from qiita_ware.commands import submit_EBI
from qiita_db.util import get_mountpoint
from qiita_db.study import Study, StudyPerson
from qiita_db.software import DefaultParameters, Parameters
from qiita_db.artifact import Artifact
Expand All @@ -34,6 +36,7 @@ def setUp(self):
self.files_to_remove = []
self.temp_dir = mkdtemp()
self.files_to_remove.append(self.temp_dir)
_, self.base_fp = get_mountpoint("preprocessed_data")[0]

def write_demux_files(self, prep_template, generate_hdf5=True):
"""Writes a demux test file to avoid duplication of code"""
Expand Down Expand Up @@ -135,33 +138,40 @@ def generate_new_study_with_preprocessed_data(self):
return ppd

def test_submit_EBI_step_2_failure(self):
ppd = self.write_demux_files(PrepTemplate(1), False)
ppd = self.write_demux_files(PrepTemplate(1), True)
pid = ppd.id

with self.assertRaises(EBISubmissionError):
submit_EBI(ppd.id, 'VALIDATE', True)
with self.assertRaises(ComputeError):
submit_EBI(pid, 'VALIDATE', True)

rmtree(join(self.base_fp, '%d_ebi_submission' % pid), True)

@skipIf(
environ.get('ASPERA_SCP_PASS', '') == '', 'skip: ascp not configured')
def test_submit_EBI_parse_EBI_reply_failure(self):
ppd = self.write_demux_files(PrepTemplate(1))
pid = ppd.id

with self.assertRaises(ComputeError) as error:
submit_EBI(ppd.id, 'VALIDATE', True)
submit_EBI(pid, 'VALIDATE', True)
error = str(error.exception)
self.assertIn('EBI Submission failed! Log id:', error)
self.assertIn('The EBI submission failed:', error)
self.assertIn(
'Failed to validate run xml, error: Expected element', error)

rmtree(join(self.base_fp, '%d_ebi_submission' % pid), True)

@skipIf(
environ.get('ASPERA_SCP_PASS', '') == '', 'skip: ascp not configured')
def test_full_submission(self):
artifact = self.generate_new_study_with_preprocessed_data()
self.assertEqual(
artifact.study.ebi_submission_status, 'not submitted')
submit_EBI(artifact.id, 'VALIDATE', True, test=True)
aid = artifact.id
submit_EBI(aid, 'VALIDATE', True, test=True)
self.assertEqual(artifact.study.ebi_submission_status, 'submitted')

rmtree(join(self.base_fp, '%d_ebi_submission' % aid), True)


FASTA_EXAMPLE = """>1.SKB2.640194_1 X orig_bc=X new_bc=X bc_diffs=0
CCACCCAGTAAC
Expand Down