Skip to content

Commit

Permalink
Solved issue BU-ISCIII#312 warnings when running the install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
luissian committed Sep 28, 2024
1 parent 8221d12 commit 05e95d2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions wetlab/utils/collection_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def get_collection_index_name(input_file):
collection_name = ""
with open(input_file, encoding="utf-8") as fh:
for line in fh:
found_collection_name = re.search("^\[Name\]", line)
found_collection_name = re.search(r"^\[Name\]", line)
if found_collection_name:
found_name = True
continue
Expand Down Expand Up @@ -305,7 +305,7 @@ def store_collection_kits_file(collection_file):
# fetch the file from user form and build the file name including
# the date and time on now to store in database

split_filename = re.search("(.*)(\.\w+$)", collection_file.name)
split_filename = re.search(r"(.*)(\.\w+$)", collection_file.name)
f_name = split_filename[1]
f_extension = split_filename[2]
fs_index_lib = FileSystemStorage()
Expand Down
2 changes: 1 addition & 1 deletion wetlab/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def find_xml_tag_text(input_file, search_tag):
fh = open(input_file, "r")
search_line = "<" + search_tag + ">(.*)</" + search_tag + ">"
for line in fh:
found_tag = re.search("^\s+ %s" % search_line, line)
found_tag = re.search(r"^\s+ %s" % search_line, line)
if found_tag:
fh.close()
return found_tag.group(1)
Expand Down
2 changes: 1 addition & 1 deletion wetlab/utils/crontab_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def get_latest_run_procesing_log(conn, log_folder, experiment_name):
continue
file_remote = sfh.filename
if file_remote.endswith(".log"):
log_file = re.search(".*_Cycle(\d+)_.*", file_remote)
log_file = re.search(r".*_Cycle(\d+)_.*", file_remote)

cycle_number = int(log_file.group(1))
if cycle_number > max_cycle:
Expand Down
2 changes: 1 addition & 1 deletion wetlab/utils/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ def get_library_code_and_unique_id(sample_id, molecule_id):
sample_id=sample_obj, molecule_id=molecule_obj
).last()
last_lib_prep_code_id = lib_prep_obj.get_lib_prep_code()
split_code = re.search("(.*_)(\d+)$", last_lib_prep_code_id)
split_code = re.search(r"(.*_)(\d+)$", last_lib_prep_code_id)
index_val = int(split_code.group(2))
new_index = str(index_val + 1).zfill(2)
lib_prep_code_id = split_code.group(1) + new_index
Expand Down
12 changes: 6 additions & 6 deletions wetlab/utils/samplesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_adapters(file_lines):
else:
adapter2 = adapter_code
break
data_found = re.search("^\[Data]", line)
data_found = re.search(r"^\[Data]", line)
if data_found:
break

Expand Down Expand Up @@ -205,7 +205,7 @@ def get_reads(file_lines):
continue
if "[Settings]" in line:
break
if read_found and re.search("^\w+", line):
if read_found and re.search(r"^\w+", line):
reads.append(line.split(",")[0])
return reads

Expand Down Expand Up @@ -392,7 +392,7 @@ def get_projects_in_run(in_file: str) -> dict:
continue
else:
# ignore the empty lines separated by commas
valid_line = re.search("^\w+", line)
valid_line = re.search(r"^\w+", line)
if not valid_line:
continue
# store the project name and the user name (Description) inside projects dict
Expand Down Expand Up @@ -442,7 +442,7 @@ def get_index_library_name(in_file):
def update_library_kit_field(library_file_name, library_kit_name, library_name):
# result_directory='documents/wetlab/BaseSpaceMigrationFiles/'
timestr = time.strftime("%Y%m%d-%H%M%S")
tmp = re.search("(.*)\d{8}-\d+.*\.csv", library_file_name)
tmp = re.search(r"(.*)\d{8}-\d+.*\.csv", library_file_name)
absolute_path = str(settings.BASE_DIR + "/")
out_file = str(
absolute_path
Expand Down Expand Up @@ -517,7 +517,7 @@ def create_unique_sample_id_values(infile, index_file):
continue
if found_sample_line:
# discard the empty lines or the lines that contains empty lines separated by comma
if line == "\n" or re.search("^\W", line):
if line == "\n" or re.search(r"^\W", line):
continue

data_line = line.split(",")
Expand Down Expand Up @@ -592,7 +592,7 @@ def set_user_names_in_sample_sheet(in_file, user_names):
continue
if found_sample_line:
# discard the empty lines or the lines that contains empty lines separated by comma
if line == "\n" or re.search("^\W", line):
if line == "\n" or re.search(r"^\W", line):
continue

data_line = line.split(",")
Expand Down

0 comments on commit 05e95d2

Please sign in to comment.