Skip to content

Commit

Permalink
updated raw analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
avikdatta committed Nov 23, 2023
1 parent 1093f50 commit 3410716
Show file tree
Hide file tree
Showing 14 changed files with 216 additions and 89 deletions.
46 changes: 46 additions & 0 deletions app/raw_analysis/CELLRANGER_MULTI_template_v1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
feature_types: Gene Expression/Antibody Capture/CRISPR Guide Capture/Multiplexing Capture/VDJ-B/VDJ-T/VDJ-T-GD/Antigen Capture
cellranger_group: GROUP_NAME
analysis_metadata:
cellranger_multi_config:
- "[gene-expression]"
- "reference,/project/tgu/resources/pipeline_resource/transcriptome/cellranger/v7/GRCh38/refdata-gex-GRCh38-2020-A"
- "# probe-set,/path/to/probe/set, # Required, Fixed RNA Profiling only."
- "# filter-probes,<true|false>, # Optional, Fixed RNA Profiling only."
- "# r1-length,<int>"
- "# r2-length,<int>"
- "# chemistry,<auto>"
- "# expect-cells,<int>"
- "# force-cells,<int>"
- "# no-secondary,<true|false>"
- "# no-bam,<true|false>"
- "# check-library-compatibility,<true|false>"
- "# include-introns,<true|false>"
- "# min-assignment-confidence,<0.9>, # Optional, Cell Multiplexing only."
- "# cmo-set,/path/to/CMO/reference, # Optional, Cell Multiplexing only."
- "# barcode-sample-assignment,/path/to/barcode-sample-assignment/csv, # Optional, Cell Multiplexing only."
- "[feature] # For Feature Barcode libraries only"
- "# reference,/path/to/feature/reference"
- "# r1-length,<int>"
- "# r2-length,<int>"
- "# [vdj] # For TCR and BCR libraries only"
- "reference,/project/tgu/resources/pipeline_resource/vdj/v7/hg38/refdata-cellranger-vdj-GRCh38-alts-ensembl-7.1.0"
- "# inner-enrichment-primers,/path/to/primers"
- "# r1-length,<int>"
- "# r2-length,<int>"
- "[antigen-specificity] # for 5' BCR/TCR Antigen Capture only"
- "#control_id,mhc_allele"
- "#[samples] # for Cell Multiplexing libraries only"
- "#sample_id,cmo_ids,description"
- "#[samples] # for Fixed RNA Profiling multiplexed libraries only"
- "#sample_id,probe_barcode_ids,description"
scanpy:
MITO_PREFIX: MT-
RUN_SCRUBLET: true
RUN_CELLCYCLE_SCORE: true
CELL_MARKER_LIST: /project/tgu/resources/pipeline_resource/cell_markers/PangaloDB/PanglaoDB_markers_27_Mar_2020.tsv
CELL_MARKER_SPECIES: HG38
S_GENES: ''
G2M_GENES: ''
CELL_MARKER_MODE: NON-VDJ
12 changes: 6 additions & 6 deletions app/raw_analysis/GEOMX_DCC.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
dsp_id:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
dsp_id:
{% endfor -%}
analysis_metadata:
config_zip_file: /rds/general/project/genomics-facility-archive-2019/live/orwell/GeoMx/
geomx_pkc_file: /rds/general/project/genomics-facility-archive-2019/live/orwell/GeoMx/GeoMx_PKC_Files/Hs_R_NGS_WTA_v1.0.pkc
geomx_dcc_params:
- "--threads=8"
config_zip_file: /rds/general/project/genomics-facility-archive-2019/live/orwell/GeoMx/
geomx_pkc_file: /rds/general/project/genomics-facility-archive-2019/live/orwell/GeoMx/GeoMx_PKC_Files/Hs_R_NGS_WTA_v1.0.pkc
geomx_dcc_params:
- "--threads=8"
16 changes: 8 additions & 8 deletions app/raw_analysis/NF_ATAC_template_v1.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
sample: SAMPLE_NAME
replicate: REPLICATE_ID
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
sample: SAMPLE_NAME
replicate: REPLICATE_ID
{% endfor -%}
analysis_metadata:
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/atacseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/atacseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
14 changes: 7 additions & 7 deletions app/raw_analysis/NF_Ampliseq_template_v1.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
condition: CONDITION_NAME
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
condition: CONDITION_NAME
{% endfor -%}
analysis_metadata:
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/ampliseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/ampliseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
12 changes: 6 additions & 6 deletions app/raw_analysis/NF_Bactmap_template_v1.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}: ""
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}: ""
{% endfor -%}
analysis_metadata:
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/bactmap
nextflow_params:
- "-profile singularity"
- "-r A.B"
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/bactmap
nextflow_params:
- "-profile singularity"
- "-r A.B"
16 changes: 8 additions & 8 deletions app/raw_analysis/NF_ChIP_template_v1.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
antibody: ANTIBODY_NAME
control: CONTROL_SAMPLE_ID
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
antibody: ANTIBODY_NAME
control: CONTROL_SAMPLE_ID
{% endfor -%}
analysis_metadata:
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/chipseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/chipseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
18 changes: 9 additions & 9 deletions app/raw_analysis/NF_CutAndRun_template_v1.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
group: GROUP_NAME
replicate: REPLICATE_ID
control: CONTROL_SAMPLE_ID
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
group: GROUP_NAME
replicate: REPLICATE_ID
control: CONTROL_SAMPLE_ID
{% endfor -%}
analysis_metadata:
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/cutandrun
nextflow_params:
- "-profile singularity"
- "-r A.B"
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/cutandrun
nextflow_params:
- "-profile singularity"
- "-r A.B"
12 changes: 6 additions & 6 deletions app/raw_analysis/NF_HIC_template_v1.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}: ""
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}: ""
{% endfor -%}
analysis_metadata:
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/hic
nextflow_params:
- "-profile singularity"
- "-r A.B"
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/hic
nextflow_params:
- "-profile singularity"
- "-r A.B"
14 changes: 7 additions & 7 deletions app/raw_analysis/NF_Methylseq_template_v1.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}: ""
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}: ""
{% endfor -%}
analysis_metadata:
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/methylseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
- "--aligner bismark"
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/methylseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
- "--aligner bismark"
20 changes: 10 additions & 10 deletions app/raw_analysis/NF_RNA_template_v1.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
condition: CONDITION_NAME (USE CAPS)
strandedness: reverse
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
condition: CONDITION_NAME (USE CAPS)
strandedness: reverse
{% endfor -%}
analysis_metadata:
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/rnaseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
- "--aligner star_rsem"
- "--seq_center IGF"
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/rnaseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
- "--aligner star_rsem"
- "--seq_center IGF"
18 changes: 9 additions & 9 deletions app/raw_analysis/NF_Sarek_template_v1.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
patient: PATIENT_ID
sex: SEX
status: STATUS_ID
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}:
patient: PATIENT_ID
sex: SEX
status: STATUS_ID
{% endfor -%}
analysis_metadata:
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/sarek
nextflow_params:
- "-profile singularity"
- "-r A.B"
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/sarek
nextflow_params:
- "-profile singularity"
- "-r A.B"
12 changes: 6 additions & 6 deletions app/raw_analysis/NF_smRNA_template_v1.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sample_metadata:
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}: ""
{% for SAMPLE_ID in SAMPLE_ID_LIST %} {{ SAMPLE_ID }}: ""
{% endfor -%}
analysis_metadata:
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/smrnaseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
NXF_VER: X.Y.Z
nfcore_pipeline: nf-core/smrnaseq
nextflow_params:
- "-profile singularity"
- "-r A.B"
59 changes: 59 additions & 0 deletions app/raw_analysis/analysis_validation_cellranger_multi_v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"id": "https://github.com/imperial-genomics-facility/IGFPortal",
"title": "IGF Cellranger Multi analysis validation schema",
"description": "Schema for validation of Cellranger multi analysis yaml file",
"type" : "object",
"version": "0.0.1",
"properties": {
"sample_metadata": {
"type": "object",
"uniqueItems": true,
"minItems": 1,
"patternProperties": {
"^IGF[a-zA-Z0-9-_]+$": {
"type": ["object", "string"],
"properties": {
"feature_types": {
"type": "string",
"enum": [
"Gene Expression",
"Antibody Capture",
"CRISPR Guide Capture",
"Multiplexing Capture",
"VDJ-B",
"VDJ-T",
"VDJ-T-GD",
"Antigen Capture"
]
},
"cellranger_group": {
"type": "string",
"pattern": "^[A-Z0-9-_]+$"
}
}
}
}
},
"analysis_metadata": {
"type": "object",
"properties": {
"scanpy": {
"type": "object",
"uniqueItems": true,
"minItems": 1
},
"cellranger_multi_config": {
"type": "array",
"uniqueItems": true,
"minItems": 1,
"items": {
"type": "string"
}
}
},
"required": ["cellranger_multi_config", "scanpy"]
}
},
"required": ["sample_metadata", "analysis_metadata"]
}
36 changes: 29 additions & 7 deletions app/raw_analysis_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,21 +223,21 @@ class RawAnalysisView(ModelView):
def reject_raw_analysis(self, item):
try:
if isinstance(item, list):
for i in item:
try:
try:
for i in item:
db.session.\
query(RawAnalysis).\
filter(RawAnalysis.raw_analysis_id==i.raw_analysis_id).\
update({'status': 'REJECTED'})
db.session.commit()
except:
db.session.rollback()
raise
db.session.commit()
except:
db.session.rollback()
raise
else:
try:
db.session.\
query(RawAnalysis).\
filter(RawAnalysis.raw_analysis_id==i.raw_analysis_id).\
filter(RawAnalysis.raw_analysis_id==item.raw_analysis_id).\
update({'status': 'REJECTED'})
db.session.commit()
except:
Expand Down Expand Up @@ -574,6 +574,28 @@ def template_geomx_dcc(self, item):
log.error(e)
return redirect(url_for('RawAnalysisView.list'))

@action("template_cellranger_multi", "Template cellranger multi", confirmation=None, icon="fa-file-excel-o", multiple=False, single=True)
def template_cellranger_multi(self, item):
try:
template_tag = "CELLRANGER_MULTI"
if item.project_id is not None:
formatted_template = \
generate_analysis_template(
project_igf_id=item.project.project_igf_id,
template_tag=template_tag)
output = BytesIO(formatted_template.encode('utf-8'))
analysis_name = item.analysis_name.encode('utf-8').decode()
output.seek(0)
self.update_redirect()
return send_file(output, download_name=f"{analysis_name}_{template_tag}_analysis.yaml", as_attachment=True)
else:
flash(f"Failed to generate {template_tag} template, no project", 'danger')
return redirect(url_for('RawAnalysisView.list'))
except Exception as e:
flash(f"Failed to generate {template_tag} template", 'danger')
log.error(e)
return redirect(url_for('RawAnalysisView.list'))


class RawAnalysisQueueView(ModelView):
datamodel = SQLAInterface(RawAnalysis)
Expand Down

0 comments on commit 3410716

Please sign in to comment.