Skip to content

Commit be551d9

Browse files
committed
Merge pull request #1221 from josenavas/1084-changelog
1084 changelog
2 parents 3ac6ab9 + cb55133 commit be551d9

File tree

4 files changed

+50
-6
lines changed

4 files changed

+50
-6
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
Qiita 0.1.0-dev (changes since Qiita 0.1.0 go here)
55
---------------------------------------------------
66

7+
* Creating an empty RawData is no longer needed in order to add a PrepTemplate.
8+
Now, the PrepTemplate is required in order to add a RawData to a study. This is
9+
the normal flow of a study, as the PrepTemplate information is usually
10+
available before the RawData information is available.
11+
* A user can upload a QIIME mapping file instead of a SampleTemplate. The
12+
system will create a SampleTemplate and a PrepTemplate from the information
13+
present in the QIIME mapping file. The QIIME required columns for this
14+
functionality to work are 'BarcodeSequence', 'LinkerPrimerSequence' and
15+
'Description'. For more information about QIIME mapping files, visit
16+
http://qiime.org/documentation/file_formats.html#mapping-file-overview.
17+
718
Version 0.1.0 (2015-04-30)
819
--------------------------
920

qiita_pet/handlers/study_handlers/edit_handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ def post(self, study=None):
198198
if study:
199199
# Check study and user access
200200
the_study = self._check_study_exists_and_user_access(study)
201-
# If the study is public, we use the short version of the form
202-
if the_study.status == 'public':
201+
# If the study is not sandbox, we use the short version
202+
if the_study.status != 'sandbox':
203203
form_factory = StudyEditorForm
204204

205205
# Get the form data from the request arguments

qiita_ware/demux.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def to_ascii(demux, samples=None):
438438
for samp, idx, seq, qual, bc_ori, bc_cor, bc_err in fetch(demux, samples):
439439
seq_id = id_fmt % {'sample': samp, 'idx': idx, 'bc_ori': bc_ori,
440440
'bc_cor': bc_cor, 'bc_diff': bc_err}
441-
if qual is not None:
441+
if qual != []:
442442
qual = qual.astype(np.uint8)
443443

444444
yield formatter(seq_id, seq, qual)
@@ -516,7 +516,7 @@ def fetch(demux, samples=None, k=None):
516516
seqs = demux[pjoin(dset_paths['sequence'])][indices]
517517

518518
# only yield qual if we have it
519-
quals = repeat(None)
519+
quals = repeat([])
520520
if demux.attrs['has-qual']:
521521
if len(indices) == 1:
522522
if indices[0]:
@@ -531,8 +531,8 @@ def fetch(demux, samples=None, k=None):
531531
iter_ = zip(repeat(sample), np.arange(indices.size)[indices], seqs,
532532
quals, bc_original, bc_corrected, bc_error)
533533

534-
for item in iter_:
535-
yield item
534+
for samp, idx, seq, qual, bc_ori, bc_cor, bc_err in iter_:
535+
yield (samp, idx, seq, qual[:len(seq)], bc_ori, bc_cor, bc_err)
536536

537537

538538
def stats(demux):

qiita_ware/test/test_demux.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,25 @@ def test_fetch(self):
331331
# implicitly tested with test_to_ascii
332332
pass
333333

334+
def test_fetch_qual_length_bug(self):
335+
# fetch was not trimming qual to the length of the sequence resulting
336+
# in qual scores for positions beyond the length of the sequence.
337+
with tempfile.NamedTemporaryFile('r+', suffix='.fq',
338+
delete=False) as f:
339+
f.write(fqdata_variable_length)
340+
341+
self.to_remove.append(f.name)
342+
to_hdf5(f.name, self.hdf5_file)
343+
344+
exp = [('a', [(b"@a_0 orig_bc=abc new_bc=abc bc_diffs=0\nxyz\n+\n"
345+
"ABC\n")]),
346+
('b', [(b"@b_0 orig_bc=abw new_bc=wbc bc_diffs=4\nqwe\n+\n"
347+
"DFG\n"),
348+
(b"@b_1 orig_bc=abw new_bc=wbc bc_diffs=4\nqwexx\n+\n"
349+
"DEF#G\n")])]
350+
351+
obs = [(s[0], list(s[1])) for s in to_per_sample_ascii(self.hdf5_file)]
352+
self.assertEqual(obs, exp)
334353

335354
seqdata = """>a_1 orig_bc=abc new_bc=abc bc_diffs=0
336355
x
@@ -370,5 +389,19 @@ def test_fetch(self):
370389
DEF
371390
"""
372391

392+
fqdata_variable_length = """@a_1 orig_bc=abc new_bc=abc bc_diffs=0
393+
xyz
394+
+
395+
ABC
396+
@b_1 orig_bc=abw new_bc=wbc bc_diffs=4
397+
qwe
398+
+
399+
DFG
400+
@b_2 orig_bc=abw new_bc=wbc bc_diffs=4
401+
qwexx
402+
+
403+
DEF#G
404+
"""
405+
373406
if __name__ == '__main__':
374407
main()

0 commit comments

Comments
 (0)