Skip to content

Commit

Permalink
Merge pull request #77 from CDCgov/dev
Browse files Browse the repository at this point in the history
v1.2.1 documentation typos fixes
  • Loading branch information
dthoward96 authored Sep 13, 2024
2 parents c2f308a + bf49d89 commit 0a1002c
Show file tree
Hide file tree
Showing 19 changed files with 63 additions and 70 deletions.
2 changes: 1 addition & 1 deletion config/genbank/genbank_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
unique=True,
coerce=False,
required=True,
description="Sequence identifier used in fasta file. This is used to create the fasta file for Genbank and/or GISAID.",
description="Sequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID by updating the sequence name in your fasta file to reflect the sample name for the specified database.",
title="sequence name",
),
"gb-sample_name": Column(
Expand Down
2 changes: 1 addition & 1 deletion config/gisaid/gisaid_ARBO_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
unique=True,
coerce=False,
required=True,
description="Sequence identifier used in fasta file. This is used to create the fasta file for Genbank and/or GISAID.",
description="Sequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID by updating the sequence name in your fasta file to reflect the sample name for the specified database.",
title="sequence name",
),
"gs-sample_name": Column(
Expand Down
2 changes: 1 addition & 1 deletion config/gisaid/gisaid_COV_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
unique=True,
coerce=False,
required=True,
description="Sequence identifier used in fasta file. This is used to create the fasta file for Genbank and/or GISAID.",
description="Sequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID by updating the sequence name in your fasta file to reflect the sample name for the specified database.",
title="sequence name",
),
"gs-sample_name": Column(
Expand Down
2 changes: 1 addition & 1 deletion config/gisaid/gisaid_FLU_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
unique=True,
coerce=False,
required=True,
description="Sequence identifier used in fasta file. This is used to create the fasta file for Genbank and/or GISAID.",
description="VSequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID by updating the sequence name in your fasta file to reflect the sample name for the specified database.",
title="sequence name",
),
"gs-sample_name": Column(
Expand Down
2 changes: 1 addition & 1 deletion config/gisaid/gisaid_POX_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
unique=True,
coerce=False,
required=True,
description="Sequence identifier used in fasta file. This is used to create the fasta file for Genbank and/or GISAID.",
description="Sequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID by updating the sequence name in your fasta file to reflect the sample name for the specified database.",
title="sequence name",
),
"gs-sample_name": Column(
Expand Down
12 changes: 0 additions & 12 deletions config/seqsender/seqsender_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@ def validate_date(date):

schema = DataFrameSchema(
columns={
"sequence_name": Column(
dtype="object",
checks=[
Check.str_matches(r"^(?!\s*$).+"),
Check.str_length(max_value=50),
],
nullable=False,
unique=True,
coerce=False,
description="Sequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID.",
title="sequence name",
),
"organism": Column(
dtype="object",
checks=[
Expand Down
21 changes: 16 additions & 5 deletions config/sra/sra_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
unique=True,
coerce=False,
required=True,
description="Identifier name used for SRA. Max length is 50 characters. Name must be unique from BioSample or Genbank submission.",
description="Identifier name used for SRA. Max length is 50 characters. Name must be unique from BioSample/Genbank submission.",
title="sample name",
),
"bs-sample_name": Column(
Expand All @@ -39,18 +39,29 @@
description="Location of raw reads files. Options: \"local\" or \"cloud\".",
title="file location",
),
"sra-file_[1-9]\d*": Column(
"sra-file_1": Column(
dtype="object",
checks=[
Check.str_matches(r"^(?!\s*$).+"),
],
nullable=False,
regex=True,
unique=False,
unique=True,
coerce=False,
required=True,
description="Name of the raw read files. All file names must be unique and not contain any sensitive information. Files can be compressed using gzip or bzip2, and may be submitted in a tar archive but archiving and/or compressing your files is not required. Do not use zip! If there are multiple files, concatenate them with a commas (\",\"), e.g. \"sample1_R1.fastq.gz, sample1_R2.fastq.gz\". Store files in /seqsender/data/raw_reads/ or provide full html path to the raw read files.",
title="file name",
description="All file names must be unique and not contain any sensitive information. Files can be compressed using gzip or bzip2, and may be submitted in a tar archive but archiving and/or compressing your files is not required. Do not use zip! If files are stored in the cloud, provide the full cloud url. If files are stored locally, if files are stored in the folder \"<--submission_dir>/raw_reads/\", then just the file name is required; otherwise, provide the full file path for the raw read.",
title="raw reads file name",
),
"sra-file_[2-9]\d*": Column(
dtype="object",
checks=None,
nullable=True,
regex=True,
unique=False,
coerce=False,
required=False,
description="Repeatable column, replace the \"#\" with the file number for each file associated with the sample. (i.e. If you had 4 separate raw reads files associated with one sample, then you would have 4 columns named: \"sra-file_1\", \"sra-file_2\", \"sra-file_3\", and \"sra-file_4\".) All file names must be unique and not contain any sensitive information. Files can be compressed using gzip or bzip2, and may be submitted in a tar archive but archiving and/or compressing your files is not required. Do not use zip! If files are stored in the cloud, provide the full cloud url. If files are stored locally, if files are stored in the folder \"<--submission_dir>/raw_reads/\", then just the file name is required; otherwise, provide the full file path for the raw read.",
title="additional raw reads files",
),
"sra-library_name": Column(
dtype="object",
Expand Down
2 changes: 1 addition & 1 deletion docs/app.json

Large diffs are not rendered by default.

43 changes: 24 additions & 19 deletions shiny/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,16 +585,16 @@

dir = pathlib.Path(__file__).parent

@reactive.file_reader(dir / "templates/config.seqsender.schema_template.csv")
@reactive.file_reader(dir / "templates/config.seqsender.seqsender.schema_template.csv")
def read_file():
df = pd.read_csv(dir / "templates/config.seqsender.schema_template.csv", index_col = "column_name")
df = pd.read_csv(dir / "templates/config.seqsender.seqsender.schema_template.csv", index_col = "column_name")
df = df.fillna("")
df = df.transpose()
return df

@reactive.file_reader(dir / "templates/config.sra.schema_template.csv")
@reactive.file_reader(dir / "templates/config.sra.sra.schema_template.csv")
def read_sra_file():
df = pd.read_csv(dir / "templates/config.sra.schema_template.csv", index_col = "column_name")
df = pd.read_csv(dir / "templates/config.sra.sra.schema_template.csv", index_col = "column_name")
df = df.fillna("")
df = df.transpose()
return df
Expand Down Expand Up @@ -732,27 +732,30 @@ def initialize_gisaid_dataframes():
@reactive.Calc
def load_database_metadata_dataframe():
database_df = initialize_base_dataframe()
if input.BioSample_checkbox():
biosample_df = initialize_biosample_dataframes()
database_df = pd.concat([database_df, biosample_df], axis=1)
if input.SRA_checkbox():
sra_df = initialize_sra_dataframes()
database_df = pd.concat([database_df, sra_df], axis=1)
if input.GenBank_checkbox():
genbank_df = initialize_genbank_dataframes()
database_df = pd.concat([database_df, genbank_df], axis=1)
if input.GISAID_checkbox():
gisaid_df = initialize_gisaid_dataframes()
database_df = pd.concat([database_df, gisaid_df], axis=1)
if input.BioSample_checkbox():
biosample_df = initialize_biosample_dataframes()
database_df = pd.concat([database_df, biosample_df], axis=1)
database_df.loc["required_column", "bioproject"] = "Required"
if input.SRA_checkbox():
sra_df = initialize_sra_dataframes()
database_df = pd.concat([database_df, sra_df], axis=1)
database_df.loc["required_column", "bioproject"] = "Required"
database_df = database_df.loc[:, ~database_df.columns.duplicated()]
database_df = (
database_df.style.set_table_styles(
[
dict(
selector="th", props=[("border", "3px black solid !important")]
selector="th", props=[("border", "3px black solid !important"), ("white-space", "nowrap"), ("vertical-align", "top")]
),
dict(selector="ti", props=[("background-color", "#DCDCDC")]),
dict(selector="ti", props=[("background-color", "#DCDCDC"), ("vertical-align", "top")]),
dict(
selector="td", props=[("border", "1px black solid !important")]
selector="td", props=[("border", "1px black solid !important"), ("vertical-align", "top")]
),
]
)
Expand Down Expand Up @@ -823,18 +826,20 @@ def initialize_config():
@render.download(filename="metadata_template.csv")
def download_metadata():
database_df = initialize_base_dataframe()
if input.BioSample_checkbox():
biosample_df = initialize_biosample_dataframes()
database_df = pd.concat([database_df, biosample_df], axis=1)
if input.SRA_checkbox():
sra_df = initialize_sra_dataframes()
database_df = pd.concat([database_df, sra_df], axis=1)
if input.GenBank_checkbox():
genbank_df = initialize_genbank_dataframes()
database_df = pd.concat([database_df, genbank_df], axis=1)
if input.GISAID_checkbox():
gisaid_df = initialize_gisaid_dataframes()
database_df = pd.concat([database_df, gisaid_df], axis=1)
if input.BioSample_checkbox():
biosample_df = initialize_biosample_dataframes()
database_df = pd.concat([database_df, biosample_df], axis=1)
database_df.loc["required_column", "bioproject"] = "Required"
if input.SRA_checkbox():
sra_df = initialize_sra_dataframes()
database_df = pd.concat([database_df, sra_df], axis=1)
database_df.loc["required_column", "bioproject"] = "Required"
database_df = database_df.loc[:,~database_df.columns.duplicated()].copy()
yield database_df.to_csv()

Expand Down
2 changes: 1 addition & 1 deletion shiny/templates/config.genbank.genbank.schema_template.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
column_name,required_column,description
sequence_name,Required,Sequence identifier used in fasta file. This is used to create the fasta file for Genbank and/or GISAID.
sequence_name,Required,Sequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID by updating the sequence name in your fasta file to reflect the sample name for the specified database.
gb-sample_name,Required,Identifier name used for GenBank. Max length is 50 characters.
gb-fasta_definition_line_modifiers,Optional,"NCBI fasta definition line modifiers can be added here. As many modifiers as you like can be added, but each must bounded by a set of brackets. Some of the available keywords are listed at ""https://www.ncbi.nlm.nih.gov/genbank/mods_fastadefline/""."
gb-title,Optional,"Optional internal field for how the GenBank submission should be named when viewed from the NCBI submission portal, . If not provided, when performing submissions <--submission_name> with the suffix ""-GB"" will be used instead."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
column_name,required_column,description
sequence_name,Required,Sequence identifier used in fasta file. This is used to create the fasta file for Genbank and/or GISAID.
sequence_name,Required,Sequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID by updating the sequence name in your fasta file to reflect the sample name for the specified database.
gs-sample_name,Required,"Identifier name used for GISAID. Max length is 50 characters. This field is the same as ""arbo_sequence_name"" in GISAID's metadata template."
gs-arbo_type,Required,"For hCoV-19, this will always be ""Chikungunya virus""."
gs-arbo_passage,Required,"""Original"" if the sample was sequenced directly from swabs, otherwise add the name of the cell line (e.g., ""Vero"") used to culture the specimen."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
column_name,required_column,description
sequence_name,Required,Sequence identifier used in fasta file. This is used to create the fasta file for Genbank and/or GISAID.
sequence_name,Required,Sequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID by updating the sequence name in your fasta file to reflect the sample name for the specified database.
gs-sample_name,Required,"Identifier name used for GISAID. Max length is 50 characters. This field is the same as ""covv_sequence_name"" in GISAID's metadata template."
gs-covv_type,Required,"For hCoV-19, this will always be ""betacoronavirus""."
gs-covv_passage,Required,"""Original"" if the sample was sequenced directly from swabs, otherwise add the name of the cell line (e.g., ""Vero"") used to culture the specimen."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
column_name,required_column,description
sequence_name,Required,Sequence identifier used in fasta file. This is used to create the fasta file for Genbank and/or GISAID.
sequence_name,Required,VSequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID by updating the sequence name in your fasta file to reflect the sample name for the specified database.
gs-sample_name,Required,Identifier name for sample segment used for GISAID. Max length is 50 characters.
gs-Isolate_Name,Required,Identifier name for sample used for GISAID. Max length is 50 characters.
gs-segment,Required,Segment name for sequence.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
column_name,required_column,description
sequence_name,Required,Sequence identifier used in fasta file. This is used to create the fasta file for Genbank and/or GISAID.
sequence_name,Required,Sequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID by updating the sequence name in your fasta file to reflect the sample name for the specified database.
gs-sample_name,Required,"Identifier name used for GISAID. Max length is 50 characters. This field is the same as ""pox_sequence_name"" in GISAID's metadata template."
gs-pox_passage,Required,"""Original"" if the sample was sequenced directly from swabs, otherwise add the name of the cell line (e.g., ""Vero"") used to culture the specimen."
gs-pox_location,Required,"Format as ""Continent / Country / Region / Sub-region""."
Expand Down
6 changes: 0 additions & 6 deletions shiny/templates/config.seqsender.schema_template.csv

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
column_name,required_column,description
sequence_name,Required,Sequence identifier used in fasta file. This is used to create the fasta file for Genbank or GISAID.
organism,Required,The most descriptive organism name for the samples.
authors,Required,"Citing authors. List of <b>Last, First Middle, suffix</b> separated by a semicolon "";"" E.g.: ""Baker, Howard Henry, Jr.; Powell, Earl Alexander, III.;"""
collection_date,Required,"Collection date for sample. Must be in a valid format based on ISO 8601: ""YYYY-MM-DD"", ""YYYY-MM"", or ""YYYY"". Time is not supported."
Expand Down
13 changes: 0 additions & 13 deletions shiny/templates/config.sra.schema_template.csv

This file was deleted.

5 changes: 3 additions & 2 deletions shiny/templates/config.sra.sra.schema_template.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
column_name,required_column,description
sra-sample_name,Required,Identifier name used for SRA. Max length is 50 characters. Name must be unique from BioSample or Genbank submission.
sra-sample_name,Required,Identifier name used for SRA. Max length is 50 characters. Name must be unique from BioSample/Genbank submission.
bs-sample_name,Required,Identifier name used for BioSample. Max length is 50 characters. Required if submitting to SRA.
sra-file_location,Required,"Location of raw reads files. Options: ""local"" or ""cloud""."
sra-file_[1-9]\d*,Required,"Name of the raw read files. All file names must be unique and not contain any sensitive information. Files can be compressed using gzip or bzip2, and may be submitted in a tar archive but archiving and/or compressing your files is not required. Do not use zip! If there are multiple files, concatenate them with a commas ("",""), e.g. ""sample1_R1.fastq.gz, sample1_R2.fastq.gz"". Store files in /seqsender/data/raw_reads/ or provide full html path to the raw read files."
sra-file_1,Required,"All file names must be unique and not contain any sensitive information. Files can be compressed using gzip or bzip2, and may be submitted in a tar archive but archiving and/or compressing your files is not required. Do not use zip! If files are stored in the cloud, provide the full cloud url. If files are stored locally, if files are stored in the folder ""<--submission_dir>/raw_reads/"", then just the file name is required; otherwise, provide the full file path for the raw read."
sra-file_#,Optional,"Repeatable column, replace the ""#"" with the file number for each file associated with the sample. (i.e. If you had 4 separate raw reads files associated with one sample, then you would have 4 columns named: ""sra-file_1"", ""sra-file_2"", ""sra-file_3"", and ""sra-file_4"".) All file names must be unique and not contain any sensitive information. Files can be compressed using gzip or bzip2, and may be submitted in a tar archive but archiving and/or compressing your files is not required. Do not use zip! If files are stored in the cloud, provide the full cloud url. If files are stored locally, if files are stored in the folder ""<--submission_dir>/raw_reads/"", then just the file name is required; otherwise, provide the full file path for the raw read."
sra-library_name,Optional,Short unique identifier for sequencing library.
sra-loader,Optional,"SRA loader selection. If NCBI says your SRA files need to be uploaded with a certain loader, you can select it here."
sra-library_strategy,Required,The sequencing technique intended for the library.
Expand Down
Loading

0 comments on commit 0a1002c

Please sign in to comment.