Skip to content

Conversation

@josenavas
Copy link
Contributor

Built on top of #1206

This PR refactors the interface so now the user has to upload first the prep template before he can add the raw data. This is how the database works and this is the normal workflow when using Qiita.

This is still a work in progress PR. I had to completely rewrite some parts of the interface code, and I've still not removed the old code, as it was useful for reference.

It would be great if people can pull down this branch and check which things are missing in the interface, and which things can be improved. I'll be able to work on it tonight and tomorrow morning, so the entire interface is consistent with the new DB layout. After that, I will be able to finally add the QIIME mapping file parsing, which shouldn't impact the interface and it's only a backend change!

@josenavas josenavas changed the title WIP: 1084 qiita pet [DO NOT MERGE] - but review 1084 qiita pet May 25, 2015
@josenavas
Copy link
Contributor Author

Tests should pass now in this PR. Ready for review once all the previous PR have been reviewed and merged.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.43%) to 78.59% when pulling f65e9da on josenavas:1084-qiita-pet into 3a0976b on biocore:fix-1084.

@josenavas
Copy link
Contributor Author

@biocore/qiita-dev In this PR I've changed the interface a lot. I would suggest first downloading the code and check the interface before actually doing the code review. The idea is that if the interface needs to change, we don't waste time reviewing code that is going to change.

@ElDeveloper
Copy link
Contributor

Thanks for the heads up, will do!

On (May-28-15|10:20), josenavas wrote:

@biocore/qiita-dev In this PR I've changed the interface a lot. I would suggest first downloading the code and check the interface before actually doing the code review. The idea is that if the interface needs to change, we don't waste time reviewing code that is going to change.


Reply to this email directly or view it on GitHub:
#1207 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

'assertItemsEqual' would be better here, since it would eliminate the sorting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Other checks in this tests depend on these 2 lists being in the same order. Leaving the sort.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@squirrelo
Copy link
Contributor

Few comments.

@ElDeveloper
Copy link
Contributor

The code seems to work just fine i. e. I was able to create a study and process the sequences up to an OTU table.

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be self._clean_up_files.extend([.....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, done

@antgonza
Copy link
Member

This looks really nice and like @ElDeveloper said it works.

Sore general comments:

  • Do we really need an '+Add raw data' button? Why not always show the 2 frames?
  • If we keep the previous button, add a space between the + and the Add raw data
  • In "Use existing raw data" add new lines between the dropbox and the "Add" button
  • Will it be possible to make the space bigger in the grey-add-raw-data section?

Gonna check the code now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would almost prefer that this loop plus the other loop were done in a single SQL query.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See my comment above. If we introduce finer control over the study visibility, this kind of functions will be added as User attributes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it.

On (May-28-15|19:21), josenavas wrote:

+filepath_types = [k.split('', 1)[1].replace('', ' ')

  •              for k in get_filepath_types()
    
  •              if k.startswith('raw_')]
    
    +fp_type_by_ft = defaultdict(
  • lambda: filepath_types, SFF=['sff'], FASTA=['fasta', 'qual'],
  • FASTQ=['barcodes', 'forward seqs', 'reverse seqs'])

+def get_accessible_raw_data(user):

  • """Retrieves a tuple of raw_data_id and the last study title for that
  • raw_data
  • """
  • d = {}
  • for sid in user.user_studies:

See my comment above. If we introduce finer control over the study visibility, this kind of functions will be added as User attributes.


Reply to this email directly or view it on GitHub:
https://github.com/biocore/qiita/pull/1207/files#r31294962

@ElDeveloper
Copy link
Contributor

The code looks good to me, 👍 after the comments are addressed.

@josenavas josenavas mentioned this pull request May 28, 2015
@ElDeveloper
Copy link
Contributor

When showing the Add new raw data and Use existing raw data accordions, they resize a bit oddly:

minor

Would be nice if the size was fixed.


The Add button should probably be green instead of blue. It is also a bit confusing that the name of the button is Add, but the instructions are Choose the files to link to the raw data. However, I think this is ok for the Use existing raw data section.


This should probably just be a bootsrap table:

screen shot 2015-05-28 at 5 05 21 pm


For some extra Yoshiki-points, we probably want to convert the dropdown that's shown in Use existing raw data into a chosen dropdown.


Looks good otherwise!

@josenavas
Copy link
Contributor Author

@ElDeveloper thanks for the suggestions!

I want all the extra Yoshiki-points (worth 🍻 ??). Weirdly enough, the Use existing raw data dropdown is already a chosen dropdown:

<select class="chosen-select" id="previous-raw-data-{{pt_id}}" data-placeholder=" ">

And I cannot find why is not working properly...

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 10a69d8 on josenavas:1084-qiita-pet into * on biocore:fix-1084*.

Copy link
Contributor

Choose a reason for hiding this comment

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

Another thing ... there's no tests for these functions, which I think we are ok as this is a transitive step, but I wanted to highlight this in case someone else has stronger feelings about it.

@ElDeveloper
Copy link
Contributor

🍻 indeed, thanks for making the changes!

I think you need to activate the dropdown with JavaScript:
https://harvesthq.github.io/chosen/#setup

On (May-28-15|20:22), josenavas wrote:

@ElDeveloper thanks for the suggestions!

I want all the extra Yoshiki-points (worth 🍻 ??). Weirdly enough, the Use existing raw data dropdown is already a chosen dropdown:

<select class="chosen-select" id="previous-raw-data-{{pt_id}}" data-placeholder=" ">

And I cannot find why is not working properly...


Reply to this email directly or view it on GitHub:
#1207 (comment)

@ElDeveloper
Copy link
Contributor

BTW, I'm 👍 for the most part now. @squirrelo, do you have any other comments, or others? Would be great to get this merged ASAP.

@squirrelo
Copy link
Contributor

I'm still meh on the accordion for Raw Data, but for the sake of having this functionality in 👍 on this code and we can do interface changes later.

@antgonza
Copy link
Member

RE accordion: I actually like it.

antgonza added a commit that referenced this pull request May 29, 2015
@antgonza antgonza merged commit 42326b0 into qiita-spots:fix-1084 May 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants