{% extends sitebase.html %} {% block head %} {% end %} {% block content %} {% from future.utils import viewitems %} {% from os.path import basename %} {% from qiita_core.qiita_settings import qiita_config %} {% from qiita_db.data import PreprocessedData, ProcessedData %}

{{study_title}}

{{study_info['study_alias']}}

{% if not is_public or user_level == "admin" %} Edit {% end %} {% if can_upload and study_status == 'sandbox' or user_level == 'admin' %} Upload {% end %} {% if study_status == 'sandbox' and qiita_config.require_approval and ste and raw_files and prep_templates %} Request Approval {% elif (user_level == 'admin' and study_status == 'awaiting_approval') or not qiita_config.require_approval %} Approve Study {% elif study_status == 'private' %} Make Public {% end %} {% if study_status not in {'sandbox', 'public'} %} Revert to sandbox {% end %}

Abstract: {{study_info['study_abstract']}}
Description: {{study_info['study_description']}}
PubMed IDs: {% raw pmids %}
Principal investigator: {% raw principal_investigator %}
Samples: {{study_info['number_samples_promised']}}/{{study_info['number_samples_collected']}}
Metadata: {{study_info['metadata_complete']}}
{% if study_status == 'sandbox' or user_level == 'admin' %} Select your sample template:

Process sample template {% end %}

{% if ste %} You have a valid sample template, if you reprocess with a new file you will lose all prep and sequence information.
You can modify a sample template here
Show sample template summary
{% for stid, stpath in sample_templates %} {% if is_local_request %}
{{stpath}} {% else %}
Download sample template {% end %} {% end %} {% end %}
{% if (ste and study_status == 'sandbox') or user_level == 'admin' %}
What file type is your raw data? {% if other_studies_rd %}

You could also select raw data from other studies that you have access to:
{% end %}

Add raw data
{% end %} {% for r in available_raw_data %}
{% if study_status == 'sandbox' or user_level == 'admin' %}

Add prep template to this raw data

To add a prep template you need to:
  1. select your prep template file ,
  2. select the prep template data type , and
  3. (optional but required for EBI submission) select an investigation type:

Add prep template

{% end %}

Prep templates uploaded

{% for prep in available_prep_templates[r.id] %} {% if not prep.preprocessed_data or prep.preprocessing_status.startswith('failed') %} {% else %} {% end %} {% end %}
{{prep.data_type()}} Show prep template summary
{% for ptid, ptpath in prep.get_filepaths() %} {% if is_local_request %}
{{ptpath}} {% else %}
{{basename(ptpath)}} {% end %} {% end %}

{% if ste and study_status == 'sandbox' or user_level == 'admin' %}
Selected investigation type:
Update Investigation Type
{% end %}
{% if study_status == 'sandbox' %} Use rev_comp_mapping_barcodes
{% end %} Status: {{prep.preprocessing_status}}
{% if 'zero-size array' in prep.preprocessing_status %} Your barcodes do not seem to match your prep template info {% end %}
{% for pdi in prep.preprocessed_data %} {% set pd = PreprocessedData(pdi) %} {% set filepaths = pd.get_filepaths() %} {% for proc_id in pd.processed_data %} {% set proc_data = ProcessedData(proc_id) %} {% set filepaths.extend(proc_data.get_filepaths()) %} {% end %} {% if filepaths %} {% if user_level == "admin" %} {% end %} {% end %} {% end %}
Preprocessing summary {% for fpid, fp, ft in filepaths %} {% if is_local_request %}
{{fp}} {% else %}
{{basename(fp)}} {% end %} {% end %}
Preprocessed Data ID: {{ pdi }}
EBI status: {{pd.submitted_to_insdc_status()}}
EBI study accession: {{pd.ebi_study_accession}}
EBI submission accession: {{pd.ebi_submission_accession}}
Submit to EBI

Linked files to this raw data

{% if (study_status == 'sandbox' or user_level == 'admin') and r.get_filepaths() and r.link_filepaths_status not in {'linking', 'unlinking'} %} Unlink all files
{% end %} {% if r.link_filepaths_status == 'linking' %} Linking files...
{% elif r.link_filepaths_status == 'unlinking' %} Unlinking files...
{% elif r.link_filepaths_status.startswith('failed') %} Error (un)linking files: {{r.link_filepaths_status}}
{% end %} {% for fpid, f, t in r.get_filepaths() %} {{basename(f)}}: {{t[4:]}}
{% end %}
{% if study_status == 'sandbox' or user_level == 'admin' %}

Link uploaded files with raw data

{% for f in files %} {% end %}
File     File type
{{f}}  

Link raw files to: {{r.filetype}} (ID: {{r.id}}) {% end %}
{% end %}
{% end %}