Skip to content

Commit

Permalink
ruff linting
Browse files Browse the repository at this point in the history
  • Loading branch information
chuan-wang committed Mar 15, 2024
1 parent df992ac commit 1a7996e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 32 deletions.
10 changes: 5 additions & 5 deletions taca/analysis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def _upload_to_statusdb(run):
parser = run.runParserObj
# Check if I have NoIndex lanes
for element in parser.obj["samplesheet_csv"]:
if (
"NoIndex" in element.get("index", "") or not element.get("index")
if "NoIndex" in element.get("index", "") or not element.get(

Check warning on line 117 in taca/analysis/analysis.py

View check run for this annotation

Codecov / codecov/patch

taca/analysis/analysis.py#L117

Added line #L117 was not covered by tests
"index"
): # NoIndex in the case of HiSeq, empty in the case of HiSeqX
lane = element["Lane"] # This is a lane with NoIndex
# In this case PF Cluster is the number of undetermined reads
Expand Down Expand Up @@ -411,13 +411,13 @@ def _process(run):
)
else:
sbt = f"{run.id} Demultiplexing Completed!"
msg = """The run {run} has been demultiplexed without any error or warning.
msg = f"""The run {run.id} has been demultiplexed without any error or warning.

Check warning on line 414 in taca/analysis/analysis.py

View check run for this annotation

Codecov / codecov/patch

taca/analysis/analysis.py#L414

Added line #L414 was not covered by tests
The Run will be transferred to the analysis cluster for further analysis.
The run is available at : https://genomics-status.scilifelab.se/flowcells/{run}
The run is available at : https://genomics-status.scilifelab.se/flowcells/{run.id}
""".format(run=run.id)
"""
run.send_mail(sbt, msg, rcp=CONFIG["mail"]["recipients"])

# Copy demultiplex stats file, InterOp meta data and run xml files to shared file system for LIMS purpose
Expand Down
10 changes: 2 additions & 8 deletions taca/cleanup/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ def cleanup_miarka(
if all_undet_files:
undet_size = _def_get_size_unit(sum(map(os.path.getsize, all_undet_files)))
if misc.query_yes_no(
"In total found {} undetermined files which are {} in size, delete now ?".format(
len(all_undet_files), undet_size
),
f"In total found {len(all_undet_files)} undetermined files which are {undet_size} in size, delete now ?",
default="no",
):
_remove_files(all_undet_files)
Expand Down Expand Up @@ -313,11 +311,7 @@ def cleanup_miarka(
for proj, info in project_clean_list.items():
proj_count += 1
if not misc.query_yes_no(
"{}Delete files for this project ({}/{})".format(
get_proj_meta_info(info, days_fastq),
proj_count,
len(project_clean_list),
),
f"{get_proj_meta_info(info, days_fastq)}Delete files for this project ({proj_count}/{len(project_clean_list)})",
default="no",
):
logger.info(f"Will not remove files for project {proj}")
Expand Down
6 changes: 3 additions & 3 deletions taca/illumina/Runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ def transfer_run(self, t_file, mail_recipients=None):
# Send an email notifying that the transfer was successful
runname = self.id
sbt = f"Rsync of data for run {runname} to the analysis cluster has finished"
msg = """ Rsync of data for run {run} to the analysis cluster has finished!
msg = f""" Rsync of data for run {runname} to the analysis cluster has finished!

Check warning on line 353 in taca/illumina/Runs.py

View check run for this annotation

Codecov / codecov/patch

taca/illumina/Runs.py#L353

Added line #L353 was not covered by tests
The run is available at : https://genomics-status.scilifelab.se/flowcells/{run}
""".format(run=runname)
The run is available at : https://genomics-status.scilifelab.se/flowcells/{runname}
"""
if mail_recipients:
send_mail(sbt, msg, mail_recipients)

Expand Down
18 changes: 2 additions & 16 deletions taca/utils/bioinfo_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,7 @@ def update_statusdb(run_dir):
for k, v in remote_doc.items():
obj["values"][k] = v
logger.info(
"Updating {} {} {} {} {} as {}".format(
run_id,
project,
flowcell,
lane,
sample,
sample_status,
)
f"Updating {run_id} {project} {flowcell} {lane} {sample} as {sample_status}"
)
# Sorts timestamps
obj["values"] = OrderedDict(
Expand All @@ -123,14 +116,7 @@ def update_statusdb(run_dir):
# Creates new entry
else:
logger.info(
"Creating {} {} {} {} {} as {}".format(
run_id,
project,
flowcell,
lane,
sample,
sample_status,
)
f"Creating {run_id} {project} {flowcell} {lane} {sample} as {sample_status}"
)
# Creates record
db.save(obj)
Expand Down

0 comments on commit 1a7996e

Please sign in to comment.