Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions bin/get_eatlas_accessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_data(url: str) -> dict:
return response.json()


def get_experiment_description(exp_dict: dict):
def get_experiment_description(exp_dict: dict) -> str:
"""
Gets the description from an experiment dictionary

Expand Down Expand Up @@ -138,7 +138,7 @@ def get_experiment_description(exp_dict: dict):
raise KeyError(f"Could not find description field in {exp_dict}")


def get_experiment_accession(exp_dict: dict):
def get_experiment_accession(exp_dict: dict) -> str:
"""
Gets the accession from an experiment dictionary

Expand Down Expand Up @@ -168,7 +168,7 @@ def get_experiment_accession(exp_dict: dict):
raise KeyError(f"Could not find accession field in {exp_dict}")


def get_properties_values(exp_dict: dict):
def get_properties_values(exp_dict: dict) -> list:
"""
Gets all values from properties from an experiment dictionary

Expand Down Expand Up @@ -199,7 +199,7 @@ def get_properties_values(exp_dict: dict):
return list(set(values))


def get_eatlas_experiments():
def get_eatlas_experiments() -> list[dict]:
"""
Gets all experiments from Expression Atlas

Expand All @@ -215,7 +215,7 @@ def get_eatlas_experiments():
return data["experiments"]


def filter_by_platform(experiments: list[dict], platform: str | None):
def filter_by_platform(experiments: list[dict], platform: str | None) -> list[dict]:
"""
Gets all experiments for a given platform from Expression Atlas
Possible platforms in Expression Atlas are 'rnaseq', 'microarray', 'proteomics'
Expand Down Expand Up @@ -258,7 +258,15 @@ def filter_by_platform(experiments: list[dict], platform: str | None):
return platform_experiments


def get_species_experiments(experiments: list[dict], species: str):
def get_species_name_without_subspecies(species: str) -> str:
"""
Returns the species name without the subspecies part.
Ex: Hordeum vulgare subsp. vulgare -> Hordeum vulgare
"""
return " ".join(species.split(" ")[:2])


def get_species_experiments(experiments: list[dict], species: str) -> list[dict]:
"""
Gets all experiments for a given species from Expression Atlas

Expand All @@ -275,12 +283,14 @@ def get_species_experiments(experiments: list[dict], species: str):
"""
species_experiments = []
for exp_dict in experiments:
if exp_dict["species"] == species:
# in case the species name contains a subspecies part, we only use the first two words
exp_species = get_species_name_without_subspecies(exp_dict["species"])
if exp_species == species:
species_experiments.append(exp_dict)
return species_experiments


def get_experiment_data(exp_dict: dict):
def get_experiment_data(exp_dict: dict) -> dict:
"""
Gets the full data for an experiment given its dictionary

Expand Down Expand Up @@ -312,7 +322,7 @@ def filter_out_excluded_accessions(experiments: list[dict]) -> list[dict]:
return valid_experiments


def parse_experiment(exp_dict: dict):
def parse_experiment(exp_dict: dict) -> dict:
# getting accession and description
accession = get_experiment_accession(exp_dict)
description = get_experiment_description(exp_dict)
Expand Down
2 changes: 1 addition & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ params {
config_profile_description = 'Minimal test dataset to check pipeline function'

// Input data
species = 'beta vulgaris'
species = 'prunus persica'
outdir = "results/test"
}
4 changes: 2 additions & 2 deletions galaxy/build/static/template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ INPUTS
</test>
<test>
<section name="input_output_options">
<param name="species" value="beta vulgaris" />
<param name="species" value="prunus persica" />
<conditional name="datasets">
<param name="provide_datasets" value="false" />
</conditional>
Expand All @@ -128,7 +128,7 @@ INPUTS
</test>
<test>
<section name="input_output_options">
<param name="species" value="beta vulgaris" />
<param name="species" value="prunus persica" />
<conditional name="datasets">
<param name="provide_datasets" value="true" />
<param name="samplesheet" value="test_data/input.csv" />
Expand Down
4 changes: 2 additions & 2 deletions galaxy/tool_shed/tool/nf_core_stableexpression.xml
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ VERSION="1.1dev"; echo "$VERSION"
</test>
<test>
<section name="input_output_options">
<param name="species" value="beta vulgaris" />
<param name="species" value="prunus persica" />
<conditional name="datasets">
<param name="provide_datasets" value="false" />
</conditional>
Expand All @@ -605,7 +605,7 @@ VERSION="1.1dev"; echo "$VERSION"
</test>
<test>
<section name="input_output_options">
<param name="species" value="beta vulgaris" />
<param name="species" value="prunus persica" />
<conditional name="datasets">
<param name="provide_datasets" value="true" />
<param name="samplesheet" value="test_data/input.csv" />
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/download_public_datasets/main.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include { EXPRESSIONATLAS_GETDATA as EXPRESSION_ATLAS } from '../../../modules/local/expressionatlas/getdata'
include { EXPRESSIONATLAS_GETDATA as EXPRESSION_ATLAS } from '../../../modules/local/expressionatlas/getdata'
include { GEO_GETDATA as GEO } from '../../../modules/local/geo/getdata'

include { addDatasetIdToMetadata } from '../utils_nfcore_stableexpression_pipeline'
Expand All @@ -7,7 +7,7 @@ include { augmentMetadata } from '../utils_nfcore_

/*
========================================================================================
SUBWORKFLOW TO DOWNLOAD GEO ACCESSIONS AND DATASETS
SUBWORKFLOW TO DOWNLOAD EXPRESSION ATLAS AND NCBI GEO DATASETS
========================================================================================
*/

