diff --git a/backend/apis/analyze.py b/backend/apis/analyze.py
index 3c37ee4..40c9682 100644
--- a/backend/apis/analyze.py
+++ b/backend/apis/analyze.py
@@ -8,6 +8,9 @@
from scipy.stats import binom
from flask_restplus import Namespace, Resource
+from datetime import datetime, timedelta
+from threading import Timer
+
from pymongo import MongoClient
from .downloadLineagesInfo import dict_lineage_mutation
@@ -301,14 +304,7 @@
class FieldList(Resource):
@api.doc('all_geo')
def get(self):
-
- conn = http.client.HTTPConnection('geco.deib.polimi.it')
- conn.request('GET', '/virusurf_epitope/api/epitope/allGeo')
-
- response = conn.getresponse()
- all_geo = response.read().decode()
- all_geo = json.loads(all_geo)
-
+ all_geo = all_geo_dict['all_geo']
return all_geo
@@ -316,34 +312,15 @@ def get(self):
class FieldList(Resource):
@api.doc('all_lineages')
def get(self):
-
- conn = http.client.HTTPConnection('geco.deib.polimi.it')
- conn.request('GET', '/virusurf_epitope/api/epitope/allLineages')
-
- response = conn.getresponse()
- all_lin = response.read().decode()
- all_lin = json.loads(all_lin)
-
+ all_lin = all_lineage_dict['all_lineage']
return all_lin
@api.route('/allProtein')
class FieldList(Resource):
@api.doc('all_protein')
- def post(self):
-
- to_send = api.payload
-
- conn = http.client.HTTPConnection('geco.deib.polimi.it')
- headers = {'Content-type': 'application/json'}
- send = to_send
- json_data = json.dumps(send)
- conn.request('POST', '/virusurf_epitope/api/epitope/allProtein', json_data, headers)
-
- response = conn.getresponse()
- all_protein = response.read().decode()
- all_protein = json.loads(all_protein)
-
+ def get(self):
+ all_protein = all_protein_dict['all_protein']
return all_protein
@@ -1036,7 +1013,7 @@ def recursive_children_lineage(parent, lineage, alias, dict_copy2, dict_lineages
def get_all_important_mutation():
- print("inizio request")
+ print("inizio request important mutation")
conn = http.client.HTTPConnection('geco.deib.polimi.it')
conn.request('GET', '/virusurf_epitope/api/epitope/allImportantMutations')
@@ -1047,12 +1024,98 @@ def get_all_important_mutation():
for mutation_per_lineage in all_important_mutation:
lineage = mutation_per_lineage['lineage']
all_important_mutation_dict[lineage] = mutation_per_lineage
+ print("fine request important mutation")
+ x = datetime.today()
+ y = x.replace(day=x.day, hour=2, minute=0, second=0, microsecond=0) + timedelta(days=1)
+ delta_t = y - x
+ secs = delta_t.total_seconds()
+ t1 = Timer(secs, get_all_important_mutation)
+ t1.start()
+
+
+all_protein_dict = {}
+
+
+def get_all_protein():
+ print("inizio request protein")
+ to_send = {'gcm': {'taxon_name':["severe acute respiratory syndrome coronavirus 2"]}}
+
+ conn = http.client.HTTPConnection('geco.deib.polimi.it')
+ headers = {'Content-type': 'application/json'}
+ send = to_send
+ json_data = json.dumps(send)
+ conn.request('POST', '/virusurf_epitope/api/epitope/allProtein', json_data, headers)
+
+ response = conn.getresponse()
+ all_protein = response.read().decode()
+ all_protein = json.loads(all_protein)
+ all_protein_dict['all_protein'] = all_protein
+ print("fine request protein")
+ x = datetime.today()
+ y = x.replace(day=x.day, hour=2, minute=0, second=0, microsecond=0) + timedelta(days=1)
+ delta_t = y - x
+ secs = delta_t.total_seconds()
+ t2 = Timer(secs, get_all_protein)
+ t2.start()
- print("fine request")
+
+all_lineage_dict = {}
+
+
+def get_all_lineage():
+ print("inizio request lineage")
+ conn = http.client.HTTPConnection('geco.deib.polimi.it')
+ conn.request('GET', '/virusurf_epitope/api/epitope/allLineages')
+
+ response = conn.getresponse()
+ all_lin = response.read().decode()
+ all_lin = json.loads(all_lin)
+ all_lineage_dict['all_lineage'] = all_lin
+ print("fine request lineage")
+ x = datetime.today()
+ y = x.replace(day=x.day, hour=2, minute=0, second=0, microsecond=0) + timedelta(days=1)
+ delta_t = y - x
+ secs = delta_t.total_seconds()
+ t3 = Timer(secs, get_all_lineage)
+ t3.start()
+
+
+all_geo_dict = {}
+
+
+def get_all_geo():
+ print("inizio request geo")
+ conn = http.client.HTTPConnection('geco.deib.polimi.it')
+ conn.request('GET', '/virusurf_epitope/api/epitope/allGeo')
+
+ response = conn.getresponse()
+ all_geo = response.read().decode()
+ all_geo = json.loads(all_geo)
+ all_geo_dict['all_geo'] = all_geo
+ print("fine request geo")
+ x = datetime.today()
+ y = x.replace(day=x.day, hour=2, minute=0, second=0, microsecond=0) + timedelta(days=1)
+ delta_t = y - x
+ secs = delta_t.total_seconds()
+ t4 = Timer(secs, get_all_geo)
+ t4.start()
def prova_mongo_db():
print("prova Mongo")
+ # results = db.seq.aggregate([
+ # {
+ # "$group": {
+ # "fullname": {
+ # "$covv_accession_id"
+ # }
+ # }
+ # }]
+ # )
+ # print("qui", results)
+ # for i, x in enumerate(results):
+ # print("qui2", x)
+
seq = db.seq
pipeline = [
@@ -1089,4 +1152,7 @@ def prova_mongo_db():
get_all_important_mutation()
+get_all_geo()
+get_all_protein()
+get_all_lineage()
# prova_mongo_db()
diff --git a/backend/repo_static/about_viruclust2.html b/backend/repo_static/about__viruclust.html
similarity index 84%
rename from backend/repo_static/about_viruclust2.html
rename to backend/repo_static/about__viruclust.html
index be824d1..a6731c3 100644
--- a/backend/repo_static/about_viruclust2.html
+++ b/backend/repo_static/about__viruclust.html
@@ -107,6 +107,12 @@
Contacts
anna.bernasconi@polimi.it
+
+
+ Dr. Matteo Chiara
+ Use cases, Testing
+
+
Dipartimento di Elettronica, Informazione e Bioingegneria
@@ -137,6 +143,7 @@ Third-party soft
PostgreSQL
Vue.js
Flask
+ Apache ECharts
@@ -168,26 +175,6 @@ GISAID data acknowledgement
-
-
- Personal acknowledgements
- The authors would like to thank several researchers
- for their contribution to requirements elicitation and for inspiring future developments
- of this research.
- They are listed in strict alphabetical order by last name.
-
-
-
-
-
- Matteo Chiara
- Università degli Studi di Milano Statale (IT)
-
-
-
Resources acknowledgements
@@ -195,24 +182,6 @@ Resources acknowledgements
Award "Data-driven Machine and Deep Learning for Genomics".
-
diff --git a/backend/repo_static/about_viruclust.html b/backend/repo_static/about_viruclust.html
deleted file mode 100644
index 479b2cc..0000000
--- a/backend/repo_static/about_viruclust.html
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
- About -- ViruClust
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Acknowledgements
-
-
-
-
- GISAID data acknowledgement
-
- We are grateful to the data contributors who shared the data used in this
- Web Application via the GISAID Initiative*: the Authors, the Originating
- Laboratories responsible for obtaining the specimens, and the
- Submitting Laboratories that generated the genetic sequences and metadata.
-
- * Elbe, S., and Buckland-Merrett, G. (2017)
- Data, disease and diplomacy: GISAID’s innovative contribution to global health.
- Global Challenges, 1:33-46. DOI: 10.1002/gch2.1018
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 1abd8a3..ccdf4c6 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -37,7 +37,7 @@
style="background-color: transparent; width: 100px">
Wiki
-
ABOUT
@@ -94,7 +94,7 @@
-
ABOUT
diff --git a/frontend/src/components/AnalyzeDistributionLineageInGeo.vue b/frontend/src/components/AnalyzeDistributionLineageInGeo.vue
index 98af886..790e0d0 100644
--- a/frontend/src/components/AnalyzeDistributionLineageInGeo.vue
+++ b/frontend/src/components/AnalyzeDistributionLineageInGeo.vue
@@ -9,7 +9,7 @@
- SELECT GEO-GRANULARITY AND LOCATION
+ PICK A PLACE
+ :denominators = "denominators"
+ :selectedSpecificGeo = "selectedSpecificGeo"
+ :selectedGeoCount = "selectedGeoCount">
@@ -231,7 +233,8 @@ export default {
if(table === 'table_geo'){
text = this.json2csv(result_sorted, this.headerTableLineageCountry);
}
- let filename = 'result.csv';
+ let filename = 'lineage_analysis_table_' + this.selectedGeoCount + '%' + '_' + this.selectedSpecificGeo + '_' + this.startDateDistributionLineageInGeo
+ + '_' + this.stopDateDistributionLineageInGeo + '.csv';
let element = document.createElement('a');
element.setAttribute('download', filename);
var data = new Blob([text]);
diff --git a/frontend/src/components/AnalyzeLineageAndCountry.vue b/frontend/src/components/AnalyzeLineageAndCountry.vue
index 0f6c2de..bd8917a 100644
--- a/frontend/src/components/AnalyzeLineageAndCountry.vue
+++ b/frontend/src/components/AnalyzeLineageAndCountry.vue
@@ -61,7 +61,7 @@
- SELECT PROTEINS TO ANALYZE
+ SELECT THE PROTEINS TO COMPARE
(no selection means "all protein")
@@ -98,7 +98,7 @@
- APPLY FILTERS TO TABLE
+ ADVANCED FILTERS
@@ -368,7 +368,7 @@
color="#E63946"
class="white--text"
>
- APPLY FILTERS
+ APPLY
diff --git a/frontend/src/components/AnalyzePage.vue b/frontend/src/components/AnalyzePage.vue
index a3c4748..0284785 100644
--- a/frontend/src/components/AnalyzePage.vue
+++ b/frontend/src/components/AnalyzePage.vue
@@ -176,8 +176,7 @@ export default {
}
let url = `/analyze/allProtein`;
- let to_send = {'gcm': {'taxon_name':["severe acute respiratory syndrome coronavirus 2"]}};
- axios.post(url, to_send)
+ axios.get(url)
.then((res) => {
return res.data;
})
diff --git a/frontend/src/components/AnalyzeProvinceRegion.vue b/frontend/src/components/AnalyzeProvinceRegion.vue
index 68af257..78a383a 100644
--- a/frontend/src/components/AnalyzeProvinceRegion.vue
+++ b/frontend/src/components/AnalyzeProvinceRegion.vue
@@ -9,7 +9,7 @@
- SELECT LINEAGE, TIME RANGE AND LOCATION (TARGET)
+ PICK A LINEAGE, PLACE AND INTERVAL OF TIME
- Select the preferred comparison
+ Comparison
- Select locations to exclude from the background
+ Exclude one or more places from the background
- SELECT PROTEINS TO ANALYZE
+ SELECT THE PROTEINS TO COMPARE
(selecting none is equivalent to "all proteins")
@@ -108,7 +108,7 @@
- (number of sequences selected is too low in the target or background)
+ (The number of currently selected genomic sequences is too low. A minimum of 10 genomes need to be selected for both the target and the background.)
{{location}}
@@ -116,11 +116,11 @@
- number of sequences selected is too low in all the targets or backgrounds (minimum 10)
+ The number of currently selected genomic sequences is too low. A minimum of 10 genomes need to be selected for both the target and the background.
- number of sequences selected is too low in the target or background (minimum 10)
+ The number of currently selected genomic sequences is too low. A minimum of 10 genomes need to be selected for both the target and the background.
- APPLY FILTERS FOR SELECTING THE CHANGES IN THE TABLES AND HEATMAP BELOW
+ ADVANCED FILTERS
@@ -617,10 +617,10 @@
-
- IMPORTANT CHANGES OF TARGET LINEAGE:
+
+ CHANGES TO HIGHLIGHT:
-
+
-
+
+ :importantMutation = "importantMutation"
+ type = "geo">
@@ -789,7 +790,7 @@
P-VALUE:
-
+
@@ -833,7 +834,7 @@
SELECT PROTEIN (mandatory):
-
+
- INCLUDE CHANGES:
+ PREVALENCE RANGE OF AA CHANGES:
-
- Include the changes that appear in a % of the sequences between the 2 values below
-
@@ -933,13 +931,13 @@
- HIGHLIGHT MUTAGENESIS SITES:
+ HIGHLIGHT FUNCTIONALLY CHARACTERISED SITES:
+
+
+
+
+
+
@@ -1002,6 +1008,97 @@
+
+ {{domain.toUpperCase()}}
+
+
+
+
+
+
+
+
+
+
+ UPLOAD YOUR REGIONS:
+
+
+
+ mdi-information
+
+
+
+
+ UPLOAD YOUR REGIONS:
+
+
+ ... infos ...
+
+
+ EXAMPLE OF FILE
+
+ mdi-download-circle-outline
+
+
+
+
+
+
+
+
+
+
+
+ Upload CSV
+
+
+
+
+
+ mdi-close
+
+
+
+
+
+
+
+
+
+
+
+
{{domain.toUpperCase()}}
@@ -1057,7 +1154,11 @@
:possibleDomainForPValueMutagenesis="possibleDomainForPValueMutagenesis"
:selectedDomainForPValueAaModifications="selectedDomainForPValueAaModifications"
:possibleDomainForPValueAaModifications="possibleDomainForPValueAaModifications"
- type="geo">
+ :selectedDomainForPValueUploaded="selectedDomainForPValueUploaded"
+ :possibleDomainForPValueUploaded="possibleDomainForPValueUploaded"
+ type="geo"
+ :rowsAnalTime = rows
+ :protein = selectedProteinForPValue>
@@ -1083,12 +1184,11 @@
width="700"
>
-
+
Accession IDs
@@ -1096,7 +1196,6 @@
@@ -1196,11 +1295,16 @@ export default {
begin_value_domain_mutagenesis: [],
end_value_domain_mutagenesis: [],
+ selectedAllAaModifications: false,
+ selectedDomainForPValueAaModificationsFake: [],
selectedDomainForPValueAaModifications: [],
possibleDomainForPValueAaModifications: [],
begin_value_domain_aa_modifications: [],
end_value_domain_aa_modifications: [],
+ possibleDomainForPValueUploaded: [],
+ selectedDomainForPValueUploaded: [],
+
selectedHeatmapMode: '% Target',
possibleHeatmapMode: ['% Target', '% Target - % Background', 'Odds ratio'],
@@ -1217,6 +1321,12 @@ export default {
selectedTypeImportantMutation: 'ECDC',
possibleTypeImportantMutation: ['ECDC', 'Present in 75% of the lineage (worldwide)'],
+
+ fileDomainCSV: null,
+ nameFileDomainCSV: null,
+
+ accessionIdsTargetOrBackground: null,
+ accessionIdsSingleMutation: null,
}
},
computed: {
@@ -1244,6 +1354,126 @@ export default {
methods: {
...mapMutations(['setNumLevelAboveBackground', 'setToExcludeGeo']),
...mapActions(['setQueryGeo']),
+ loadDomainCSV(){
+ this.fileDomainCSV = null;
+ this.nameFileDomainCSV = null;
+ this.selectedDomainForPValueUploaded = [];
+ this.possibleDomainForPValueUploaded = [];
+ let reader = new FileReader();
+ let selectedFile = document.getElementById ('inputDomainCSVGeo'). files[0];
+ this.nameFileDomainCSV = selectedFile.name;
+ let that = this;
+ reader.onload = function() {
+ let fileDomain = reader.result.replaceAll('"', '');
+ let jsonTranslate = that.CSVToJson(fileDomain);
+ localStorage.setItem('uploadedDomainsGeo', jsonTranslate);
+ localStorage.setItem('uploadedFileNameGeo', that.nameFileDomainCSV);
+ that.calculateUploadedDomains();
+ }
+ reader.readAsText(selectedFile);
+ },
+ CSVToJson(file){
+ let lines= file.split("\r\n");
+ let result = [];
+ let headers = lines[0].split(",");
+
+ for(let i=1;i 0) {
+ filename = 'spatial_analysis_table_';
+ if(this.queryGeo['lineage']){
+ filename += this.queryGeo['lineage'] + '_';
+ }
+ filename += '(' + rows[0]['target'] + ')' + '_vs_' + '(' + rows[0]['background'] + ')';
+ filename += '_' + this.startDateQueryGeo + '_' + this.stopDateQueryGeo ;
+ }
+ filename += '.csv';
let element = document.createElement('a');
element.setAttribute('download', filename);
var data = new Blob([text]);
@@ -1364,6 +1603,37 @@ export default {
element.click();
document.body.removeChild(element);
},
+ json2csvDomains(input, selected_headers) {
+ var json = input;
+ var fields = [];
+ var fields2 = [];
+ selected_headers.forEach(function (el) {
+ fields.push(el.text);
+ });
+ selected_headers.forEach(function (el) {
+ fields2.push(el.value);
+ });
+ var csv = json.map(function (row) {
+ return fields2.map(function (fieldName) {
+ let string_val;
+ if (fieldName === 'mutation_position'){
+ string_val = row['mutation'];
+ if(typeof string_val === 'string' || string_val instanceof String) {
+ string_val = string_val.replaceAll("\n", " ");
+ }
+ }
+ else {
+ string_val = row[fieldName];
+ if(typeof string_val === 'string' || string_val instanceof String) {
+ string_val = string_val.replaceAll("\n", " ");
+ }
+ }
+ return string_val;
+ }).join(',')
+ });
+ csv.unshift(fields.join(','));
+ return csv.join('\r\n')
+ },
json2csv(input, selected_headers) {
var json = input;
var fields = [];
@@ -1818,6 +2088,11 @@ export default {
},
applyFilterPValueChart(){
this.selectedDomainForPValue = [];
+ this.selectedDomainForPValueMutagenesis = [];
+ this.selectedDomainForPValueAaModifications = [];
+ this.selectedDomainForPValueUploaded = [];
+ this.possibleDomainForPValueUploaded = [];
+ this.selectedAllAaModifications = false;
this.pValueContent = [];
this.pValueName = [];
@@ -1892,11 +2167,27 @@ export default {
return value_a > value_b ? 1 : -1;
});
this.possibleDomainForPValueAaModifications = res['aa_modifications'].sort(function(a, b){
+ a['disabled'] = true;
+ b['disabled'] = true;
let value_a = a['Description'].toLowerCase();
let value_b = b['Description'].toLowerCase();
return value_a > value_b ? 1 : -1;
});
+ if(this.fileDomainCSV !== null) {
+ let that = this;
+ this.possibleDomainForPValueUploaded = this.fileDomainCSV.filter(function (dom) {
+ return dom['Protein'] === that.selectedProteinForPValue;
+ })
+
+ for (let i = 0; i < this.possibleDomainForPValueUploaded.length; i = i + 1) {
+ let single_domain = this.possibleDomainForPValueUploaded[i]['Description'] + ' / (' +
+ this.possibleDomainForPValueUploaded[i]['Begin'] + ' , ' +
+ this.possibleDomainForPValueUploaded[i]['End'] + ')';
+ this.selectedDomainForPValueUploaded.push(single_domain);
+ }
+ }
+
this.overlay = false;
this.pValueBarChartApplied = true;
});
@@ -1910,6 +2201,8 @@ export default {
let query = JSON.parse(JSON.stringify(this.queryGeo));
let query_false = '';
if(type === 'target'){
+ this.accessionIdsTargetOrBackground = type;
+ this.accessionIdsSingleMutation = '(' + item['product'] + '_' + item['sequence_aa_original'] + item['start_aa_original'] + item['sequence_aa_alternative'] + ')';
query['lineage'] = item['lineage'];
query['start_aa_original'] = item['start_aa_original'];
query['sequence_aa_original'] = item['sequence_aa_original'];
@@ -1933,6 +2226,8 @@ export default {
}
}
else if(type === 'background'){
+ this.accessionIdsTargetOrBackground = type;
+ this.accessionIdsSingleMutation = '(' + item['product'] + '_' + item['sequence_aa_original'] + item['start_aa_original'] + item['sequence_aa_alternative'] + ')';
query['lineage'] = item['lineage'];
query['start_aa_original'] = item['start_aa_original'];
query['sequence_aa_original'] = item['sequence_aa_original'];
@@ -1942,6 +2237,19 @@ export default {
query['product'] = item['product'];
query['toExclude'] = this.toExcludeGeo;
+ if(!query['country']){
+ query['geo_group'] = item['target'];
+ }
+ else if(!query['region']){
+ query['country'] = item['target'];
+ }
+ else if(!query['province']){
+ query['region'] = item['target'];
+ }
+ else{
+ query['province'] = item['target'];
+ }
+
if(!query['country']){
query_false = 'geo_group'
}
@@ -1976,7 +2284,21 @@ export default {
for (let i=0; i 0) {
+ filename = 'spatial_analysis_' + this.accessionIdsSingleMutation + '_';
+ if(this.queryGeo['lineage']){
+ filename += this.queryGeo['lineage'] + '_';
+ }
+ if(this.accessionIdsTargetOrBackground === 'target'){
+ filename += this.rowsTableProvReg[this.selectedTabTable][0]['target'];
+ }
+ else{
+ filename += this.rowsTableProvReg[this.selectedTabTable][0]['background'];
+ }
+ filename += '_' + this.startDateQueryGeo + '_' + this.stopDateQueryGeo ;
+ }
+ filename += '.txt'
let element = document.createElement('a');
element.setAttribute('download', filename);
var data = new Blob([text]);
@@ -2102,6 +2424,17 @@ export default {
},
},
watch: {
+ selectedAllAaModifications(){
+ this.selectedDomainForPValueAaModifications = [];
+ if(this.selectedAllAaModifications){
+ for(let i = 0; i < this.possibleDomainForPValueAaModifications.length; i = i + 1){
+ let selected = this.possibleDomainForPValueAaModifications[i]['Description'] + ' / (' +
+ this.possibleDomainForPValueAaModifications[i]['Begin'] + ' , ' +
+ this.possibleDomainForPValueAaModifications[i]['End'] + ')';
+ this.selectedDomainForPValueAaModifications.push(selected);
+ }
+ }
+ },
selectedTypeImportantMutation(){
if(this.selectedTypeImportantMutation === 'ECDC'){
this.importantMutation = this.importantMutationECDC;
@@ -2541,6 +2874,7 @@ export default {
// }
},
mounted() {
+ this.calculateUploadedDomains();
this.computeFieldToExclude();
let array_specific_geo = [];
this.all_geo.forEach(elem => {
diff --git a/frontend/src/components/AnalyzeTimeLinCou.vue b/frontend/src/components/AnalyzeTimeLinCou.vue
index 950e031..266f43a 100644
--- a/frontend/src/components/AnalyzeTimeLinCou.vue
+++ b/frontend/src/components/AnalyzeTimeLinCou.vue
@@ -9,7 +9,7 @@
- SELECT LINEAGE AND LOCATION OF INTEREST
+ PICK LINEAGE AND PLACE OF INTEREST
- Select a location at the previous level
+ Please select a continent
+ Please select a continent to pick a country
+ Please select a country to pick a region
+ Please select a region to pick a province
(multiple values may be selected here)
diff --git a/frontend/src/components/SelectorsQueryFree.vue b/frontend/src/components/SelectorsQueryFree.vue
index 32f76d1..6a542aa 100644
--- a/frontend/src/components/SelectorsQueryFree.vue
+++ b/frontend/src/components/SelectorsQueryFree.vue
@@ -23,6 +23,7 @@
hide-details
:item-text="getFieldText"
:loading="isLoading"
+ :multiple="checkMultiple()"
:disabled="isLoading || possibleValues.length === 0"
>
@@ -64,32 +65,34 @@ export default {
possibleValues: [],
isLoading: false,
selectorDisabled: false,
+ isMultiple: false,
+ selected: [],
}
},
computed: {
...mapState(['queryFreeTarget', 'queryFreeBackground', 'toExcludeFreeTarget', 'toExcludeFreeBackground']),
...mapGetters({}),
- selected: {
- get() {
- if(this.type === 'target'){
- return this.queryFreeTarget[this.field];
- }
- else if (this.type === 'background'){
- return this.queryFreeBackground[this.field];
- }
- else {
- return 0;
- }
- },
- set(value){
- if(this.type === 'target'){
- this.setQueryFreeTarget({field: this.field, list: value});
- }
- else if (this.type === 'background'){
- this.setQueryFreeBackground({field: this.field, list: value});
- }
- }
- },
+ // selected: {
+ // get() {
+ // if(this.type === 'target'){
+ // return this.queryFreeTarget[this.field];
+ // }
+ // else if (this.type === 'background'){
+ // return this.queryFreeBackground[this.field];
+ // }
+ // else {
+ // return 0;
+ // }
+ // },
+ // set(value){
+ // if(this.type === 'target'){
+ // this.setQueryFreeTarget({field: this.field, list: value});
+ // }
+ // else if (this.type === 'background'){
+ // this.setQueryFreeBackground({field: this.field, list: value});
+ // }
+ // }
+ // },
},
methods: {
...mapMutations([]),
@@ -148,6 +151,18 @@ export default {
this.possibleValues = [];
this.isLoading = false;
}
+ },
+ checkMultiple(){
+ return !(this.field === 'lineage');
+ },
+ clearToExcludeField(){
+ this.selected = [];
+ if(this.type === 'target'){
+ this.setQueryFreeTarget({field: this.field, list: []});
+ }
+ else if(this.type === 'background'){
+ this.setQueryFreeBackground({field: this.field, list: []});
+ }
}
},
mounted() {
@@ -164,6 +179,74 @@ export default {
this.loadData();
}
},
+ selected() {
+ if (this.selected !== null) {
+ if(this.field === 'lineage'){
+ if(this.type === 'target'){
+ this.setQueryFreeTarget({field: this.field, list: null});
+ this.setQueryFreeTarget({field: this.field, list: this.selected});
+ }
+ else if(this.type === 'background'){
+ this.setQueryFreeBackground({field: this.field, list: null});
+ this.setQueryFreeBackground({field: this.field, list: this.selected});
+ }
+ }
+ else {
+ if(this.type === 'target'){
+ this.setQueryFreeTarget({field: this.field, list: []});
+ let copy = JSON.parse(JSON.stringify(this.selected));
+ this.setQueryFreeTarget({field: this.field, list: copy});
+ }
+ else if(this.type === 'background'){
+ this.setQueryFreeBackground({field: this.field, list: []});
+ let copy = JSON.parse(JSON.stringify(this.selected));
+ this.setQueryFreeBackground({field: this.field, list: copy});
+ }
+ }
+ } else {
+ this.clearToExcludeField();
+ }
+ },
+ 'queryFreeTarget.geo_group': function (){
+ if(this.field === 'geo_group' && (!this.queryFreeTarget['geo_group'] || this.queryFreeTarget['geo_group'].length === 0)) {
+ this.clearToExcludeField();
+ }
+ },
+ 'queryFreeTarget.country': function (){
+ if(this.field === 'country' && (!this.queryFreeTarget['country'] || this.queryFreeTarget['country'].length === 0)) {
+ this.clearToExcludeField();
+ }
+ },
+ 'queryFreeTarget.region': function (){
+ if(this.field === 'region' && (!this.queryFreeTarget['region'] || this.queryFreeTarget['region'].length === 0)) {
+ this.clearToExcludeField();
+ }
+ },
+ 'queryFreeTarget.province': function (){
+ if(this.field === 'province' && (!this.queryFreeTarget['province'] || this.queryFreeTarget['province'].length === 0 )) {
+ this.clearToExcludeField();
+ }
+ },
+ 'queryFreeBackground.geo_group': function (){
+ if(this.field === 'geo_group' && (!this.queryFreeBackground['geo_group'] || this.queryFreeBackground['geo_group'].length === 0)) {
+ this.clearToExcludeField();
+ }
+ },
+ 'queryFreeBackground.country': function (){
+ if(this.field === 'country' && (!this.queryFreeBackground['country'] || this.queryFreeBackground['country'].length === 0)) {
+ this.clearToExcludeField();
+ }
+ },
+ 'queryFreeBackground.region': function (){
+ if(this.field === 'region' && (!this.queryFreeBackground['region'] || this.queryFreeBackground['region'].length === 0)) {
+ this.clearToExcludeField();
+ }
+ },
+ 'queryFreeBackground.province': function (){
+ if(this.field === 'province' && (!this.queryFreeBackground['province'] || this.queryFreeBackground['province'].length === 0 )) {
+ this.clearToExcludeField();
+ }
+ },
}
}
diff --git a/frontend/src/components/SelectorsQueryGeo.vue b/frontend/src/components/SelectorsQueryGeo.vue
index eb4b6e9..fe2019f 100644
--- a/frontend/src/components/SelectorsQueryGeo.vue
+++ b/frontend/src/components/SelectorsQueryGeo.vue
@@ -26,7 +26,11 @@
:loading="isLoading"
:disabled="isLoading || possibleValues2.length === 0 || pieChartBlocked"
:multiple="checkMultiple()"
+ style="position: relative"
>
+
+ Select multiple locations for separated analysis
+
{{getFieldText(data.item)}}
{{data.item.count}}
@@ -236,4 +240,17 @@ export default {
right: 0.5em;
}
+ .firstElement{
+ padding: 5px;
+ margin: 0;
+ color: grey;
+ text-align: center;
+ border-bottom: grey solid 1px;
+ position: sticky !important;
+ position: -webkit-sticky !important;
+ top: 0;
+ z-index: 1;
+ background: white;
+ }
+
\ No newline at end of file
diff --git a/frontend/src/components/TimeDistributionChart.vue b/frontend/src/components/TimeDistributionChart.vue
index 880b699..be0084c 100644
--- a/frontend/src/components/TimeDistributionChart.vue
+++ b/frontend/src/components/TimeDistributionChart.vue
@@ -1,7 +1,7 @@
- TIME DISTRIBUTION # GENOMES BY COLLECTION DATE
mdi-download-circle-outline
@@ -374,7 +374,7 @@ export default {
}
},
computed: {
- ...mapState([]),
+ ...mapState(['queryTime']),
...mapGetters({}),
},
methods: {
@@ -387,7 +387,22 @@ export default {
});
let $a = document.createElement('a');
let type = 'png';
- $a.download = 'graph.' + type;
+ let filename = 'temporal_analysis_timeDistribution2Periods';
+ if(this.queryTime['lineage']){
+ filename += '_' + this.queryTime['lineage'];
+ }
+ if (!this.queryTime['geo_group']) {
+ filename += '_World';
+ } else if (!this.queryTime['country']) {
+ filename += '_' + this.queryTime['geo_group'];
+ } else if (!this.queryTime['region']) {
+ filename += '_' + this.queryTime['country'];
+ } else if (!this.queryTime['province']) {
+ filename += '_' + this.queryTime['region'];
+ } else {
+ filename += '_' + this.queryTime['province'];
+ }
+ $a.download = filename + '.' + type;
$a.target = '_blank';
$a.href = url;
if (typeof MouseEvent === 'function') {
diff --git a/frontend/src/components/TimeDistributionChartWeekMonth.vue b/frontend/src/components/TimeDistributionChartWeekMonth.vue
index 7a06e56..ed4df21 100644
--- a/frontend/src/components/TimeDistributionChartWeekMonth.vue
+++ b/frontend/src/components/TimeDistributionChartWeekMonth.vue
@@ -1,7 +1,7 @@
- TIME DISTRIBUTION # GENOMES BY COLLECTION DATE
mdi-download-circle-outline
@@ -117,7 +117,7 @@
- Select type of analysis
+ Type of analysis
@@ -129,10 +129,10 @@
hide-details
>
-
- Select length of the period
+
+ Span of the user defined interval (in days)
-
+
- (only bold squared periods are analyzed, as they contain enough sequences and can be compared with the adjacent periods)
+ Only intervals associated with a sufficient number of genomic sequences (in bold) will be compared
- SELECTION OF COLLECTION-DATES TIME FRAME
+ # GENOMES BY COLLECTION DATE
@@ -239,7 +239,7 @@ name: "TimeSelectorDistributionLineageInGeo",
});
let $a = document.createElement('a');
let type = 'png';
- $a.download = 'graph.' + type;
+ $a.download = 'lineage_analysis_timeDistribution_' + this.geoSpecific + '.' + type;
$a.target = '_blank';
$a.href = url;
if (typeof MouseEvent === 'function') {
diff --git a/frontend/src/components/TimeSelectorQueryFree.vue b/frontend/src/components/TimeSelectorQueryFree.vue
index f59fe19..4a3b255 100644
--- a/frontend/src/components/TimeSelectorQueryFree.vue
+++ b/frontend/src/components/TimeSelectorQueryFree.vue
@@ -1,7 +1,7 @@
- TIME DISTRIBUTION # GENOMES BY COLLECTION DATE
mdi-download-circle-outline
@@ -229,7 +229,104 @@ export default {
});
let $a = document.createElement('a');
let type = 'png';
- $a.download = 'graph.' + type;
+ let filename = '';
+ if(this.type === 'target') {
+ filename = 'open_analysis_target_timeDistribution';
+ if (this.queryFreeTarget['lineage']) {
+ filename += '_' + this.queryFreeTarget['lineage'];
+ }
+ if (!this.queryFreeTarget['geo_group']) {
+ filename += '_World';
+ } else if (!this.queryFreeTarget['country']) {
+ if(this.queryFreeTarget['geo_group'].length > 2){
+ filename += '_' + this.queryFreeTarget['geo_group'][0] + '_etc';
+ }
+ else {
+ filename += '_' + this.queryFreeTarget['geo_group'];
+ }
+ } else if (!this.queryFreeTarget['region']) {
+ if(this.queryFreeTarget['country'].length > 2){
+ filename += '_' + this.queryFreeTarget['country'][0] + '_etc';
+ }
+ else{
+ filename += '_' + this.queryFreeTarget['country'];
+ }
+ } else if (!this.queryFreeTarget['province']) {
+ if(this.queryFreeTarget['region'].length > 2){
+ filename += '_' + this.queryFreeTarget['region'][0] + '_etc';
+ }
+ else{
+ filename += '_' + this.queryFreeTarget['region'];
+ }
+ } else {
+ if(this.queryFreeTarget['province'].length > 2){
+ filename += '_' + this.queryFreeTarget['province'][0] + '_etc';
+ }
+ else{
+ filename += '_' + this.queryFreeTarget['province'];
+ }
+ }
+ // if (!this.queryFreeTarget['geo_group']) {
+ // filename += '_World';
+ // } else if (!this.queryFreeTarget['country']) {
+ // filename += '_' + this.queryFreeTarget['geo_group'];
+ // } else if (!this.queryFreeTarget['region']) {
+ // filename += '_' + this.queryFreeTarget['country'];
+ // } else if (!this.queryFreeTarget['province']) {
+ // filename += '_' + this.queryFreeTarget['region'];
+ // } else {
+ // filename += '_' + this.queryFreeTarget['province'];
+ // }
+ }
+ else{
+ filename = 'open_analysis_background_timeDistribution';
+ if (this.queryFreeBackground['lineage']) {
+ filename += '_' + this.queryFreeBackground['lineage'];
+ }
+ if (!this.queryFreeBackground['geo_group']) {
+ filename += '_World';
+ } else if (!this.queryFreeBackground['country']) {
+ if(this.queryFreeBackground['geo_group'].length > 2){
+ filename += '_' + this.queryFreeBackground['geo_group'][0] + '_etc';
+ }
+ else{
+ filename += '_' + this.queryFreeBackground['geo_group'];
+ }
+ } else if (!this.queryFreeBackground['region']) {
+ if(this.queryFreeBackground['country'].length > 2){
+ filename += '_' + this.queryFreeBackground['country'][0] + '_etc';
+ }
+ else{
+ filename += '_' + this.queryFreeBackground['country'];
+ }
+ } else if (!this.queryFreeBackground['province']) {
+ if(this.queryFreeBackground['region'].length > 2){
+ filename += '_' + this.queryFreeBackground['region'][0] + '_etc';
+ }
+ else{
+ filename += '_' + this.queryFreeBackground['region'];
+ }
+ } else {
+ if(this.queryFreeBackground['province'].length > 2){
+ filename += '_' + this.queryFreeBackground['province'][0] + '_etc';
+ }
+ else{
+ filename += '_' + this.queryFreeBackground['province'];
+ }
+ }
+ // if (!this.queryFreeBackground['geo_group']) {
+ // filename += '_World';
+ // } else if (!this.queryFreeBackground['country']) {
+ // filename += '_' + this.queryFreeBackground['geo_group'];
+ // } else if (!this.queryFreeBackground['region']) {
+ // filename += '_' + this.queryFreeBackground['country'];
+ // } else if (!this.queryFreeBackground['province']) {
+ // filename += '_' + this.queryFreeBackground['region'];
+ // } else {
+ // filename += '_' + this.queryFreeBackground['province'];
+ // }
+ }
+ $a.download = filename + '.' + type;
$a.target = '_blank';
$a.href = url;
if (typeof MouseEvent === 'function') {
diff --git a/frontend/src/components/TimeSelectorQueryGeo.vue b/frontend/src/components/TimeSelectorQueryGeo.vue
index e22bfd6..508ae52 100644
--- a/frontend/src/components/TimeSelectorQueryGeo.vue
+++ b/frontend/src/components/TimeSelectorQueryGeo.vue
@@ -1,7 +1,7 @@
- TIME DISTRIBUTION # GENOMES BY COLLECTION DATE
mdi-download-circle-outline
@@ -181,7 +181,7 @@
- TIME FILTER
+ TIME INTERVAL
@@ -417,7 +417,17 @@ export default {
});
let $a = document.createElement('a');
let type = 'png';
- $a.download = 'graph.' + type;
+ let filename = 'spatial_analysis_timeDistribution';
+ if(this.queryGeo['lineage']){
+ filename += '_' + this.queryGeo['lineage'];
+ }
+ if(this.selectedTarget === null || this.selectedTarget === undefined){
+ filename += '_World';
+ }
+ else{
+ filename += '_' + this.selectedTarget;
+ }
+ $a.download = filename + '.' + type;
$a.target = '_blank';
$a.href = url;
if (typeof MouseEvent === 'function') {
@@ -542,8 +552,7 @@ export default {
this.num_sequences_target[k] = 0;
this.num_sequences_background[k] = 0;
- while (i <= max) {
-
+ while (i <= max && this.timeContent[k][i] !== undefined && this.timeContent[k][i] !== null) {
this.num_sequences_target[k] = this.num_sequences_target[k] + this.timeContent[k][i].value;
this.num_sequences_background[k] = this.num_sequences_background[k] + this.timeContentBackground[k][i].value;
i = i + 1;
@@ -619,6 +628,10 @@ export default {
this.possibleTarget = target;
this.selectedTarget = target[0];
}
+ else{
+ this.possibleTarget = [];
+ this.selectedTarget = null;
+ }
if(!(target.length > 1)) {