Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload database module updated #295

Merged
merged 6 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
22 changes: 11 additions & 11 deletions relecov_tools/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import relecov_tools.download_manager
import relecov_tools.json_validation
import relecov_tools.map_schema
import relecov_tools.feed_database
import relecov_tools.upload_database
import relecov_tools.read_bioinfo_metadata
import relecov_tools.metadata_homogeneizer
import relecov_tools.gisaid_upload
Expand Down Expand Up @@ -60,7 +60,7 @@ def run_relecov_tools():
)

# stderr.print("[green] `._,._,'\n", highlight=False)
__version__ = "0.0.5"
__version__ = "0.0.6"
stderr.print(
"\n" "[grey39] RELECOV-tools version {}".format(__version__), highlight=False
)
Expand Down Expand Up @@ -373,7 +373,6 @@ def launch(user):
pass


# update_db TODO: Include types of data and database servers in config file
@relecov_tools_cli.command(help_priority=9)
@click.option("-j", "--json", help="data in json format")
@click.option(
Expand All @@ -385,8 +384,8 @@ def launch(user):
help="Select the type of information to upload to database",
)
@click.option(
"-d",
"databaseServer",
"-plat",
"--platform",
type=click.Choice(
[
"iskylims",
Expand All @@ -395,23 +394,24 @@ def launch(user):
),
multiple=False,
default=None,
help="name of the server which information is defined in config file",
help="name of the platform where data is uploaded",
)
@click.option("-u", "--user", help="user name for login")
@click.option("-p", "--password", help="password for the user to login")
@click.option("-s", "--server_url", help="url of the platform server")
@click.option(
"-f",
"--full_update",
is_flag=True,
default=False,
help="Sequentially run every update option",
)
def update_db(user, password, json, type, databaseServer, full_update):
"""feed database with json"""
feed_database = relecov_tools.feed_database.FeedDatabase(
user, password, json, type, databaseServer, full_update
def update_db(user, password, json, type, platform, server_url, full_update):
"""upload the information included in json file to the database"""
update_database_obj = relecov_tools.upload_database.UpdateDatabase(
user, password, json, type, platform, server_url, full_update
)
feed_database.update_db()
update_database_obj.update_db()


# read metadata bioinformatics
Expand Down
86 changes: 44 additions & 42 deletions relecov_tools/conf/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,54 +270,56 @@
"GISAID_configuration": {
"submitter": "GISAID_ID"
},
"external_url": {
"iskylims": {
"server": "http://relecov-iskylims.isciiides.es",
"url": "/wetlab/api/",
"store_samples": "createSampleData",
"url_project_fields": "sampleProjectFields",
"url_sample_fields": "sampleFields",
"param_sample_project": "project",
"project_name": "relecov",
"token": ""
},
"relecov": {
"server": "http://relecov-platform.isciiides.es",
"url": "/api/",
"upload_database": {
"platform":{
"iskylims": {
"server_url": "http://relecov-iskylims.isciiides.es",
"api_url": "/wetlab/api/",
"store_samples": "create-sample",
"url_project_fields": "projects-fields",
"url_sample_fields": "sample-fields",
"param_sample_project": "project",
"project_name": "relecov",
"token": ""
},
"relecov": {
"server_url": "http://relecov-platform.isciiides.es",
"api_url": "/api/",
"store_samples": "createSampleData",
"bioinfodata": "createBioinfoData",
"variantdata": "createVariantData",
"sftp_info": "sftpInfo",
"token": ""
}
},
"iskylims_fixed_values": {
"patientCore": "",
"sampleProject": "Relecov",
"onlyRecorded": "Yes",
"sampleLocation": "Not defined"
}
},
"iskylims_fixed_values": {
"patient_core": "",
"sample_project": "Relecov",
"only_recorded": "Yes",
"sample_location": "Not defined"
},
"relecov_sample_metadata": [
"authors",
"collecting_institution",
"collecting_lab_sample_id",
"ena_broker_name",
"ena_sample_accession",
"gisaid_accession_id",
"gisaid_virus_name",
"microbiology_lab_sample_id",
"r1_fastq_filepath",
"r2_fastq_filepath",
"schema_name",
"schema_version",
"sequencing_date",
"sequence_file_R1_md5",
"sequence_file_R2_md5",
"sequence_file_R1_fastq",
"sequence_file_R2_fastq",
"sequencing_sample_id",
"submitting_lab_sample_id"
]
},
"relecov_sample_metadata": [
"authors",
"collecting_institution",
"collecting_lab_sample_id",
"ena_broker_name",
"ena_sample_accession",
"gisaid_accession_id",
"gisaid_virus_name",
"microbiology_lab_sample_id",
"r1_fastq_filepath",
"r2_fastq_filepath",
"schema_name",
"schema_version",
"sequencing_date",
"sequence_file_R1_md5",
"sequence_file_R2_md5",
"sequence_file_R1_fastq",
"sequence_file_R2_fastq",
"sequencing_sample_id",
"submitting_lab_sample_id"
],
"ENA_fields": {
"ENA_configuration": {
"study_alias": "RELECOV",
Expand Down
Loading
Loading