Expand Down
6 changes: 3 additions & 3 deletions subworkflows/local/gene_statistics/main.nf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include { COMPUTE_GENE_STATISTICS as GLOBAL } from '../../../modules/local/compute_gene_statistics'
include { COMPUTE_GENE_STATISTICS as PLATFORM } from '../../../modules/local/compute_gene_statistics'
include { COMPUTE_GENE_STATISTICS as GLOBAL } from '../../../modules/local/compute_gene_statistics'
include { COMPUTE_GENE_STATISTICS as PLATFORM } from '../../../modules/local/compute_gene_statistics'

/*
========================================================================================
SUBWORKFLOW TO DOWNLOAD EXPRESSIONATLAS ACCESSIONS AND DATASETS
SUBWORKFLOW TO COMPUTE STATISTICS FOR ALL GENES
========================================================================================
*/

Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/genorm/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include { COMPUTE_M_MEASURE } from '../../../modules/local/genorm/com

/*
========================================================================================
SUBWORKFLOW TO COMPUTE PAIRWISE GENE VARIATION
SUBWORKFLOW TO COMPUTE PAIRWISE GENE VARIATION (ADAPTED VERSION OF GENORM)
========================================================================================
*/

Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/get_public_accessions/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include { GEO_GETACCESSIONS as GEO } from '../

/*
========================================================================================
SUBWORKFLOW TO DOWNLOAD EXPRESSIONATLAS ACCESSIONS AND DATASETS
SUBWORKFLOW TO FETCH EXPRESSION ATLAS AND NCBI GEO ACCESSIONS
========================================================================================
*/

Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/get_transcript_lengths/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include { DOWNLOAD_ENSEMBL_ANNOTATION } from '../../../modules/

/*
========================================================================================
SUBWORKFLOW TO DOWNLOAD EXPRESSIONATLAS ACCESSIONS AND DATASETS
SUBWORKFLOW TO GET TRANSCRIPT LENGTHS FROM GENOME ANNOTATION
========================================================================================
*/

Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/idmapping/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include { FILTER_AND_RENAME_GENES } from '../../../modules/local/

/*
========================================================================================
SUBWORKFLOW TO DOWNLOAD EXPRESSIONATLAS ACCESSIONS AND DATASETS
SUBWORKFLOW TO MAP GENE IDS TO COMMON IDS AMONG ALL DATASETS AND TO REMOVE RARE GENES
========================================================================================
*/

Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/merge_data/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ workflow MERGE_DATA {
.collect( sort: true )
.map { files -> [ [ platform: "all" ], files ] }

GLOBAL( ch_collected_merged_counts.collect() )
GLOBAL( ch_collected_merged_counts )
ch_all_counts = GLOBAL.out.counts

// -----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/reporting/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include { paramsSummaryMap } from 'plugin/nf-schema'

/*
========================================================================================
SUBWORKFLOW TO DOWNLOAD EXPRESSIONATLAS ACCESSIONS AND DATASETS
SUBWORKFLOW DEDICATED TO AGGREGATION OF RESULTS AND REPORTING (DASH APP AND MULTIQC)
========================================================================================
*/

Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/sample_filtering/main.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include { FILTER_OUT_SAMPLES_WITH_TOO_MANY_ZEROS as TOO_MANY_ZEROS } from '../../../modules/local/filter_out_samples/with_too_many_zeros'
include { FILTER_OUT_SAMPLES_WITH_TOO_MANY_MISSING_VALUES as TOO_MANY_MISSING_VALUES } from '../../../modules/local/filter_out_samples/with_too_many_missing_values'
include { FILTER_OUT_SAMPLES_WITH_TOO_MANY_ZEROS as TOO_MANY_ZEROS } from '../../../modules/local/filter_out_samples/with_too_many_zeros'
include { FILTER_OUT_SAMPLES_WITH_TOO_MANY_MISSING_VALUES as TOO_MANY_MISSING_VALUES } from '../../../modules/local/filter_out_samples/with_too_many_missing_values'


/*
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/stability_scoring/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include { GENORM } from '../genorm'

/*
========================================================================================
COMPUTE STABILITY SCORES
SUBWORKFLOW TO COMPUTE STABILITY SCORES
========================================================================================
*/

Expand Down Expand Up @@ -61,7 +61,7 @@ workflow STABILITY_SCORING {
// -----------------------------------------------------------------
// AGGREGATION AND FINAL STABILITY SCORE
// -----------------------------------------------------------------
//ch_normfinder_stabilities.join( ch_genorm_stability ).join( ch_section_stats ),

COMPUTE_STABILITY_SCORES (
ch_normfinder_stabilities.join( ch_genorm_stability ).join( ch_section_stats ),
stability_score_weights
Expand Down
6 changes: 3 additions & 3 deletions tests/default.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nextflow_pipeline {

when {
params {
species = 'beta vulgaris'
species = 'prunus persica'
outdir = "$outputDir"
}
}
Expand Down Expand Up @@ -110,7 +110,7 @@ nextflow_pipeline {

when {
params {
species = 'beta vulgaris'
species = 'arabidopsis lyrata'
accessions_only = true
outdir = "$outputDir"
}
Expand Down Expand Up @@ -140,7 +140,7 @@ nextflow_pipeline {

when {
params {
species = 'beta vulgaris'
species = 'aspergillus fumigatus'
download_only = true
outdir = "$outputDir"
}
Expand Down
Loading
Loading