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

Hotfix for tmp folder creation in remote home #269

Merged
merged 4 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion relecov_tools/sftp_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def recursive_list(folder_name):

if recursive:
directory_list = recursive_list(folder_name)
directory_list.append(folder_name)
if folder_name != ".":
directory_list.append(folder_name)
return directory_list
try:
directory_list = [
Expand Down
5 changes: 0 additions & 5 deletions relecov_tools/upload_ena_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@ def update_json(self, updated_schemas_df, json_data):

def xml_submission(self, json_data, schemas_dataframe, batch_index=None):
"""The metadata is submitted in an xml format"""
import pdb

pdb.set_trace()
schema_targets = extract_targets(self.action, schemas_dataframe)

tool = self.config_json.get_configuration("ENA_fields")["tool"]
Expand Down Expand Up @@ -266,9 +263,7 @@ def xml_submission(self, json_data, schemas_dataframe, batch_index=None):
schema_xmls["submission"] = submission_xml

stderr.print(f"\nProcessing submission to ENA server: {self.url}")
import pdb

pdb.set_trace()
receipt = send_schemas(schema_xmls, self.url, self.user, self.passwd).text
if not os.path.exists(self.output_path):
os.mkdir(self.output_path)
Expand Down
9 changes: 6 additions & 3 deletions relecov_tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ def read_excel_file(f_name, sheet_name, header_flag, leave_empty=True):
"""
wb_file = openpyxl.load_workbook(f_name, data_only=True)
ws_metadata_lab = wb_file[sheet_name]
heading_row = [
idx + 1 for idx, x in enumerate(ws_metadata_lab.values) if header_flag in x
][0]
try:
heading_row = [
idx + 1 for idx, x in enumerate(ws_metadata_lab.values) if header_flag in x
][0]
except IndexError:
raise KeyError(f"Header flag '{header_flag}' could not be found in {f_name}")
heading = [str(i.value).strip() for i in ws_metadata_lab[heading_row] if i.value]
ws_data = []
for row in islice(ws_metadata_lab.values, heading_row, ws_metadata_lab.max_row):
Expand Down
Loading